@hopeplayer/core 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/HopePlayerElement.d.ts +42 -2
  2. package/dist/HopePlayerElement.d.ts.map +1 -1
  3. package/dist/chunks/NativeEme-CXosVcw8.js +80 -0
  4. package/dist/chunks/NativeEme-CXosVcw8.js.map +1 -0
  5. package/dist/chunks/{accessibility-DeUIoAda.js → accessibility-DFx4CE0H.js} +9 -8
  6. package/dist/chunks/{accessibility-DeUIoAda.js.map → accessibility-DFx4CE0H.js.map} +1 -1
  7. package/dist/chunks/adTriggers-BIAWe8o4.js +419 -0
  8. package/dist/chunks/adTriggers-BIAWe8o4.js.map +1 -0
  9. package/dist/chunks/{ads-CdWbE9aD.js → ads-DlpHPpR9.js} +3 -3
  10. package/dist/chunks/ads-DlpHPpR9.js.map +1 -0
  11. package/dist/chunks/analytics-DEjTAJO9.js +281 -0
  12. package/dist/chunks/analytics-DEjTAJO9.js.map +1 -0
  13. package/dist/chunks/{cast-BQ-suTcF.js → cast-vHyi7oV_.js} +2 -2
  14. package/dist/chunks/{cast-BQ-suTcF.js.map → cast-vHyi7oV_.js.map} +1 -1
  15. package/dist/chunks/dash-CWjy-y7B.js +22 -0
  16. package/dist/chunks/dash-CWjy-y7B.js.map +1 -0
  17. package/dist/chunks/docPip-wybMVP1H.js +82 -0
  18. package/dist/chunks/docPip-wybMVP1H.js.map +1 -0
  19. package/dist/chunks/heatmap-Bb7neaYU.js +92 -0
  20. package/dist/chunks/heatmap-Bb7neaYU.js.map +1 -0
  21. package/dist/chunks/{history-DAbqEhNB.js → history-CwqLXiZi.js} +2 -2
  22. package/dist/chunks/{history-DAbqEhNB.js.map → history-CwqLXiZi.js.map} +1 -1
  23. package/dist/chunks/interactive-CgltIneu.js +189 -0
  24. package/dist/chunks/interactive-CgltIneu.js.map +1 -0
  25. package/dist/chunks/keySystems-CNzjRq6e.js +70 -0
  26. package/dist/chunks/keySystems-CNzjRq6e.js.map +1 -0
  27. package/dist/chunks/{loopSection-CvF4l5uf.js → loopSection-Bwk4W8vz.js} +16 -16
  28. package/dist/chunks/loopSection-Bwk4W8vz.js.map +1 -0
  29. package/dist/chunks/{markers-B04NMI79.js → markers-L69W3kj6.js} +53 -51
  30. package/dist/chunks/markers-L69W3kj6.js.map +1 -0
  31. package/dist/chunks/player-D2_HRzot.js +4351 -0
  32. package/dist/chunks/player-D2_HRzot.js.map +1 -0
  33. package/dist/chunks/{playlist-C6Mh9BE8.js → playlist-CHfStNbQ.js} +29 -21
  34. package/dist/chunks/playlist-CHfStNbQ.js.map +1 -0
  35. package/dist/chunks/plugin-style-CPJELe-i.js +17 -0
  36. package/dist/chunks/plugin-style-CPJELe-i.js.map +1 -0
  37. package/dist/chunks/pluginHost-cN2uGFeG.js +566 -0
  38. package/dist/chunks/pluginHost-cN2uGFeG.js.map +1 -0
  39. package/dist/chunks/redirectScreen-TIqLdvBY.js +239 -0
  40. package/dist/chunks/redirectScreen-TIqLdvBY.js.map +1 -0
  41. package/dist/chunks/{rewardedUnlock-CGhQyWOk.js → rewardedUnlock-DUqYwXTr.js} +2 -2
  42. package/dist/chunks/{rewardedUnlock-CGhQyWOk.js.map → rewardedUnlock-DUqYwXTr.js.map} +1 -1
  43. package/dist/chunks/segments-Ds-c1b5e.js +66 -0
  44. package/dist/chunks/segments-Ds-c1b5e.js.map +1 -0
  45. package/dist/chunks/{skipSegments-BbWzPpXz.js → skipSegments-ByNoF1qZ.js} +2 -2
  46. package/dist/chunks/{skipSegments-BbWzPpXz.js.map → skipSegments-ByNoF1qZ.js.map} +1 -1
  47. package/dist/chunks/{spriteThumbnails-B7oDZFTo.js → spriteThumbnails-Cr9UmkM9.js} +74 -51
  48. package/dist/chunks/spriteThumbnails-Cr9UmkM9.js.map +1 -0
  49. package/dist/chunks/{statsPanel-DSClIwA3.js → statsPanel-D0DtoFgS.js} +2 -2
  50. package/dist/chunks/statsPanel-D0DtoFgS.js.map +1 -0
  51. package/dist/chunks/{sticky-D_eLCNFk.js → sticky-BDStzjBM.js} +27 -26
  52. package/dist/chunks/sticky-BDStzjBM.js.map +1 -0
  53. package/dist/chunks/{story-BLBij82f.js → story-CodA2dfn.js} +2 -2
  54. package/dist/chunks/{story-BLBij82f.js.map → story-CodA2dfn.js.map} +1 -1
  55. package/dist/chunks/transcript-LG7E9UYE.js +186 -0
  56. package/dist/chunks/transcript-LG7E9UYE.js.map +1 -0
  57. package/dist/controls/ContextMenu.d.ts +1 -0
  58. package/dist/controls/ContextMenu.d.ts.map +1 -1
  59. package/dist/controls/ControlBar.d.ts +6 -0
  60. package/dist/controls/ControlBar.d.ts.map +1 -1
  61. package/dist/controls/SeekBar.d.ts +5 -2
  62. package/dist/controls/SeekBar.d.ts.map +1 -1
  63. package/dist/controls/SettingsMenu.d.ts +2 -1
  64. package/dist/controls/SettingsMenu.d.ts.map +1 -1
  65. package/dist/drm/NativeEme.d.ts +23 -0
  66. package/dist/drm/NativeEme.d.ts.map +1 -0
  67. package/dist/drm/keySystems.d.ts +18 -0
  68. package/dist/drm/keySystems.d.ts.map +1 -0
  69. package/dist/hls/SourceManager.d.ts +31 -5
  70. package/dist/hls/SourceManager.d.ts.map +1 -1
  71. package/dist/hls/dashEngine.d.ts +85 -0
  72. package/dist/hls/dashEngine.d.ts.map +1 -0
  73. package/dist/hls/sourceGroups.d.ts.map +1 -1
  74. package/dist/hope-player.js +1 -1
  75. package/dist/i18n/locales/en.d.ts.map +1 -1
  76. package/dist/i18n/locales/tr.d.ts.map +1 -1
  77. package/dist/i18n/types.d.ts +28 -0
  78. package/dist/i18n/types.d.ts.map +1 -1
  79. package/dist/index.d.ts +2 -2
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/keyboard/KeyboardController.d.ts +14 -0
  82. package/dist/keyboard/KeyboardController.d.ts.map +1 -1
  83. package/dist/plugin-api/PluginAds.d.ts +61 -0
  84. package/dist/plugin-api/PluginAds.d.ts.map +1 -0
  85. package/dist/plugin-api/PluginHost.d.ts +6 -0
  86. package/dist/plugin-api/PluginHost.d.ts.map +1 -1
  87. package/dist/plugin-api/types.d.ts +39 -0
  88. package/dist/plugin-api/types.d.ts.map +1 -1
  89. package/dist/plugins/accessibility/Accessibility.d.ts.map +1 -1
  90. package/dist/plugins/ad-triggers/AdTriggers.d.ts +5 -0
  91. package/dist/plugins/ad-triggers/AdTriggers.d.ts.map +1 -1
  92. package/dist/plugins/ads/AdsController.d.ts +2 -0
  93. package/dist/plugins/ads/AdsController.d.ts.map +1 -1
  94. package/dist/plugins/analytics/QoeTracker.d.ts +71 -0
  95. package/dist/plugins/analytics/QoeTracker.d.ts.map +1 -0
  96. package/dist/plugins/analytics/index.d.ts +6 -0
  97. package/dist/plugins/analytics/index.d.ts.map +1 -0
  98. package/dist/plugins/doc-pip/DocumentPip.d.ts +44 -0
  99. package/dist/plugins/doc-pip/DocumentPip.d.ts.map +1 -0
  100. package/dist/plugins/doc-pip/index.d.ts +5 -0
  101. package/dist/plugins/doc-pip/index.d.ts.map +1 -0
  102. package/dist/plugins/heatmap/Heatmap.d.ts +36 -0
  103. package/dist/plugins/heatmap/Heatmap.d.ts.map +1 -0
  104. package/dist/plugins/heatmap/index.d.ts +6 -0
  105. package/dist/plugins/heatmap/index.d.ts.map +1 -0
  106. package/dist/plugins/interactive/Interactive.d.ts +45 -0
  107. package/dist/plugins/interactive/Interactive.d.ts.map +1 -0
  108. package/dist/plugins/interactive/index.d.ts +6 -0
  109. package/dist/plugins/interactive/index.d.ts.map +1 -0
  110. package/dist/plugins/markers/MarkProgress.d.ts +3 -1
  111. package/dist/plugins/markers/MarkProgress.d.ts.map +1 -1
  112. package/dist/plugins/playlist/PlaylistRunner.d.ts +2 -0
  113. package/dist/plugins/playlist/PlaylistRunner.d.ts.map +1 -1
  114. package/dist/plugins/redirect-screen/RedirectScreen.d.ts +3 -1
  115. package/dist/plugins/redirect-screen/RedirectScreen.d.ts.map +1 -1
  116. package/dist/plugins/segments/Segments.d.ts +1 -0
  117. package/dist/plugins/segments/Segments.d.ts.map +1 -1
  118. package/dist/plugins/sprite-thumbnails/SpriteThumbnails.d.ts +9 -0
  119. package/dist/plugins/sprite-thumbnails/SpriteThumbnails.d.ts.map +1 -1
  120. package/dist/plugins/sticky/StickyManager.d.ts +2 -0
  121. package/dist/plugins/sticky/StickyManager.d.ts.map +1 -1
  122. package/dist/plugins/transcript/Transcript.d.ts +65 -0
  123. package/dist/plugins/transcript/Transcript.d.ts.map +1 -0
  124. package/dist/plugins/transcript/index.d.ts +6 -0
  125. package/dist/plugins/transcript/index.d.ts.map +1 -0
  126. package/dist/screens/ErrorScreen.d.ts +1 -1
  127. package/dist/screens/ErrorScreen.d.ts.map +1 -1
  128. package/dist/subtitles/attachTracks.d.ts +6 -0
  129. package/dist/subtitles/attachTracks.d.ts.map +1 -1
  130. package/dist/types/index.d.ts +320 -16
  131. package/dist/types/index.d.ts.map +1 -1
  132. package/dist/utils/plugin-style.d.ts +5 -0
  133. package/dist/utils/plugin-style.d.ts.map +1 -0
  134. package/package.json +2 -1
  135. package/dist/chunks/adTriggers-DXmtF4t2.js +0 -410
  136. package/dist/chunks/adTriggers-DXmtF4t2.js.map +0 -1
  137. package/dist/chunks/ads-CdWbE9aD.js.map +0 -1
  138. package/dist/chunks/loopSection-CvF4l5uf.js.map +0 -1
  139. package/dist/chunks/markers-B04NMI79.js.map +0 -1
  140. package/dist/chunks/player-D7WQxMzr.js +0 -3894
  141. package/dist/chunks/player-D7WQxMzr.js.map +0 -1
  142. package/dist/chunks/playlist-C6Mh9BE8.js.map +0 -1
  143. package/dist/chunks/pluginHost-DjvLmMYZ.js +0 -376
  144. package/dist/chunks/pluginHost-DjvLmMYZ.js.map +0 -1
  145. package/dist/chunks/redirectScreen-5HAVRtxe.js +0 -208
  146. package/dist/chunks/redirectScreen-5HAVRtxe.js.map +0 -1
  147. package/dist/chunks/segments-gCPrWRig.js +0 -63
  148. package/dist/chunks/segments-gCPrWRig.js.map +0 -1
  149. package/dist/chunks/spriteThumbnails-B7oDZFTo.js.map +0 -1
  150. package/dist/chunks/statsPanel-DSClIwA3.js.map +0 -1
  151. package/dist/chunks/sticky-D_eLCNFk.js.map +0 -1
@@ -0,0 +1,22 @@
1
+ var ru=Object.defineProperty,iu=(Nt,Re,C)=>Re in Nt?ru(Nt,Re,{enumerable:!0,configurable:!0,writable:!0,value:C}):Nt[Re]=C,Pr=(Nt,Re,C)=>iu(Nt,typeof Re!="symbol"?Re+"":Re,C);import{hasDrm as ou,dashProtectionData as su}from"./keySystems-CNzjRq6e.js";var au={7267:function(Nt,Re){Re.toByteArray=function(b){var T,Q,V=(function(ue){var F=ue.length;if(F%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var ve=ue.indexOf("=");return ve===-1&&(ve=F),[ve,ve===F?0:4-ve%4]})(b),se=V[0],Y=V[1],ce=new f((function(ue,F,ve){return 3*(F+ve)/4-ve})(0,se,Y)),ge=0,Te=Y>0?se-4:se;for(Q=0;Q<Te;Q+=4)T=j[b.charCodeAt(Q)]<<18|j[b.charCodeAt(Q+1)]<<12|j[b.charCodeAt(Q+2)]<<6|j[b.charCodeAt(Q+3)],ce[ge++]=T>>16&255,ce[ge++]=T>>8&255,ce[ge++]=255&T;return Y===2&&(T=j[b.charCodeAt(Q)]<<2|j[b.charCodeAt(Q+1)]>>4,ce[ge++]=255&T),Y===1&&(T=j[b.charCodeAt(Q)]<<10|j[b.charCodeAt(Q+1)]<<4|j[b.charCodeAt(Q+2)]>>2,ce[ge++]=T>>8&255,ce[ge++]=255&T),ce},Re.fromByteArray=function(b){for(var T,Q=b.length,V=Q%3,se=[],Y=16383,ce=0,ge=Q-V;ce<ge;ce+=Y)se.push(m(b,ce,ce+Y>ge?ge:ce+Y));return V===1?(T=b[Q-1],se.push(C[T>>2]+C[T<<4&63]+"==")):V===2&&(T=(b[Q-2]<<8)+b[Q-1],se.push(C[T>>10]+C[T>>4&63]+C[T<<2&63]+"=")),se.join("")};for(var C=[],j=[],f=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)C[u]=o[u],j[o.charCodeAt(u)]=u;function E(b){return C[b>>18&63]+C[b>>12&63]+C[b>>6&63]+C[63&b]}function m(b,T,Q){for(var V,se=[],Y=T;Y<Q;Y+=3)V=(b[Y]<<16&16711680)+(b[Y+1]<<8&65280)+(255&b[Y+2]),se.push(E(V));return se.join("")}j[45]=62,j[95]=63},44:function(Nt,Re,C){const j=C(7267),f=C(7986),o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Re.Buffer=m,Re.SlowBuffer=function(g){return+g!=g&&(g=0),m.alloc(+g)},Re.INSPECT_MAX_BYTES=50;const u=2147483647;function E(g){if(g>u)throw new RangeError('The value "'+g+'" is invalid for option "size"');const y=new Uint8Array(g);return Object.setPrototypeOf(y,m.prototype),y}function m(g,y,R){if(typeof g=="number"){if(typeof y=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Q(g)}return b(g,y,R)}function b(g,y,R){if(typeof g=="string")return(function(de,qe){if(typeof qe=="string"&&qe!==""||(qe="utf8"),!m.isEncoding(qe))throw new TypeError("Unknown encoding: "+qe);const yt=0|ce(de,qe);let Lt=E(yt);const Ft=Lt.write(de,qe);return Ft!==yt&&(Lt=Lt.slice(0,Ft)),Lt})(g,y);if(ArrayBuffer.isView(g))return(function(de){if(P(de,Uint8Array)){const qe=new Uint8Array(de);return se(qe.buffer,qe.byteOffset,qe.byteLength)}return V(de)})(g);if(g==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof g);if(P(g,ArrayBuffer)||g&&P(g.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(P(g,SharedArrayBuffer)||g&&P(g.buffer,SharedArrayBuffer)))return se(g,y,R);if(typeof g=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ne=g.valueOf&&g.valueOf();if(ne!=null&&ne!==g)return m.from(ne,y,R);const Z=(function(de){if(m.isBuffer(de)){const qe=0|Y(de.length),yt=E(qe);return yt.length===0||de.copy(yt,0,0,qe),yt}return de.length!==void 0?typeof de.length!="number"||_e(de.length)?E(0):V(de):de.type==="Buffer"&&Array.isArray(de.data)?V(de.data):void 0})(g);if(Z)return Z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof g[Symbol.toPrimitive]=="function")return m.from(g[Symbol.toPrimitive]("string"),y,R);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof g)}function T(g){if(typeof g!="number")throw new TypeError('"size" argument must be of type number');if(g<0)throw new RangeError('The value "'+g+'" is invalid for option "size"')}function Q(g){return T(g),E(g<0?0:0|Y(g))}function V(g){const y=g.length<0?0:0|Y(g.length),R=E(y);for(let ne=0;ne<y;ne+=1)R[ne]=255&g[ne];return R}function se(g,y,R){if(y<0||g.byteLength<y)throw new RangeError('"offset" is outside of buffer bounds');if(g.byteLength<y+(R||0))throw new RangeError('"length" is outside of buffer bounds');let ne;return ne=y===void 0&&R===void 0?new Uint8Array(g):R===void 0?new Uint8Array(g,y):new Uint8Array(g,y,R),Object.setPrototypeOf(ne,m.prototype),ne}function Y(g){if(g>=u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u.toString(16)+" bytes");return 0|g}function ce(g,y){if(m.isBuffer(g))return g.length;if(ArrayBuffer.isView(g)||P(g,ArrayBuffer))return g.byteLength;if(typeof g!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof g);const R=g.length,ne=arguments.length>2&&arguments[2]===!0;if(!ne&&R===0)return 0;let Z=!1;for(;;)switch(y){case"ascii":case"latin1":case"binary":return R;case"utf8":case"utf-8":return K(g).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*R;case"hex":return R>>>1;case"base64":return S(g).length;default:if(Z)return ne?-1:K(g).length;y=(""+y).toLowerCase(),Z=!0}}function ge(g,y,R){let ne=!1;if((y===void 0||y<0)&&(y=0),y>this.length||((R===void 0||R>this.length)&&(R=this.length),R<=0)||(R>>>=0)<=(y>>>=0))return"";for(g||(g="utf8");;)switch(g){case"hex":return mt(this,y,R);case"utf8":case"utf-8":return we(this,y,R);case"ascii":return pt(this,y,R);case"latin1":case"binary":return ye(this,y,R);case"base64":return he(this,y,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ze(this,y,R);default:if(ne)throw new TypeError("Unknown encoding: "+g);g=(g+"").toLowerCase(),ne=!0}}function Te(g,y,R){const ne=g[y];g[y]=g[R],g[R]=ne}function ue(g,y,R,ne,Z){if(g.length===0)return-1;if(typeof R=="string"?(ne=R,R=0):R>2147483647?R=2147483647:R<-2147483648&&(R=-2147483648),_e(R=+R)&&(R=Z?0:g.length-1),R<0&&(R=g.length+R),R>=g.length){if(Z)return-1;R=g.length-1}else if(R<0){if(!Z)return-1;R=0}if(typeof y=="string"&&(y=m.from(y,ne)),m.isBuffer(y))return y.length===0?-1:F(g,y,R,ne,Z);if(typeof y=="number")return y&=255,typeof Uint8Array.prototype.indexOf=="function"?Z?Uint8Array.prototype.indexOf.call(g,y,R):Uint8Array.prototype.lastIndexOf.call(g,y,R):F(g,[y],R,ne,Z);throw new TypeError("val must be string, number or Buffer")}function F(g,y,R,ne,Z){let de,qe=1,yt=g.length,Lt=y.length;if(ne!==void 0&&((ne=String(ne).toLowerCase())==="ucs2"||ne==="ucs-2"||ne==="utf16le"||ne==="utf-16le")){if(g.length<2||y.length<2)return-1;qe=2,yt/=2,Lt/=2,R/=2}function Ft(X,De){return qe===1?X[De]:X.readUInt16BE(De*qe)}if(Z){let X=-1;for(de=R;de<yt;de++)if(Ft(g,de)===Ft(y,X===-1?0:de-X)){if(X===-1&&(X=de),de-X+1===Lt)return X*qe}else X!==-1&&(de-=de-X),X=-1}else for(R+Lt>yt&&(R=yt-Lt),de=R;de>=0;de--){let X=!0;for(let De=0;De<Lt;De++)if(Ft(g,de+De)!==Ft(y,De)){X=!1;break}if(X)return de}return-1}function ve(g,y,R,ne){R=Number(R)||0;const Z=g.length-R;ne?(ne=Number(ne))>Z&&(ne=Z):ne=Z;const de=y.length;let qe;for(ne>de/2&&(ne=de/2),qe=0;qe<ne;++qe){const yt=parseInt(y.substr(2*qe,2),16);if(_e(yt))return qe;g[R+qe]=yt}return qe}function je(g,y,R,ne){return ae(K(y,g.length-R),g,R,ne)}function tt(g,y,R,ne){return ae((function(Z){const de=[];for(let qe=0;qe<Z.length;++qe)de.push(255&Z.charCodeAt(qe));return de})(y),g,R,ne)}function re(g,y,R,ne){return ae(S(y),g,R,ne)}function z(g,y,R,ne){return ae((function(Z,de){let qe,yt,Lt;const Ft=[];for(let X=0;X<Z.length&&!((de-=2)<0);++X)qe=Z.charCodeAt(X),yt=qe>>8,Lt=qe%256,Ft.push(Lt),Ft.push(yt);return Ft})(y,g.length-R),g,R,ne)}function he(g,y,R){return y===0&&R===g.length?j.fromByteArray(g):j.fromByteArray(g.slice(y,R))}function we(g,y,R){R=Math.min(g.length,R);const ne=[];let Z=y;for(;Z<R;){const de=g[Z];let qe=null,yt=de>239?4:de>223?3:de>191?2:1;if(Z+yt<=R){let Lt,Ft,X,De;switch(yt){case 1:de<128&&(qe=de);break;case 2:Lt=g[Z+1],(192&Lt)==128&&(De=(31&de)<<6|63&Lt,De>127&&(qe=De));break;case 3:Lt=g[Z+1],Ft=g[Z+2],(192&Lt)==128&&(192&Ft)==128&&(De=(15&de)<<12|(63&Lt)<<6|63&Ft,De>2047&&(De<55296||De>57343)&&(qe=De));break;case 4:Lt=g[Z+1],Ft=g[Z+2],X=g[Z+3],(192&Lt)==128&&(192&Ft)==128&&(192&X)==128&&(De=(15&de)<<18|(63&Lt)<<12|(63&Ft)<<6|63&X,De>65535&&De<1114112&&(qe=De))}}qe===null?(qe=65533,yt=1):qe>65535&&(qe-=65536,ne.push(qe>>>10&1023|55296),qe=56320|1023&qe),ne.push(qe),Z+=yt}return(function(de){const qe=de.length;if(qe<=Be)return String.fromCharCode.apply(String,de);let yt="",Lt=0;for(;Lt<qe;)yt+=String.fromCharCode.apply(String,de.slice(Lt,Lt+=Be));return yt})(ne)}Re.kMaxLength=u,m.TYPED_ARRAY_SUPPORT=(function(){try{const g=new Uint8Array(1),y={foo:function(){return 42}};return Object.setPrototypeOf(y,Uint8Array.prototype),Object.setPrototypeOf(g,y),g.foo()===42}catch{return!1}})(),m.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.buffer}}),Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.byteOffset}}),m.poolSize=8192,m.from=function(g,y,R){return b(g,y,R)},Object.setPrototypeOf(m.prototype,Uint8Array.prototype),Object.setPrototypeOf(m,Uint8Array),m.alloc=function(g,y,R){return(function(ne,Z,de){return T(ne),ne<=0?E(ne):Z!==void 0?typeof de=="string"?E(ne).fill(Z,de):E(ne).fill(Z):E(ne)})(g,y,R)},m.allocUnsafe=function(g){return Q(g)},m.allocUnsafeSlow=function(g){return Q(g)},m.isBuffer=function(g){return g!=null&&g._isBuffer===!0&&g!==m.prototype},m.compare=function(g,y){if(P(g,Uint8Array)&&(g=m.from(g,g.offset,g.byteLength)),P(y,Uint8Array)&&(y=m.from(y,y.offset,y.byteLength)),!m.isBuffer(g)||!m.isBuffer(y))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(g===y)return 0;let R=g.length,ne=y.length;for(let Z=0,de=Math.min(R,ne);Z<de;++Z)if(g[Z]!==y[Z]){R=g[Z],ne=y[Z];break}return R<ne?-1:ne<R?1:0},m.isEncoding=function(g){switch(String(g).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},m.concat=function(g,y){if(!Array.isArray(g))throw new TypeError('"list" argument must be an Array of Buffers');if(g.length===0)return m.alloc(0);let R;if(y===void 0)for(y=0,R=0;R<g.length;++R)y+=g[R].length;const ne=m.allocUnsafe(y);let Z=0;for(R=0;R<g.length;++R){let de=g[R];if(P(de,Uint8Array))Z+de.length>ne.length?(m.isBuffer(de)||(de=m.from(de)),de.copy(ne,Z)):Uint8Array.prototype.set.call(ne,de,Z);else{if(!m.isBuffer(de))throw new TypeError('"list" argument must be an Array of Buffers');de.copy(ne,Z)}Z+=de.length}return ne},m.byteLength=ce,m.prototype._isBuffer=!0,m.prototype.swap16=function(){const g=this.length;if(g%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let y=0;y<g;y+=2)Te(this,y,y+1);return this},m.prototype.swap32=function(){const g=this.length;if(g%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let y=0;y<g;y+=4)Te(this,y,y+3),Te(this,y+1,y+2);return this},m.prototype.swap64=function(){const g=this.length;if(g%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let y=0;y<g;y+=8)Te(this,y,y+7),Te(this,y+1,y+6),Te(this,y+2,y+5),Te(this,y+3,y+4);return this},m.prototype.toString=function(){const g=this.length;return g===0?"":arguments.length===0?we(this,0,g):ge.apply(this,arguments)},m.prototype.toLocaleString=m.prototype.toString,m.prototype.equals=function(g){if(!m.isBuffer(g))throw new TypeError("Argument must be a Buffer");return this===g||m.compare(this,g)===0},m.prototype.inspect=function(){let g="";const y=Re.INSPECT_MAX_BYTES;return g=this.toString("hex",0,y).replace(/(.{2})/g,"$1 ").trim(),this.length>y&&(g+=" ... "),"<Buffer "+g+">"},o&&(m.prototype[o]=m.prototype.inspect),m.prototype.compare=function(g,y,R,ne,Z){if(P(g,Uint8Array)&&(g=m.from(g,g.offset,g.byteLength)),!m.isBuffer(g))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof g);if(y===void 0&&(y=0),R===void 0&&(R=g?g.length:0),ne===void 0&&(ne=0),Z===void 0&&(Z=this.length),y<0||R>g.length||ne<0||Z>this.length)throw new RangeError("out of range index");if(ne>=Z&&y>=R)return 0;if(ne>=Z)return-1;if(y>=R)return 1;if(this===g)return 0;let de=(Z>>>=0)-(ne>>>=0),qe=(R>>>=0)-(y>>>=0);const yt=Math.min(de,qe),Lt=this.slice(ne,Z),Ft=g.slice(y,R);for(let X=0;X<yt;++X)if(Lt[X]!==Ft[X]){de=Lt[X],qe=Ft[X];break}return de<qe?-1:qe<de?1:0},m.prototype.includes=function(g,y,R){return this.indexOf(g,y,R)!==-1},m.prototype.indexOf=function(g,y,R){return ue(this,g,y,R,!0)},m.prototype.lastIndexOf=function(g,y,R){return ue(this,g,y,R,!1)},m.prototype.write=function(g,y,R,ne){if(y===void 0)ne="utf8",R=this.length,y=0;else if(R===void 0&&typeof y=="string")ne=y,R=this.length,y=0;else{if(!isFinite(y))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");y>>>=0,isFinite(R)?(R>>>=0,ne===void 0&&(ne="utf8")):(ne=R,R=void 0)}const Z=this.length-y;if((R===void 0||R>Z)&&(R=Z),g.length>0&&(R<0||y<0)||y>this.length)throw new RangeError("Attempt to write outside buffer bounds");ne||(ne="utf8");let de=!1;for(;;)switch(ne){case"hex":return ve(this,g,y,R);case"utf8":case"utf-8":return je(this,g,y,R);case"ascii":case"latin1":case"binary":return tt(this,g,y,R);case"base64":return re(this,g,y,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,g,y,R);default:if(de)throw new TypeError("Unknown encoding: "+ne);ne=(""+ne).toLowerCase(),de=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const Be=4096;function pt(g,y,R){let ne="";R=Math.min(g.length,R);for(let Z=y;Z<R;++Z)ne+=String.fromCharCode(127&g[Z]);return ne}function ye(g,y,R){let ne="";R=Math.min(g.length,R);for(let Z=y;Z<R;++Z)ne+=String.fromCharCode(g[Z]);return ne}function mt(g,y,R){const ne=g.length;(!y||y<0)&&(y=0),(!R||R<0||R>ne)&&(R=ne);let Z="";for(let de=y;de<R;++de)Z+=Ue[g[de]];return Z}function Ze(g,y,R){const ne=g.slice(y,R);let Z="";for(let de=0;de<ne.length-1;de+=2)Z+=String.fromCharCode(ne[de]+256*ne[de+1]);return Z}function He(g,y,R){if(g%1!=0||g<0)throw new RangeError("offset is not uint");if(g+y>R)throw new RangeError("Trying to access beyond buffer length")}function U(g,y,R,ne,Z,de){if(!m.isBuffer(g))throw new TypeError('"buffer" argument must be a Buffer instance');if(y>Z||y<de)throw new RangeError('"value" argument is out of bounds');if(R+ne>g.length)throw new RangeError("Index out of range")}function Bt(g,y,R,ne,Z){Ee(y,ne,Z,g,R,7);let de=Number(y&BigInt(4294967295));g[R++]=de,de>>=8,g[R++]=de,de>>=8,g[R++]=de,de>>=8,g[R++]=de;let qe=Number(y>>BigInt(32)&BigInt(4294967295));return g[R++]=qe,qe>>=8,g[R++]=qe,qe>>=8,g[R++]=qe,qe>>=8,g[R++]=qe,R}function Ut(g,y,R,ne,Z){Ee(y,ne,Z,g,R,7);let de=Number(y&BigInt(4294967295));g[R+7]=de,de>>=8,g[R+6]=de,de>>=8,g[R+5]=de,de>>=8,g[R+4]=de;let qe=Number(y>>BigInt(32)&BigInt(4294967295));return g[R+3]=qe,qe>>=8,g[R+2]=qe,qe>>=8,g[R+1]=qe,qe>>=8,g[R]=qe,R+8}function kt(g,y,R,ne,Z,de){if(R+ne>g.length)throw new RangeError("Index out of range");if(R<0)throw new RangeError("Index out of range")}function Kt(g,y,R,ne,Z){return y=+y,R>>>=0,Z||kt(g,0,R,4),f.write(g,y,R,ne,23,4),R+4}function on(g,y,R,ne,Z){return y=+y,R>>>=0,Z||kt(g,0,R,8),f.write(g,y,R,ne,52,8),R+8}m.prototype.slice=function(g,y){const R=this.length;(g=~~g)<0?(g+=R)<0&&(g=0):g>R&&(g=R),(y=y===void 0?R:~~y)<0?(y+=R)<0&&(y=0):y>R&&(y=R),y<g&&(y=g);const ne=this.subarray(g,y);return Object.setPrototypeOf(ne,m.prototype),ne},m.prototype.readUintLE=m.prototype.readUIntLE=function(g,y,R){g>>>=0,y>>>=0,R||He(g,y,this.length);let ne=this[g],Z=1,de=0;for(;++de<y&&(Z*=256);)ne+=this[g+de]*Z;return ne},m.prototype.readUintBE=m.prototype.readUIntBE=function(g,y,R){g>>>=0,y>>>=0,R||He(g,y,this.length);let ne=this[g+--y],Z=1;for(;y>0&&(Z*=256);)ne+=this[g+--y]*Z;return ne},m.prototype.readUint8=m.prototype.readUInt8=function(g,y){return g>>>=0,y||He(g,1,this.length),this[g]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(g,y){return g>>>=0,y||He(g,2,this.length),this[g]|this[g+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(g,y){return g>>>=0,y||He(g,2,this.length),this[g]<<8|this[g+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(g,y){return g>>>=0,y||He(g,4,this.length),(this[g]|this[g+1]<<8|this[g+2]<<16)+16777216*this[g+3]},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(g,y){return g>>>=0,y||He(g,4,this.length),16777216*this[g]+(this[g+1]<<16|this[g+2]<<8|this[g+3])},m.prototype.readBigUInt64LE=Pe(function(g){Tt(g>>>=0,"offset");const y=this[g],R=this[g+7];y!==void 0&&R!==void 0||Ct(g,this.length-8);const ne=y+256*this[++g]+65536*this[++g]+this[++g]*2**24,Z=this[++g]+256*this[++g]+65536*this[++g]+R*2**24;return BigInt(ne)+(BigInt(Z)<<BigInt(32))}),m.prototype.readBigUInt64BE=Pe(function(g){Tt(g>>>=0,"offset");const y=this[g],R=this[g+7];y!==void 0&&R!==void 0||Ct(g,this.length-8);const ne=y*2**24+65536*this[++g]+256*this[++g]+this[++g],Z=this[++g]*2**24+65536*this[++g]+256*this[++g]+R;return(BigInt(ne)<<BigInt(32))+BigInt(Z)}),m.prototype.readIntLE=function(g,y,R){g>>>=0,y>>>=0,R||He(g,y,this.length);let ne=this[g],Z=1,de=0;for(;++de<y&&(Z*=256);)ne+=this[g+de]*Z;return Z*=128,ne>=Z&&(ne-=Math.pow(2,8*y)),ne},m.prototype.readIntBE=function(g,y,R){g>>>=0,y>>>=0,R||He(g,y,this.length);let ne=y,Z=1,de=this[g+--ne];for(;ne>0&&(Z*=256);)de+=this[g+--ne]*Z;return Z*=128,de>=Z&&(de-=Math.pow(2,8*y)),de},m.prototype.readInt8=function(g,y){return g>>>=0,y||He(g,1,this.length),128&this[g]?-1*(255-this[g]+1):this[g]},m.prototype.readInt16LE=function(g,y){g>>>=0,y||He(g,2,this.length);const R=this[g]|this[g+1]<<8;return 32768&R?4294901760|R:R},m.prototype.readInt16BE=function(g,y){g>>>=0,y||He(g,2,this.length);const R=this[g+1]|this[g]<<8;return 32768&R?4294901760|R:R},m.prototype.readInt32LE=function(g,y){return g>>>=0,y||He(g,4,this.length),this[g]|this[g+1]<<8|this[g+2]<<16|this[g+3]<<24},m.prototype.readInt32BE=function(g,y){return g>>>=0,y||He(g,4,this.length),this[g]<<24|this[g+1]<<16|this[g+2]<<8|this[g+3]},m.prototype.readBigInt64LE=Pe(function(g){Tt(g>>>=0,"offset");const y=this[g],R=this[g+7];y!==void 0&&R!==void 0||Ct(g,this.length-8);const ne=this[g+4]+256*this[g+5]+65536*this[g+6]+(R<<24);return(BigInt(ne)<<BigInt(32))+BigInt(y+256*this[++g]+65536*this[++g]+this[++g]*2**24)}),m.prototype.readBigInt64BE=Pe(function(g){Tt(g>>>=0,"offset");const y=this[g],R=this[g+7];y!==void 0&&R!==void 0||Ct(g,this.length-8);const ne=(y<<24)+65536*this[++g]+256*this[++g]+this[++g];return(BigInt(ne)<<BigInt(32))+BigInt(this[++g]*2**24+65536*this[++g]+256*this[++g]+R)}),m.prototype.readFloatLE=function(g,y){return g>>>=0,y||He(g,4,this.length),f.read(this,g,!0,23,4)},m.prototype.readFloatBE=function(g,y){return g>>>=0,y||He(g,4,this.length),f.read(this,g,!1,23,4)},m.prototype.readDoubleLE=function(g,y){return g>>>=0,y||He(g,8,this.length),f.read(this,g,!0,52,8)},m.prototype.readDoubleBE=function(g,y){return g>>>=0,y||He(g,8,this.length),f.read(this,g,!1,52,8)},m.prototype.writeUintLE=m.prototype.writeUIntLE=function(g,y,R,ne){g=+g,y>>>=0,R>>>=0,ne||U(this,g,y,R,Math.pow(2,8*R)-1,0);let Z=1,de=0;for(this[y]=255&g;++de<R&&(Z*=256);)this[y+de]=g/Z&255;return y+R},m.prototype.writeUintBE=m.prototype.writeUIntBE=function(g,y,R,ne){g=+g,y>>>=0,R>>>=0,ne||U(this,g,y,R,Math.pow(2,8*R)-1,0);let Z=R-1,de=1;for(this[y+Z]=255&g;--Z>=0&&(de*=256);)this[y+Z]=g/de&255;return y+R},m.prototype.writeUint8=m.prototype.writeUInt8=function(g,y,R){return g=+g,y>>>=0,R||U(this,g,y,1,255,0),this[y]=255&g,y+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(g,y,R){return g=+g,y>>>=0,R||U(this,g,y,2,65535,0),this[y]=255&g,this[y+1]=g>>>8,y+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(g,y,R){return g=+g,y>>>=0,R||U(this,g,y,2,65535,0),this[y]=g>>>8,this[y+1]=255&g,y+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(g,y,R){return g=+g,y>>>=0,R||U(this,g,y,4,4294967295,0),this[y+3]=g>>>24,this[y+2]=g>>>16,this[y+1]=g>>>8,this[y]=255&g,y+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(g,y,R){return g=+g,y>>>=0,R||U(this,g,y,4,4294967295,0),this[y]=g>>>24,this[y+1]=g>>>16,this[y+2]=g>>>8,this[y+3]=255&g,y+4},m.prototype.writeBigUInt64LE=Pe(function(g,y=0){return Bt(this,g,y,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeBigUInt64BE=Pe(function(g,y=0){return Ut(this,g,y,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeIntLE=function(g,y,R,ne){if(g=+g,y>>>=0,!ne){const yt=Math.pow(2,8*R-1);U(this,g,y,R,yt-1,-yt)}let Z=0,de=1,qe=0;for(this[y]=255&g;++Z<R&&(de*=256);)g<0&&qe===0&&this[y+Z-1]!==0&&(qe=1),this[y+Z]=(g/de|0)-qe&255;return y+R},m.prototype.writeIntBE=function(g,y,R,ne){if(g=+g,y>>>=0,!ne){const yt=Math.pow(2,8*R-1);U(this,g,y,R,yt-1,-yt)}let Z=R-1,de=1,qe=0;for(this[y+Z]=255&g;--Z>=0&&(de*=256);)g<0&&qe===0&&this[y+Z+1]!==0&&(qe=1),this[y+Z]=(g/de|0)-qe&255;return y+R},m.prototype.writeInt8=function(g,y,R){return g=+g,y>>>=0,R||U(this,g,y,1,127,-128),g<0&&(g=255+g+1),this[y]=255&g,y+1},m.prototype.writeInt16LE=function(g,y,R){return g=+g,y>>>=0,R||U(this,g,y,2,32767,-32768),this[y]=255&g,this[y+1]=g>>>8,y+2},m.prototype.writeInt16BE=function(g,y,R){return g=+g,y>>>=0,R||U(this,g,y,2,32767,-32768),this[y]=g>>>8,this[y+1]=255&g,y+2},m.prototype.writeInt32LE=function(g,y,R){return g=+g,y>>>=0,R||U(this,g,y,4,2147483647,-2147483648),this[y]=255&g,this[y+1]=g>>>8,this[y+2]=g>>>16,this[y+3]=g>>>24,y+4},m.prototype.writeInt32BE=function(g,y,R){return g=+g,y>>>=0,R||U(this,g,y,4,2147483647,-2147483648),g<0&&(g=4294967295+g+1),this[y]=g>>>24,this[y+1]=g>>>16,this[y+2]=g>>>8,this[y+3]=255&g,y+4},m.prototype.writeBigInt64LE=Pe(function(g,y=0){return Bt(this,g,y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),m.prototype.writeBigInt64BE=Pe(function(g,y=0){return Ut(this,g,y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),m.prototype.writeFloatLE=function(g,y,R){return Kt(this,g,y,!0,R)},m.prototype.writeFloatBE=function(g,y,R){return Kt(this,g,y,!1,R)},m.prototype.writeDoubleLE=function(g,y,R){return on(this,g,y,!0,R)},m.prototype.writeDoubleBE=function(g,y,R){return on(this,g,y,!1,R)},m.prototype.copy=function(g,y,R,ne){if(!m.isBuffer(g))throw new TypeError("argument should be a Buffer");if(R||(R=0),ne||ne===0||(ne=this.length),y>=g.length&&(y=g.length),y||(y=0),ne>0&&ne<R&&(ne=R),ne===R||g.length===0||this.length===0)return 0;if(y<0)throw new RangeError("targetStart out of bounds");if(R<0||R>=this.length)throw new RangeError("Index out of range");if(ne<0)throw new RangeError("sourceEnd out of bounds");ne>this.length&&(ne=this.length),g.length-y<ne-R&&(ne=g.length-y+R);const Z=ne-R;return this===g&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(y,R,ne):Uint8Array.prototype.set.call(g,this.subarray(R,ne),y),Z},m.prototype.fill=function(g,y,R,ne){if(typeof g=="string"){if(typeof y=="string"?(ne=y,y=0,R=this.length):typeof R=="string"&&(ne=R,R=this.length),ne!==void 0&&typeof ne!="string")throw new TypeError("encoding must be a string");if(typeof ne=="string"&&!m.isEncoding(ne))throw new TypeError("Unknown encoding: "+ne);if(g.length===1){const de=g.charCodeAt(0);(ne==="utf8"&&de<128||ne==="latin1")&&(g=de)}}else typeof g=="number"?g&=255:typeof g=="boolean"&&(g=Number(g));if(y<0||this.length<y||this.length<R)throw new RangeError("Out of range index");if(R<=y)return this;let Z;if(y>>>=0,R=R===void 0?this.length:R>>>0,g||(g=0),typeof g=="number")for(Z=y;Z<R;++Z)this[Z]=g;else{const de=m.isBuffer(g)?g:m.from(g,ne),qe=de.length;if(qe===0)throw new TypeError('The value "'+g+'" is invalid for argument "value"');for(Z=0;Z<R-y;++Z)this[Z+y]=de[Z%qe]}return this};const un={};function hn(g,y,R){un[g]=class extends R{constructor(){super(),Object.defineProperty(this,"message",{value:y.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${g}]`,this.stack,delete this.name}get code(){return g}set code(ne){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ne,writable:!0})}toString(){return`${this.name} [${g}]: ${this.message}`}}}function Le(g){let y="",R=g.length;const ne=g[0]==="-"?1:0;for(;R>=ne+4;R-=3)y=`_${g.slice(R-3,R)}${y}`;return`${g.slice(0,R)}${y}`}function Ee(g,y,R,ne,Z,de){if(g>R||g<y){const qe=typeof y=="bigint"?"n":"";let yt;throw yt=y===0||y===BigInt(0)?`>= 0${qe} and < 2${qe} ** ${8*(de+1)}${qe}`:`>= -(2${qe} ** ${8*(de+1)-1}${qe}) and < 2 ** ${8*(de+1)-1}${qe}`,new un.ERR_OUT_OF_RANGE("value",yt,g)}(function(qe,yt,Lt){Tt(yt,"offset"),qe[yt]!==void 0&&qe[yt+Lt]!==void 0||Ct(yt,qe.length-(Lt+1))})(ne,Z,de)}function Tt(g,y){if(typeof g!="number")throw new un.ERR_INVALID_ARG_TYPE(y,"number",g)}function Ct(g,y,R){throw Math.floor(g)!==g?(Tt(g,R),new un.ERR_OUT_OF_RANGE("offset","an integer",g)):y<0?new un.ERR_BUFFER_OUT_OF_BOUNDS:new un.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${y}`,g)}hn("ERR_BUFFER_OUT_OF_BOUNDS",function(g){return g?`${g} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),hn("ERR_INVALID_ARG_TYPE",function(g,y){return`The "${g}" argument must be of type number. Received type ${typeof y}`},TypeError),hn("ERR_OUT_OF_RANGE",function(g,y,R){let ne=`The value of "${g}" is out of range.`,Z=R;return Number.isInteger(R)&&Math.abs(R)>2**32?Z=Le(String(R)):typeof R=="bigint"&&(Z=String(R),(R>BigInt(2)**BigInt(32)||R<-(BigInt(2)**BigInt(32)))&&(Z=Le(Z)),Z+="n"),ne+=` It must be ${y}. Received ${Z}`,ne},RangeError);const Ye=/[^+/0-9A-Za-z-_]/g;function K(g,y){let R;y=y||1/0;const ne=g.length;let Z=null;const de=[];for(let qe=0;qe<ne;++qe){if(R=g.charCodeAt(qe),R>55295&&R<57344){if(!Z){if(R>56319){(y-=3)>-1&&de.push(239,191,189);continue}if(qe+1===ne){(y-=3)>-1&&de.push(239,191,189);continue}Z=R;continue}if(R<56320){(y-=3)>-1&&de.push(239,191,189),Z=R;continue}R=65536+(Z-55296<<10|R-56320)}else Z&&(y-=3)>-1&&de.push(239,191,189);if(Z=null,R<128){if((y-=1)<0)break;de.push(R)}else if(R<2048){if((y-=2)<0)break;de.push(R>>6|192,63&R|128)}else if(R<65536){if((y-=3)<0)break;de.push(R>>12|224,R>>6&63|128,63&R|128)}else{if(!(R<1114112))throw new Error("Invalid code point");if((y-=4)<0)break;de.push(R>>18|240,R>>12&63|128,R>>6&63|128,63&R|128)}}return de}function S(g){return j.toByteArray((function(y){if((y=(y=y.split("=")[0]).trim().replace(Ye,"")).length<2)return"";for(;y.length%4!=0;)y+="=";return y})(g))}function ae(g,y,R,ne){let Z;for(Z=0;Z<ne&&!(Z+R>=y.length||Z>=g.length);++Z)y[Z+R]=g[Z];return Z}function P(g,y){return g instanceof y||g!=null&&g.constructor!=null&&g.constructor.name!=null&&g.constructor.name===y.name}function _e(g){return g!=g}const Ue=(function(){const g="0123456789abcdef",y=new Array(256);for(let R=0;R<16;++R){const ne=16*R;for(let Z=0;Z<16;++Z)y[ne+Z]=g[R]+g[Z]}return y})();function Pe(g){return typeof BigInt>"u"?Je:g}function Je(){throw new Error("BigInt not supported")}},6877:function(Nt,Re){var C={parseBuffer:function(o){return new j(o).parse()},addBoxProcessor:function(o,u){typeof o=="string"&&typeof u=="function"&&(f.prototype._boxProcessors[o]=u)},createFile:function(){return new j},createBox:function(o,u,E){var m=f.create(o);return u&&u.append(m,E),m},createFullBox:function(o,u,E){var m=C.createBox(o,u,E);return m.version=0,m.flags=0,m},Utils:{}};C.Utils.dataViewToString=function(o,u){var E=u||"utf-8";if(typeof TextDecoder<"u")return new TextDecoder(E).decode(o);var m=[],b=0;if(E==="utf-8")for(;b<o.byteLength;){var T=o.getUint8(b++);T<128||(T<224?(T=(31&T)<<6,T|=63&o.getUint8(b++)):T<240?(T=(15&T)<<12,T|=(63&o.getUint8(b++))<<6,T|=63&o.getUint8(b++)):(T=(7&T)<<18,T|=(63&o.getUint8(b++))<<12,T|=(63&o.getUint8(b++))<<6,T|=63&o.getUint8(b++))),m.push(String.fromCharCode(T))}else for(;b<o.byteLength;)m.push(String.fromCharCode(o.getUint8(b++)));return m.join("")},C.Utils.utf8ToByteArray=function(o){var u,E;if(typeof TextEncoder<"u")u=new TextEncoder().encode(o);else for(u=[],E=0;E<o.length;++E){var m=o.charCodeAt(E);m<128?u.push(m):m<2048?(u.push(192|m>>6),u.push(128|63&m)):m<65536?(u.push(224|m>>12),u.push(128|63&m>>6),u.push(128|63&m)):(u.push(240|m>>18),u.push(128|63&m>>12),u.push(128|63&m>>6),u.push(128|63&m))}return u},C.Utils.appendBox=function(o,u,E){if(u._offset=o._cursor.offset,u._root=o._root?o._root:o,u._raw=o._raw,u._parent=o,E!==-1)if(E!=null){var m,b=-1;if(typeof E=="number")b=E;else{if(typeof E=="string")m=E;else{if(typeof E!="object"||!E.type)return void o.boxes.push(u);m=E.type}for(var T=0;T<o.boxes.length;T++)if(m===o.boxes[T].type){b=T+1;break}}o.boxes.splice(b,0,u)}else o.boxes.push(u)},Re.parseBuffer=C.parseBuffer,Re.addBoxProcessor=C.addBoxProcessor,Re.createFile=C.createFile,Re.createBox=C.createBox,Re.createFullBox=C.createFullBox,Re.Utils=C.Utils,C.Cursor=function(o){this.offset=o===void 0?0:o};var j=function(o){this._cursor=new C.Cursor,this.boxes=[],o&&(this._raw=new DataView(o))};j.prototype.fetch=function(o){var u=this.fetchAll(o,!0);return u.length?u[0]:null},j.prototype.fetchAll=function(o,u){var E=[];return j._sweep.call(this,o,E,u),E},j.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var o=f.parse(this);if(o.type===void 0)break;this.boxes.push(o)}return this},j._sweep=function(o,u,E){for(var m in this.type&&this.type==o&&u.push(this),this.boxes){if(u.length&&E)return;j._sweep.call(this.boxes[m],o,u,E)}},j.prototype.write=function(){var o,u=0;for(o=0;o<this.boxes.length;o++)u+=this.boxes[o].getLength(!1);var E=new Uint8Array(u);for(this._rawo=new DataView(E.buffer),this.bytes=E,this._cursor.offset=0,o=0;o<this.boxes.length;o++)this.boxes[o].write();return E.buffer},j.prototype.append=function(o,u){C.Utils.appendBox(this,o,u)};var f=function(){this._cursor=new C.Cursor};f.parse=function(o){var u=new f;return u._offset=o._cursor.offset,u._root=o._root?o._root:o,u._raw=o._raw,u._parent=o,u._parseBox(),o._cursor.offset=u._raw.byteOffset+u._raw.byteLength,u},f.create=function(o){var u=new f;return u.type=o,u.boxes=[],u},f.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca","meta","grpl","prsl"],f.prototype._boxProcessors={},f.prototype._procField=function(o,u,E){this._parsing?this[o]=this._readField(u,E):this._writeField(u,E,this[o])},f.prototype._procFieldArray=function(o,u,E,m){var b;if(this._parsing)for(this[o]=[],b=0;b<u;b++)this[o][b]=this._readField(E,m);else for(b=0;b<this[o].length;b++)this._writeField(E,m,this[o][b])},f.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},f.prototype._procEntries=function(o,u,E){var m;if(this._parsing)for(this[o]=[],m=0;m<u;m++)this[o].push({}),E.call(this,this[o][m]);else for(m=0;m<u;m++)E.call(this,this[o][m])},f.prototype._procSubEntries=function(o,u,E,m){var b;if(this._parsing)for(o[u]=[],b=0;b<E;b++)o[u].push({}),m.call(this,o[u][b]);else for(b=0;b<E;b++)m.call(this,o[u][b])},f.prototype._procEntryField=function(o,u,E,m){this._parsing?o[u]=this._readField(E,m):this._writeField(E,m,o[u])},f.prototype._procSubBoxes=function(o,u){var E;if(this._parsing)for(this[o]=[],E=0;E<u;E++)this[o].push(f.parse(this));else for(E=0;E<u;E++)this._rawo?this[o][E].write():this.size+=this[o][E].getLength()},f.prototype._readField=function(o,u){switch(o){case"uint":return this._readUint(u);case"int":return this._readInt(u);case"template":return this._readTemplate(u);case"string":return u===-1?this._readTerminatedString():this._readString(u);case"data":return this._readData(u);case"utf8":return this._readUTF8String();case"utf8string":return this._readUTF8TerminatedString();default:return-1}},f.prototype._readInt=function(o){var u=null,E=this._cursor.offset-this._raw.byteOffset;switch(o){case 8:u=this._raw.getInt8(E);break;case 16:u=this._raw.getInt16(E);break;case 32:u=this._raw.getInt32(E);break;case 64:var m=this._raw.getInt32(E),b=this._raw.getInt32(E+4);u=m*Math.pow(2,32)+b}return this._cursor.offset+=o>>3,u},f.prototype._readUint=function(o){var u,E,m=null,b=this._cursor.offset-this._raw.byteOffset;switch(o){case 8:m=this._raw.getUint8(b);break;case 16:m=this._raw.getUint16(b);break;case 24:m=((u=this._raw.getUint16(b))<<8)+(E=this._raw.getUint8(b+2));break;case 32:m=this._raw.getUint32(b);break;case 64:u=this._raw.getUint32(b),E=this._raw.getUint32(b+4),m=u*Math.pow(2,32)+E}return this._cursor.offset+=o>>3,m},f.prototype._readString=function(o){for(var u="",E=0;E<o;E++){var m=this._readUint(8);u+=String.fromCharCode(m)}return u},f.prototype._readTemplate=function(o){return this._readUint(o/2)+this._readUint(o/2)/Math.pow(2,o/2)},f.prototype._readTerminatedString=function(){for(var o="";this._cursor.offset-this._offset<this._raw.byteLength;){var u=this._readUint(8);if(u===0)break;o+=String.fromCharCode(u)}return o},f.prototype._readData=function(o){var u=o>0?o:this._raw.byteLength-(this._cursor.offset-this._offset);if(u>0){var E=new Uint8Array(this._raw.buffer,this._cursor.offset,u);return this._cursor.offset+=u,E}return null},f.prototype._readUTF8String=function(){var o=this._raw.byteLength-(this._cursor.offset-this._offset),u=null;return o>0&&(u=new DataView(this._raw.buffer,this._cursor.offset,o),this._cursor.offset+=o),u&&C.Utils.dataViewToString(u)},f.prototype._readUTF8TerminatedString=function(){var o=this._raw.byteLength-(this._cursor.offset-this._offset),u=null;if(o>0){var E;for(u=new DataView(this._raw.buffer,this._cursor.offset,o),E=0;E<o&&u.getUint8(E)!==0;E++);u=new DataView(this._raw.buffer,this._cursor.offset,E),this._cursor.offset+=Math.min(E+1,o)}return u&&C.Utils.dataViewToString(u)},f.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),this.size===1&&this._procField("largesize","uint",64),this.type==="uuid"&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),this._boxContainers.indexOf(this.type)!==-1?this._parseContainerBox():this._data=this._readData())}},f.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},f.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(f.parse(this))},f.prototype.append=function(o,u){C.Utils.appendBox(this,o,u)},f.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField("size","uint",32),this._procField("type","string",4),this.size===1&&this._procField("largesize","uint",64),this.type==="uuid"&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),this._boxContainers.indexOf(this.type)!==-1)for(var o=0;o<this.boxes.length;o++)this.size+=this.boxes[o].getLength();return this._data&&this._writeData(this._data),this.size},f.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(this._procField("size","uint",32),this._procField("type","string",4),this.size===1&&this._procField("largesize","uint",64),this.type==="uuid"&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),this._boxContainers.indexOf(this.type)!==-1)for(var o=0;o<this.boxes.length;o++)this.boxes[o].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},f.prototype._writeInt=function(o,u){if(this._rawo){var E=this._cursor.offset-this._rawo.byteOffset;switch(o){case 8:this._rawo.setInt8(E,u);break;case 16:this._rawo.setInt16(E,u);break;case 32:this._rawo.setInt32(E,u);break;case 64:var m=Math.floor(u/Math.pow(2,32)),b=u-m*Math.pow(2,32);this._rawo.setUint32(E,m),this._rawo.setUint32(E+4,b)}this._cursor.offset+=o>>3}else this.size+=o>>3},f.prototype._writeUint=function(o,u){if(this._rawo){var E,m,b=this._cursor.offset-this._rawo.byteOffset;switch(o){case 8:this._rawo.setUint8(b,u);break;case 16:this._rawo.setUint16(b,u);break;case 24:E=(16776960&u)>>8,m=255&u,this._rawo.setUint16(b,E),this._rawo.setUint8(b+2,m);break;case 32:this._rawo.setUint32(b,u);break;case 64:m=u-(E=Math.floor(u/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(b,E),this._rawo.setUint32(b+4,m)}this._cursor.offset+=o>>3}else this.size+=o>>3},f.prototype._writeString=function(o,u){for(var E=0;E<o;E++)this._writeUint(8,u.charCodeAt(E))},f.prototype._writeTerminatedString=function(o){if(o.length!==0){for(var u=0;u<o.length;u++)this._writeUint(8,o.charCodeAt(u));this._writeUint(8,0)}},f.prototype._writeTemplate=function(o,u){var E=Math.floor(u),m=(u-E)*Math.pow(2,o/2);this._writeUint(o/2,E),this._writeUint(o/2,m)},f.prototype._writeData=function(o){if(o)if(this._rawo){if(o instanceof Array){for(var u=this._cursor.offset-this._rawo.byteOffset,E=0;E<o.length;E++)this._rawo.setInt8(u+E,o[E]);this._cursor.offset+=o.length}o instanceof Uint8Array&&(this._root.bytes.set(o,this._cursor.offset),this._cursor.offset+=o.length)}else this.size+=o.length},f.prototype._writeUTF8String=function(o){var u=C.Utils.utf8ToByteArray(o);if(this._rawo)for(var E=new DataView(this._rawo.buffer,this._cursor.offset,u.length),m=0;m<u.length;m++)E.setUint8(m,u[m]);else this.size+=u.length},f.prototype._writeField=function(o,u,E){switch(o){case"uint":this._writeUint(u,E);break;case"int":this._writeInt(u,E);break;case"template":this._writeTemplate(u,E);break;case"string":u==-1?this._writeTerminatedString(E):this._writeString(u,E);break;case"data":this._writeData(E);break;case"utf8":this._writeUTF8String(E)}},f.prototype._boxProcessors.ardi=function(){this._procFullBox(),this._procField("audio_rendering_indication","uint",8)},f.prototype._boxProcessors.avc1=f.prototype._boxProcessors.avc2=f.prototype._boxProcessors.avc3=f.prototype._boxProcessors.avc4=f.prototype._boxProcessors.hvc1=f.prototype._boxProcessors.hev1=f.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},f.prototype._boxProcessors.ctts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(o){this._procEntryField(o,"sample_count","uint",32),this._procEntryField(o,"sample_offset",this.version===1?"int":"uint",32)})},f.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},f.prototype._boxProcessors.elng=function(){this._procFullBox(),this._procField("extended_language","utf8string")},f.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(o){this._procEntryField(o,"segment_duration","uint",this.version===1?64:32),this._procEntryField(o,"media_time","int",this.version===1?64:32),this._procEntryField(o,"media_rate_integer","int",16),this._procEntryField(o,"media_rate_fraction","int",16)})},f.prototype._boxProcessors.emsg=function(){this._procFullBox(),this.version==1?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},f.prototype._boxProcessors.free=f.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},f.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},f.prototype._boxProcessors.ftyp=f.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var o=-1;this._parsing&&(o=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",o,"string",4)},f.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},f.prototype._boxProcessors.imda=function(){this._procField("imda_identifier","uint",32),this._procField("data","data",-1)},f.prototype._boxProcessors.kind=function(){this._procFullBox(),this._procField("schemeURI","utf8string"),this._procField("value","utf8string")},f.prototype._boxProcessors.labl=function(){this._procFullBox(),this.is_group_label=!!(1&this.flags),this._procField("label_id","uint",16),this._procField("language","utf8string"),this._procField("label","utf8string")},f.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},f.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField("creation_time","uint",this.version==1?64:32),this._procField("modification_time","uint",this.version==1?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",this.version==1?64:32),this._parsing||typeof this.language!="string"||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},f.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",this.version==1?64:32)},f.prototype._boxProcessors.meta=function(){this._procFullBox()},f.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},f.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},f.prototype._boxProcessors.mp4a=f.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},f.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",this.version==1?64:32),this._procField("modification_time","uint",this.version==1?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",this.version==1?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},f.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},f.prototype._boxProcessors.prft=function(){this._procFullBox(),this._procField("reference_track_ID","uint",32),this._procField("ntp_timestamp_sec","uint",32),this._procField("ntp_timestamp_frac","uint",32),this._procField("media_time","uint",this.version==1?64:32)},f.prototype._boxProcessors.prsl=function(){this._procFullBox(),this._procField("group_id","uint",32),this._procField("num_entities_in_group","uint",32),this._procEntries("entities",this.num_entities_in_group,function(o){this._procEntryField(o,"entity_id","uint",32)}),4096&this.flags&&this._procField("preselection_tag","utf8string"),8192&this.flags&&this._procField("selection_priority","uint",8),16384&this.flags&&this._procField("interleaving_tag","utf8string")},f.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},f.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},f.prototype._boxProcessors.sdtp=function(){this._procFullBox();var o=-1;this._parsing&&(o=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",o,"uint",8)},f.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",this.version==1?64:32),this._procField("first_offset","uint",this.version==1?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,function(o){this._parsing||(o.reference=(1&o.reference_type)<<31,o.reference|=2147483647&o.referenced_size,o.sap=(1&o.starts_with_SAP)<<31,o.sap|=(3&o.SAP_type)<<28,o.sap|=268435455&o.SAP_delta_time),this._procEntryField(o,"reference","uint",32),this._procEntryField(o,"subsegment_duration","uint",32),this._procEntryField(o,"sap","uint",32),this._parsing&&(o.reference_type=o.reference>>31&1,o.referenced_size=2147483647&o.reference,o.starts_with_SAP=o.sap>>31&1,o.SAP_type=o.sap>>28&7,o.SAP_delta_time=268435455&o.sap)})},f.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},f.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,function(o){this._procEntryField(o,"ranges_count","uint",32),this._procSubEntries(o,"ranges",o.ranges_count,function(u){this._procEntryField(u,"level","uint",8),this._procEntryField(u,"range_size","uint",24)})})},f.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},f.prototype._boxProcessors.sttg=function(){this._procField("settings","utf8")},f.prototype._boxProcessors.stts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(o){this._procEntryField(o,"sample_count","uint",32),this._procEntryField(o,"sample_delta","uint",32)})},f.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(o){this._procEntryField(o,"sample_delta","uint",32),this._procEntryField(o,"subsample_count","uint",16),this._procSubEntries(o,"subsamples",o.subsample_count,function(u){this._procEntryField(u,"subsample_size","uint",this.version===1?32:16),this._procEntryField(u,"subsample_priority","uint",8),this._procEntryField(u,"discardable","uint",8),this._procEntryField(u,"codec_specific_parameters","uint",32)})})},f.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},f.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",this.version==1?64:32)},f.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},f.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,function(o){this._procEntryField(o,"time","uint",this.version===1?64:32),this._procEntryField(o,"moof_offset","uint",this.version===1?64:32),this._procEntryField(o,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(o,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(o,"sample_number","uint",8*(this.length_size_of_sample_num+1))})},f.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",this.version==1?64:32),this._procField("modification_time","uint",this.version==1?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",this.version==1?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},f.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},f.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,function(o){256&this.flags&&this._procEntryField(o,"sample_duration","uint",32),512&this.flags&&this._procEntryField(o,"sample_size","uint",32),1024&this.flags&&this._procEntryField(o,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(o,"sample_composition_time_offset",this.version===1?"int":"uint",32)})},f.prototype._boxProcessors["url "]=f.prototype._boxProcessors["urn "]=function(){this._procFullBox(),this.type==="urn "&&this._procField("name","string",-1),this._procField("location","string",-1)},f.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},f.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},f.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},f.prototype._boxProcessors.vtte=function(){}},9826:function(Nt){var Re,C=typeof Reflect=="object"?Reflect:null,j=C&&typeof C.apply=="function"?C.apply:function(ge,Te,ue){return Function.prototype.apply.call(ge,Te,ue)};Re=C&&typeof C.ownKeys=="function"?C.ownKeys:Object.getOwnPropertySymbols?function(ge){return Object.getOwnPropertyNames(ge).concat(Object.getOwnPropertySymbols(ge))}:function(ge){return Object.getOwnPropertyNames(ge)};var f=Number.isNaN||function(ge){return ge!=ge};function o(){o.init.call(this)}Nt.exports=o,Nt.exports.once=function(ge,Te){return new Promise(function(ue,F){function ve(tt){ge.removeListener(Te,je),F(tt)}function je(){typeof ge.removeListener=="function"&&ge.removeListener("error",ve),ue([].slice.call(arguments))}ce(ge,Te,je,{once:!0}),Te!=="error"&&(function(tt,re){typeof tt.on=="function"&&ce(tt,"error",re,{once:!0})})(ge,ve)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var u=10;function E(ge){if(typeof ge!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof ge)}function m(ge){return ge._maxListeners===void 0?o.defaultMaxListeners:ge._maxListeners}function b(ge,Te,ue,F){var ve,je,tt,re;if(E(ue),(je=ge._events)===void 0?(je=ge._events=Object.create(null),ge._eventsCount=0):(je.newListener!==void 0&&(ge.emit("newListener",Te,ue.listener?ue.listener:ue),je=ge._events),tt=je[Te]),tt===void 0)tt=je[Te]=ue,++ge._eventsCount;else if(typeof tt=="function"?tt=je[Te]=F?[ue,tt]:[tt,ue]:F?tt.unshift(ue):tt.push(ue),(ve=m(ge))>0&&tt.length>ve&&!tt.warned){tt.warned=!0;var z=new Error("Possible EventEmitter memory leak detected. "+tt.length+" "+String(Te)+" listeners added. Use emitter.setMaxListeners() to increase limit");z.name="MaxListenersExceededWarning",z.emitter=ge,z.type=Te,z.count=tt.length,re=z,console&&console.warn&&console.warn(re)}return ge}function T(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Q(ge,Te,ue){var F={fired:!1,wrapFn:void 0,target:ge,type:Te,listener:ue},ve=T.bind(F);return ve.listener=ue,F.wrapFn=ve,ve}function V(ge,Te,ue){var F=ge._events;if(F===void 0)return[];var ve=F[Te];return ve===void 0?[]:typeof ve=="function"?ue?[ve.listener||ve]:[ve]:ue?(function(je){for(var tt=new Array(je.length),re=0;re<tt.length;++re)tt[re]=je[re].listener||je[re];return tt})(ve):Y(ve,ve.length)}function se(ge){var Te=this._events;if(Te!==void 0){var ue=Te[ge];if(typeof ue=="function")return 1;if(ue!==void 0)return ue.length}return 0}function Y(ge,Te){for(var ue=new Array(Te),F=0;F<Te;++F)ue[F]=ge[F];return ue}function ce(ge,Te,ue,F){if(typeof ge.on=="function")F.once?ge.once(Te,ue):ge.on(Te,ue);else{if(typeof ge.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof ge);ge.addEventListener(Te,function ve(je){F.once&&ge.removeEventListener(Te,ve),ue(je)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(ge){if(typeof ge!="number"||ge<0||f(ge))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+ge+".");u=ge}}),o.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(ge){if(typeof ge!="number"||ge<0||f(ge))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+ge+".");return this._maxListeners=ge,this},o.prototype.getMaxListeners=function(){return m(this)},o.prototype.emit=function(ge){for(var Te=[],ue=1;ue<arguments.length;ue++)Te.push(arguments[ue]);var F=ge==="error",ve=this._events;if(ve!==void 0)F=F&&ve.error===void 0;else if(!F)return!1;if(F){var je;if(Te.length>0&&(je=Te[0]),je instanceof Error)throw je;var tt=new Error("Unhandled error."+(je?" ("+je.message+")":""));throw tt.context=je,tt}var re=ve[ge];if(re===void 0)return!1;if(typeof re=="function")j(re,this,Te);else{var z=re.length,he=Y(re,z);for(ue=0;ue<z;++ue)j(he[ue],this,Te)}return!0},o.prototype.addListener=function(ge,Te){return b(this,ge,Te,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(ge,Te){return b(this,ge,Te,!0)},o.prototype.once=function(ge,Te){return E(Te),this.on(ge,Q(this,ge,Te)),this},o.prototype.prependOnceListener=function(ge,Te){return E(Te),this.prependListener(ge,Q(this,ge,Te)),this},o.prototype.removeListener=function(ge,Te){var ue,F,ve,je,tt;if(E(Te),(F=this._events)===void 0)return this;if((ue=F[ge])===void 0)return this;if(ue===Te||ue.listener===Te)--this._eventsCount===0?this._events=Object.create(null):(delete F[ge],F.removeListener&&this.emit("removeListener",ge,ue.listener||Te));else if(typeof ue!="function"){for(ve=-1,je=ue.length-1;je>=0;je--)if(ue[je]===Te||ue[je].listener===Te){tt=ue[je].listener,ve=je;break}if(ve<0)return this;ve===0?ue.shift():(function(re,z){for(;z+1<re.length;z++)re[z]=re[z+1];re.pop()})(ue,ve),ue.length===1&&(F[ge]=ue[0]),F.removeListener!==void 0&&this.emit("removeListener",ge,tt||Te)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(ge){var Te,ue,F;if((ue=this._events)===void 0)return this;if(ue.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ue[ge]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ue[ge]),this;if(arguments.length===0){var ve,je=Object.keys(ue);for(F=0;F<je.length;++F)(ve=je[F])!=="removeListener"&&this.removeAllListeners(ve);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(Te=ue[ge])=="function")this.removeListener(ge,Te);else if(Te!==void 0)for(F=Te.length-1;F>=0;F--)this.removeListener(ge,Te[F]);return this},o.prototype.listeners=function(ge){return V(this,ge,!0)},o.prototype.rawListeners=function(ge){return V(this,ge,!1)},o.listenerCount=function(ge,Te){return typeof ge.listenerCount=="function"?ge.listenerCount(Te):se.call(ge,Te)},o.prototype.listenerCount=se,o.prototype.eventNames=function(){return this._eventsCount>0?Re(this._events):[]}},7316:function(Nt){Nt.exports=function Re(C,j){if(C===j)return!0;if(C&&j&&typeof C=="object"&&typeof j=="object"){if(C.constructor!==j.constructor)return!1;var f,o,u;if(Array.isArray(C)){if((f=C.length)!=j.length)return!1;for(o=f;o--!==0;)if(!Re(C[o],j[o]))return!1;return!0}if(C.constructor===RegExp)return C.source===j.source&&C.flags===j.flags;if(C.valueOf!==Object.prototype.valueOf)return C.valueOf()===j.valueOf();if(C.toString!==Object.prototype.toString)return C.toString()===j.toString();if((f=(u=Object.keys(C)).length)!==Object.keys(j).length)return!1;for(o=f;o--!==0;)if(!Object.prototype.hasOwnProperty.call(j,u[o]))return!1;for(o=f;o--!==0;){var E=u[o];if(!Re(C[E],j[E]))return!1}return!0}return C!=C&&j!=j}},7986:function(Nt,Re){Re.read=function(C,j,f,o,u){var E,m,b=8*u-o-1,T=(1<<b)-1,Q=T>>1,V=-7,se=f?u-1:0,Y=f?-1:1,ce=C[j+se];for(se+=Y,E=ce&(1<<-V)-1,ce>>=-V,V+=b;V>0;E=256*E+C[j+se],se+=Y,V-=8);for(m=E&(1<<-V)-1,E>>=-V,V+=o;V>0;m=256*m+C[j+se],se+=Y,V-=8);if(E===0)E=1-Q;else{if(E===T)return m?NaN:1/0*(ce?-1:1);m+=Math.pow(2,o),E-=Q}return(ce?-1:1)*m*Math.pow(2,E-o)},Re.write=function(C,j,f,o,u,E){var m,b,T,Q=8*E-u-1,V=(1<<Q)-1,se=V>>1,Y=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,ce=o?0:E-1,ge=o?1:-1,Te=j<0||j===0&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(b=isNaN(j)?1:0,m=V):(m=Math.floor(Math.log(j)/Math.LN2),j*(T=Math.pow(2,-m))<1&&(m--,T*=2),(j+=m+se>=1?Y/T:Y*Math.pow(2,1-se))*T>=2&&(m++,T/=2),m+se>=V?(b=0,m=V):m+se>=1?(b=(j*T-1)*Math.pow(2,u),m+=se):(b=j*Math.pow(2,se-1)*Math.pow(2,u),m=0));u>=8;C[f+ce]=255&b,ce+=ge,b/=256,u-=8);for(m=m<<u|b,Q+=u;Q>0;C[f+ce]=255&m,ce+=ge,m/=256,Q-=8);C[f+ce-ge]|=128*Te}},5474:function(Nt,Re,C){(function(j){j.parser=function(K,S){return new u(K,S)},j.SAXParser=u,j.SAXStream=m,j.createStream=function(K,S){return new m(K,S)},j.MAX_BUFFER_LENGTH=65536;var f,o=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function u(K,S){if(!(this instanceof u))return new u(K,S);var ae=this;(function(P){for(var _e=0,Ue=o.length;_e<Ue;_e++)P[o[_e]]=""})(ae),ae.q=ae.c="",ae.bufferCheckPosition=j.MAX_BUFFER_LENGTH,ae.opt=S||{},ae.opt.lowercase=ae.opt.lowercase||ae.opt.lowercasetags,ae.looseCase=ae.opt.lowercase?"toLowerCase":"toUpperCase",ae.tags=[],ae.closed=ae.closedRoot=ae.sawRoot=!1,ae.tag=ae.error=null,ae.strict=!!K,ae.noscript=!(!K&&!ae.opt.noscript),ae.state=ye.BEGIN,ae.strictEntities=ae.opt.strictEntities,ae.ENTITIES=ae.strictEntities?Object.create(j.XML_ENTITIES):Object.create(j.ENTITIES),ae.attribList=[],ae.opt.xmlns&&(ae.ns=Object.create(ue)),ae.trackPosition=ae.opt.position!==!1,ae.trackPosition&&(ae.position=ae.line=ae.column=0),Ze(ae,"onready")}j.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(K){function S(){}return S.prototype=K,new S}),Object.keys||(Object.keys=function(K){var S=[];for(var ae in K)K.hasOwnProperty(ae)&&S.push(ae);return S}),u.prototype={end:function(){kt(this)},write:function(K){var S=this;if(this.error)throw this.error;if(S.closed)return Ut(S,"Cannot write after close. Assign an onready handler.");if(K===null)return kt(S);typeof K=="object"&&(K=K.toString());for(var ae=0,P="";P=Ye(K,ae++),S.c=P,P;)switch(S.trackPosition&&(S.position++,P===`
2
+ `?(S.line++,S.column=0):S.column++),S.state){case ye.BEGIN:if(S.state=ye.BEGIN_WHITESPACE,P==="\uFEFF")continue;Ct(S,P);continue;case ye.BEGIN_WHITESPACE:Ct(S,P);continue;case ye.TEXT:if(S.sawRoot&&!S.closedRoot){for(var _e=ae-1;P&&P!=="<"&&P!=="&";)(P=Ye(K,ae++))&&S.trackPosition&&(S.position++,P===`
3
+ `?(S.line++,S.column=0):S.column++);S.textNode+=K.substring(_e,ae-1)}P!=="<"||S.sawRoot&&S.closedRoot&&!S.strict?(!he(b,P)||S.sawRoot&&!S.closedRoot||Kt(S,"Text data outside of root node."),P==="&"?S.state=ye.TEXT_ENTITY:S.textNode+=P):(S.state=ye.OPEN_WAKA,S.startTagPosition=S.position);continue;case ye.SCRIPT:P==="<"?S.state=ye.SCRIPT_ENDING:S.script+=P;continue;case ye.SCRIPT_ENDING:P==="/"?S.state=ye.CLOSE_TAG:(S.script+="<"+P,S.state=ye.SCRIPT);continue;case ye.OPEN_WAKA:if(P==="!")S.state=ye.SGML_DECL,S.sgmlDecl="";else if(!z(b,P))if(z(F,P))S.state=ye.OPEN_TAG,S.tagName=P;else if(P==="/")S.state=ye.CLOSE_TAG,S.tagName="";else if(P==="?")S.state=ye.PROC_INST,S.procInstName=S.procInstBody="";else{if(Kt(S,"Unencoded <"),S.startTagPosition+1<S.position){var Ue=S.position-S.startTagPosition;P=new Array(Ue).join(" ")+P}S.textNode+="<"+P,S.state=ye.TEXT}continue;case ye.SGML_DECL:(S.sgmlDecl+P).toUpperCase()===Y?(He(S,"onopencdata"),S.state=ye.CDATA,S.sgmlDecl="",S.cdata=""):S.sgmlDecl+P==="--"?(S.state=ye.COMMENT,S.comment="",S.sgmlDecl=""):(S.sgmlDecl+P).toUpperCase()===ce?(S.state=ye.DOCTYPE,(S.doctype||S.sawRoot)&&Kt(S,"Inappropriately located doctype declaration"),S.doctype="",S.sgmlDecl=""):P===">"?(He(S,"onsgmldeclaration",S.sgmlDecl),S.sgmlDecl="",S.state=ye.TEXT):(z(V,P)&&(S.state=ye.SGML_DECL_QUOTED),S.sgmlDecl+=P);continue;case ye.SGML_DECL_QUOTED:P===S.q&&(S.state=ye.SGML_DECL,S.q=""),S.sgmlDecl+=P;continue;case ye.DOCTYPE:P===">"?(S.state=ye.TEXT,He(S,"ondoctype",S.doctype),S.doctype=!0):(S.doctype+=P,P==="["?S.state=ye.DOCTYPE_DTD:z(V,P)&&(S.state=ye.DOCTYPE_QUOTED,S.q=P));continue;case ye.DOCTYPE_QUOTED:S.doctype+=P,P===S.q&&(S.q="",S.state=ye.DOCTYPE);continue;case ye.DOCTYPE_DTD:S.doctype+=P,P==="]"?S.state=ye.DOCTYPE:z(V,P)&&(S.state=ye.DOCTYPE_DTD_QUOTED,S.q=P);continue;case ye.DOCTYPE_DTD_QUOTED:S.doctype+=P,P===S.q&&(S.state=ye.DOCTYPE_DTD,S.q="");continue;case ye.COMMENT:P==="-"?S.state=ye.COMMENT_ENDING:S.comment+=P;continue;case ye.COMMENT_ENDING:P==="-"?(S.state=ye.COMMENT_ENDED,S.comment=Bt(S.opt,S.comment),S.comment&&He(S,"oncomment",S.comment),S.comment=""):(S.comment+="-"+P,S.state=ye.COMMENT);continue;case ye.COMMENT_ENDED:P!==">"?(Kt(S,"Malformed comment"),S.comment+="--"+P,S.state=ye.COMMENT):S.state=ye.TEXT;continue;case ye.CDATA:P==="]"?S.state=ye.CDATA_ENDING:S.cdata+=P;continue;case ye.CDATA_ENDING:P==="]"?S.state=ye.CDATA_ENDING_2:(S.cdata+="]"+P,S.state=ye.CDATA);continue;case ye.CDATA_ENDING_2:P===">"?(S.cdata&&He(S,"oncdata",S.cdata),He(S,"onclosecdata"),S.cdata="",S.state=ye.TEXT):P==="]"?S.cdata+="]":(S.cdata+="]]"+P,S.state=ye.CDATA);continue;case ye.PROC_INST:P==="?"?S.state=ye.PROC_INST_ENDING:z(b,P)?S.state=ye.PROC_INST_BODY:S.procInstName+=P;continue;case ye.PROC_INST_BODY:if(!S.procInstBody&&z(b,P))continue;P==="?"?S.state=ye.PROC_INST_ENDING:S.procInstBody+=P;continue;case ye.PROC_INST_ENDING:P===">"?(He(S,"onprocessinginstruction",{name:S.procInstName,body:S.procInstBody}),S.procInstName=S.procInstBody="",S.state=ye.TEXT):(S.procInstBody+="?"+P,S.state=ye.PROC_INST_BODY);continue;case ye.OPEN_TAG:z(ve,P)?S.tagName+=P:(on(S),P===">"?Le(S):P==="/"?S.state=ye.OPEN_TAG_SLASH:(he(b,P)&&Kt(S,"Invalid character in tag name"),S.state=ye.ATTRIB));continue;case ye.OPEN_TAG_SLASH:P===">"?(Le(S,!0),Ee(S)):(Kt(S,"Forward-slash in opening tag not followed by >"),S.state=ye.ATTRIB);continue;case ye.ATTRIB:if(z(b,P))continue;P===">"?Le(S):P==="/"?S.state=ye.OPEN_TAG_SLASH:z(F,P)?(S.attribName=P,S.attribValue="",S.state=ye.ATTRIB_NAME):Kt(S,"Invalid attribute name");continue;case ye.ATTRIB_NAME:P==="="?S.state=ye.ATTRIB_VALUE:P===">"?(Kt(S,"Attribute without value"),S.attribValue=S.attribName,hn(S),Le(S)):z(b,P)?S.state=ye.ATTRIB_NAME_SAW_WHITE:z(ve,P)?S.attribName+=P:Kt(S,"Invalid attribute name");continue;case ye.ATTRIB_NAME_SAW_WHITE:if(P==="=")S.state=ye.ATTRIB_VALUE;else{if(z(b,P))continue;Kt(S,"Attribute without value"),S.tag.attributes[S.attribName]="",S.attribValue="",He(S,"onattribute",{name:S.attribName,value:""}),S.attribName="",P===">"?Le(S):z(F,P)?(S.attribName=P,S.state=ye.ATTRIB_NAME):(Kt(S,"Invalid attribute name"),S.state=ye.ATTRIB)}continue;case ye.ATTRIB_VALUE:if(z(b,P))continue;z(V,P)?(S.q=P,S.state=ye.ATTRIB_VALUE_QUOTED):(Kt(S,"Unquoted attribute value"),S.state=ye.ATTRIB_VALUE_UNQUOTED,S.attribValue=P);continue;case ye.ATTRIB_VALUE_QUOTED:if(P!==S.q){P==="&"?S.state=ye.ATTRIB_VALUE_ENTITY_Q:S.attribValue+=P;continue}hn(S),S.q="",S.state=ye.ATTRIB_VALUE_CLOSED;continue;case ye.ATTRIB_VALUE_CLOSED:z(b,P)?S.state=ye.ATTRIB:P===">"?Le(S):P==="/"?S.state=ye.OPEN_TAG_SLASH:z(F,P)?(Kt(S,"No whitespace between attributes"),S.attribName=P,S.attribValue="",S.state=ye.ATTRIB_NAME):Kt(S,"Invalid attribute name");continue;case ye.ATTRIB_VALUE_UNQUOTED:if(he(se,P)){P==="&"?S.state=ye.ATTRIB_VALUE_ENTITY_U:S.attribValue+=P;continue}hn(S),P===">"?Le(S):S.state=ye.ATTRIB;continue;case ye.CLOSE_TAG:if(S.tagName)P===">"?Ee(S):z(ve,P)?S.tagName+=P:S.script?(S.script+="</"+S.tagName,S.tagName="",S.state=ye.SCRIPT):(he(b,P)&&Kt(S,"Invalid tagname in closing tag"),S.state=ye.CLOSE_TAG_SAW_WHITE);else{if(z(b,P))continue;he(F,P)?S.script?(S.script+="</"+P,S.state=ye.SCRIPT):Kt(S,"Invalid tagname in closing tag."):S.tagName=P}continue;case ye.CLOSE_TAG_SAW_WHITE:if(z(b,P))continue;P===">"?Ee(S):Kt(S,"Invalid characters in closing tag");continue;case ye.TEXT_ENTITY:case ye.ATTRIB_VALUE_ENTITY_Q:case ye.ATTRIB_VALUE_ENTITY_U:var Pe,Je;switch(S.state){case ye.TEXT_ENTITY:Pe=ye.TEXT,Je="textNode";break;case ye.ATTRIB_VALUE_ENTITY_Q:Pe=ye.ATTRIB_VALUE_QUOTED,Je="attribValue";break;case ye.ATTRIB_VALUE_ENTITY_U:Pe=ye.ATTRIB_VALUE_UNQUOTED,Je="attribValue"}P===";"?(S[Je]+=Tt(S),S.entity="",S.state=Pe):z(S.entity.length?tt:je,P)?S.entity+=P:(Kt(S,"Invalid character in entity name"),S[Je]+="&"+S.entity+P,S.entity="",S.state=Pe);continue;default:throw new Error(S,"Unknown state: "+S.state)}return S.position>=S.bufferCheckPosition&&(function(g){for(var y=Math.max(j.MAX_BUFFER_LENGTH,10),R=0,ne=0,Z=o.length;ne<Z;ne++){var de=g[o[ne]].length;if(de>y)switch(o[ne]){case"textNode":U(g);break;case"cdata":He(g,"oncdata",g.cdata),g.cdata="";break;case"script":He(g,"onscript",g.script),g.script="";break;default:Ut(g,"Max buffer length exceeded: "+o[ne])}R=Math.max(R,de)}var qe=j.MAX_BUFFER_LENGTH-R;g.bufferCheckPosition=qe+g.position})(S),S},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var K;U(K=this),K.cdata!==""&&(He(K,"oncdata",K.cdata),K.cdata=""),K.script!==""&&(He(K,"onscript",K.script),K.script="")}};try{f=C(3515).Stream}catch{f=function(){}}var E=j.EVENTS.filter(function(K){return K!=="error"&&K!=="end"});function m(K,S){if(!(this instanceof m))return new m(K,S);f.apply(this),this._parser=new u(K,S),this.writable=!0,this.readable=!0;var ae=this;this._parser.onend=function(){ae.emit("end")},this._parser.onerror=function(P){ae.emit("error",P),ae._parser.error=null},this._decoder=null,E.forEach(function(P){Object.defineProperty(ae,"on"+P,{get:function(){return ae._parser["on"+P]},set:function(_e){if(!_e)return ae.removeAllListeners(P),ae._parser["on"+P]=_e,_e;ae.on(P,_e)},enumerable:!0,configurable:!1})})}m.prototype=Object.create(f.prototype,{constructor:{value:m}}),m.prototype.write=function(K){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(K)){if(!this._decoder){var S=C(748).I;this._decoder=new S("utf8")}K=this._decoder.write(K)}return this._parser.write(K.toString()),this.emit("data",K),!0},m.prototype.end=function(K){return K&&K.length&&this.write(K),this._parser.end(),!0},m.prototype.on=function(K,S){var ae=this;return ae._parser["on"+K]||E.indexOf(K)===-1||(ae._parser["on"+K]=function(){var P=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);P.splice(0,0,K),ae.emit.apply(ae,P)}),f.prototype.on.call(ae,K,S)};var b=`\r
4
+ `,T="0124356789",Q="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",V=`'"`,se=b+">",Y="[CDATA[",ce="DOCTYPE",ge="http://www.w3.org/XML/1998/namespace",Te="http://www.w3.org/2000/xmlns/",ue={xml:ge,xmlns:Te};b=re(b),T=re(T),Q=re(Q);var F=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,ve=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,je=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,tt=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function re(K){return K.split("").reduce(function(S,ae){return S[ae]=!0,S},{})}function z(K,S){return(function(ae){return Object.prototype.toString.call(ae)==="[object RegExp]"})(K)?!!S.match(K):K[S]}function he(K,S){return!z(K,S)}V=re(V),se=re(se);var we,Be,pt,ye=0;for(var mt in j.STATE={BEGIN:ye++,BEGIN_WHITESPACE:ye++,TEXT:ye++,TEXT_ENTITY:ye++,OPEN_WAKA:ye++,SGML_DECL:ye++,SGML_DECL_QUOTED:ye++,DOCTYPE:ye++,DOCTYPE_QUOTED:ye++,DOCTYPE_DTD:ye++,DOCTYPE_DTD_QUOTED:ye++,COMMENT_STARTING:ye++,COMMENT:ye++,COMMENT_ENDING:ye++,COMMENT_ENDED:ye++,CDATA:ye++,CDATA_ENDING:ye++,CDATA_ENDING_2:ye++,PROC_INST:ye++,PROC_INST_BODY:ye++,PROC_INST_ENDING:ye++,OPEN_TAG:ye++,OPEN_TAG_SLASH:ye++,ATTRIB:ye++,ATTRIB_NAME:ye++,ATTRIB_NAME_SAW_WHITE:ye++,ATTRIB_VALUE:ye++,ATTRIB_VALUE_QUOTED:ye++,ATTRIB_VALUE_CLOSED:ye++,ATTRIB_VALUE_UNQUOTED:ye++,ATTRIB_VALUE_ENTITY_Q:ye++,ATTRIB_VALUE_ENTITY_U:ye++,CLOSE_TAG:ye++,CLOSE_TAG_SAW_WHITE:ye++,SCRIPT:ye++,SCRIPT_ENDING:ye++},j.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},j.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(j.ENTITIES).forEach(function(K){var S=j.ENTITIES[K],ae=typeof S=="number"?String.fromCharCode(S):S;j.ENTITIES[K]=ae}),j.STATE)j.STATE[j.STATE[mt]]=mt;function Ze(K,S,ae){K[S]&&K[S](ae)}function He(K,S,ae){K.textNode&&U(K),Ze(K,S,ae)}function U(K){K.textNode=Bt(K.opt,K.textNode),K.textNode&&Ze(K,"ontext",K.textNode),K.textNode=""}function Bt(K,S){return K.trim&&(S=S.trim()),K.normalize&&(S=S.replace(/\s+/g," ")),S}function Ut(K,S){return U(K),K.trackPosition&&(S+=`
5
+ Line: `+K.line+`
6
+ Column: `+K.column+`
7
+ Char: `+K.c),S=new Error(S),K.error=S,Ze(K,"onerror",S),K}function kt(K){return K.sawRoot&&!K.closedRoot&&Kt(K,"Unclosed root tag"),K.state!==ye.BEGIN&&K.state!==ye.BEGIN_WHITESPACE&&K.state!==ye.TEXT&&Ut(K,"Unexpected end"),U(K),K.c="",K.closed=!0,Ze(K,"onend"),u.call(K,K.strict,K.opt),K}function Kt(K,S){if(typeof K!="object"||!(K instanceof u))throw new Error("bad call to strictFail");K.strict&&Ut(K,S)}function on(K){K.strict||(K.tagName=K.tagName[K.looseCase]());var S=K.tags[K.tags.length-1]||K,ae=K.tag={name:K.tagName,attributes:{}};K.opt.xmlns&&(ae.ns=S.ns),K.attribList.length=0,He(K,"onopentagstart",ae)}function un(K,S){var ae=K.indexOf(":")<0?["",K]:K.split(":"),P=ae[0],_e=ae[1];return S&&K==="xmlns"&&(P="xmlns",_e=""),{prefix:P,local:_e}}function hn(K){if(K.strict||(K.attribName=K.attribName[K.looseCase]()),K.attribList.indexOf(K.attribName)!==-1||K.tag.attributes.hasOwnProperty(K.attribName))K.attribName=K.attribValue="";else{if(K.opt.xmlns){var S=un(K.attribName,!0),ae=S.prefix,P=S.local;if(ae==="xmlns")if(P==="xml"&&K.attribValue!==ge)Kt(K,"xml: prefix must be bound to "+ge+`
8
+ Actual: `+K.attribValue);else if(P==="xmlns"&&K.attribValue!==Te)Kt(K,"xmlns: prefix must be bound to "+Te+`
9
+ Actual: `+K.attribValue);else{var _e=K.tag,Ue=K.tags[K.tags.length-1]||K;_e.ns===Ue.ns&&(_e.ns=Object.create(Ue.ns)),_e.ns[P]=K.attribValue}K.attribList.push([K.attribName,K.attribValue])}else K.tag.attributes[K.attribName]=K.attribValue,He(K,"onattribute",{name:K.attribName,value:K.attribValue});K.attribName=K.attribValue=""}}function Le(K,S){if(K.opt.xmlns){var ae=K.tag,P=un(K.tagName);ae.prefix=P.prefix,ae.local=P.local,ae.uri=ae.ns[P.prefix]||"",ae.prefix&&!ae.uri&&(Kt(K,"Unbound namespace prefix: "+JSON.stringify(K.tagName)),ae.uri=P.prefix);var _e=K.tags[K.tags.length-1]||K;ae.ns&&_e.ns!==ae.ns&&Object.keys(ae.ns).forEach(function(yt){He(K,"onopennamespace",{prefix:yt,uri:ae.ns[yt]})});for(var Ue=0,Pe=K.attribList.length;Ue<Pe;Ue++){var Je=K.attribList[Ue],g=Je[0],y=Je[1],R=un(g,!0),ne=R.prefix,Z=R.local,de=ne===""?"":ae.ns[ne]||"",qe={name:g,value:y,prefix:ne,local:Z,uri:de};ne&&ne!=="xmlns"&&!de&&(Kt(K,"Unbound namespace prefix: "+JSON.stringify(ne)),qe.uri=ne),K.tag.attributes[g]=qe,He(K,"onattribute",qe)}K.attribList.length=0}K.tag.isSelfClosing=!!S,K.sawRoot=!0,K.tags.push(K.tag),He(K,"onopentag",K.tag),S||(K.noscript||K.tagName.toLowerCase()!=="script"?K.state=ye.TEXT:K.state=ye.SCRIPT,K.tag=null,K.tagName=""),K.attribName=K.attribValue="",K.attribList.length=0}function Ee(K){if(!K.tagName)return Kt(K,"Weird empty close tag."),K.textNode+="</>",void(K.state=ye.TEXT);if(K.script){if(K.tagName!=="script")return K.script+="</"+K.tagName+">",K.tagName="",void(K.state=ye.SCRIPT);He(K,"onscript",K.script),K.script=""}var S=K.tags.length,ae=K.tagName;K.strict||(ae=ae[K.looseCase]());for(var P=ae;S--&&K.tags[S].name!==P;)Kt(K,"Unexpected close tag");if(S<0)return Kt(K,"Unmatched closing tag: "+K.tagName),K.textNode+="</"+K.tagName+">",void(K.state=ye.TEXT);K.tagName=ae;for(var _e=K.tags.length;_e-- >S;){var Ue=K.tag=K.tags.pop();K.tagName=K.tag.name,He(K,"onclosetag",K.tagName);var Pe={};for(var Je in Ue.ns)Pe[Je]=Ue.ns[Je];var g=K.tags[K.tags.length-1]||K;K.opt.xmlns&&Ue.ns!==g.ns&&Object.keys(Ue.ns).forEach(function(y){var R=Ue.ns[y];He(K,"onclosenamespace",{prefix:y,uri:R})})}S===0&&(K.closedRoot=!0),K.tagName=K.attribValue=K.attribName="",K.attribList.length=0,K.state=ye.TEXT}function Tt(K){var S,ae=K.entity,P=ae.toLowerCase(),_e="";return K.ENTITIES[ae]?K.ENTITIES[ae]:K.ENTITIES[P]?K.ENTITIES[P]:((ae=P).charAt(0)==="#"&&(ae.charAt(1)==="x"?(ae=ae.slice(2),_e=(S=parseInt(ae,16)).toString(16)):(ae=ae.slice(1),_e=(S=parseInt(ae,10)).toString(10))),ae=ae.replace(/^0+/,""),_e.toLowerCase()!==ae?(Kt(K,"Invalid character entity"),"&"+K.entity+";"):String.fromCodePoint(S))}function Ct(K,S){S==="<"?(K.state=ye.OPEN_WAKA,K.startTagPosition=K.position):he(b,S)&&(Kt(K,"Non-whitespace before first tag."),K.textNode=S,K.state=ye.TEXT)}function Ye(K,S){var ae="";return S<K.length&&(ae=K.charAt(S)),ae}ye=j.STATE,String.fromCodePoint||(we=String.fromCharCode,Be=Math.floor,pt=function(){var K,S,ae=[],P=-1,_e=arguments.length;if(!_e)return"";for(var Ue="";++P<_e;){var Pe=Number(arguments[P]);if(!isFinite(Pe)||Pe<0||Pe>1114111||Be(Pe)!==Pe)throw RangeError("Invalid code point: "+Pe);Pe<=65535?ae.push(Pe):(K=55296+((Pe-=65536)>>10),S=Pe%1024+56320,ae.push(K,S)),(P+1===_e||ae.length>16384)&&(Ue+=we.apply(null,ae),ae.length=0)}return Ue},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:pt,configurable:!0,writable:!0}):String.fromCodePoint=pt)})(Re)},6739:function(Nt,Re,C){(function(j,f,o,u,E){function m(Ye){if("contents"in Ye)for(var K=("styleAttrs"in Ye)?Ye.styleAttrs[u.byName.ruby.qname]:null,S=Ye.kind==="span"&&(K==="container"||K==="textContainer"||K==="baseContainer"),ae=Ye.contents.length-1;ae>=0;ae--)!S||"styleAttrs"in Ye.contents[ae]&&u.byName.ruby.qname in Ye.contents[ae].styleAttrs?m(Ye.contents[ae]):delete Ye.contents[ae]}function b(Ye,K,S,ae){var P=ae&&ae.timeContainer==="seq",_e=0;ae&&(_e=P&&S?S.end:ae.begin),K.begin=K.explicit_begin?K.explicit_begin+_e:_e;var Ue=K.begin,Pe=null;if("sets"in K)for(var Je=0;Je<K.sets.length;Je++)b(Ye,K.sets[Je],Pe,K),Ue=K.timeContainer==="seq"?K.sets[Je].end:Math.max(Ue,K.sets[Je].end),Pe=K.sets[Je];if("contents"in K){if("contents"in K)for(var g=0;g<K.contents.length;g++)b(Ye,K.contents[g],Pe,K),Ue=K.timeContainer==="seq"?K.contents[g].end:Math.max(Ue,K.contents[g].end),Pe=K.contents[g]}else Ue=P?K.begin:Number.POSITIVE_INFINITY;K.explicit_end!==null&&K.explicit_dur!==null?K.end=Math.min(K.begin+K.explicit_dur,_e+K.explicit_end):K.explicit_end===null&&K.explicit_dur!==null?K.end=K.begin+K.explicit_dur:K.explicit_end!==null&&K.explicit_dur===null?K.end=_e+K.explicit_end:K.end=Ue,delete K.explicit_begin,delete K.explicit_dur,delete K.explicit_end,Ye._registerEvent(K)}function T(Ye){this.node=Ye}function Q(){this.events=[],this.head=new V,this.body=null}function V(){this.styling=new se,this.layout=new ge}function se(){this.styles={},this.initials={}}function Y(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function ce(){this.styleAttrs=null}function ge(){this.regions={}}function Te(Ye,K){ue.call(this,"image"),this.src=Ye,this.type=K}function ue(Ye){this.kind=Ye}function F(Ye){this.id=Ye}function ve(Ye){this.regionID=Ye}function je(Ye){this.styleAttrs=Ye}function tt(Ye){this.sets=Ye}function re(Ye){this.contents=Ye}function z(Ye,K,S){this.explicit_begin=Ye,this.explicit_end=K,this.explicit_dur=S}function he(){ue.call(this,"body")}function we(){ue.call(this,"div")}function Be(){ue.call(this,"p")}function pt(){ue.call(this,"span")}function ye(){ue.call(this,"span")}function mt(){ue.call(this,"br")}function Ze(){}function He(){}function U(Ye){return Ye&&"xml:id"in Ye.attributes&&Ye.attributes["xml:id"].value||null}function Bt(Ye){return Ye&&"style"in Ye.attributes?Ye.attributes.style.value.split(" "):[]}function Ut(Ye,K){var S={};if(Ye!==null)for(var ae in Ye.attributes){var P=Ye.attributes[ae].uri+" "+Ye.attributes[ae].local,_e=u.byQName[P];if(_e!==void 0){var Ue=_e.parse(Ye.attributes[ae].value);Ue!==null?(S[P]=Ue,_e===u.byName.zIndex&&Le(K,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):Ee(K,"Cannot parse styling attribute "+P+" --> "+Ye.attributes[ae].value)}}return S}function kt(Ye,K,S){for(var ae in Ye.attributes)if(Ye.attributes[ae].uri===K&&Ye.attributes[ae].local===S)return Ye.attributes[ae].value;return null}function Kt(Ye,K,S){var ae,P=null;return(ae=/^(\d+(?:\.\d+)?)f$/.exec(S))!==null?K!==null&&(P=parseFloat(ae[1])/K):(ae=/^(\d+(?:\.\d+)?)t$/.exec(S))!==null?Ye!==null&&(P=parseFloat(ae[1])/Ye):(ae=/^(\d+(?:\.\d+)?)ms$/.exec(S))!==null?P=parseFloat(ae[1])/1e3:(ae=/^(\d+(?:\.\d+)?)s$/.exec(S))!==null?P=parseFloat(ae[1]):(ae=/^(\d+(?:\.\d+)?)h$/.exec(S))!==null?P=3600*parseFloat(ae[1]):(ae=/^(\d+(?:\.\d+)?)m$/.exec(S))!==null?P=60*parseFloat(ae[1]):(ae=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(S))!==null?P=3600*parseInt(ae[1])+60*parseInt(ae[2])+parseFloat(ae[3]):(ae=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(S))!==null&&K!==null&&(P=3600*parseInt(ae[1])+60*parseInt(ae[2])+parseInt(ae[3])+(ae[4]===null?0:parseInt(ae[4])/K)),P}function on(Ye,K,S){for(;K.styleRefs.length>0;){var ae=K.styleRefs.pop();ae in Ye.styles?(on(Ye,Ye.styles[ae],S),hn(Ye.styles[ae].styleAttrs,K.styleAttrs)):Ee(S,"Non-existant style id referenced")}}function un(Ye,K,S,ae){for(var P=K.length-1;P>=0;P--){var _e=K[P];_e in Ye.styles?hn(Ye.styles[_e].styleAttrs,S):Ee(ae,"Non-existant style id referenced")}}function hn(Ye,K){for(var S in Ye)Ye.hasOwnProperty(S)&&(S in K||(K[S]=Ye[S]))}function Le(Ye,K){if(Ye&&Ye.warn&&Ye.warn(K))throw K}function Ee(Ye,K){if(Ye&&Ye.error&&Ye.error(K))throw K}function Tt(Ye,K){throw Ye&&Ye.fatal&&Ye.fatal(K),K}function Ct(Ye,K){for(var S,ae=0,P=Ye.length-1;ae<=P;){var _e=Ye[S=Math.floor((ae+P)/2)];if(_e<K)ae=S+1;else{if(!(_e>K))return{found:!0,index:S};P=S-1}}return{found:!1,index:ae}}j.fromXML=function(Ye,K,S){var ae=f.parser(!0,{xmlns:!0}),P=[],_e=[],Ue=[],Pe=0,Je=null;ae.onclosetag=function(Z){if(P[0]instanceof Ze)Je.head!==null&&Je.head.styling!==null&&un(Je.head.styling,P[0].styleRefs,P[0].styleAttrs,K),delete P[0].styleRefs;else if(P[0]instanceof se)for(var de in P[0].styles)P[0].styles.hasOwnProperty(de)&&on(P[0],P[0].styles[de],K);else if(P[0]instanceof Be||P[0]instanceof pt){if(P[0].contents.length>1){var qe,yt=[P[0].contents[0]];for(qe=1;qe<P[0].contents.length;qe++)P[0].contents[qe]instanceof ye&&yt[yt.length-1]instanceof ye?yt[yt.length-1].text+=P[0].contents[qe].text:yt.push(P[0].contents[qe]);P[0].contents=yt}P[0]instanceof pt&&P[0].contents.length===1&&P[0].contents[0]instanceof ye&&(P[0].text=P[0].contents[0].text,delete P[0].contents)}else P[0]instanceof T&&(P[0].node.uri===o.ns_tt&&P[0].node.local==="metadata"?Pe--:Pe>0&&S&&"onCloseTag"in S&&S.onCloseTag());Ue.shift(),_e.shift(),P.shift()},ae.ontext=function(Z){if(P[0]!==void 0)if(P[0]instanceof pt||P[0]instanceof Be){if(P[0]instanceof pt){var de=P[0].styleAttrs[u.byName.ruby.qname];if(de==="container"||de==="textContainer"||de==="baseContainer")return}var qe=new ye;qe.initFromText(Je,P[0],Z,_e[0],Ue[0],K),P[0].contents.push(qe)}else P[0]instanceof T&&Pe>0&&S&&"onText"in S&&S.onText(Z)},ae.onopentag=function(Z){var de=Z.attributes["xml:space"];de?Ue.unshift(de.value):Ue.length===0?Ue.unshift("default"):Ue.unshift(Ue[0]);var qe=Z.attributes["xml:lang"];if(qe?_e.unshift(qe.value):_e.length===0?_e.unshift(""):_e.unshift(_e[0]),Z.uri===o.ns_tt)if(Z.local==="tt")Je!==null&&Tt(K,"Two <tt> elements at ("+this.line+","+this.column+")"),(Je=new Q).initFromNode(Z,_e[0],K),P.unshift(Je);else if(Z.local==="head")P[0]instanceof Q||Tt(K,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),P.unshift(Je.head);else if(Z.local==="styling")P[0]instanceof V||Tt(K,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),P.unshift(Je.head.styling);else if(Z.local==="style"){var yt;P[0]instanceof se?((yt=new Y).initFromNode(Z,K),yt.id?Je.head.styling.styles[yt.id]=yt:Ee(K,"<style> element missing @id attribute"),P.unshift(yt)):P[0]instanceof Ze?((yt=new Y).initFromNode(Z,K),hn(yt.styleAttrs,P[0].styleAttrs),P.unshift(yt)):Tt(K,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if(Z.local==="initial"){var Lt;if(P[0]instanceof se){for(var Ft in(Lt=new ce).initFromNode(Z,K),Lt.styleAttrs)Lt.styleAttrs.hasOwnProperty(Ft)&&(Je.head.styling.initials[Ft]=Lt.styleAttrs[Ft]);P.unshift(Lt)}else Tt(K,"Parent of <initial> element is not <styling> at ("+this.line+","+this.column+")")}else if(Z.local==="layout")P[0]instanceof V||Tt(K,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),P.unshift(Je.head.layout);else if(Z.local==="region"){P[0]instanceof ge||Tt(K,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var X=new Ze;X.initFromNode(Je,Z,_e[0],K),!X.id||X.id in Je.head.layout.regions?Ee(K,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):Je.head.layout.regions[X.id]=X,P.unshift(X)}else if(Z.local==="body"){P[0]instanceof Q||Tt(K,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),Je.body!==null&&Tt(K,"Second <body> element at "+this.line+","+this.column+")");var De=new he;De.initFromNode(Je,Z,_e[0],K),Je.body=De,P.unshift(De)}else if(Z.local==="div"){P[0]instanceof we||P[0]instanceof he||Tt(K,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var it=new we;it.initFromNode(Je,P[0],Z,_e[0],K);var dt=it.styleAttrs[u.byName.backgroundImage.qname];dt&&(it.contents.push(new Te(dt)),delete it.styleAttrs[u.byName.backgroundImage.qname]),P[0].contents.push(it),P.unshift(it)}else if(Z.local==="image"){P[0]instanceof we||Tt(K,"Parent of <image> element is not <div> at "+this.line+","+this.column+")");var It=new Te;It.initFromNode(Je,P[0],Z,_e[0],K),P[0].contents.push(It),P.unshift(It)}else if(Z.local==="p"){P[0]instanceof we||Tt(K,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var lt=new Be;lt.initFromNode(Je,P[0],Z,_e[0],K),P[0].contents.push(lt),P.unshift(lt)}else if(Z.local==="span"){P[0]instanceof pt||P[0]instanceof Be||Tt(K,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var Yt=new pt;Yt.initFromNode(Je,P[0],Z,_e[0],Ue[0],K),P[0].contents.push(Yt),P.unshift(Yt)}else if(Z.local==="br"){P[0]instanceof pt||P[0]instanceof Be||Tt(K,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var Xt=new mt;Xt.initFromNode(Je,P[0],Z,_e[0],K),P[0].contents.push(Xt),P.unshift(Xt)}else if(Z.local==="set"){P[0]instanceof pt||P[0]instanceof Be||P[0]instanceof we||P[0]instanceof he||P[0]instanceof Ze||P[0]instanceof mt||Tt(K,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var Zt=new He;Zt.initFromNode(Je,P[0],Z,K),P[0].sets.push(Zt),P.unshift(Zt)}else P.unshift(new T(Z));else P.unshift(new T(Z));if(P[0]instanceof T){if(Z.uri===o.ns_tt&&Z.local==="metadata")Pe++;else if(Pe>0&&S&&"onOpenTag"in S){var Gt=[];for(var mn in Z.attributes)Gt[Z.attributes[mn].uri+" "+Z.attributes[mn].local]={uri:Z.attributes[mn].uri,local:Z.attributes[mn].local,value:Z.attributes[mn].value};S.onOpenTag(Z.uri,Z.local,Gt)}}},ae.write(Ye).close(),delete Je.head.styling.styles;var g=!1;for(var y in Je.head.layout.regions)if(Je.head.layout.regions.hasOwnProperty(y)){g=!0;break}if(!g){var R=Ze.prototype.createDefaultRegion(Je.lang);Je.head.layout.regions[R.id]=R}for(var ne in Je.head.layout.regions)Je.head.layout.regions.hasOwnProperty(ne)&&b(Je,Je.head.layout.regions[ne],null,null);return Je.body&&b(Je,Je.body,null,null),Je.body&&m(Je.body),Je},Q.prototype.initFromNode=function(Ye,K,S){var ae=(function(Pe,Je){var g=kt(Pe,o.ns_ttp,"cellResolution"),y=15,R=32;if(g!==null){var ne=/(\d+) (\d+)/.exec(g);ne!==null?(R=parseInt(ne[1]),y=parseInt(ne[2])):Le(Je,"Malformed cellResolution value (using initial value instead)")}return{w:R,h:y}})(Ye,S);this.cellLength={h:new E.ComputedLength(0,1/ae.h),w:new E.ComputedLength(1/ae.w,0)};var P=(function(Pe,Je){var g,y=kt(Pe,o.ns_ttp,"frameRate"),R=30;y!==null&&((g=/(\d+)/.exec(y))!==null?R=parseInt(g[1]):Le(Je,"Malformed frame rate attribute (using initial value instead)"));var ne=kt(Pe,o.ns_ttp,"frameRateMultiplier"),Z=1;ne!==null&&((g=/(\d+) (\d+)/.exec(ne))!==null?Z=parseInt(g[1])/parseInt(g[2]):Le(Je,"Malformed frame rate multiplier attribute (using initial value instead)"));var de=Z*R,qe=1,yt=kt(Pe,o.ns_ttp,"tickRate");return yt===null?y!==null&&(qe=de):(g=/(\d+)/.exec(yt))!==null?qe=parseInt(g[1]):Le(Je,"Malformed tick rate attribute (using initial value instead)"),{effectiveFrameRate:de,tickRate:qe}})(Ye,S);this.effectiveFrameRate=P.effectiveFrameRate,this.tickRate=P.tickRate,this.aspectRatio=(function(Pe,Je){var g=kt(Pe,o.ns_ittp,"aspectRatio");g===null&&(g=kt(Pe,o.ns_ttp,"displayAspectRatio"));var y=null;if(g!==null){var R=/(\d+)\s+(\d+)/.exec(g);if(R!==null){var ne=parseInt(R[1]),Z=parseInt(R[2]);ne!==0&&Z!==0?y=ne/Z:Ee(Je,"Illegal aspectRatio values (ignoring)")}else Ee(Je,"Malformed aspectRatio attribute (ignoring)")}return y})(Ye,S);var _e=kt(Ye,o.ns_ttp,"timeBase");_e!==null&&_e!=="media"&&Tt(S,"Unsupported time base");var Ue=(function(Pe,Je){var g=kt(Pe,o.ns_tts,"extent");if(g===null)return null;var y=g.split(" ");if(y.length!==2)return Le(Je,"Malformed extent (ignoring)"),null;var R=E.parseLength(y[0]),ne=E.parseLength(y[1]);return ne&&R?{h:ne,w:R}:(Le(Je,"Malformed extent values (ignoring)"),null)})(Ye,S);Ue===null?this.pxLength={h:null,w:null}:(Ue.h.unit==="px"&&Ue.w.unit==="px"||Tt(S,"Extent on TT must be in px or absent"),this.pxLength={h:new E.ComputedLength(0,1/Ue.h.value),w:new E.ComputedLength(1/Ue.w.value,0)}),this.dimensions={h:new E.ComputedLength(0,1),w:new E.ComputedLength(1,0)},this.lang=K},Q.prototype._registerEvent=function(Ye){if(!(Ye.end<=Ye.begin)){var K=Ct(this.events,Ye.begin);if(K.found||this.events.splice(K.index,0,Ye.begin),Ye.end!==Number.POSITIVE_INFINITY){var S=Ct(this.events,Ye.end);S.found||this.events.splice(S.index,0,Ye.end)}}},Q.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},Q.prototype.getMediaTimeEvents=function(){return this.events},Y.prototype.initFromNode=function(Ye,K){this.id=U(Ye),this.styleAttrs=Ut(Ye,K),this.styleRefs=Bt(Ye)},ce.prototype.initFromNode=function(Ye,K){for(var S in this.styleAttrs={},Ye.attributes)if(Ye.attributes[S].uri===o.ns_itts||Ye.attributes[S].uri===o.ns_ebutts||Ye.attributes[S].uri===o.ns_tts){var ae=Ye.attributes[S].uri+" "+Ye.attributes[S].local;this.styleAttrs[ae]=Ye.attributes[S].value}},Te.prototype.initFromNode=function(Ye,K,S,ae,P){this.src="src"in S.attributes?S.attributes.src.value:null,this.src||Ee(P,"Invalid image@src attribute"),this.type="type"in S.attributes?S.attributes.type.value:null,this.type||Ee(P,"Invalid image@type attribute"),je.prototype.initFromNode.call(this,Ye,K,S,P),z.prototype.initFromNode.call(this,Ye,K,S,P),tt.prototype.initFromNode.call(this,Ye,K,S,P),ve.prototype.initFromNode.call(this,Ye,K,S,P),this.lang=ae},F.prototype.initFromNode=function(Ye,K,S,ae){this.id=U(S)},ve.prototype.initFromNode=function(Ye,K,S,ae){this.regionID=(function(P){return P&&"region"in P.attributes?P.attributes.region.value:""})(S)},je.prototype.initFromNode=function(Ye,K,S,ae){this.styleAttrs=Ut(S,ae),Ye.head!==null&&Ye.head.styling!==null&&un(Ye.head.styling,Bt(S),this.styleAttrs,ae)},tt.prototype.initFromNode=function(Ye,K,S,ae){this.sets=[]},re.prototype.initFromNode=function(Ye,K,S,ae){this.contents=[]},z.prototype.initFromNode=function(Ye,K,S,ae){var P=(function(_e,Ue,Pe,Je){var g=null;Pe&&"begin"in Pe.attributes&&(g=Kt(_e.tickRate,_e.effectiveFrameRate,Pe.attributes.begin.value))===null&&Le(Je,"Malformed begin value "+Pe.attributes.begin.value+" (using 0)");var y=null;Pe&&"dur"in Pe.attributes&&(y=Kt(_e.tickRate,_e.effectiveFrameRate,Pe.attributes.dur.value))===null&&Le(Je,"Malformed dur value "+Pe.attributes.dur.value+" (ignoring)");var R=null;return Pe&&"end"in Pe.attributes&&(R=Kt(_e.tickRate,_e.effectiveFrameRate,Pe.attributes.end.value))===null&&Le(Je,"Malformed end value (ignoring)"),{explicit_begin:g,explicit_end:R,explicit_dur:y}})(Ye,0,S,ae);this.explicit_begin=P.explicit_begin,this.explicit_end=P.explicit_end,this.explicit_dur=P.explicit_dur,this.timeContainer=(function(_e,Ue){var Pe=_e&&"timeContainer"in _e.attributes?_e.attributes.timeContainer.value:null;return Pe&&Pe!=="par"?Pe==="seq"?"seq":(Ee(Ue,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"})(S,ae)},he.prototype.initFromNode=function(Ye,K,S,ae){je.prototype.initFromNode.call(this,Ye,null,K,ae),z.prototype.initFromNode.call(this,Ye,null,K,ae),tt.prototype.initFromNode.call(this,Ye,null,K,ae),ve.prototype.initFromNode.call(this,Ye,null,K,ae),re.prototype.initFromNode.call(this,Ye,null,K,ae),this.lang=S},we.prototype.initFromNode=function(Ye,K,S,ae,P){je.prototype.initFromNode.call(this,Ye,K,S,P),z.prototype.initFromNode.call(this,Ye,K,S,P),tt.prototype.initFromNode.call(this,Ye,K,S,P),ve.prototype.initFromNode.call(this,Ye,K,S,P),re.prototype.initFromNode.call(this,Ye,K,S,P),this.lang=ae},Be.prototype.initFromNode=function(Ye,K,S,ae,P){je.prototype.initFromNode.call(this,Ye,K,S,P),z.prototype.initFromNode.call(this,Ye,K,S,P),tt.prototype.initFromNode.call(this,Ye,K,S,P),ve.prototype.initFromNode.call(this,Ye,K,S,P),re.prototype.initFromNode.call(this,Ye,K,S,P),this.lang=ae},pt.prototype.initFromNode=function(Ye,K,S,ae,P,_e){je.prototype.initFromNode.call(this,Ye,K,S,_e),z.prototype.initFromNode.call(this,Ye,K,S,_e),tt.prototype.initFromNode.call(this,Ye,K,S,_e),ve.prototype.initFromNode.call(this,Ye,K,S,_e),re.prototype.initFromNode.call(this,Ye,K,S,_e),this.space=P,this.lang=ae},ye.prototype.initFromText=function(Ye,K,S,ae,P,_e){z.prototype.initFromNode.call(this,Ye,K,null,_e),this.text=S,this.space=P,this.lang=ae},mt.prototype.initFromNode=function(Ye,K,S,ae,P){ve.prototype.initFromNode.call(this,Ye,K,S,P),z.prototype.initFromNode.call(this,Ye,K,S,P),this.lang=ae},Ze.prototype.createDefaultRegion=function(Ye){var K=new Ze;return F.call(K,""),je.call(K,{}),tt.call(K,[]),z.call(K,0,Number.POSITIVE_INFINITY,null),this.lang=Ye,K},Ze.prototype.initFromNode=function(Ye,K,S,ae){F.prototype.initFromNode.call(this,Ye,null,K,ae),z.prototype.initFromNode.call(this,Ye,null,K,ae),tt.prototype.initFromNode.call(this,Ye,null,K,ae),this.styleAttrs=Ut(K,ae),this.styleRefs=Bt(K),this.lang=S},He.prototype.initFromNode=function(Ye,K,S,ae){z.prototype.initFromNode.call(this,Ye,K,S,ae);var P=Ut(S,ae);for(var _e in this.qname=null,this.value=null,P)if(P.hasOwnProperty(_e)){if(this.qname){Ee(ae,"More than one style specified on set");break}this.qname=_e,this.value=P[_e]}}})(Re,typeof sax>"u"?C(5474):sax,typeof imscNames>"u"?C(977):imscNames,typeof imscStyles>"u"?C(1219):imscStyles,typeof imscUtils>"u"?C(6404):imscUtils)},1612:function(Nt,Re,C){var j=/firefox/i.test(navigator.userAgent);(function(f,o,u){function E(re,z,he,we){var Be;if(he.kind==="region")(Be=document.createElement("div")).style.position="absolute";else if(he.kind==="body")Be=document.createElement("div");else if(he.kind==="div")Be=document.createElement("div");else if(he.kind==="image"){if(Be=document.createElement("img"),re.imgResolver!==null&&he.src!==null){var pt=re.imgResolver(he.src,Be);pt&&(Be.src=pt),Be.height=re.regionH,Be.width=re.regionW}}else if(he.kind==="p")Be=document.createElement("p");else if(he.kind==="span")if(he.styleAttrs[u.byName.ruby.qname]==="container")Be=document.createElement("ruby"),re.ruby=!0;else if(he.styleAttrs[u.byName.ruby.qname]==="base")Be=document.createElement("span");else if(he.styleAttrs[u.byName.ruby.qname]==="text")Be=document.createElement("rt");else if(he.styleAttrs[u.byName.ruby.qname]==="baseContainer")Be=document.createElement("rbc");else if(he.styleAttrs[u.byName.ruby.qname]==="textContainer")Be=document.createElement("rtc");else{if(he.styleAttrs[u.byName.ruby.qname]==="delimiter")return;Be=document.createElement("span")}else he.kind==="br"&&(Be=document.createElement("br"));if(Be){if(he.lang&&(he.kind!=="region"&&he.lang===we.lang||(Be.lang=he.lang)),z.appendChild(Be),Be.style.margin="0",he.kind==="region"){var ye=he.styleAttrs[u.byName.writingMode.qname];ye==="lrtb"||ye==="lr"?(re.ipd="lr",re.bpd="tb"):ye==="rltb"||ye==="rl"?(re.ipd="rl",re.bpd="tb"):ye==="tblr"?(re.ipd="tb",re.bpd="lr"):ye!=="tbrl"&&ye!=="tb"||(re.ipd="tb",re.bpd="rl")}else if(he.kind==="p"&&re.bpd==="tb"){var mt=he.styleAttrs[u.byName.direction.qname];re.ipd=mt==="ltr"?"lr":"rl"}for(var Ze=0;Ze<ce.length;Ze++){var He=ce[Ze],U=he.styleAttrs[He.qname];U!==void 0&&He.map!==null&&He.map(re,Be,he,U)}var Bt=Be,Ut=he.styleAttrs[u.byName.linePadding.qname];if(Ut&&!Ut.isZero()){var kt=Ut.toUsedLength(re.w,re.h);if(kt>0){var Kt=Math.ceil(kt)+"px";re.bpd==="tb"?(Bt.style.paddingLeft=Kt,Bt.style.paddingRight=Kt):(Bt.style.paddingTop=Kt,Bt.style.paddingBottom=Kt),re.lp=Ut}}var on=he.styleAttrs[u.byName.multiRowAlign.qname];if(on&&on!=="auto"){var un=document.createElement("span");un.style.display="inline-block",un.style.textAlign=on,Be.appendChild(un),Bt=un,re.mra=on}var hn=he.styleAttrs[u.byName.rubyReserve.qname];if(hn&&hn[0]!=="none"&&(re.rubyReserve=hn),he.styleAttrs[u.byName.fillLineGap.qname]&&(re.flg=!0),he.kind==="span"&&he.text){var Le=he.styleAttrs[u.byName.textEmphasis.qname];if(Le&&Le.style!=="none"&&(re.textEmphasis=!0),u.byName.textCombine.qname in he.styleAttrs&&he.styleAttrs[u.byName.textCombine.qname]==="all")Be.textContent=he.text,Be._isd_element=he,Le&&se(re,Be,0,Le);else for(var Ee="",Tt=0;Tt<he.text.length;Tt++){Ee+=he.text.charAt(Tt);var Ct=he.text.charCodeAt(Tt);if(Ct<55296||Ct>56319||Tt===he.text.length-1){var Ye=document.createElement("span");Ye.textContent=Ee,Le&&se(re,Ye,0,Le),Be.appendChild(Ye),Ee="",Ye._isd_element=he}}}if("contents"in he)for(var K=0;K<he.contents.length;K++)E(re,Bt,he.contents[K],he);var S=[];if(he.kind==="p"&&(V(re,Bt,S,null),re.rubyReserve&&((function(Pe,Je){for(var g=0;g<Pe.length;g++){var y,R,ne=document.createElement("ruby"),Z=document.createElement("span");Z.textContent="\u200B",ne.appendChild(Z);var de,qe=Je.rubyReserve[1].toUsedLength(Je.w,Je.h)+"px";Je.rubyReserve[0]==="both"||Je.rubyReserve[0]==="outside"&&Pe.length==1?((y=document.createElement("rtc")).style[F]=ue?"after":"under",y.textContent="\u200B",y.style.fontSize=qe,(R=document.createElement("rtc")).style[F]=ue?"before":"over",R.textContent="\u200B",R.style.fontSize=qe,ne.appendChild(y),ne.appendChild(R)):((y=document.createElement("rtc")).textContent="\u200B",y.style.fontSize=qe,de=Je.rubyReserve[0]==="after"||Je.rubyReserve[0]==="outside"&&g>0?ue?"after":Je.bpd==="tb"||Je.bpd==="rl"?"under":"over":ue?"before":Je.bpd==="tb"||Je.bpd==="rl"?"over":"under",y.style[F]=de,ne.appendChild(y));for(var yt=null,Lt=0;Lt<Pe[g].rbc.length;Lt++)if(Pe[g].rbc[Lt].localName==="ruby"){yt=Pe[g].rbc[Lt];for(var Ft=0;Ft<yt.style.length;Ft++)ne.style.setProperty(yt.style.item(Ft),yt.style.getPropertyValue(yt.style.item(Ft)));break}(yt=yt||Pe[g].elements[0].node).parentElement.insertBefore(ne,yt)}})(S,re),re.rubyReserve=null),(re.ruby||re.rubyReserve)&&((function(Pe,Je){for(var g=0;g<Pe.length;g++)for(var y=0;y<Pe[g].rbc.length;y++){var R;Pe[g].rbc[y].style[F]||(R=ue?g===0?"before":"after":Je.bpd==="tb"||Je.bpd==="rl"?g===0?"over":"under":g===0?"under":"over",Pe[g].rbc[y].style[F]=R)}})(S,re),re.ruby=null),re.textEmphasis&&((function(Pe,Je){for(var g=0;g<Pe.length;g++)for(var y=0;y<Pe[g].te.length;y++){var R;Pe[g].te[y].style[je]&&Pe[g].te[y].style[je]!=="none"||(R=Je.bpd==="tb"?g===0?"left over":"left under":Je.bpd==="rl"?g===0?"right under":"left under":g===0?"left under":"right under",Pe[g].te[y].style[je]=R)}})(S,re),re.textEmphasis=null),re.mra&&((function(Pe){for(var Je=0;Je<Pe.length-1;Je++){var g=Pe[Je].elements.length;if(g!==0&&Pe[Je].br===!1){var y=document.createElement("br"),R=Pe[Je].elements[g-1].node;R.parentElement.insertBefore(y,R.nextSibling)}}})(S),re.mra=null),re.lp&&((function(Pe,Je,g){if(Pe!==null)for(var y=0;y<Pe.length;y++){var R=Pe[y].elements.length,ne=Math.ceil(Je)+"px",Z="-"+Math.ceil(Je)+"px";if(R!==0){var de=Pe[y].elements[Pe[y].start_elem],qe=Pe[y].elements[Pe[y].end_elem];if(de===qe){var yt=de.node.getBoundingClientRect();if(yt.width==0||yt.height==0)continue}g.ipd==="lr"?(de.node.style.marginLeft=Z,de.node.style.paddingLeft=ne):g.ipd==="rl"?(de.node.style.paddingRight=ne,de.node.style.marginRight=Z):g.ipd==="tb"&&(de.node.style.paddingTop=ne,de.node.style.marginTop=Z),g.ipd==="lr"?(j||(qe.node.style.marginRight=Z),qe.node.style.paddingRight=ne):g.ipd==="rl"?(qe.node.style.paddingLeft=ne,j||(qe.node.style.marginLeft=Z)):g.ipd==="tb"&&(qe.node.style.paddingBottom=ne,qe.node.style.marginBottom=Z)}}})(S,re.lp.toUsedLength(re.w,re.h),re),re.lp=null),(function(Pe,Je){for(var g=0;g<Pe.length;g++)for(var y=Pe[g],R=1;R<y.elements.length;){var ne=y.elements[R-1],Z=y.elements[R];b(ne.node,Z.node,Je)?y.elements.splice(R,1):R++}for(var de,qe,yt=[],Lt=0;Lt<Pe.length;Lt++)for(var Ft=0;Ft<Pe[Lt].elements.length;Ft++)(qe=m(de=Pe[Lt].elements[Ft].node,yt,!1))&&(de.style.backgroundColor=qe);for(var X=0;X<yt.length;X++)yt[X].style.backgroundColor=""})(S,re),re.flg)){var ae=Q(Bt.getBoundingClientRect(),re);(function(Pe,Je,g,y){for(var R=Math.sign(g-Je),ne=0;ne<=Pe.length;ne++){var Z,de,qe,yt;if(Z=ne===0?Math.round(Je):ne===Pe.length?Math.round(g):Math.round((Pe[ne-1].after+Pe[ne].before)/2),ne>0&&Pe[ne-1])for(qe=0;qe<Pe[ne-1].elements.length;qe++)de=R*(Z-(yt=Pe[ne-1].elements[qe]).after)+"px",y.bpd==="lr"?yt.node.style.paddingRight=de:y.bpd==="rl"?yt.node.style.paddingLeft=de:y.bpd==="tb"&&(yt.node.style.paddingBottom=de);if(ne<Pe.length)for(qe=0;qe<Pe[ne].elements.length;qe++)de=R*((yt=Pe[ne].elements[qe]).before-Z)+"px",y.bpd==="lr"?yt.node.style.paddingLeft=de:y.bpd==="rl"?yt.node.style.paddingRight=de:y.bpd==="tb"&&(yt.node.style.paddingTop=de)}})(S,ae.before,ae.after,re),re.flg=null}if(he.kind==="region"&&re.bpd==="tb"&&re.enableRollUp&&he.contents.length>0&&he.styleAttrs[u.byName.displayAlign.qname]==="after"){V(re,Bt,S,null);var P=new T(he.id===""?"_":he.id,S);if(re.currentISDState[P.id]=P,re.previousISDState&&P.id in re.previousISDState&&re.previousISDState[P.id].plist.length>0&&P.plist.length>1&&P.plist[P.plist.length-2].text===re.previousISDState[P.id].plist[re.previousISDState[P.id].plist.length-1].text){var _e=Be.firstElementChild,Ue=P.plist[P.plist.length-1].after-P.plist[P.plist.length-1].before;_e.style.bottom="-"+Ue+"px",_e.style.transition="transform 0.4s",_e.style.position="relative",_e.style.transform="translateY(-"+Ue+"px)"}}}else tt(re.errorHandler,"Error processing ISD element kind: "+he.kind)}function m(re,z,he){return re.style.backgroundColor?(he&&!z.includes(re)&&z.push(re),re.style.backgroundColor):re.parentElement.nodeName==="SPAN"||re.parentElement.nodeName==="RUBY"||re.parentElement.nodeName==="RBC"||re.parentElement.nodeName==="RTC"||re.parentElement.nodeName==="RT"?m(re.parentElement,z,!0):void 0}function b(re,z,he){if(re.tagName==="SPAN"&&z.tagName==="SPAN"&&re._isd_element===z._isd_element){if(!re._isd_element)return tt(he.errorHandler,"Internal error: HTML span is not linked to a source element; cannot merge spans."),!1;re.textContent+=z.textContent;for(var we=0;we<z.style.length;we++){var Be=z.style[we];(Be.indexOf("border")>=0||Be.indexOf("padding")>=0||Be.indexOf("margin")>=0)&&(re.style[Be]=z.style[Be])}return z.parentElement.removeChild(z),!0}return!1}function T(re,z){this.id=re,this.plist=z}function Q(re,z){var he={before:null,after:null,start:null,end:null};return z.bpd==="tb"?(he.before=re.top,he.after=re.bottom,z.ipd==="lr"?(he.start=re.left,he.end=re.right):(he.start=re.right,he.end=re.left)):z.bpd==="lr"?(he.before=re.left,he.after=re.right,he.start=re.top,he.end=re.bottom):z.bpd==="rl"&&(he.before=re.right,he.after=re.left,he.start=re.top,he.end=re.bottom),he}function V(re,z,he,we){if(z.localName!=="rt"&&z.localName!=="rtc"){var Be,pt,ye,mt,Ze=z.style.backgroundColor||we;if(z.childElementCount===0)if(z.localName==="span"||z.localName==="rb"){var He=Q(z.getBoundingClientRect(),re);if(he.length!==0&&(Be=He.before,pt=He.after,ye=he[he.length-1].before,pt<(mt=he[he.length-1].after)&&Be>ye||mt<=pt&&ye>=Be)){var U=Math.sign(He.after-He.before),Bt=Math.sign(He.end-He.start);U*(He.before-he[he.length-1].before)<0&&(he[he.length-1].before=He.before),U*(He.after-he[he.length-1].after)>0&&(he[he.length-1].after=He.after),Bt*(He.start-he[he.length-1].start)<0&&(he[he.length-1].start=He.start,he[he.length-1].start_elem=he[he.length-1].elements.length),Bt*(He.end-he[he.length-1].end)>0&&(he[he.length-1].end=He.end,he[he.length-1].end_elem=he[he.length-1].elements.length)}else he.push({before:He.before,after:He.after,start:He.start,end:He.end,start_elem:0,end_elem:0,elements:[],rbc:[],te:[],text:"",br:!1});he[he.length-1].text+=z.textContent,he[he.length-1].elements.push({node:z,bgcolor:Ze,before:He.before,after:He.after})}else z.localName==="br"&&he.length!==0&&(he[he.length-1].br=!0);else for(var Ut=z.firstChild;Ut;)Ut.nodeType===Node.ELEMENT_NODE&&(V(re,Ut,he,Ze),Ut.localName==="ruby"||Ut.localName==="rtc"?he.length>0&&he[he.length-1].rbc.push(Ut):Ut.localName==="span"&&Ut.style[ve]&&Ut.style[ve]!=="none"&&he.length>0&&he[he.length-1].te.push(Ut)),Ut=Ut.nextSibling}}function se(re,z,he,we){var Be;we.style!=="none"&&(we.style==="auto"?z.style[ve]="filled":z.style[ve]=we.style+" "+we.symbol,(we.position==="before"||we.position==="after")&&(Be=re.bpd==="tb"?we.position==="before"?"left over":"left under":re.bpd==="rl"?we.position==="before"?"right under":"left under":we.position==="before"?"left under":"right under",z.style[je]=Be))}function Y(re,z){this.qname=re,this.map=z}f.render=function(re,z,he,we,Be,pt,ye,mt,Ze){var He=we||z.clientHeight,U=Be||z.clientWidth;if(re.aspectRatio!==null){var Bt=He*re.aspectRatio;Bt>U?He=Math.round(U/re.aspectRatio):U=Bt}var Ut=document.createElement("div");Ut.style.position="relative",Ut.style.width=U+"px",Ut.style.height=He+"px",Ut.style.margin="auto",Ut.style.top=0,Ut.style.bottom=0,Ut.style.left=0,Ut.style.right=0,Ut.style.zIndex=0;var kt={h:He,w:U,regionH:null,regionW:null,imgResolver:he,displayForcedOnlyMode:pt||!1,isd:re,errorHandler:ye,previousISDState:mt,enableRollUp:Ze||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null,ruby:null,textEmphasis:null,rubyReserve:null};if(z.appendChild(Ut),"contents"in re)for(var Kt=0;Kt<re.contents.length;Kt++)E(kt,Ut,re.contents[Kt],re);return kt.currentISDState};for(var ce=[new Y("http://www.w3.org/ns/ttml#styling backgroundColor",function(re,z,he,we){we[3]!==0&&(z.style.backgroundColor="rgba("+we[0].toString()+","+we[1].toString()+","+we[2].toString()+","+(we[3]/255).toString()+")")}),new Y("http://www.w3.org/ns/ttml#styling color",function(re,z,he,we){z.style.color="rgba("+we[0].toString()+","+we[1].toString()+","+we[2].toString()+","+(we[3]/255).toString()+")"}),new Y("http://www.w3.org/ns/ttml#styling direction",function(re,z,he,we){z.style.direction=we}),new Y("http://www.w3.org/ns/ttml#styling display",function(re,z,he,we){}),new Y("http://www.w3.org/ns/ttml#styling displayAlign",function(re,z,he,we){z.style.display="flex",z.style.flexDirection="column",we==="before"?z.style.justifyContent="flex-start":we==="center"?z.style.justifyContent="center":we==="after"&&(z.style.justifyContent="flex-end")}),new Y("http://www.w3.org/ns/ttml#styling extent",function(re,z,he,we){re.regionH=we.h.toUsedLength(re.w,re.h),re.regionW=we.w.toUsedLength(re.w,re.h);var Be=0,pt=0,ye=he.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];ye&&(Be=ye[0].toUsedLength(re.w,re.h)+ye[2].toUsedLength(re.w,re.h),pt=ye[1].toUsedLength(re.w,re.h)+ye[3].toUsedLength(re.w,re.h)),z.style.height=re.regionH-Be+"px",z.style.width=re.regionW-pt+"px"}),new Y("http://www.w3.org/ns/ttml#styling fontFamily",function(re,z,he,we){for(var Be=[],pt=0;pt<we.length;pt++)we[pt]=we[pt].trim(),we[pt]==="monospaceSerif"?(Be.push("Courier New"),Be.push('"Liberation Mono"'),Be.push("Courier"),Be.push("monospace")):we[pt]==="proportionalSansSerif"?(Be.push("Arial"),Be.push("Helvetica"),Be.push('"Liberation Sans"'),Be.push("sans-serif")):we[pt]==="monospace"?Be.push("monospace"):we[pt]==="sansSerif"?Be.push("sans-serif"):we[pt]==="serif"?Be.push("serif"):we[pt]==="monospaceSansSerif"?(Be.push("Consolas"),Be.push("monospace")):we[pt]==="proportionalSerif"?Be.push("serif"):Be.push(we[pt]);if(Be.length>0){for(var ye=[Be[0]],mt=1;mt<Be.length;mt++)ye.indexOf(Be[mt])==-1&&ye.push(Be[mt]);Be=ye}z.style.fontFamily=Be.join(",")}),new Y("http://www.w3.org/ns/ttml#styling shear",function(re,z,he,we){if(we!==0){var Be=-.9*we;re.bpd==="tb"?z.style.transform="skewX("+Be+"deg)":z.style.transform="skewY("+Be+"deg)"}}),new Y("http://www.w3.org/ns/ttml#styling fontSize",function(re,z,he,we){z.style.fontSize=we.toUsedLength(re.w,re.h)+"px"}),new Y("http://www.w3.org/ns/ttml#styling fontStyle",function(re,z,he,we){z.style.fontStyle=we}),new Y("http://www.w3.org/ns/ttml#styling fontWeight",function(re,z,he,we){z.style.fontWeight=we}),new Y("http://www.w3.org/ns/ttml#styling lineHeight",function(re,z,he,we){z.style.lineHeight=we==="normal"?"normal":we.toUsedLength(re.w,re.h)+"px"}),new Y("http://www.w3.org/ns/ttml#styling opacity",function(re,z,he,we){z.style.opacity=we}),new Y("http://www.w3.org/ns/ttml#styling origin",function(re,z,he,we){z.style.top=we.h.toUsedLength(re.w,re.h)+"px",z.style.left=we.w.toUsedLength(re.w,re.h)+"px"}),new Y("http://www.w3.org/ns/ttml#styling overflow",function(re,z,he,we){z.style.overflow=we}),new Y("http://www.w3.org/ns/ttml#styling padding",function(re,z,he,we){var Be=[];Be[0]=we[0].toUsedLength(re.w,re.h)+"px",Be[1]=we[3].toUsedLength(re.w,re.h)+"px",Be[2]=we[2].toUsedLength(re.w,re.h)+"px",Be[3]=we[1].toUsedLength(re.w,re.h)+"px",z.style.padding=Be.join(" ")}),new Y("http://www.w3.org/ns/ttml#styling position",function(re,z,he,we){z.style.top=we.h.toUsedLength(re.w,re.h)+"px",z.style.left=we.w.toUsedLength(re.w,re.h)+"px"}),new Y("http://www.w3.org/ns/ttml#styling rubyAlign",function(re,z,he,we){z.style.rubyAlign=we==="spaceAround"?"space-around":"center"}),new Y("http://www.w3.org/ns/ttml#styling rubyPosition",function(re,z,he,we){var Be;we!=="before"&&we!=="after"||(Be=ue?we:re.bpd==="tb"||re.bpd==="rl"?we==="before"?"over":"under":we==="before"?"under":"over",z.parentElement.style[F]=Be)}),new Y("http://www.w3.org/ns/ttml#styling showBackground",null),new Y("http://www.w3.org/ns/ttml#styling textAlign",function(re,z,he,we){var Be;Be=we==="start"?re.ipd==="rl"?"right":"left":we==="end"?re.ipd==="rl"?"left":"right":we,z.style.textAlign=Be}),new Y("http://www.w3.org/ns/ttml#styling textDecoration",function(re,z,he,we){z.style.textDecoration=we.join(" ").replace("lineThrough","line-through")}),new Y("http://www.w3.org/ns/ttml#styling textOutline",function(re,z,he,we){}),new Y("http://www.w3.org/ns/ttml#styling textShadow",function(re,z,he,we){var Be=he.styleAttrs[u.byName.textOutline.qname];if(we==="none"&&Be==="none")z.style.textShadow="";else{var pt=[];if(Be!=="none"){var ye="rgba("+Be.color[0].toString()+","+Be.color[1].toString()+","+Be.color[2].toString()+","+(Be.color[3]/255).toString()+")";pt.push("1px 1px 1px "+ye),pt.push("-1px 1px 1px "+ye),pt.push("1px -1px 1px "+ye),pt.push("-1px -1px 1px "+ye)}if(we!=="none")for(var mt=0;mt<we.length;mt++)pt.push(we[mt].x_off.toUsedLength(re.w,re.h)+"px "+we[mt].y_off.toUsedLength(re.w,re.h)+"px "+we[mt].b_radius.toUsedLength(re.w,re.h)+"px rgba("+we[mt].color[0].toString()+","+we[mt].color[1].toString()+","+we[mt].color[2].toString()+","+(we[mt].color[3]/255).toString()+")");z.style.textShadow=pt.join(",")}}),new Y("http://www.w3.org/ns/ttml#styling textCombine",function(re,z,he,we){z.style.textCombineUpright=we}),new Y("http://www.w3.org/ns/ttml#styling textEmphasis",function(re,z,he,we){}),new Y("http://www.w3.org/ns/ttml#styling unicodeBidi",function(re,z,he,we){var Be;Be=we==="bidiOverride"?"bidi-override":we,z.style.unicodeBidi=Be}),new Y("http://www.w3.org/ns/ttml#styling visibility",function(re,z,he,we){z.style.visibility=we}),new Y("http://www.w3.org/ns/ttml#styling wrapOption",function(re,z,he,we){we==="wrap"?he.space==="preserve"?z.style.whiteSpace="pre-wrap":z.style.whiteSpace="normal":he.space==="preserve"?z.style.whiteSpace="pre":z.style.whiteSpace="noWrap"}),new Y("http://www.w3.org/ns/ttml#styling writingMode",function(re,z,he,we){we==="lrtb"||we==="lr"||we==="rltb"||we==="rl"?z.style.writingMode="horizontal-tb":we==="tblr"?z.style.writingMode="vertical-lr":we!=="tbrl"&&we!=="tb"||(z.style.writingMode="vertical-rl")}),new Y("http://www.w3.org/ns/ttml#styling zIndex",function(re,z,he,we){z.style.zIndex=we}),new Y("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",function(re,z,he,we){re.displayForcedOnlyMode&&we===!1&&(z.style.visibility="hidden")})],ge={},Te=0;Te<ce.length;Te++)ge[ce[Te].qname]=ce[Te];var ue="webkitRubyPosition"in window.getComputedStyle(document.documentElement),F=ue?"webkitRubyPosition":"rubyPosition",ve="webkitTextEmphasisStyle"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisStyle":"textEmphasisStyle",je="webkitTextEmphasisPosition"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisPosition":"textEmphasisPosition";function tt(re,z){if(re&&re.error&&re.error(z))throw z}})(Re,typeof imscNames>"u"?C(977):imscNames,typeof imscStyles>"u"?C(1219):imscStyles,typeof imscUtils>"u"?C(6404):imscUtils)},8905:function(Nt,Re,C){(function(j,f,o,u){j.generateISD=function(Y,ce,ge){var Te,ue=new Q(Y),F={},ve={},je=Y.head.styling.initials[o.byName.showBackground.qname],tt=Y.head.styling.initials[o.byName.backgroundColor.qname];for(var re in Y.head.layout.regions)if(Y.head.layout.regions.hasOwnProperty(re)){var z=Y.head.layout.regions[re],he=z.styleAttrs[o.byName.showBackground.qname]||je,we=z.styleAttrs[o.byName.backgroundColor.qname]||tt;ve[z.id]=(he==="always"||he===void 0)&&we!==void 0&&!(ce<z.begin||ce>=z.end)}for(var Be in Y.body&&Y.body.regionID&&(ve[Y.body.regionID]=!0),Te=Y.body!==null?(function ye(mt,Ze){if(Ze.contents){var He={};for(var U in Ze)Ze.hasOwnProperty(U)&&(He[U]=Ze[U]);return He.contents=[],Ze.contents.filter(function(Bt){return!(mt<Bt.begin||mt>=Bt.end)}).forEach(function(Bt){var Ut=ye(mt,Bt);Ut.regionID&&(ve[Ut.regionID]=!0),Ut!==null&&He.contents.push(Ut)}),He}return Ze})(ce,Y.body):null,ve[""]!==void 0&&(ve[""]=!0),ve)if(ve[Be]){var pt=m(Y,ce,Y.head.layout.regions[Be],Te,null,"",Y.head.layout.regions[Be],ge,F);pt!==null&&ue.contents.push(pt.element)}return ue};var E=[o.byName.color.qname,o.byName.textCombine.qname,o.byName.textDecoration.qname,o.byName.textEmphasis.qname,o.byName.textOutline.qname,o.byName.textShadow.qname];function m(Y,ce,ge,Te,ue,F,ve,je,tt){if(ce<ve.begin||ce>=ve.end)return null;var re="regionID"in ve&&ve.regionID!==""?ve.regionID:F;if(ue!==null&&re!==ge.id&&(!("contents"in ve)||"contents"in ve&&ve.contents.length===0||re!==""))return null;var z=new V(ve);if("sets"in ve)for(var he=0;he<ve.sets.length;he++)ce<ve.sets[he].begin||ce>=ve.sets[he].end||(z.styleAttrs[ve.sets[he].qname]=ve.sets[he].value);var we={};for(var Be in z.styleAttrs)if(z.styleAttrs.hasOwnProperty(Be)&&(we[Be]=!0,z.kind==="region"&&Be===o.byName.writingMode.qname&&!(o.byName.direction.qname in z.styleAttrs))){var pt=z.styleAttrs[Be];pt==="lrtb"||pt==="lr"?z.styleAttrs[o.byName.direction.qname]="ltr":pt!=="rltb"&&pt!=="rl"||(z.styleAttrs[o.byName.direction.qname]="rtl")}if(ue!==null)for(var ye=0;ye<o.all.length;ye++){var mt=o.all[ye];if(mt.qname===o.byName.textDecoration.qname){var Ze=ue.styleAttrs[mt.qname],He=z.styleAttrs[mt.qname],U=[];He===void 0?U=Ze:He.indexOf("none")===-1?((He.indexOf("noUnderline")===-1&&Ze.indexOf("underline")!==-1||He.indexOf("underline")!==-1)&&U.push("underline"),(He.indexOf("noLineThrough")===-1&&Ze.indexOf("lineThrough")!==-1||He.indexOf("lineThrough")!==-1)&&U.push("lineThrough"),(He.indexOf("noOverline")===-1&&Ze.indexOf("overline")!==-1||He.indexOf("overline")!==-1)&&U.push("overline")):U.push("none"),z.styleAttrs[mt.qname]=U}else if(mt.qname!==o.byName.fontSize.qname||mt.qname in z.styleAttrs||z.kind!=="span"||z.styleAttrs[o.byName.ruby.qname]!=="textContainer")if(mt.qname!==o.byName.fontSize.qname||mt.qname in z.styleAttrs||z.kind!=="span"||z.styleAttrs[o.byName.ruby.qname]!=="text")mt.inherit&&mt.qname in ue.styleAttrs&&!(mt.qname in z.styleAttrs)&&(z.styleAttrs[mt.qname]=ue.styleAttrs[mt.qname]);else{var Bt=ue.styleAttrs[o.byName.fontSize.qname];ue.styleAttrs[o.byName.ruby.qname]==="textContainer"?z.styleAttrs[mt.qname]=Bt:z.styleAttrs[mt.qname]=new u.ComputedLength(.5*Bt.rw,.5*Bt.rh)}else{var Ut=ue.styleAttrs[o.byName.fontSize.qname];z.styleAttrs[mt.qname]=new u.ComputedLength(.5*Ut.rw,.5*Ut.rh)}}for(var kt=0;kt<o.all.length;kt++){var Kt=o.all[kt];if(!(Kt.qname in z.styleAttrs)&&!(Kt.qname===o.byName.position.qname&&o.byName.origin.qname in z.styleAttrs||Kt.qname===o.byName.origin.qname&&o.byName.position.qname in z.styleAttrs)){var on=Y.head.styling.initials[Kt.qname]||Kt.initial;if(on!==null&&(z.kind==="region"||Kt.inherit===!1&&on!==null)){var un=Kt.parse(on);un!==null?(z.styleAttrs[Kt.qname]=un,we[Kt.qname]=!0):se(je,"Invalid initial value for '"+Kt.qname+"' on element '"+z.kind)}}}for(var hn=0;hn<o.all.length;hn++){var Le=o.all[hn];if(Le.qname in we&&Le.compute!==null){var Ee=Le.compute(Y,ue,z,z.styleAttrs[Le.qname],tt);Ee!==null?z.styleAttrs[Le.qname]=Ee:(z.styleAttrs[Le.qname]=Le.compute(Y,ue,z,Le.parse(Le.initial),tt),se(je,"Style '"+Le.qname+"' on element '"+z.kind+"' cannot be computed"))}}if(z.styleAttrs[o.byName.display.qname]==="none")return null;var Tt=null;ue===null?Tt=Te===null?[]:[Te]:"contents"in ve&&(Tt=ve.contents);for(var Ct=0;Tt!==null&&Ct<Tt.length;Ct++){var Ye=m(Y,ce,ge,Te,z,re,Tt[Ct],je,tt);Ye!==null&&z.contents.push(Ye.element)}for(var K in z.styleAttrs)if(z.styleAttrs.hasOwnProperty(K)){var S=!1;if(z.kind==="span"){var ae=z.styleAttrs[o.byName.ruby.qname];(S=(ae==="container"||ae==="textContainer"||ae==="baseContainer")&&E.indexOf(K)!==-1)||(S=ae!=="container"&&K===o.byName.rubyAlign.qname),S||(S=!(ae==="textContainer"||ae==="text")&&K===o.byName.rubyPosition.qname)}if(!S){var P=o.byQName[K];"applies"in P&&(S=P.applies.indexOf(z.kind)===-1)}S&&delete z.styleAttrs[K]}var _e=z.styleAttrs[o.byName.ruby.qname];if(z.kind==="p"||z.kind==="span"&&(_e==="textContainer"||_e==="text")){var Ue=[];b(z,Ue),(function(Pe){function Je(Z){return Z.kind==="br"||/[\r\n\t ]$/.test(Z.text)}function g(Z){return Z.kind==="br"||Z.space==="preserve"&&/^[\r\n]/.test(Z.text)}for(var y,R=0;R<Pe.length;)if((y=Pe[R]).kind!=="br"&&y.space!=="preserve"){var ne=y.text.replace(/[\t\r\n ]+/g," ");/^[ ]/.test(ne)&&(R===0||Je(Pe[R-1]))&&(ne=ne.substring(1)),y.text=ne,ne.length===0?Pe.splice(R,1):R++}else R++;for(R=0;R<Pe.length;R++)(y=Pe[R]).kind!=="br"&&y.space!=="preserve"?/[ ]$/.test(y.text)&&(R===Pe.length-1||g(Pe[R+1]))&&(y.text=y.text.slice(0,-1)):R++})(Ue),T(z)}return z.kind==="div"&&o.byName.backgroundImage.qname in z.styleAttrs||z.kind==="br"||z.kind==="image"||"contents"in z&&z.contents.length>0||z.kind==="span"&&z.text!==null||z.kind==="region"&&z.styleAttrs[o.byName.showBackground.qname]==="always"?{region_id:re,element:z}:null}function b(Y,ce){if("contents"in Y)for(var ge=0;ge<Y.contents.length;ge++){var Te=Y.contents[ge],ue=Te.styleAttrs[o.byName.ruby.qname];(Te.kind!=="span"||ue!=="textContainer"&&ue!=="text")&&("contents"in Te?b(Te,ce):(Te.kind==="span"&&Te.text.length!==0||Te.kind==="br")&&ce.push(Te))}}function T(Y){if(Y.kind==="br")return!1;if("text"in Y)return Y.text.length===0;if("contents"in Y){for(var ce=Y.contents.length;ce--;)T(Y.contents[ce])&&Y.contents.splice(ce,1);return Y.contents.length===0}}function Q(Y){this.contents=[],this.aspectRatio=Y.aspectRatio,this.lang=Y.lang}function V(Y){for(var ce in this.kind=Y.kind||"region",this.lang=Y.lang,Y.id&&(this.id=Y.id),this.styleAttrs={},Y.styleAttrs)Y.styleAttrs.hasOwnProperty(ce)&&(this.styleAttrs[ce]=Y.styleAttrs[ce]);"src"in Y&&(this.src=Y.src),"type"in Y&&(this.type=Y.type),"text"in Y?this.text=Y.text:(this.kind==="region"||"contents"in Y)&&(this.contents=[]),"space"in Y&&(this.space=Y.space)}function se(Y,ce){if(Y&&Y.error&&Y.error(ce))throw ce}})(Re,typeof imscNames>"u"?C(977):imscNames,typeof imscStyles>"u"?C(1219):imscStyles,typeof imscUtils>"u"?C(6404):imscUtils)},7640:function(Nt,Re,C){Re.generateISD=C(8905).generateISD,Re.fromXML=C(6739).fromXML,Re.renderHTML=C(1612).render},977:function(Nt,Re){(function(C){C.ns_tt="http://www.w3.org/ns/ttml",C.ns_tts="http://www.w3.org/ns/ttml#styling",C.ns_ttp="http://www.w3.org/ns/ttml#parameter",C.ns_xml="http://www.w3.org/XML/1998/namespace",C.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",C.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",C.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",C.ns_ebutts="urn:ebu:tt:style"})(Re)},1219:function(Nt,Re,C){(function(j,f,o){function u(b,T,Q,V,se,Y,ce,ge){this.name=T,this.ns=b,this.qname=b+" "+T,this.inherit=se,this.animatable=Y,this.initial=Q,this.applies=V,this.parse=ce,this.compute=ge}for(var E in j.all=[new u(f.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,o.parseColor,null),new u(f.ns_tts,"color","white",["span"],!0,!0,o.parseColor,null),new u(f.ns_tts,"direction","ltr",["p","span"],!0,!0,function(b){return b},null),new u(f.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,function(b){return b},null),new u(f.ns_tts,"displayAlign","before",["region"],!1,!0,function(b){return b},null),new u(f.ns_tts,"extent","auto",["tt","region"],!1,!0,function(b){if(b==="auto")return b;var T=b.split(" ");if(T.length!==2)return null;var Q=o.parseLength(T[0]),V=o.parseLength(T[1]);return V&&Q?{h:V,w:Q}:null},function(b,T,Q,V,se){var Y,ce;if(V==="auto")Y=new o.ComputedLength(0,1);else if((Y=o.toComputedLength(V.h.value,V.h.unit,null,b.dimensions.h,null,b.pxLength.h))===null)return null;if(V==="auto")ce=new o.ComputedLength(1,0);else if((ce=o.toComputedLength(V.w.value,V.w.unit,null,b.dimensions.w,null,b.pxLength.w))===null)return null;return{h:Y,w:ce}}),new u(f.ns_tts,"fontFamily","default",["span","p"],!0,!0,function(b){for(var T=b.split(","),Q=[],V=0;V<T.length;V++)T[V]=T[V].trim(),T[V].charAt(0)!=="'"&&T[V].charAt(0)!=='"'&&T[V]==="default"?Q.push("monospaceSerif"):Q.push(T[V]);return Q},null),new u(f.ns_tts,"shear","0%",["p"],!0,!0,o.parseLength,function(b,T,Q,V){return V.unit!=="%"?null:Math.abs(V.value)>100?100*Math.sign(V.value):V.value}),new u(f.ns_tts,"fontSize","1c",["span","p"],!0,!0,o.parseLength,function(b,T,Q,V,se){return o.toComputedLength(V.value,V.unit,T!==null?T.styleAttrs[j.byName.fontSize.qname]:b.cellLength.h,T!==null?T.styleAttrs[j.byName.fontSize.qname]:b.cellLength.h,b.cellLength.h,b.pxLength.h)}),new u(f.ns_tts,"fontStyle","normal",["span","p"],!0,!0,function(b){return b},null),new u(f.ns_tts,"fontWeight","normal",["span","p"],!0,!0,function(b){return b},null),new u(f.ns_tts,"lineHeight","normal",["p"],!0,!0,function(b){return b==="normal"?b:o.parseLength(b)},function(b,T,Q,V,se){var Y;if(V==="normal")Y=V;else if((Y=o.toComputedLength(V.value,V.unit,Q.styleAttrs[j.byName.fontSize.qname],Q.styleAttrs[j.byName.fontSize.qname],b.cellLength.h,b.pxLength.h))===null)return null;return Y}),new u(f.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new u(f.ns_tts,"origin","auto",["region"],!1,!0,function(b){if(b==="auto")return b;var T=b.split(" ");if(T.length!==2)return null;var Q=o.parseLength(T[0]),V=o.parseLength(T[1]);return V&&Q?{h:V,w:Q}:null},function(b,T,Q,V,se){var Y,ce;if(V==="auto")Y=new o.ComputedLength(0,0);else if((Y=o.toComputedLength(V.h.value,V.h.unit,null,b.dimensions.h,null,b.pxLength.h))===null)return null;if(V==="auto")ce=new o.ComputedLength(0,0);else if((ce=o.toComputedLength(V.w.value,V.w.unit,null,b.dimensions.w,null,b.pxLength.w))===null)return null;return{h:Y,w:ce}}),new u(f.ns_tts,"overflow","hidden",["region"],!1,!0,function(b){return b},null),new u(f.ns_tts,"padding","0px",["region"],!1,!0,function(b){var T=b.split(" ");if(T.length>4)return null;for(var Q=[],V=0;V<T.length;V++){var se=o.parseLength(T[V]);if(!se)return null;Q.push(se)}return Q},function(b,T,Q,V,se){var Y;if(V.length===1)Y=[V[0],V[0],V[0],V[0]];else if(V.length===2)Y=[V[0],V[1],V[0],V[1]];else if(V.length===3)Y=[V[0],V[1],V[2],V[1]];else{if(V.length!==4)return null;Y=[V[0],V[1],V[2],V[3]]}var ce=Q.styleAttrs[j.byName.writingMode.qname];if(ce==="lrtb"||ce==="lr")Y=[Y[0],Y[3],Y[2],Y[1]];else if(ce==="rltb"||ce==="rl")Y=[Y[0],Y[1],Y[2],Y[3]];else if(ce==="tblr")Y=[Y[3],Y[0],Y[1],Y[2]];else{if(ce!=="tbrl"&&ce!=="tb")return null;Y=[Y[3],Y[2],Y[1],Y[0]]}for(var ge=[],Te=0;Te<Y.length;Te++)if(Y[Te].value===0)ge[Te]=new o.ComputedLength(0,0);else if(ge[Te]=o.toComputedLength(Y[Te].value,Y[Te].unit,Q.styleAttrs[j.byName.fontSize.qname],Te===0||Te===2?Q.styleAttrs[j.byName.extent.qname].h:Q.styleAttrs[j.byName.extent.qname].w,Te===0||Te===2?b.cellLength.h:b.cellLength.w,Te===0||Te===2?b.pxLength.h:b.pxLength.w),ge[Te]===null)return null;return ge}),new u(f.ns_tts,"position","top left",["region"],!1,!0,function(b){return o.parsePosition(b)},function(b,T,Q,V){var se,Y;return(se=o.toComputedLength(V.v.offset.value,V.v.offset.unit,null,new o.ComputedLength(-Q.styleAttrs[j.byName.extent.qname].h.rw,b.dimensions.h.rh-Q.styleAttrs[j.byName.extent.qname].h.rh),null,b.pxLength.h))===null?null:(V.v.edge==="bottom"&&(se=new o.ComputedLength(-se.rw-Q.styleAttrs[j.byName.extent.qname].h.rw,b.dimensions.h.rh-se.rh-Q.styleAttrs[j.byName.extent.qname].h.rh)),Y=o.toComputedLength(V.h.offset.value,V.h.offset.unit,null,new o.ComputedLength(b.dimensions.w.rw-Q.styleAttrs[j.byName.extent.qname].w.rw,-Q.styleAttrs[j.byName.extent.qname].w.rh),null,b.pxLength.w),se===null?null:(V.h.edge==="right"&&(Y=new o.ComputedLength(b.dimensions.w.rw-Y.rw-Q.styleAttrs[j.byName.extent.qname].w.rw,-Y.rh-Q.styleAttrs[j.byName.extent.qname].w.rh)),{h:se,w:Y}))}),new u(f.ns_tts,"ruby","none",["span"],!1,!0,function(b){return b},null),new u(f.ns_tts,"rubyAlign","center",["span"],!0,!0,function(b){return b!=="center"&&b!=="spaceAround"?null:b},null),new u(f.ns_tts,"rubyPosition","outside",["span"],!0,!0,function(b){return b},null),new u(f.ns_tts,"rubyReserve","none",["p"],!0,!0,function(b){var T=b.split(" "),Q=[null,null];if(T.length===0||T.length>2||T[0]!=="none"&&T[0]!=="both"&&T[0]!=="after"&&T[0]!=="before"&&T[0]!=="outside")return null;if(Q[0]=T[0],T.length===2&&T[0]!=="none"){var V=o.parseLength(T[1]);if(!V)return null;Q[1]=V}return Q},function(b,T,Q,V,se){if(V[0]==="none")return V;var Y;return(Y=V[1]===null?new o.ComputedLength(.5*Q.styleAttrs[j.byName.fontSize.qname].rw,.5*Q.styleAttrs[j.byName.fontSize.qname].rh):o.toComputedLength(V[1].value,V[1].unit,Q.styleAttrs[j.byName.fontSize.qname],Q.styleAttrs[j.byName.fontSize.qname],b.cellLength.h,b.pxLength.h))===null?null:[V[0],Y]}),new u(f.ns_tts,"showBackground","always",["region"],!1,!0,function(b){return b},null),new u(f.ns_tts,"textAlign","start",["p"],!0,!0,function(b){return b},function(b,T,Q,V,se){return V==="left"?"start":V==="right"?"end":V}),new u(f.ns_tts,"textCombine","none",["span"],!0,!0,function(b){return b==="none"||b==="all"?b:null},null),new u(f.ns_tts,"textDecoration","none",["span"],!0,!0,function(b){return b.split(" ")},null),new u(f.ns_tts,"textEmphasis","none",["span"],!0,!0,function(b){for(var T=b.split(" "),Q={style:null,symbol:null,color:null,position:null},V=0;V<T.length;V++)if(T[V]==="none"||T[V]==="auto")Q.style=T[V];else if(T[V]==="filled"||T[V]==="open")Q.style=T[V];else if(T[V]==="circle"||T[V]==="dot"||T[V]==="sesame")Q.symbol=T[V];else if(T[V]==="current")Q.color=T[V];else if(T[V]==="outside"||T[V]==="before"||T[V]==="after")Q.position=T[V];else if(Q.color=o.parseColor(T[V]),Q.color===null)return null;return Q.style==null&&Q.symbol==null?Q.style="auto":(Q.symbol=Q.symbol||"circle",Q.style=Q.style||"filled"),Q.position=Q.position||"outside",Q.color=Q.color||"current",Q},null),new u(f.ns_tts,"textOutline","none",["span"],!0,!0,function(b){if(b==="none")return b;var T={},Q=b.split(" ");if(Q.length===0||Q.length>2)return null;var V=o.parseColor(Q[0]);if(T.color=V,V!==null&&Q.shift(),Q.length!==1)return null;var se=o.parseLength(Q[0]);return se?(T.thickness=se,T):null},function(b,T,Q,V,se){if(V==="none")return V;var Y={};return V.color===null?Y.color=Q.styleAttrs[j.byName.color.qname]:Y.color=V.color,Y.thickness=o.toComputedLength(V.thickness.value,V.thickness.unit,Q.styleAttrs[j.byName.fontSize.qname],Q.styleAttrs[j.byName.fontSize.qname],b.cellLength.h,b.pxLength.h),Y.thickness===null?null:Y}),new u(f.ns_tts,"textShadow","none",["span"],!0,!0,o.parseTextShadow,function(b,T,Q,V){if(V==="none")return V;for(var se=[],Y=0;Y<V.length;Y++){var ce={};if(ce.x_off=o.toComputedLength(V[Y][0].value,V[Y][0].unit,null,Q.styleAttrs[j.byName.fontSize.qname],null,b.pxLength.w),ce.x_off===null||(ce.y_off=o.toComputedLength(V[Y][1].value,V[Y][1].unit,null,Q.styleAttrs[j.byName.fontSize.qname],null,b.pxLength.h),ce.y_off===null))return null;if(V[Y][2]===null)ce.b_radius=0;else if(ce.b_radius=o.toComputedLength(V[Y][2].value,V[Y][2].unit,null,Q.styleAttrs[j.byName.fontSize.qname],null,b.pxLength.h),ce.b_radius===null)return null;V[Y][3]===null?ce.color=Q.styleAttrs[j.byName.color.qname]:ce.color=V[Y][3],se.push(ce)}return se}),new u(f.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,function(b){return b},null),new u(f.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,function(b){return b},null),new u(f.ns_tts,"wrapOption","wrap",["span"],!0,!0,function(b){return b},null),new u(f.ns_tts,"writingMode","lrtb",["region"],!1,!0,function(b){return b},null),new u(f.ns_tts,"zIndex","auto",["region"],!1,!0,function(b){var T;return b==="auto"?T=b:(T=parseInt(b),isNaN(T)&&(T=null)),T},null),new u(f.ns_ebutts,"linePadding","0c",["p"],!0,!1,o.parseLength,function(b,T,Q,V,se){return o.toComputedLength(V.value,V.unit,null,null,b.cellLength.w,null)}),new u(f.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,function(b){return b},null),new u(f.ns_smpte,"backgroundImage",null,["div"],!1,!1,function(b){return b},null),new u(f.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,function(b){return b==="true"},null),new u(f.ns_itts,"fillLineGap","false",["p"],!0,!0,function(b){return b==="true"},null)],j.byQName={},j.all)j.byQName[j.all[E].qname]=j.all[E];for(var m in j.byName={},j.all)j.byName[j.all[m].name]=j.all[m]})(Re,typeof imscNames>"u"?C(977):imscNames,typeof imscUtils>"u"?C(6404):imscUtils)},6404:function(Nt,Re){(function(C){var j=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,f=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,o=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,u={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};C.parseColor=function(m){var b,T=null,Q=u[m.toLowerCase()];return Q!==void 0?T=Q:(b=j.exec(m))!==null?T=[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16),b[4]!==void 0?parseInt(b[4],16):255]:(b=f.exec(m))!==null?T=[parseInt(b[1]),parseInt(b[2]),parseInt(b[3]),255]:(b=o.exec(m))!==null&&(T=[parseInt(b[1]),parseInt(b[2]),parseInt(b[3]),parseInt(b[4])]),T};var E=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/;C.parseLength=function(m){var b,T=null;return(b=E.exec(m))!==null&&(T={value:parseFloat(b[1]),unit:b[2]}),T},C.parseTextShadow=function(m){for(var b=m.match(/([^\(,\)]|\([^\)]+\))+/g),T=[],Q=0;Q<b.length;Q++){var V=b[Q].split(" ");if(V.length===1&&V[0]==="none")return"none";if(V.length>1&&V.length<5){var se=[null,null,null,null],Y=C.parseLength(V.shift());if(Y===null||(se[0]=Y,(Y=C.parseLength(V.shift()))===null))return null;if(se[1]=Y,V.length===0){T.push(se);continue}if((Y=C.parseLength(V[0]))!==null&&(se[2]=Y,V.shift()),V.length===0){T.push(se);continue}var ce=C.parseColor(V[0]);if(ce===null)return null;se[3]=ce,T.push(se)}}return T},C.parsePosition=function(m){var b=m.split(" "),T=function(Te){return Te==="center"||Te==="left"||Te==="top"||Te==="bottom"||Te==="right"};if(b.length>4)return null;for(var Q=0;Q<b.length;Q++)if(!T(b[Q])){var V=C.parseLength(b[Q]);if(V===null)return null;b[Q]=V}for(var se={h:{edge:"left",offset:{value:50,unit:"%"}},v:{edge:"top",offset:{value:50,unit:"%"}}},Y=0;Y<b.length;){var ce=b[Y++];if(T(ce)){var ge={value:0,unit:"%"};b.length!==2&&Y<b.length&&!T(b[Y])&&(ge=b[Y++]),ce==="right"?(se.h.edge=ce,se.h.offset=ge):ce==="bottom"?(se.v.edge=ce,se.v.offset=ge):ce==="left"?se.h.offset=ge:ce==="top"&&(se.v.offset=ge)}else{if(b.length!==1&&b.length!==2)return null;Y===1?se.h.offset=ce:se.v.offset=ce}}return se},C.ComputedLength=function(m,b){this.rw=m,this.rh=b},C.ComputedLength.prototype.toUsedLength=function(m,b){return m*this.rw+b*this.rh},C.ComputedLength.prototype.isZero=function(){return this.rw===0&&this.rh===0},C.toComputedLength=function(m,b,T,Q,V,se){return b==="%"&&Q?new C.ComputedLength(Q.rw*m/100,Q.rh*m/100):b==="em"&&T?new C.ComputedLength(T.rw*m,T.rh*m):b==="c"&&V?new C.ComputedLength(m*V.rw,m*V.rh):b==="px"&&se?new C.ComputedLength(m*se.rw,m*se.rh):b==="rh"?new C.ComputedLength(0,m/100):b==="rw"?new C.ComputedLength(m/100,0):null}})(Re)},7523:function(Nt){typeof Object.create=="function"?Nt.exports=function(Re,C){C&&(Re.super_=C,Re.prototype=Object.create(C.prototype,{constructor:{value:Re,enumerable:!1,writable:!0,configurable:!0}}))}:Nt.exports=function(Re,C){if(C){Re.super_=C;var j=function(){};j.prototype=C.prototype,Re.prototype=new j,Re.prototype.constructor=Re}}},3282:function(Nt){function Re(f){if(typeof f!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(f))}function C(f,o){for(var u,E="",m=0,b=-1,T=0,Q=0;Q<=f.length;++Q){if(Q<f.length)u=f.charCodeAt(Q);else{if(u===47)break;u=47}if(u===47){if(!(b===Q-1||T===1))if(b!==Q-1&&T===2){if(E.length<2||m!==2||E.charCodeAt(E.length-1)!==46||E.charCodeAt(E.length-2)!==46){if(E.length>2){var V=E.lastIndexOf("/");if(V!==E.length-1){V===-1?(E="",m=0):m=(E=E.slice(0,V)).length-1-E.lastIndexOf("/"),b=Q,T=0;continue}}else if(E.length===2||E.length===1){E="",m=0,b=Q,T=0;continue}}o&&(E.length>0?E+="/..":E="..",m=2)}else E.length>0?E+="/"+f.slice(b+1,Q):E=f.slice(b+1,Q),m=Q-b-1;b=Q,T=0}else u===46&&T!==-1?++T:T=-1}return E}var j={resolve:function(){for(var f,o="",u=!1,E=arguments.length-1;E>=-1&&!u;E--){var m;E>=0?m=arguments[E]:(f===void 0&&(f=process.cwd()),m=f),Re(m),m.length!==0&&(o=m+"/"+o,u=m.charCodeAt(0)===47)}return o=C(o,!u),u?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(f){if(Re(f),f.length===0)return".";var o=f.charCodeAt(0)===47,u=f.charCodeAt(f.length-1)===47;return(f=C(f,!o)).length!==0||o||(f="."),f.length>0&&u&&(f+="/"),o?"/"+f:f},isAbsolute:function(f){return Re(f),f.length>0&&f.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var f,o=0;o<arguments.length;++o){var u=arguments[o];Re(u),u.length>0&&(f===void 0?f=u:f+="/"+u)}return f===void 0?".":j.normalize(f)},relative:function(f,o){if(Re(f),Re(o),f===o||(f=j.resolve(f))===(o=j.resolve(o)))return"";for(var u=1;u<f.length&&f.charCodeAt(u)===47;++u);for(var E=f.length,m=E-u,b=1;b<o.length&&o.charCodeAt(b)===47;++b);for(var T=o.length-b,Q=m<T?m:T,V=-1,se=0;se<=Q;++se){if(se===Q){if(T>Q){if(o.charCodeAt(b+se)===47)return o.slice(b+se+1);if(se===0)return o.slice(b+se)}else m>Q&&(f.charCodeAt(u+se)===47?V=se:se===0&&(V=0));break}var Y=f.charCodeAt(u+se);if(Y!==o.charCodeAt(b+se))break;Y===47&&(V=se)}var ce="";for(se=u+V+1;se<=E;++se)se!==E&&f.charCodeAt(se)!==47||(ce.length===0?ce+="..":ce+="/..");return ce.length>0?ce+o.slice(b+V):(b+=V,o.charCodeAt(b)===47&&++b,o.slice(b))},_makeLong:function(f){return f},dirname:function(f){if(Re(f),f.length===0)return".";for(var o=f.charCodeAt(0),u=o===47,E=-1,m=!0,b=f.length-1;b>=1;--b)if((o=f.charCodeAt(b))===47){if(!m){E=b;break}}else m=!1;return E===-1?u?"/":".":u&&E===1?"//":f.slice(0,E)},basename:function(f,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');Re(f);var u,E=0,m=-1,b=!0;if(o!==void 0&&o.length>0&&o.length<=f.length){if(o.length===f.length&&o===f)return"";var T=o.length-1,Q=-1;for(u=f.length-1;u>=0;--u){var V=f.charCodeAt(u);if(V===47){if(!b){E=u+1;break}}else Q===-1&&(b=!1,Q=u+1),T>=0&&(V===o.charCodeAt(T)?--T===-1&&(m=u):(T=-1,m=Q))}return E===m?m=Q:m===-1&&(m=f.length),f.slice(E,m)}for(u=f.length-1;u>=0;--u)if(f.charCodeAt(u)===47){if(!b){E=u+1;break}}else m===-1&&(b=!1,m=u+1);return m===-1?"":f.slice(E,m)},extname:function(f){Re(f);for(var o=-1,u=0,E=-1,m=!0,b=0,T=f.length-1;T>=0;--T){var Q=f.charCodeAt(T);if(Q!==47)E===-1&&(m=!1,E=T+1),Q===46?o===-1?o=T:b!==1&&(b=1):o!==-1&&(b=-1);else if(!m){u=T+1;break}}return o===-1||E===-1||b===0||b===1&&o===E-1&&o===u+1?"":f.slice(o,E)},format:function(f){if(f===null||typeof f!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof f);return(function(o,u){var E=u.dir||u.root,m=u.base||(u.name||"")+(u.ext||"");return E?E===u.root?E+m:E+"/"+m:m})(0,f)},parse:function(f){Re(f);var o={root:"",dir:"",base:"",ext:"",name:""};if(f.length===0)return o;var u,E=f.charCodeAt(0),m=E===47;m?(o.root="/",u=1):u=0;for(var b=-1,T=0,Q=-1,V=!0,se=f.length-1,Y=0;se>=u;--se)if((E=f.charCodeAt(se))!==47)Q===-1&&(V=!1,Q=se+1),E===46?b===-1?b=se:Y!==1&&(Y=1):b!==-1&&(Y=-1);else if(!V){T=se+1;break}return b===-1||Q===-1||Y===0||Y===1&&b===Q-1&&b===T+1?Q!==-1&&(o.base=o.name=T===0&&m?f.slice(1,Q):f.slice(T,Q)):(T===0&&m?(o.name=f.slice(1,b),o.base=f.slice(1,Q)):(o.name=f.slice(T,b),o.base=f.slice(T,Q)),o.ext=f.slice(b,Q)),T>0?o.dir=f.slice(0,T-1):m&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null};j.posix=j,Nt.exports=j},3515:function(Nt,Re,C){Nt.exports=f;var j=C(9826).EventEmitter;function f(){j.call(this)}C(7523)(f,j),f.Readable=C(2762),f.Writable=C(3726),f.Duplex=C(884),f.Transform=C(6756),f.PassThrough=C(1390),f.finished=C(2896),f.pipeline=C(8460),f.Stream=f,f.prototype.pipe=function(o,u){var E=this;function m(ce){o.writable&&o.write(ce)===!1&&E.pause&&E.pause()}function b(){E.readable&&E.resume&&E.resume()}E.on("data",m),o.on("drain",b),o._isStdio||u&&u.end===!1||(E.on("end",Q),E.on("close",V));var T=!1;function Q(){T||(T=!0,o.end())}function V(){T||(T=!0,typeof o.destroy=="function"&&o.destroy())}function se(ce){if(Y(),j.listenerCount(this,"error")===0)throw ce}function Y(){E.removeListener("data",m),o.removeListener("drain",b),E.removeListener("end",Q),E.removeListener("close",V),E.removeListener("error",se),o.removeListener("error",se),E.removeListener("end",Y),E.removeListener("close",Y),o.removeListener("close",Y)}return E.on("error",se),o.on("error",se),E.on("end",Y),E.on("close",Y),o.on("close",Y),o.emit("pipe",E),o}},1602:function(Nt){var Re={};function C(f,o,u){u||(u=Error);var E=(function(m){var b,T;function Q(V,se,Y){return m.call(this,(function(ce,ge,Te){return typeof o=="string"?o:o(ce,ge,Te)})(V,se,Y))||this}return T=m,(b=Q).prototype=Object.create(T.prototype),b.prototype.constructor=b,b.__proto__=T,Q})(u);E.prototype.name=u.name,E.prototype.code=f,Re[f]=E}function j(f,o){if(Array.isArray(f)){var u=f.length;return f=f.map(function(E){return String(E)}),u>2?"one of ".concat(o," ").concat(f.slice(0,u-1).join(", "),", or ")+f[u-1]:u===2?"one of ".concat(o," ").concat(f[0]," or ").concat(f[1]):"of ".concat(o," ").concat(f[0])}return"of ".concat(o," ").concat(String(f))}C("ERR_INVALID_OPT_VALUE",function(f,o){return'The value "'+o+'" is invalid for option "'+f+'"'},TypeError),C("ERR_INVALID_ARG_TYPE",function(f,o,u){var E,m,b,T,Q;if(typeof o=="string"&&(m="not ",o.substr(0,4)===m)?(E="must not be",o=o.replace(/^not /,"")):E="must be",(function(se,Y,ce){return(ce===void 0||ce>se.length)&&(ce=se.length),se.substring(ce-9,ce)===Y})(f," argument"))b="The ".concat(f," ").concat(E," ").concat(j(o,"type"));else{var V=(typeof Q!="number"&&(Q=0),Q+1>(T=f).length||T.indexOf(".",Q)===-1?"argument":"property");b='The "'.concat(f,'" ').concat(V," ").concat(E," ").concat(j(o,"type"))}return b+". Received type ".concat(typeof u)},TypeError),C("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),C("ERR_METHOD_NOT_IMPLEMENTED",function(f){return"The "+f+" method is not implemented"}),C("ERR_STREAM_PREMATURE_CLOSE","Premature close"),C("ERR_STREAM_DESTROYED",function(f){return"Cannot call "+f+" after a stream was destroyed"}),C("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),C("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),C("ERR_STREAM_WRITE_AFTER_END","write after end"),C("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),C("ERR_UNKNOWN_ENCODING",function(f){return"Unknown encoding: "+f},TypeError),C("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Nt.exports.F=Re},884:function(Nt,Re,C){var j=Object.keys||function(V){var se=[];for(var Y in V)se.push(Y);return se};Nt.exports=b;var f=C(2762),o=C(3726);C(7523)(b,f);for(var u=j(o.prototype),E=0;E<u.length;E++){var m=u[E];b.prototype[m]||(b.prototype[m]=o.prototype[m])}function b(V){if(!(this instanceof b))return new b(V);f.call(this,V),o.call(this,V),this.allowHalfOpen=!0,V&&(V.readable===!1&&(this.readable=!1),V.writable===!1&&(this.writable=!1),V.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",T)))}function T(){this._writableState.ended||process.nextTick(Q,this)}function Q(V){V.end()}Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(b.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(b.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(b.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(V){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=V,this._writableState.destroyed=V)}})},1390:function(Nt,Re,C){Nt.exports=f;var j=C(6756);function f(o){if(!(this instanceof f))return new f(o);j.call(this,o)}C(7523)(f,j),f.prototype._transform=function(o,u,E){E(null,o)}},2762:function(Nt,Re,C){var j;Nt.exports=z,z.ReadableState=re,C(9826).EventEmitter;var f,o=function(Le,Ee){return Le.listeners(Ee).length},u=C(2611),E=C(44).Buffer,m=(C.g!==void 0?C.g:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},b=C(7199);f=b&&b.debuglog?b.debuglog("stream"):function(){};var T,Q,V,se=C(3791),Y=C(2410),ce=C(1749).getHighWaterMark,ge=C(1602).F,Te=ge.ERR_INVALID_ARG_TYPE,ue=ge.ERR_STREAM_PUSH_AFTER_EOF,F=ge.ERR_METHOD_NOT_IMPLEMENTED,ve=ge.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;C(7523)(z,u);var je=Y.errorOrDestroy,tt=["error","close","destroy","pause","resume"];function re(Le,Ee,Tt){j=j||C(884),Le=Le||{},typeof Tt!="boolean"&&(Tt=Ee instanceof j),this.objectMode=!!Le.objectMode,Tt&&(this.objectMode=this.objectMode||!!Le.readableObjectMode),this.highWaterMark=ce(this,Le,"readableHighWaterMark",Tt),this.buffer=new se,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=Le.emitClose!==!1,this.autoDestroy=!!Le.autoDestroy,this.destroyed=!1,this.defaultEncoding=Le.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Le.encoding&&(T||(T=C(748).I),this.decoder=new T(Le.encoding),this.encoding=Le.encoding)}function z(Le){if(j=j||C(884),!(this instanceof z))return new z(Le);var Ee=this instanceof j;this._readableState=new re(Le,this,Ee),this.readable=!0,Le&&(typeof Le.read=="function"&&(this._read=Le.read),typeof Le.destroy=="function"&&(this._destroy=Le.destroy)),u.call(this)}function he(Le,Ee,Tt,Ct,Ye){f("readableAddChunk",Ee);var K,S=Le._readableState;if(Ee===null)S.reading=!1,(function(ae,P){if(f("onEofChunk"),!P.ended){if(P.decoder){var _e=P.decoder.end();_e&&_e.length&&(P.buffer.push(_e),P.length+=P.objectMode?1:_e.length)}P.ended=!0,P.sync?ye(ae):(P.needReadable=!1,P.emittedReadable||(P.emittedReadable=!0,mt(ae)))}})(Le,S);else if(Ye||(K=(function(ae,P){var _e,Ue;return Ue=P,E.isBuffer(Ue)||Ue instanceof m||typeof P=="string"||P===void 0||ae.objectMode||(_e=new Te("chunk",["string","Buffer","Uint8Array"],P)),_e})(S,Ee)),K)je(Le,K);else if(S.objectMode||Ee&&Ee.length>0)if(typeof Ee=="string"||S.objectMode||Object.getPrototypeOf(Ee)===E.prototype||(Ee=(function(ae){return E.from(ae)})(Ee)),Ct)S.endEmitted?je(Le,new ve):we(Le,S,Ee,!0);else if(S.ended)je(Le,new ue);else{if(S.destroyed)return!1;S.reading=!1,S.decoder&&!Tt?(Ee=S.decoder.write(Ee),S.objectMode||Ee.length!==0?we(Le,S,Ee,!1):Ze(Le,S)):we(Le,S,Ee,!1)}else Ct||(S.reading=!1,Ze(Le,S));return!S.ended&&(S.length<S.highWaterMark||S.length===0)}function we(Le,Ee,Tt,Ct){Ee.flowing&&Ee.length===0&&!Ee.sync?(Ee.awaitDrain=0,Le.emit("data",Tt)):(Ee.length+=Ee.objectMode?1:Tt.length,Ct?Ee.buffer.unshift(Tt):Ee.buffer.push(Tt),Ee.needReadable&&ye(Le)),Ze(Le,Ee)}Object.defineProperty(z.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(Le){this._readableState&&(this._readableState.destroyed=Le)}}),z.prototype.destroy=Y.destroy,z.prototype._undestroy=Y.undestroy,z.prototype._destroy=function(Le,Ee){Ee(Le)},z.prototype.push=function(Le,Ee){var Tt,Ct=this._readableState;return Ct.objectMode?Tt=!0:typeof Le=="string"&&((Ee=Ee||Ct.defaultEncoding)!==Ct.encoding&&(Le=E.from(Le,Ee),Ee=""),Tt=!0),he(this,Le,Ee,!1,Tt)},z.prototype.unshift=function(Le){return he(this,Le,null,!0,!1)},z.prototype.isPaused=function(){return this._readableState.flowing===!1},z.prototype.setEncoding=function(Le){T||(T=C(748).I);var Ee=new T(Le);this._readableState.decoder=Ee,this._readableState.encoding=this._readableState.decoder.encoding;for(var Tt=this._readableState.buffer.head,Ct="";Tt!==null;)Ct+=Ee.write(Tt.data),Tt=Tt.next;return this._readableState.buffer.clear(),Ct!==""&&this._readableState.buffer.push(Ct),this._readableState.length=Ct.length,this};var Be=1073741824;function pt(Le,Ee){return Le<=0||Ee.length===0&&Ee.ended?0:Ee.objectMode?1:Le!=Le?Ee.flowing&&Ee.length?Ee.buffer.head.data.length:Ee.length:(Le>Ee.highWaterMark&&(Ee.highWaterMark=(function(Tt){return Tt>=Be?Tt=Be:(Tt--,Tt|=Tt>>>1,Tt|=Tt>>>2,Tt|=Tt>>>4,Tt|=Tt>>>8,Tt|=Tt>>>16,Tt++),Tt})(Le)),Le<=Ee.length?Le:Ee.ended?Ee.length:(Ee.needReadable=!0,0))}function ye(Le){var Ee=Le._readableState;f("emitReadable",Ee.needReadable,Ee.emittedReadable),Ee.needReadable=!1,Ee.emittedReadable||(f("emitReadable",Ee.flowing),Ee.emittedReadable=!0,process.nextTick(mt,Le))}function mt(Le){var Ee=Le._readableState;f("emitReadable_",Ee.destroyed,Ee.length,Ee.ended),Ee.destroyed||!Ee.length&&!Ee.ended||(Le.emit("readable"),Ee.emittedReadable=!1),Ee.needReadable=!Ee.flowing&&!Ee.ended&&Ee.length<=Ee.highWaterMark,kt(Le)}function Ze(Le,Ee){Ee.readingMore||(Ee.readingMore=!0,process.nextTick(He,Le,Ee))}function He(Le,Ee){for(;!Ee.reading&&!Ee.ended&&(Ee.length<Ee.highWaterMark||Ee.flowing&&Ee.length===0);){var Tt=Ee.length;if(f("maybeReadMore read 0"),Le.read(0),Tt===Ee.length)break}Ee.readingMore=!1}function U(Le){var Ee=Le._readableState;Ee.readableListening=Le.listenerCount("readable")>0,Ee.resumeScheduled&&!Ee.paused?Ee.flowing=!0:Le.listenerCount("data")>0&&Le.resume()}function Bt(Le){f("readable nexttick read 0"),Le.read(0)}function Ut(Le,Ee){f("resume",Ee.reading),Ee.reading||Le.read(0),Ee.resumeScheduled=!1,Le.emit("resume"),kt(Le),Ee.flowing&&!Ee.reading&&Le.read(0)}function kt(Le){var Ee=Le._readableState;for(f("flow",Ee.flowing);Ee.flowing&&Le.read()!==null;);}function Kt(Le,Ee){return Ee.length===0?null:(Ee.objectMode?Tt=Ee.buffer.shift():!Le||Le>=Ee.length?(Tt=Ee.decoder?Ee.buffer.join(""):Ee.buffer.length===1?Ee.buffer.first():Ee.buffer.concat(Ee.length),Ee.buffer.clear()):Tt=Ee.buffer.consume(Le,Ee.decoder),Tt);var Tt}function on(Le){var Ee=Le._readableState;f("endReadable",Ee.endEmitted),Ee.endEmitted||(Ee.ended=!0,process.nextTick(un,Ee,Le))}function un(Le,Ee){if(f("endReadableNT",Le.endEmitted,Le.length),!Le.endEmitted&&Le.length===0&&(Le.endEmitted=!0,Ee.readable=!1,Ee.emit("end"),Le.autoDestroy)){var Tt=Ee._writableState;(!Tt||Tt.autoDestroy&&Tt.finished)&&Ee.destroy()}}function hn(Le,Ee){for(var Tt=0,Ct=Le.length;Tt<Ct;Tt++)if(Le[Tt]===Ee)return Tt;return-1}z.prototype.read=function(Le){f("read",Le),Le=parseInt(Le,10);var Ee=this._readableState,Tt=Le;if(Le!==0&&(Ee.emittedReadable=!1),Le===0&&Ee.needReadable&&((Ee.highWaterMark!==0?Ee.length>=Ee.highWaterMark:Ee.length>0)||Ee.ended))return f("read: emitReadable",Ee.length,Ee.ended),Ee.length===0&&Ee.ended?on(this):ye(this),null;if((Le=pt(Le,Ee))===0&&Ee.ended)return Ee.length===0&&on(this),null;var Ct,Ye=Ee.needReadable;return f("need readable",Ye),(Ee.length===0||Ee.length-Le<Ee.highWaterMark)&&f("length less than watermark",Ye=!0),Ee.ended||Ee.reading?f("reading or ended",Ye=!1):Ye&&(f("do read"),Ee.reading=!0,Ee.sync=!0,Ee.length===0&&(Ee.needReadable=!0),this._read(Ee.highWaterMark),Ee.sync=!1,Ee.reading||(Le=pt(Tt,Ee))),(Ct=Le>0?Kt(Le,Ee):null)===null?(Ee.needReadable=Ee.length<=Ee.highWaterMark,Le=0):(Ee.length-=Le,Ee.awaitDrain=0),Ee.length===0&&(Ee.ended||(Ee.needReadable=!0),Tt!==Le&&Ee.ended&&on(this)),Ct!==null&&this.emit("data",Ct),Ct},z.prototype._read=function(Le){je(this,new F("_read()"))},z.prototype.pipe=function(Le,Ee){var Tt=this,Ct=this._readableState;switch(Ct.pipesCount){case 0:Ct.pipes=Le;break;case 1:Ct.pipes=[Ct.pipes,Le];break;default:Ct.pipes.push(Le)}Ct.pipesCount+=1,f("pipe count=%d opts=%j",Ct.pipesCount,Ee);var Ye=Ee&&Ee.end===!1||Le===process.stdout||Le===process.stderr?Je:K;function K(){f("onend"),Le.end()}Ct.endEmitted?process.nextTick(Ye):Tt.once("end",Ye),Le.on("unpipe",function g(y,R){f("onunpipe"),y===Tt&&R&&R.hasUnpiped===!1&&(R.hasUnpiped=!0,f("cleanup"),Le.removeListener("close",Ue),Le.removeListener("finish",Pe),Le.removeListener("drain",S),Le.removeListener("error",_e),Le.removeListener("unpipe",g),Tt.removeListener("end",K),Tt.removeListener("end",Je),Tt.removeListener("data",P),ae=!0,!Ct.awaitDrain||Le._writableState&&!Le._writableState.needDrain||S())});var S=(function(g){return function(){var y=g._readableState;f("pipeOnDrain",y.awaitDrain),y.awaitDrain&&y.awaitDrain--,y.awaitDrain===0&&o(g,"data")&&(y.flowing=!0,kt(g))}})(Tt);Le.on("drain",S);var ae=!1;function P(g){f("ondata");var y=Le.write(g);f("dest.write",y),y===!1&&((Ct.pipesCount===1&&Ct.pipes===Le||Ct.pipesCount>1&&hn(Ct.pipes,Le)!==-1)&&!ae&&(f("false write response, pause",Ct.awaitDrain),Ct.awaitDrain++),Tt.pause())}function _e(g){f("onerror",g),Je(),Le.removeListener("error",_e),o(Le,"error")===0&&je(Le,g)}function Ue(){Le.removeListener("finish",Pe),Je()}function Pe(){f("onfinish"),Le.removeListener("close",Ue),Je()}function Je(){f("unpipe"),Tt.unpipe(Le)}return Tt.on("data",P),(function(g,y,R){if(typeof g.prependListener=="function")return g.prependListener(y,R);g._events&&g._events[y]?Array.isArray(g._events[y])?g._events[y].unshift(R):g._events[y]=[R,g._events[y]]:g.on(y,R)})(Le,"error",_e),Le.once("close",Ue),Le.once("finish",Pe),Le.emit("pipe",Tt),Ct.flowing||(f("pipe resume"),Tt.resume()),Le},z.prototype.unpipe=function(Le){var Ee=this._readableState,Tt={hasUnpiped:!1};if(Ee.pipesCount===0)return this;if(Ee.pipesCount===1)return Le&&Le!==Ee.pipes||(Le||(Le=Ee.pipes),Ee.pipes=null,Ee.pipesCount=0,Ee.flowing=!1,Le&&Le.emit("unpipe",this,Tt)),this;if(!Le){var Ct=Ee.pipes,Ye=Ee.pipesCount;Ee.pipes=null,Ee.pipesCount=0,Ee.flowing=!1;for(var K=0;K<Ye;K++)Ct[K].emit("unpipe",this,{hasUnpiped:!1});return this}var S=hn(Ee.pipes,Le);return S===-1||(Ee.pipes.splice(S,1),Ee.pipesCount-=1,Ee.pipesCount===1&&(Ee.pipes=Ee.pipes[0]),Le.emit("unpipe",this,Tt)),this},z.prototype.on=function(Le,Ee){var Tt=u.prototype.on.call(this,Le,Ee),Ct=this._readableState;return Le==="data"?(Ct.readableListening=this.listenerCount("readable")>0,Ct.flowing!==!1&&this.resume()):Le==="readable"&&(Ct.endEmitted||Ct.readableListening||(Ct.readableListening=Ct.needReadable=!0,Ct.flowing=!1,Ct.emittedReadable=!1,f("on readable",Ct.length,Ct.reading),Ct.length?ye(this):Ct.reading||process.nextTick(Bt,this))),Tt},z.prototype.addListener=z.prototype.on,z.prototype.removeListener=function(Le,Ee){var Tt=u.prototype.removeListener.call(this,Le,Ee);return Le==="readable"&&process.nextTick(U,this),Tt},z.prototype.removeAllListeners=function(Le){var Ee=u.prototype.removeAllListeners.apply(this,arguments);return Le!=="readable"&&Le!==void 0||process.nextTick(U,this),Ee},z.prototype.resume=function(){var Le=this._readableState;return Le.flowing||(f("resume"),Le.flowing=!Le.readableListening,(function(Ee,Tt){Tt.resumeScheduled||(Tt.resumeScheduled=!0,process.nextTick(Ut,Ee,Tt))})(this,Le)),Le.paused=!1,this},z.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},z.prototype.wrap=function(Le){var Ee=this,Tt=this._readableState,Ct=!1;for(var Ye in Le.on("end",function(){if(f("wrapped end"),Tt.decoder&&!Tt.ended){var S=Tt.decoder.end();S&&S.length&&Ee.push(S)}Ee.push(null)}),Le.on("data",function(S){f("wrapped data"),Tt.decoder&&(S=Tt.decoder.write(S)),Tt.objectMode&&S==null||(Tt.objectMode||S&&S.length)&&(Ee.push(S)||(Ct=!0,Le.pause()))}),Le)this[Ye]===void 0&&typeof Le[Ye]=="function"&&(this[Ye]=(function(S){return function(){return Le[S].apply(Le,arguments)}})(Ye));for(var K=0;K<tt.length;K++)Le.on(tt[K],this.emit.bind(this,tt[K]));return this._read=function(S){f("wrapped _read",S),Ct&&(Ct=!1,Le.resume())},this},typeof Symbol=="function"&&(z.prototype[Symbol.asyncIterator]=function(){return Q===void 0&&(Q=C(5857)),Q(this)}),Object.defineProperty(z.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(z.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(z.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(Le){this._readableState&&(this._readableState.flowing=Le)}}),z._fromList=Kt,Object.defineProperty(z.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(z.from=function(Le,Ee){return V===void 0&&(V=C(3411)),V(z,Le,Ee)})},6756:function(Nt,Re,C){Nt.exports=T;var j=C(1602).F,f=j.ERR_METHOD_NOT_IMPLEMENTED,o=j.ERR_MULTIPLE_CALLBACK,u=j.ERR_TRANSFORM_ALREADY_TRANSFORMING,E=j.ERR_TRANSFORM_WITH_LENGTH_0,m=C(884);function b(se,Y){var ce=this._transformState;ce.transforming=!1;var ge=ce.writecb;if(ge===null)return this.emit("error",new o);ce.writechunk=null,ce.writecb=null,Y!=null&&this.push(Y),ge(se);var Te=this._readableState;Te.reading=!1,(Te.needReadable||Te.length<Te.highWaterMark)&&this._read(Te.highWaterMark)}function T(se){if(!(this instanceof T))return new T(se);m.call(this,se),this._transformState={afterTransform:b.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,se&&(typeof se.transform=="function"&&(this._transform=se.transform),typeof se.flush=="function"&&(this._flush=se.flush)),this.on("prefinish",Q)}function Q(){var se=this;typeof this._flush!="function"||this._readableState.destroyed?V(this,null,null):this._flush(function(Y,ce){V(se,Y,ce)})}function V(se,Y,ce){if(Y)return se.emit("error",Y);if(ce!=null&&se.push(ce),se._writableState.length)throw new E;if(se._transformState.transforming)throw new u;return se.push(null)}C(7523)(T,m),T.prototype.push=function(se,Y){return this._transformState.needTransform=!1,m.prototype.push.call(this,se,Y)},T.prototype._transform=function(se,Y,ce){ce(new f("_transform()"))},T.prototype._write=function(se,Y,ce){var ge=this._transformState;if(ge.writecb=ce,ge.writechunk=se,ge.writeencoding=Y,!ge.transforming){var Te=this._readableState;(ge.needTransform||Te.needReadable||Te.length<Te.highWaterMark)&&this._read(Te.highWaterMark)}},T.prototype._read=function(se){var Y=this._transformState;Y.writechunk===null||Y.transforming?Y.needTransform=!0:(Y.transforming=!0,this._transform(Y.writechunk,Y.writeencoding,Y.afterTransform))},T.prototype._destroy=function(se,Y){m.prototype._destroy.call(this,se,function(ce){Y(ce)})}},3726:function(Nt,Re,C){function j(Ze){var He=this;this.next=null,this.entry=null,this.finish=function(){(function(U,Bt){var Ut=U.entry;for(U.entry=null;Ut;){var kt=Ut.callback;Bt.pendingcb--,kt(void 0),Ut=Ut.next}Bt.corkedRequestsFree.next=U})(He,Ze)}}var f;Nt.exports=z,z.WritableState=re;var o,u={deprecate:C(9e3)},E=C(2611),m=C(44).Buffer,b=(C.g!==void 0?C.g:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},T=C(2410),Q=C(1749).getHighWaterMark,V=C(1602).F,se=V.ERR_INVALID_ARG_TYPE,Y=V.ERR_METHOD_NOT_IMPLEMENTED,ce=V.ERR_MULTIPLE_CALLBACK,ge=V.ERR_STREAM_CANNOT_PIPE,Te=V.ERR_STREAM_DESTROYED,ue=V.ERR_STREAM_NULL_VALUES,F=V.ERR_STREAM_WRITE_AFTER_END,ve=V.ERR_UNKNOWN_ENCODING,je=T.errorOrDestroy;function tt(){}function re(Ze,He,U){f=f||C(884),Ze=Ze||{},typeof U!="boolean"&&(U=He instanceof f),this.objectMode=!!Ze.objectMode,U&&(this.objectMode=this.objectMode||!!Ze.writableObjectMode),this.highWaterMark=Q(this,Ze,"writableHighWaterMark",U),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Bt=Ze.decodeStrings===!1;this.decodeStrings=!Bt,this.defaultEncoding=Ze.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Ut){(function(kt,Kt){var on=kt._writableState,un=on.sync,hn=on.writecb;if(typeof hn!="function")throw new ce;if((function(Ee){Ee.writing=!1,Ee.writecb=null,Ee.length-=Ee.writelen,Ee.writelen=0})(on),Kt)(function(Ee,Tt,Ct,Ye,K){--Tt.pendingcb,Ct?(process.nextTick(K,Ye),process.nextTick(mt,Ee,Tt),Ee._writableState.errorEmitted=!0,je(Ee,Ye)):(K(Ye),Ee._writableState.errorEmitted=!0,je(Ee,Ye),mt(Ee,Tt))})(kt,on,un,Kt,hn);else{var Le=pt(on)||kt.destroyed;Le||on.corked||on.bufferProcessing||!on.bufferedRequest||Be(kt,on),un?process.nextTick(we,kt,on,Le,hn):we(kt,on,Le,hn)}})(He,Ut)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Ze.emitClose!==!1,this.autoDestroy=!!Ze.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new j(this)}function z(Ze){var He=this instanceof(f=f||C(884));if(!He&&!o.call(z,this))return new z(Ze);this._writableState=new re(Ze,this,He),this.writable=!0,Ze&&(typeof Ze.write=="function"&&(this._write=Ze.write),typeof Ze.writev=="function"&&(this._writev=Ze.writev),typeof Ze.destroy=="function"&&(this._destroy=Ze.destroy),typeof Ze.final=="function"&&(this._final=Ze.final)),E.call(this)}function he(Ze,He,U,Bt,Ut,kt,Kt){He.writelen=Bt,He.writecb=Kt,He.writing=!0,He.sync=!0,He.destroyed?He.onwrite(new Te("write")):U?Ze._writev(Ut,He.onwrite):Ze._write(Ut,kt,He.onwrite),He.sync=!1}function we(Ze,He,U,Bt){U||(function(Ut,kt){kt.length===0&&kt.needDrain&&(kt.needDrain=!1,Ut.emit("drain"))})(Ze,He),He.pendingcb--,Bt(),mt(Ze,He)}function Be(Ze,He){He.bufferProcessing=!0;var U=He.bufferedRequest;if(Ze._writev&&U&&U.next){var Bt=He.bufferedRequestCount,Ut=new Array(Bt),kt=He.corkedRequestsFree;kt.entry=U;for(var Kt=0,on=!0;U;)Ut[Kt]=U,U.isBuf||(on=!1),U=U.next,Kt+=1;Ut.allBuffers=on,he(Ze,He,!0,He.length,Ut,"",kt.finish),He.pendingcb++,He.lastBufferedRequest=null,kt.next?(He.corkedRequestsFree=kt.next,kt.next=null):He.corkedRequestsFree=new j(He),He.bufferedRequestCount=0}else{for(;U;){var un=U.chunk,hn=U.encoding,Le=U.callback;if(he(Ze,He,!1,He.objectMode?1:un.length,un,hn,Le),U=U.next,He.bufferedRequestCount--,He.writing)break}U===null&&(He.lastBufferedRequest=null)}He.bufferedRequest=U,He.bufferProcessing=!1}function pt(Ze){return Ze.ending&&Ze.length===0&&Ze.bufferedRequest===null&&!Ze.finished&&!Ze.writing}function ye(Ze,He){Ze._final(function(U){He.pendingcb--,U&&je(Ze,U),He.prefinished=!0,Ze.emit("prefinish"),mt(Ze,He)})}function mt(Ze,He){var U=pt(He);if(U&&((function(Ut,kt){kt.prefinished||kt.finalCalled||(typeof Ut._final!="function"||kt.destroyed?(kt.prefinished=!0,Ut.emit("prefinish")):(kt.pendingcb++,kt.finalCalled=!0,process.nextTick(ye,Ut,kt)))})(Ze,He),He.pendingcb===0&&(He.finished=!0,Ze.emit("finish"),He.autoDestroy))){var Bt=Ze._readableState;(!Bt||Bt.autoDestroy&&Bt.endEmitted)&&Ze.destroy()}return U}C(7523)(z,E),re.prototype.getBuffer=function(){for(var Ze=this.bufferedRequest,He=[];Ze;)He.push(Ze),Ze=Ze.next;return He},(function(){try{Object.defineProperty(re.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(z,Symbol.hasInstance,{value:function(Ze){return!!o.call(this,Ze)||this===z&&Ze&&Ze._writableState instanceof re}})):o=function(Ze){return Ze instanceof this},z.prototype.pipe=function(){je(this,new ge)},z.prototype.write=function(Ze,He,U){var Bt,Ut=this._writableState,kt=!1,Kt=!Ut.objectMode&&(Bt=Ze,m.isBuffer(Bt)||Bt instanceof b);return Kt&&!m.isBuffer(Ze)&&(Ze=(function(on){return m.from(on)})(Ze)),typeof He=="function"&&(U=He,He=null),Kt?He="buffer":He||(He=Ut.defaultEncoding),typeof U!="function"&&(U=tt),Ut.ending?(function(on,un){var hn=new F;je(on,hn),process.nextTick(un,hn)})(this,U):(Kt||(function(on,un,hn,Le){var Ee;return hn===null?Ee=new ue:typeof hn=="string"||un.objectMode||(Ee=new se("chunk",["string","Buffer"],hn)),!Ee||(je(on,Ee),process.nextTick(Le,Ee),!1)})(this,Ut,Ze,U))&&(Ut.pendingcb++,kt=(function(on,un,hn,Le,Ee,Tt){if(!hn){var Ct=(function(ae,P,_e){return ae.objectMode||ae.decodeStrings===!1||typeof P!="string"||(P=m.from(P,_e)),P})(un,Le,Ee);Le!==Ct&&(hn=!0,Ee="buffer",Le=Ct)}var Ye=un.objectMode?1:Le.length;un.length+=Ye;var K=un.length<un.highWaterMark;if(K||(un.needDrain=!0),un.writing||un.corked){var S=un.lastBufferedRequest;un.lastBufferedRequest={chunk:Le,encoding:Ee,isBuf:hn,callback:Tt,next:null},S?S.next=un.lastBufferedRequest:un.bufferedRequest=un.lastBufferedRequest,un.bufferedRequestCount+=1}else he(on,un,!1,Ye,Le,Ee,Tt);return K})(this,Ut,Kt,Ze,He,U)),kt},z.prototype.cork=function(){this._writableState.corked++},z.prototype.uncork=function(){var Ze=this._writableState;Ze.corked&&(Ze.corked--,Ze.writing||Ze.corked||Ze.bufferProcessing||!Ze.bufferedRequest||Be(this,Ze))},z.prototype.setDefaultEncoding=function(Ze){if(typeof Ze=="string"&&(Ze=Ze.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Ze+"").toLowerCase())>-1))throw new ve(Ze);return this._writableState.defaultEncoding=Ze,this},Object.defineProperty(z.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),z.prototype._write=function(Ze,He,U){U(new Y("_write()"))},z.prototype._writev=null,z.prototype.end=function(Ze,He,U){var Bt=this._writableState;return typeof Ze=="function"?(U=Ze,Ze=null,He=null):typeof He=="function"&&(U=He,He=null),Ze!=null&&this.write(Ze,He),Bt.corked&&(Bt.corked=1,this.uncork()),Bt.ending||(function(Ut,kt,Kt){kt.ending=!0,mt(Ut,kt),Kt&&(kt.finished?process.nextTick(Kt):Ut.once("finish",Kt)),kt.ended=!0,Ut.writable=!1})(this,Bt,U),this},Object.defineProperty(z.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(z.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(Ze){this._writableState&&(this._writableState.destroyed=Ze)}}),z.prototype.destroy=T.destroy,z.prototype._undestroy=T.undestroy,z.prototype._destroy=function(Ze,He){He(Ze)}},5857:function(Nt,Re,C){var j;function f(ue,F,ve){return(F=(function(je){var tt=(function(re){if(typeof re!="object"||re===null)return re;var z=re[Symbol.toPrimitive];if(z!==void 0){var he=z.call(re,"string");if(typeof he!="object")return he;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)})(je);return typeof tt=="symbol"?tt:String(tt)})(F))in ue?Object.defineProperty(ue,F,{value:ve,enumerable:!0,configurable:!0,writable:!0}):ue[F]=ve,ue}var o=C(2896),u=Symbol("lastResolve"),E=Symbol("lastReject"),m=Symbol("error"),b=Symbol("ended"),T=Symbol("lastPromise"),Q=Symbol("handlePromise"),V=Symbol("stream");function se(ue,F){return{value:ue,done:F}}function Y(ue){var F=ue[u];if(F!==null){var ve=ue[V].read();ve!==null&&(ue[T]=null,ue[u]=null,ue[E]=null,F(se(ve,!1)))}}function ce(ue){process.nextTick(Y,ue)}var ge=Object.getPrototypeOf(function(){}),Te=Object.setPrototypeOf((f(j={get stream(){return this[V]},next:function(){var ue=this,F=this[m];if(F!==null)return Promise.reject(F);if(this[b])return Promise.resolve(se(void 0,!0));if(this[V].destroyed)return new Promise(function(re,z){process.nextTick(function(){ue[m]?z(ue[m]):re(se(void 0,!0))})});var ve,je=this[T];if(je)ve=new Promise((function(re,z){return function(he,we){re.then(function(){z[b]?he(se(void 0,!0)):z[Q](he,we)},we)}})(je,this));else{var tt=this[V].read();if(tt!==null)return Promise.resolve(se(tt,!1));ve=new Promise(this[Q])}return this[T]=ve,ve}},Symbol.asyncIterator,function(){return this}),f(j,"return",function(){var ue=this;return new Promise(function(F,ve){ue[V].destroy(null,function(je){je?ve(je):F(se(void 0,!0))})})}),j),ge);Nt.exports=function(ue){var F,ve=Object.create(Te,(f(F={},V,{value:ue,writable:!0}),f(F,u,{value:null,writable:!0}),f(F,E,{value:null,writable:!0}),f(F,m,{value:null,writable:!0}),f(F,b,{value:ue._readableState.endEmitted,writable:!0}),f(F,Q,{value:function(je,tt){var re=ve[V].read();re?(ve[T]=null,ve[u]=null,ve[E]=null,je(se(re,!1))):(ve[u]=je,ve[E]=tt)},writable:!0}),F));return ve[T]=null,o(ue,function(je){if(je&&je.code!=="ERR_STREAM_PREMATURE_CLOSE"){var tt=ve[E];return tt!==null&&(ve[T]=null,ve[u]=null,ve[E]=null,tt(je)),void(ve[m]=je)}var re=ve[u];re!==null&&(ve[T]=null,ve[u]=null,ve[E]=null,re(se(void 0,!0))),ve[b]=!0}),ue.on("readable",ce.bind(null,ve)),ve}},3791:function(Nt,Re,C){function j(V,se){var Y=Object.keys(V);if(Object.getOwnPropertySymbols){var ce=Object.getOwnPropertySymbols(V);se&&(ce=ce.filter(function(ge){return Object.getOwnPropertyDescriptor(V,ge).enumerable})),Y.push.apply(Y,ce)}return Y}function f(V){for(var se=1;se<arguments.length;se++){var Y=arguments[se]!=null?arguments[se]:{};se%2?j(Object(Y),!0).forEach(function(ce){o(V,ce,Y[ce])}):Object.getOwnPropertyDescriptors?Object.defineProperties(V,Object.getOwnPropertyDescriptors(Y)):j(Object(Y)).forEach(function(ce){Object.defineProperty(V,ce,Object.getOwnPropertyDescriptor(Y,ce))})}return V}function o(V,se,Y){return(se=E(se))in V?Object.defineProperty(V,se,{value:Y,enumerable:!0,configurable:!0,writable:!0}):V[se]=Y,V}function u(V,se){for(var Y=0;Y<se.length;Y++){var ce=se[Y];ce.enumerable=ce.enumerable||!1,ce.configurable=!0,"value"in ce&&(ce.writable=!0),Object.defineProperty(V,E(ce.key),ce)}}function E(V){var se=(function(Y){if(typeof Y!="object"||Y===null)return Y;var ce=Y[Symbol.toPrimitive];if(ce!==void 0){var ge=ce.call(Y,"string");if(typeof ge!="object")return ge;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Y)})(V);return typeof se=="symbol"?se:String(se)}var m=C(44).Buffer,b=C(3779).inspect,T=b&&b.custom||"inspect";function Q(V,se,Y){m.prototype.copy.call(V,se,Y)}Nt.exports=(function(){function V(){(function(ce,ge){if(!(ce instanceof ge))throw new TypeError("Cannot call a class as a function")})(this,V),this.head=null,this.tail=null,this.length=0}var se,Y;return se=V,(Y=[{key:"push",value:function(ce){var ge={data:ce,next:null};this.length>0?this.tail.next=ge:this.head=ge,this.tail=ge,++this.length}},{key:"unshift",value:function(ce){var ge={data:ce,next:this.head};this.length===0&&(this.tail=ge),this.head=ge,++this.length}},{key:"shift",value:function(){if(this.length!==0){var ce=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ce}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(ce){if(this.length===0)return"";for(var ge=this.head,Te=""+ge.data;ge=ge.next;)Te+=ce+ge.data;return Te}},{key:"concat",value:function(ce){if(this.length===0)return m.alloc(0);for(var ge=m.allocUnsafe(ce>>>0),Te=this.head,ue=0;Te;)Q(Te.data,ge,ue),ue+=Te.data.length,Te=Te.next;return ge}},{key:"consume",value:function(ce,ge){var Te;return ce<this.head.data.length?(Te=this.head.data.slice(0,ce),this.head.data=this.head.data.slice(ce)):Te=ce===this.head.data.length?this.shift():ge?this._getString(ce):this._getBuffer(ce),Te}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(ce){var ge=this.head,Te=1,ue=ge.data;for(ce-=ue.length;ge=ge.next;){var F=ge.data,ve=ce>F.length?F.length:ce;if(ve===F.length?ue+=F:ue+=F.slice(0,ce),(ce-=ve)===0){ve===F.length?(++Te,ge.next?this.head=ge.next:this.head=this.tail=null):(this.head=ge,ge.data=F.slice(ve));break}++Te}return this.length-=Te,ue}},{key:"_getBuffer",value:function(ce){var ge=m.allocUnsafe(ce),Te=this.head,ue=1;for(Te.data.copy(ge),ce-=Te.data.length;Te=Te.next;){var F=Te.data,ve=ce>F.length?F.length:ce;if(F.copy(ge,ge.length-ce,0,ve),(ce-=ve)===0){ve===F.length?(++ue,Te.next?this.head=Te.next:this.head=this.tail=null):(this.head=Te,Te.data=F.slice(ve));break}++ue}return this.length-=ue,ge}},{key:T,value:function(ce,ge){return b(this,f(f({},ge),{},{depth:0,customInspect:!1}))}}])&&u(se.prototype,Y),Object.defineProperty(se,"prototype",{writable:!1}),V})()},2410:function(Nt){function Re(f,o){j(f,o),C(f)}function C(f){f._writableState&&!f._writableState.emitClose||f._readableState&&!f._readableState.emitClose||f.emit("close")}function j(f,o){f.emit("error",o)}Nt.exports={destroy:function(f,o){var u=this,E=this._readableState&&this._readableState.destroyed,m=this._writableState&&this._writableState.destroyed;return E||m?(o?o(f):f&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(j,this,f)):process.nextTick(j,this,f)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(b){!o&&b?u._writableState?u._writableState.errorEmitted?process.nextTick(C,u):(u._writableState.errorEmitted=!0,process.nextTick(Re,u,b)):process.nextTick(Re,u,b):o?(process.nextTick(C,u),o(b)):process.nextTick(C,u)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(f,o){var u=f._readableState,E=f._writableState;u&&u.autoDestroy||E&&E.autoDestroy?f.destroy(o):f.emit("error",o)}}},2896:function(Nt,Re,C){var j=C(1602).F.ERR_STREAM_PREMATURE_CLOSE;function f(){}Nt.exports=function o(u,E,m){if(typeof E=="function")return o(u,null,E);E||(E={}),m=(function(F){var ve=!1;return function(){if(!ve){ve=!0;for(var je=arguments.length,tt=new Array(je),re=0;re<je;re++)tt[re]=arguments[re];F.apply(this,tt)}}})(m||f);var b=E.readable||E.readable!==!1&&u.readable,T=E.writable||E.writable!==!1&&u.writable,Q=function(){u.writable||se()},V=u._writableState&&u._writableState.finished,se=function(){T=!1,V=!0,b||m.call(u)},Y=u._readableState&&u._readableState.endEmitted,ce=function(){b=!1,Y=!0,T||m.call(u)},ge=function(F){m.call(u,F)},Te=function(){var F;return b&&!Y?(u._readableState&&u._readableState.ended||(F=new j),m.call(u,F)):T&&!V?(u._writableState&&u._writableState.ended||(F=new j),m.call(u,F)):void 0},ue=function(){u.req.on("finish",se)};return(function(F){return F.setHeader&&typeof F.abort=="function"})(u)?(u.on("complete",se),u.on("abort",Te),u.req?ue():u.on("request",ue)):T&&!u._writableState&&(u.on("end",Q),u.on("close",Q)),u.on("end",ce),u.on("finish",se),E.error!==!1&&u.on("error",ge),u.on("close",Te),function(){u.removeListener("complete",se),u.removeListener("abort",Te),u.removeListener("request",ue),u.req&&u.req.removeListener("finish",se),u.removeListener("end",Q),u.removeListener("close",Q),u.removeListener("finish",se),u.removeListener("end",ce),u.removeListener("error",ge),u.removeListener("close",Te)}}},3411:function(Nt){Nt.exports=function(){throw new Error("Readable.from is not available in the browser")}},8460:function(Nt,Re,C){var j,f=C(1602).F,o=f.ERR_MISSING_ARGS,u=f.ERR_STREAM_DESTROYED;function E(T){if(T)throw T}function m(T){T()}function b(T,Q){return T.pipe(Q)}Nt.exports=function(){for(var T=arguments.length,Q=new Array(T),V=0;V<T;V++)Q[V]=arguments[V];var se,Y=(function(ge){return ge.length?typeof ge[ge.length-1]!="function"?E:ge.pop():E})(Q);if(Array.isArray(Q[0])&&(Q=Q[0]),Q.length<2)throw new o("streams");var ce=Q.map(function(ge,Te){var ue=Te<Q.length-1;return(function(F,ve,je,tt){tt=(function(he){var we=!1;return function(){we||(we=!0,he.apply(void 0,arguments))}})(tt);var re=!1;F.on("close",function(){re=!0}),j===void 0&&(j=C(2896)),j(F,{readable:ve,writable:je},function(he){if(he)return tt(he);re=!0,tt()});var z=!1;return function(he){if(!re&&!z)return z=!0,(function(we){return we.setHeader&&typeof we.abort=="function"})(F)?F.abort():typeof F.destroy=="function"?F.destroy():void tt(he||new u("pipe"))}})(ge,ue,Te>0,function(F){se||(se=F),F&&ce.forEach(m),ue||(ce.forEach(m),Y(se))})});return Q.reduce(b)}},1749:function(Nt,Re,C){var j=C(1602).F.ERR_INVALID_OPT_VALUE;Nt.exports={getHighWaterMark:function(f,o,u,E){var m=(function(b,T,Q){return b.highWaterMark!=null?b.highWaterMark:T?b[Q]:null})(o,E,u);if(m!=null){if(!isFinite(m)||Math.floor(m)!==m||m<0)throw new j(E?u:"highWaterMark",m);return Math.floor(m)}return f.objectMode?16:16384}}},2611:function(Nt,Re,C){Nt.exports=C(9826).EventEmitter},748:function(Nt,Re,C){var j=C(4598).Buffer,f=j.isEncoding||function(Y){switch((Y=""+Y)&&Y.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(Y){var ce;switch(this.encoding=(function(ge){var Te=(function(ue){if(!ue)return"utf8";for(var F;;)switch(ue){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return ue;default:if(F)return;ue=(""+ue).toLowerCase(),F=!0}})(ge);if(typeof Te!="string"&&(j.isEncoding===f||!f(ge)))throw new Error("Unknown encoding: "+ge);return Te||ge})(Y),this.encoding){case"utf16le":this.text=m,this.end=b,ce=4;break;case"utf8":this.fillLast=E,ce=4;break;case"base64":this.text=T,this.end=Q,ce=3;break;default:return this.write=V,void(this.end=se)}this.lastNeed=0,this.lastTotal=0,this.lastChar=j.allocUnsafe(ce)}function u(Y){return Y<=127?0:Y>>5==6?2:Y>>4==14?3:Y>>3==30?4:Y>>6==2?-1:-2}function E(Y){var ce=this.lastTotal-this.lastNeed,ge=(function(Te,ue){if((192&ue[0])!=128)return Te.lastNeed=0,"\uFFFD";if(Te.lastNeed>1&&ue.length>1){if((192&ue[1])!=128)return Te.lastNeed=1,"\uFFFD";if(Te.lastNeed>2&&ue.length>2&&(192&ue[2])!=128)return Te.lastNeed=2,"\uFFFD"}})(this,Y);return ge!==void 0?ge:this.lastNeed<=Y.length?(Y.copy(this.lastChar,ce,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(Y.copy(this.lastChar,ce,0,Y.length),void(this.lastNeed-=Y.length))}function m(Y,ce){if((Y.length-ce)%2==0){var ge=Y.toString("utf16le",ce);if(ge){var Te=ge.charCodeAt(ge.length-1);if(Te>=55296&&Te<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=Y[Y.length-2],this.lastChar[1]=Y[Y.length-1],ge.slice(0,-1)}return ge}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=Y[Y.length-1],Y.toString("utf16le",ce,Y.length-1)}function b(Y){var ce=Y&&Y.length?this.write(Y):"";if(this.lastNeed){var ge=this.lastTotal-this.lastNeed;return ce+this.lastChar.toString("utf16le",0,ge)}return ce}function T(Y,ce){var ge=(Y.length-ce)%3;return ge===0?Y.toString("base64",ce):(this.lastNeed=3-ge,this.lastTotal=3,ge===1?this.lastChar[0]=Y[Y.length-1]:(this.lastChar[0]=Y[Y.length-2],this.lastChar[1]=Y[Y.length-1]),Y.toString("base64",ce,Y.length-ge))}function Q(Y){var ce=Y&&Y.length?this.write(Y):"";return this.lastNeed?ce+this.lastChar.toString("base64",0,3-this.lastNeed):ce}function V(Y){return Y.toString(this.encoding)}function se(Y){return Y&&Y.length?this.write(Y):""}Re.I=o,o.prototype.write=function(Y){if(Y.length===0)return"";var ce,ge;if(this.lastNeed){if((ce=this.fillLast(Y))===void 0)return"";ge=this.lastNeed,this.lastNeed=0}else ge=0;return ge<Y.length?ce?ce+this.text(Y,ge):this.text(Y,ge):ce||""},o.prototype.end=function(Y){var ce=Y&&Y.length?this.write(Y):"";return this.lastNeed?ce+"\uFFFD":ce},o.prototype.text=function(Y,ce){var ge=(function(ue,F,ve){var je=F.length-1;if(je<ve)return 0;var tt=u(F[je]);return tt>=0?(tt>0&&(ue.lastNeed=tt-1),tt):--je<ve||tt===-2?0:(tt=u(F[je]))>=0?(tt>0&&(ue.lastNeed=tt-2),tt):--je<ve||tt===-2?0:(tt=u(F[je]))>=0?(tt>0&&(tt===2?tt=0:ue.lastNeed=tt-3),tt):0})(this,Y,ce);if(!this.lastNeed)return Y.toString("utf8",ce);this.lastTotal=ge;var Te=Y.length-(ge-this.lastNeed);return Y.copy(this.lastChar,0,Te),Y.toString("utf8",ce,Te)},o.prototype.fillLast=function(Y){if(this.lastNeed<=Y.length)return Y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);Y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,Y.length),this.lastNeed-=Y.length}},4598:function(Nt,Re,C){var j=C(44),f=j.Buffer;function o(E,m){for(var b in E)m[b]=E[b]}function u(E,m,b){return f(E,m,b)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?Nt.exports=j:(o(j,Re),Re.Buffer=u),o(f,u),u.from=function(E,m,b){if(typeof E=="number")throw new TypeError("Argument must not be a number");return f(E,m,b)},u.alloc=function(E,m,b){if(typeof E!="number")throw new TypeError("Argument must be a number");var T=f(E);return m!==void 0?typeof b=="string"?T.fill(m,b):T.fill(m):T.fill(0),T},u.allocUnsafe=function(E){if(typeof E!="number")throw new TypeError("Argument must be a number");return f(E)},u.allocUnsafeSlow=function(E){if(typeof E!="number")throw new TypeError("Argument must be a number");return j.SlowBuffer(E)}},9e3:function(Nt,Re,C){function j(f){try{if(!C.g.localStorage)return!1}catch{return!1}var o=C.g.localStorage[f];return o!=null&&String(o).toLowerCase()==="true"}Nt.exports=function(f,o){if(j("noDeprecation"))return f;var u=!1;return function(){if(!u){if(j("throwDeprecation"))throw new Error(o);j("traceDeprecation")?console.trace(o):console.warn(o),u=!0}return f.apply(this,arguments)}}},3779:function(){},7199:function(){},5393:function(Nt,Re,C){C.d(Re,{KJ:function(){return j.A}});var j=C(4355),f=C(138),o=C(649),u=C(8986),E=typeof window<"u"&&window||typeof globalThis<"u"&&globalThis||{},m=E.dashjs;m||(m=E.dashjs={}),m.MediaPlayer=j.A,m.FactoryMaker=f.A,m.Debug=o.A,m.Version=(0,u.i)(),Re.Ay=m},8735:function(Nt,Re,C){C.d(Re,{Qn:function(){return Y},gz:function(){return sn},tt:function(){return mn}});var j=C(2877),f=C(9259);const o=new Set(["ab","bl","br","bsa","bsd","bsda","lab","lb","mtp","pb","tab","tb","tbl","tpb"]),u={ab:{type:"ot-list",round:1,supersededBy:"br",version:2},bg:{type:"boolean",omitDefault:!1,requiredOn:"b",version:2},bl:{type:"ot-list",round:100},br:{type:"ot-list",round:1,requiredOn:"bc"},bs:{type:"boolean",omitDefault:!1},bsa:{type:"ot-list",round:1,version:2},bsd:{type:"ot-list",round:1,version:2},bsda:{type:"ot-list",round:1,version:2},cdn:{type:"string",max:128,version:2},cen:{type:"string",max:64,mode:"event",onlyOn:"ce",requiredOn:"ce",version:2},cid:{type:"string",max:128,v1Max:64,requiredOn:"c"},cmsdd:{type:"string",mode:"event",onlyOn:"rr",version:2},cmsds:{type:"string",mode:"event",onlyOn:"rr",version:2},cs:{type:"string",version:2},d:{type:"integer",round:1,ot:["a","v","av","tt","c","o"]},dfa:{type:"integer",round:1,version:2},dl:{type:"integer",round:100},e:{type:"token",mode:"event",requiredOn:"always",version:2},ec:{type:"string-list",requiredOn:"e",version:2},h:{type:"string",max:128,mode:"event",requiredOn:"h",version:2},lab:{type:"ot-list",round:1,supersededBy:"lb",version:2},lb:{type:"ot-list",round:1,version:2},ltc:{type:"integer",round:1,version:2},msd:{type:"integer",round:1,version:2},mtp:{type:"ot-list",round:100},nor:{type:"nor"},nr:{type:"boolean",omitDefault:!1,version:2},nrr:{type:"string",version:1},ot:{type:"token"},pb:{type:"ot-list",round:1,version:2},pr:{type:"decimal",omitDefault:1,requiredOn:"pr"},pt:{type:"integer",round:1,version:2},rc:{type:"integer",round:1,mode:"event",onlyOn:"rr",version:2},rtp:{type:"integer",round:100},sf:{type:"token",v1Map:{e:"o"}},sid:{type:"string",max:64},smrt:{type:"string",mode:"event",onlyOn:"rr",version:2},sn:{type:"integer",round:1,version:2},st:{type:"token",v1Map:{ll:"l"}},sta:{type:"token",requiredOn:"ps",version:2},su:{type:"boolean",omitDefault:!1},tab:{type:"ot-list",round:1,supersededBy:"tb",version:2},tb:{type:"ot-list",round:1},tbl:{type:"ot-list",round:100,version:2},tpb:{type:"ot-list",round:1,ot:["a","v","av","c"],version:2},ts:{type:"integer",round:1,mode:"event",requiredOn:"always",version:2},ttfb:{type:"integer",round:1,mode:"event",onlyOn:"rr",version:2},ttfbb:{type:"integer",round:1,mode:"event",onlyOn:"rr",version:2},ttlb:{type:"integer",round:1,mode:"event",onlyOn:"rr",version:2},url:{type:"string",mode:"event",onlyOn:"rr",requiredOn:"rr",version:2},v:{type:"integer",round:1,requiredOn:"always",version:2}},E=2,m="event",b="request",T={REQUEST:b,EVENT:m};function Q(Me){for(const Ce in Me)return!0;return!1}function V(Me,Ce){var Ve;if(Me instanceof j.d5&&(Me=Me.value),!Array.isArray(Me))return Me;let Ne;for(const Ge of Me)if(Ge instanceof j.d5){if(Ce&&((Ve=Ge.params)==null?void 0:Ve[Ce])===!0)return Ge.value;Ne!==void 0||Q(Ge.params)||(Ne=Ge.value)}else Ne===void 0&&(Ne=Ge);return Ne}const se=/^[a-z][a-z0-9.-]*$/;function Y(Me){const Ce=Me.indexOf("-",1);return Ce>0&&Ce<Me.length-1&&se.test(Me)}const ce={type:"custom",omitDefault:!1,max:64,v1Max:1/0};function ge(Me){return Object.prototype.hasOwnProperty.call(u,Me)?u[Me]:Y(Me)?ce:void 0}function Te(Me){return typeof Me=="number"?Number.isFinite(Me):Array.isArray(Me)?Me.length>0:Me!=null&&Me!==""&&Me!==!1}function ue(Me,Ce,Ve){if(typeof Me!="string"||Me==="")return;const Ne=Ce?(0,f.gn)(Me,Ce):Me;return Ve===1?encodeURIComponent(Ne):Ne}function F(Me,Ce,Ve){if(Me instanceof j.d5){const Ne=ue(Me.value,Ce,Ve);return Ne===void 0?void 0:new j.d5(Ne,Me.params)}return ue(Me,Ce,Ve)}function ve(Me,Ce,Ve){const Ne=[];for(const Ge of Me){const st=F(Ge,Ce,Ve);st!==void 0&&Ne.push(st)}return Ne.length>0?Ne:void 0}function je(Me){return Me instanceof j.d5?je(Me.value):typeof Me=="string"?Me:typeof Me=="symbol"||Me instanceof j.P7?(0,j.rI)(Me):void 0}function tt(Me,Ce,Ve){const Ne=(Ve===1?Ce.v1Max:void 0)??Ce.max??1/0;return typeof Me=="string"&&Me!==""&&Me.length<=Ne?Me:void 0}function re(Me,Ce,Ve){switch(Ce.type){case"boolean":return typeof Me=="boolean"?Me:void 0;case"integer":case"ot-list":return typeof Me=="number"&&Number.isFinite(Me)?Math.round(Me/Ce.round)*Ce.round:void 0;case"decimal":return typeof Me=="number"&&Number.isFinite(Me)?Me:void 0;case"string":return tt(Me,Ce,Ve);case"string-list":return typeof Me=="string"&&Me!==""?Me:void 0;case"token":{const Ne=je(Me),Ge=Ve===1?Ce.v1Map:void 0,st=Ne!==void 0&&Ge!==void 0&&Object.prototype.hasOwnProperty.call(Ge,Ne)?Ge[Ne]:Ne;return st?new j.P7(st):void 0}case"custom":return typeof Me=="string"?tt(Me,Ce,Ve):typeof Me=="number"?Number.isFinite(Me)?Me:void 0:Array.isArray(Me)?Me.length>0?Me:void 0:typeof Me=="boolean"||typeof Me=="symbol"||Me instanceof j.P7?Me:void 0;default:return}}function z(Me,Ce,Ve){if(Me instanceof j.d5){const Ne=re(Me.value,Ce,Ve);return Ne===void 0?void 0:new j.d5(Ne,Me.params)}return re(Me,Ce,Ve)}function he(Me,Ce,Ve){return Ce.type==="nor"?(function(Ne,Ge){const st=(function(Pt){if(Pt)try{return new URL((0,f.$_)(Pt)).href}catch{return}})(Ge.baseUrl),nt=Ge.version;if(Array.isArray(Ne))return ve(Ne,st,nt);if(Ne instanceof j.d5&&Array.isArray(Ne.value)){const Pt=ve(Ne.value,st,nt);return Pt&&new j.d5(Pt,Ne.params)}const ft=F(Ne,st,nt);return nt===1||ft===void 0?ft:[ft]})(Me,Ve):Ce.type==="string-list"||Ce.type==="ot-list"&&Ve.version!==1?(function(Ne,Ge,st){const nt=Ne instanceof j.d5&&Array.isArray(Ne.value)?Ne:void 0,ft=nt?nt.value:Array.isArray(Ne)?Ne:[Ne],Pt=[];for(const _t of ft){const Et=z(_t,Ge,st);Et!==void 0&&Pt.push(Et)}if(Pt.length!==0)return nt?new j.d5(Pt,nt.params):Pt})(Me,Ce,Ve.version):z(Me,Ce,Ve.version)}function we(Me){return Me instanceof j.d5?Me.value:Me}function Be(Me,Ce,Ve){return!(Me.mode!==void 0&&Me.mode!==Ce||Me.version!==void 0&&Me.version===1!==Ve)}function pt(Me,Ce){return Me.requiredOn==="always"||Ce!==void 0&&Me.requiredOn===Ce}function ye(Me){return(Me.type==="integer"||Me.type==="ot-list")&&Me.ot!==void 0}function mt(Me,Ce){return Ce===void 0||Me.type!=="integer"&&Me.type!=="ot-list"||Me.ot===void 0||Me.ot.includes(Ce)}function Ze(Me,Ce){return"omitDefault"in Me&&we(Ce)===Me.omitDefault}function He(Me,Ce,Ve){let Ne=0;for(;Ne<Me.length&&Me[Ne]<Ve;)Ne++;Me.splice(Ne,0,Ve),Ce.splice(Ne,0,u[Ve])}function U(Me,Ce,Ve,Ne,Ge){var st;const nt=(st=Ne.formatters)==null?void 0:st[Me];if(typeof nt!="function")return Ce==null?void 0:he(Ce,Ve,Ge);const ft=Te(Ce)?nt(Ce,Ge):Ce;if(Te(ft)||ft===!1&&Ve.type==="boolean"){if(Ve.type==="token"){if(typeof ft=="string")return new j.P7(ft);if(ft instanceof j.d5&&typeof ft.value=="string")return new j.d5(new j.P7(ft.value),ft.params)}return ft}}function Bt(Me,Ce={}){const Ve={};if(Me==null||typeof Me!="object")return Ve;const Ne=Ce.version||we(Me.v)||E,Ge=Ce.reportingMode||b,st=Ne===1,nt=!st&&Ge===m,ft={version:Ne,reportingMode:Ge,baseUrl:Ce.baseUrl},Pt=Ce.filter;let _t,Et;st&&(function($t,At){if(typeof At!="function"||At("ot"))return!0;for(const ct of o)if(Array.isArray(we($t[ct]))&&At(ct))return!0;return!1})(Me,Pt)&&(_t=U("ot",Me.ot,u.ot,Ce,ft),Et=je(_t));const Dt=st?(function($t,At){var ct;const Vt={};for(const[jt,Fe]of Object.entries($t))if(Fe!=null)if(jt==="nor"){const ln=Fe instanceof j.d5&&Array.isArray(Fe.value)?Fe.value:Fe,Pn=Array.isArray(ln)?ln[0]:ln;Pn instanceof j.d5?(Vt.nor=Pn.value,(ct=Pn.params)!=null&&ct.r&&(Vt.nrr=Pn.params.r)):Vt.nor=Pn}else o.has(jt)?Vt[jt]=V(Fe,At):Vt[jt]=Fe;else Vt[jt]=Fe;return Vt})(Me,Et):Me,pn=nt?U("e",Dt.e,u.e,Ce,ft):void 0,cn=je(pn),qt=[],dn=[];let Mn=!1,yn=!1;for(const $t of Object.keys(Dt).sort()){const At=ge($t);if(At!==void 0&&Be(At,Ge,st)){if(typeof Pt!="function"||Pt($t))Mn=!0;else if(!pt(At,cn))continue;At.onlyOn!==void 0&&At.onlyOn!==cn||(($t==="ot"||ye(At))&&(yn=!0),qt.push($t),dn.push(At))}}if(!Mn&&!nt)return Ve;yn&&!st&&(_t=U("ot",Dt.ot,u.ot,Ce,ft),Et=je(_t)),nt&&!qt.includes("ts")&&He(qt,dn,"ts"),st||qt.includes("v")||He(qt,dn,"v");const gn=new Array(qt.length);for(let $t=qt.length-1;$t>=0;$t--){const At=qt[$t],ct=dn[$t];if(ct.type==="ot-list"&&ct.supersededBy!==void 0){const Vt=qt.indexOf(ct.supersededBy,$t+1);if(Vt!==-1&&gn[Vt]!==void 0)continue}if(At==="v"?gn[$t]=Ne:At==="ot"?gn[$t]=_t:At==="e"?gn[$t]=pn:(st||mt(ct,Et))&&(gn[$t]=U(At,Dt[At],ct,Ce,ft)),At==="ts"){const Vt=we(gn[$t]);typeof Vt=="number"&&Number.isFinite(Vt)||(gn[$t]=Date.now())}}for(let $t=0;$t<qt.length;$t++){const At=gn[$t];At===void 0||Ze(dn[$t],At)&&!pt(dn[$t],cn)||(Ve[qt[$t]]=At)}return Ve}const Ut="CMCD-Object",kt="CMCD-Request",Kt="CMCD-Session",on="CMCD-Status",un=kt,hn={ab:Ut,br:Ut,d:Ut,lab:Ut,lb:Ut,ot:Ut,tab:Ut,tb:Ut,tpb:Ut,bl:kt,cs:kt,dfa:kt,dl:kt,ltc:kt,mtp:kt,nor:kt,nrr:kt,pb:kt,sn:kt,sta:kt,su:kt,tbl:kt,cid:Kt,msd:Kt,sf:Kt,sid:Kt,st:Kt,v:Kt,bg:on,bs:on,bsa:on,bsd:on,bsda:on,cdn:on,ec:on,nr:on,pr:on,pt:on,rtp:on};function Le(Me,Ce){const Ve={},Ne=(function(Ge,st){const nt={};if(!Ge)return nt;const ft=Object.keys(Ge),Pt=st?(_t=st,Object.keys(_t).reduce((Et,Dt)=>{var pn;return(pn=_t[Dt])==null||pn.forEach(cn=>Et[cn]=Dt),Et},{})):{};var _t;for(const Et of ft){const Dt=hn[Et]||Pt[Et]||un;(nt[Dt]??(nt[Dt]={}))[Et]=Ge[Et]}return nt})(Me,Ce);for(const[Ge,st]of Object.entries(Ne)){const nt=(0,j.Of)(st,{whitespace:!1});nt&&(Ve[Ge]=nt)}return Ve}function Ee(Me){return(0,j.Of)(Me,{whitespace:!1})}function Tt(Me,Ce={}){return Me?Ee(Bt(Me,Ce)):""}const Ct="CMCD",Ye=/[!'()*]/g,K=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDFFF]/g;function S(Me){return`%${Me.charCodeAt(0).toString(16).toUpperCase()}`}function ae(Me){return Me.length===2?Me:"\uFFFD"}function P(Me){return Me===Ct||Me.startsWith(`${Ct}=`)}function _e(Me,Ce){const Ve=Me.indexOf("#"),Ne=Ve===-1?Me.length:Ve,Ge=Me.indexOf("?"),st=Ge===-1||Ge>Ne?Ne:Ge,nt=[];let ft=Ce?`${Ct}=${(function(Et){let Dt;try{Dt=encodeURIComponent(Et)}catch{Dt=encodeURIComponent(Et.replace(K,ae))}return Dt.replace(Ye,S)})(Ce)}`:"",Pt=!1;for(const Et of st<Ne?Me.slice(st+1,Ne).split("&"):[])P(Et)?(Pt=!0,ft&&(nt.push(ft),ft="")):nt.push(Et);if(ft)nt[nt.length-1]===""&&nt.pop(),nt.push(ft);else if(!Pt)return Me;const _t=nt.join("&");return`${Me.slice(0,st)}${_t?`?${_t}`:""}${Me.slice(Ne)}`}const Ue=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v","ab","bg","bl","br","bs","bsa","bsd","bsda","cdn","cid","cs","d","dfa","dl","ec","lab","lb","ltc","msd","mtp","nor","nr","ot","pb","pr","pt","rtp","sf","sid","sn","st","sta","su","tab","tb","tbl","tpb","v","cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url","cen","e","h","ts"].filter((Me,Ce,Ve)=>Ve.indexOf(Me)===Ce),Pe=Symbol.for("@svta/cml-cmcd/request-provenance"),Je="t",g="rr",y={BITRATE_CHANGE:"bc",PLAY_STATE:"ps",PLAYBACK_RATE:"pr",ERROR:"e",TIME_INTERVAL:Je,CONTENT_ID:"c",BACKGROUNDED_MODE:"b",MUTE:"m",UNMUTE:"um",PLAYER_EXPAND:"pe",PLAYER_COLLAPSE:"pc",RESPONSE_RECEIVED:g,AD_START:"as",AD_END:"ae",AD_BREAK_START:"abs",AD_BREAK_END:"abe",SKIP:"sk",CUSTOM_EVENT:"ce"},R=new Map([["ps","sta"],["pr","pr"],["c","cid"],["b","bg"],["bc","br"]]),ne="query",Z="headers",de={JSON:"json",QUERY:ne,HEADERS:Z};function qe(Me,Ce){return Array.isArray(Me)?Me.map(Ve=>qe(Ve,Ce)):typeof Me=="symbol"?Ce===void 0?(0,j.rI)(Me):Me:Me instanceof j.d5?Me.params?new j.d5(qe(Me.value,Ce),Me.params):qe(Me.value,Ce):Me}function yt(Me,Ce){if(!Me)return{};const Ve=(0,j.A2)(Me,Ce),Ne={};for(const[Ge,st]of Object.entries(Ve))Ne[Ge]=qe(st,Ce?.useSymbol);return Ce!=null&&Ce.convertToLatest?(function(Ge){if(we(Ge.v)===E)return Ge;const st={};for(const[nt,ft]of Object.entries(Ge))ft!=null?o.has(nt)&&!Array.isArray(we(ft))?st[nt]=[ft]:st[nt]=nt==="nor"&&typeof ft=="string"?[ft]:ft:st[nt]=ft;return st})(Ne):Ne}function Lt(Me,Ce,Ve){const Ne=new Set(Ce.enabledKeys??[]);return{version:Ce.version||E,reportingMode:Me,filter:Ge=>Ne.has(Ge),baseUrl:Ve,customHeaderMap:Ce.customHeaderMap}}function Ft(Me,Ce){const Ve=we(Me),Ne=we(Ce);return Array.isArray(Ve)&&Array.isArray(Ne)?(function(Ge,st){if(Ge===st)return!0;if(Ge.length!==st.length)return!1;for(let nt=0;nt<Ge.length;nt++){const ft=Ge[nt],Pt=st[nt];if(ft===Pt)continue;if((typeof ft=="number"?ft:ft.value)!==(typeof Pt=="number"?Pt:Pt.value))return!1;const _t=typeof ft=="number"?void 0:ft.params,Et=typeof Pt=="number"?void 0:Pt.params,Dt=_t&&Object.keys(_t)[0],pn=Et&&Object.keys(Et)[0];if(Dt!==pn||Dt!==void 0&&pn!==void 0&&_t&&Et&&_t[Dt]!==Et[pn])return!1}return!0})(Ve,Ne):Object.is(Me,Ce)}const X=Object.is,De=Me=>Me,it=Array.from(R,([Me,Ce])=>Ce==="br"?{event:Me,field:Ce,equal:Ft,snapshot:Ve=>Array.isArray(Ve)?Ve.slice():Yt(Ve)}:{event:Me,field:Ce,equal:X,snapshot:De}),dt=new Map(it.map(Me=>[Me.event,Me]));function It(){return new Map([...R,["ce","cen"],["e","ec"],[g,"url"]])}const lt=It();function Yt(Me){if(Me===null||typeof Me!="object")return Me;const Ce=Object.assign(Object.create(Object.getPrototypeOf(Me)),Me);return Ce.params!==null&&typeof Ce.params=="object"&&(Ce.params={...Ce.params}),Array.isArray(Ce.value)&&(Ce.value=Ce.value.map(Yt)),Ce}function Xt(Me){const Ce=Me;for(const Ve in Ce){const Ne=Ce[Ve];if(Array.isArray(Ne)){const Ge=new Array(Ne.length);for(let st=0;st<Ne.length;st++)Ge[st]=Yt(Ne[st]);Ce[Ve]=Ge}else Ne!==null&&typeof Ne=="object"&&(Ce[Ve]=Yt(Ne))}return Me}function Zt(Me,Ce){return Object.freeze(typeof Ce=="string"&&Ce?{sid:Me,cid:Ce}:{sid:Me})}function Gt(Me){const{url:Ce,...Ve}=Me;return fetch(Ce,Ve)}var mn=class{constructor(Me,Ce=Gt){var Ve;this.timeOrigin=performance.timeOrigin||((Ve=performance.timing)==null?void 0:Ve.fetchStart)||Date.now()-performance.now(),this.sessions=new Map,this.intervals=new Map,this.started=!1,this.config=(function(Ne){const{version:Ge=E,eventTargets:st=[],sid:nt=(0,f.uR)(),transmissionMode:ft=ne,...Pt}=Ne,_t=Ne.sessionRetention,Et=typeof _t=="number"?Math.floor(_t):NaN;return{...Pt,version:Ge,transmissionMode:ft,sid:nt,sessionRetention:Et>=0?Et:2,eventTargets:st.reduce((Dt,pn)=>{var cn,qt;return pn!=null&&pn.url&&(cn=pn.events)!=null&&cn.length&&Dt.push({version:pn.version||E,enabledKeys:((qt=pn.enabledKeys)==null?void 0:qt.slice())||[],url:pn.url,events:pn.events.slice(),interval:pn.interval??30,batchSize:pn.batchSize||1,transform:pn.transform}),Dt},[])}})(Me),this.session=this.createSession(this.config.sid,{cid:this.config.cid,v:this.config.version}),this.sessions.set(this.session.sid,this.session),this.requester=Ce}createSession(Me,Ce){const Ve=new Map;for(const Ne of this.config.eventTargets)Ve.set(Ne,{sn:0,msdSent:!1,queue:[],disposed:!1});return{sid:Me,provenance:Zt(Me,Ce.cid),data:Ce,msd:NaN,lastEmitted:we(Ce.bg)===!0?{}:{bg:!1},eventTargets:Ve,requestTarget:{sn:0,msdSent:!1}}}start(){let Me;this.started=!0;const Ce=this.session;if(Ce.eventTargets.forEach((Ve,Ne)=>{if(this.disarmInterval(Ne),!Ve.disposed&&this.armInterval(Ne))try{this.recordTargetEvent(Ce,Ve,Ne,Je),this.processEventTargets()}catch(Ge){Me??(Me={error:Ge})}}),Me)throw Me.error}armInterval(Me){return!(Me.interval===0||!Me.events.includes(Je)||(this.intervals.set(Me,setInterval(()=>{const Ce=this.session,Ve=Ce.eventTargets.get(Me);Ve&&(this.recordTargetEvent(Ce,Ve,Me,Je),this.processEventTargets())},1e3*Me.interval)),0))}stop(Me=!1){this.started=!1,Me&&this.flush();for(const Ce of this.config.eventTargets)this.disarmInterval(Ce)}flush(){this.processEventTargets(!0)}update(Me){Me.sid&&Me.sid!==this.session.sid&&this.startSession(Me.sid);const Ce=this.session,{msd:Ve}=Me;if(typeof Ve=="number"&&Number.isFinite(Ve)&&Ve>=0){const Ne=Math.round(Ve);Ne<=999999999999999&&(Ce.msd=Ne)}Ce.data={...Ce.data,...Me,sid:void 0,msd:void 0},Ce.data.cid!==Ce.provenance.cid&&(Ce.provenance=Zt(Ce.sid,Ce.data.cid));for(const Ne of it)Ne.field in Me&&!Ne.equal(Ce.data[Ne.field],Ce.lastEmitted[Ne.field])&&this.recordEvent(Ne.event)}startSession(Me){this.session.data=Xt({...this.session.data}),this.session=this.createSession(Me,{...this.session.data}),this.sessions.delete(Me),this.sessions.set(Me,this.session),this.processEventTargets();for(const Ce of this.sessions.keys()){if(this.sessions.size<=this.config.sessionRetention+1)break;this.sessions.delete(Ce)}if(this.started)for(const Ce of this.config.eventTargets)this.intervals.has(Ce)||this.armInterval(Ce)}recordEvent(Me,Ce={}){this.emitEvent(this.session,Me,Ce)}emitEvent(Me,Ce,Ve,Ne){const Ge=dt.get(Ce);if(Ge){const nt=Ge.field,ft=Ve[nt];ft!==void 0&&Object.assign(Me.data,{[nt]:ft});const Pt=Me.data[nt];if(Pt===void 0||Ge.equal(Pt,Me.lastEmitted[nt]))return;Object.assign(Me.lastEmitted,{[nt]:Ge.snapshot(Pt)})}let st;if(Me.eventTargets.forEach((nt,ft)=>{try{this.recordTargetEvent(Me,nt,ft,Ce,Ve,Ne)}catch(Pt){st??(st={error:Pt})}}),this.processEventTargets(),st)throw st.error}recordTargetEvent(Me,Ce,Ve,Ne,Ge={},st){if(Ce.disposed||!Ve.events.includes(Ne))return;const nt={...Me.data,...Ge,sid:Me.sid,e:Ne,ts:Ge.ts??Date.now()};Ne==="b"&&we(nt.bg)===!1&&delete nt.bg;const{transform:ft}=Ve;if(!ft)return void this.queueTargetEvent(Me,Ce,Ve,nt,Ne);Xt(nt);const Pt=lt.get(Ne),_t=Pt?nt[Pt]:void 0,Et=nt.ts,Dt=ft(nt,st);Dt!=null&&(Te(Dt.ts)||(Dt.ts=Et),Pt&&Te(_t)&&!Te(Dt[Pt])&&Object.assign(Dt,{[Pt]:_t}),this.queueTargetEvent(Me,Ce,Ve,Dt,Ne))}queueTargetEvent(Me,Ce,Ve,Ne,Ge){var st;Ne.e=Ge,Ne.sn=Ce.sn++,Ne.sid=Me.sid,isNaN(Me.msd)||Ce.msdSent||!((st=Ve.enabledKeys)!=null&&st.includes("msd"))?delete Ne.msd:(Ne.msd=Me.msd,Ce.msdSent=!0),Ce.queue.push(Tt(Ne,Lt(m,Ve)))}recordResponseReceived(Me,Ce={}){var Ve,Ne;const{request:Ge}=Me,st=Ce.url??Ge?.url;if(!st)return;const nt=(Ve=Ge.customData)==null?void 0:Ve[Pe],ft=nt===void 0?this.session:this.resolveSession(nt);if(!ft)return;const Pt=nt===void 0?{...(Ne=Ge.customData)==null?void 0:Ne.cmcd}:(function(pn){const cn=pn!==null&&typeof pn=="object"?pn.data:void 0;if(typeof cn!="string"||!cn)return{};try{return yt(cn,{useSymbol:!1})}catch{return{}}})(nt),{cid:_t}=nt??{},Et={url:_e(st),rc:Me.status},Dt=Me.resourceTiming;Dt&&(Dt.startTime!=null&&(Et.ts=Math.round(this.timeOrigin+Dt.startTime),Dt.responseStart!=null&&(Et.ttfb=Math.round(Dt.responseStart-Dt.startTime))),Dt.duration!=null&&(Et.ttlb=Math.round(Dt.duration))),this.emitEvent(ft,g,{...typeof _t=="string"&&_t?{cid:_t}:void 0,...Pt,...Et,...Ce},Ge)}resolveSession(Me){if(Me===null||typeof Me!="object")return;const{sid:Ce}=Me;return typeof Ce=="string"?this.sessions.get(Ce):void 0}applyRequestReport(Me){return this.createRequestReport(Me)??Me}isRequestReportingEnabled(){var Me;return!!((Me=this.config.enabledKeys)!=null&&Me.length)}createRequestProvenance(Me,Ce){const Ve=this.session.provenance;if(!Me)return Ve;try{const Ne=Tt(Me,{version:this.config.version,reportingMode:b,baseUrl:Ce});return Ne?Object.freeze({...Ve,data:Ne}):Ve}catch{return Ve}}createRequestReport(Me,Ce){var Ve;const{customData:Ne={},headers:Ge={},...st}=Me,nt={...st,headers:{...Ge},customData:{...Ne,cmcd:{},[Pe]:this.createRequestProvenance(Ce,Me.url)}};if(!((Ve=this.config.enabledKeys)!=null&&Ve.length)||!nt.url)return nt;const ft=this.session,Pt={...ft.data,...Ce,sid:ft.sid},{transform:_t}=this.config;let Et=Pt;if(_t&&(Xt(Pt),Et=_t(Pt,Me),Et==null))return nt;Et.sn=ft.requestTarget.sn++,Et.sid=ft.sid;const Dt=!isNaN(ft.msd)&&!ft.requestTarget.msdSent;Dt?Et.msd=ft.msd:delete Et.msd;const pn=Lt(b,this.config,nt.url),cn=nt.customData.cmcd=Xt(Bt(Et,pn));Dt&&cn.msd!==void 0&&(ft.requestTarget.msdSent=!0);const qt=Ee(cn);switch(this.config.transmissionMode){case ne:qt&&(nt.url=_e(nt.url,qt));break;case Z:Object.assign(nt.headers,Le(cn,pn.customHeaderMap))}return nt}processEventTargets(Me=!1){let Ce=!1;this.sessions.forEach(Ve=>{const Ne=Me||Ve!==this.session;Ve.eventTargets.forEach((Ge,st)=>{const{queue:nt}=Ge;if(Ge.disposed||!nt.length||nt.length<st.batchSize&&!Ne)return;const ft=Ne?nt.length:st.batchSize,Pt=nt.splice(0,ft);this.sendEventReport(Ve,st,Pt).catch(()=>{Ge.queue.unshift(...Pt)}),Ce||(Ce=nt.length>0)})}),Ce&&this.processEventTargets()}async sendEventReport(Me,Ce,Ve){const{status:Ne}=await this.requester({url:Ce.url,method:"POST",headers:{"Content-Type":"application/cmcd"},body:Ve.join(`
10
+ `)});if(Ne===410)this.disposeEventTarget(Me,Ce);else if(Ne===429||Ne>499&&Ne<600)throw new Error(`Event report failed with status ${Ne}`)}disarmInterval(Me){clearInterval(this.intervals.get(Me)),this.intervals.delete(Me)}disposeEventTarget(Me,Ce){Me.eventTargets.forEach((Ve,Ne)=>{Ne.url!==Ce.url||Ve.disposed||(Ve.disposed=!0,Ve.queue.length=0,Me===this.session&&this.disarmInterval(Ne))})}};function sn(Me,Ce){return new j.d5(Me,Ce)}C.d(Re,["I$",0,{STARTING:"s",PLAYING:"p",SEEKING:"k",REBUFFERING:"r",PAUSED:"a",WAITING:"w",ENDED:"e",FATAL_ERROR:"f",QUIT:"q",PRELOADING:"d"},"LA",0,T,"WJ",0,y,"YM",0,{VOD:"v",LIVE:"l",LOW_LATENCY:"ll"},"dp",0,Z,"hU",0,{MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},"pv",0,Ue,"x_",0,de,"xq",0,{DASH:"d",HLS:"h",SMOOTH:"s",OTHER:"o"}])},1103:function(Nt,Re,C){C.d(Re,{aD:function(){return E},nt:function(){return u}});var j=C(6390),f=C(2877);const o=j.QA;function u(m){return m?(0,f.Ov)(m):[]}function E(m){return m?Object.entries((0,f.A2)(m)).reduce((b,[T,Q])=>{const{value:V}=Q;return b[T]=typeof V=="symbol"?(0,f.rI)(V):V,b},{}):{}}C.d(Re,["Nw",0,o,"Pb",0,"CMSD-Static","uu",0,"CMSD-Dynamic"])},6390:function(Nt,Re,C){C.d(Re,["QA",0,{MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"}])},2877:function(Nt,Re,C){C.d(Re,{A2:function(){return ye},Of:function(){return K},Ov:function(){return Ze},P7:function(){return je},d5:function(){return f},rI:function(){return Kt}});var j=C(9259),f=class $i{constructor(ae,P){Array.isArray(ae)&&(ae=ae.map(_e=>_e instanceof $i?_e:new $i(_e))),this.value=ae,this.params=P}};const o="Dict";function u(S,ae){return{value:S,src:ae}}function E(S,ae,P,_e){return new Error(`failed to ${S} "${Ue=ae,Array.isArray(Ue)?JSON.stringify(Ue):Ue instanceof Map?"Map{}":Ue instanceof Set?"Set{}":typeof Ue=="object"?JSON.stringify(Ue):String(Ue)}" as ${P}`,{cause:_e});var Ue}function m(S,ae,P){return E("parse",S,ae,P)}const b="Inner List",T="Bare Item",Q="Boolean",V="Byte Sequence",se="Date",Y="Decimal",ce="Integer";function ge(S){return S<-999999999999999||999999999999999<S}function Te(S){return m(S,`${ce} or ${Y}`)}function ue(S){const ae=S;let P,_e=1,Ue="";if(S[0]==="-"&&(_e=-1,S=S.substring(1)),S.length<=0)throw Te(ae);const Pe=/^(\d+)?/g,Je=Pe.exec(S);if(Je[0].length===0)throw Te(ae);if(Ue+=Je[1],(S=S.substring(Pe.lastIndex))[0]==="."){if(Ue.length>12)throw Te(ae);const g=/^(\.\d+)?/g,y=g.exec(S);if(S=S.substring(g.lastIndex),y[0].length===0||y[1].length>4||(Ue+=y[1],Ue.length>16))throw Te(ae);P=parseFloat(Ue)*_e}else{if(Ue.length>15)throw Te(ae);if(P=parseInt(Ue)*_e,ge(P))throw Te(Ue)}return u(P,S)}const F="String",ve=/[\x00-\x1f\x7f]+/;var je=class{constructor(S){this.description=S}};const tt="Token";function re(S,ae){const P=S[0];if(P==='"')return(function(_e){let Ue="",Pe=0;if(_e[Pe]!=='"')throw m(_e,F);for(Pe++;_e.length>Pe;){if(_e[Pe]==="\\"){if(_e.length<=Pe+1||(Pe++,_e[Pe]!=='"'&&_e[Pe]!=="\\"))throw m(_e,F);Ue+=_e[Pe]}else{if(_e[Pe]==='"')return u(Ue,_e.substring(++Pe));if(ve.test(_e[Pe]))throw m(_e,F);Ue+=_e[Pe]}Pe++}throw m(_e,F)})(S);if(/^[-0-9]/.test(P))return ue(S);if(P==="?")return(function(_e){let Ue=0;if(_e[Ue]!=="?")throw m(_e,Q);if(Ue++,_e[Ue]==="1")return u(!0,_e.substring(++Ue));if(_e[Ue]==="0")return u(!1,_e.substring(++Ue));throw m(_e,Q)})(S);if(P===":")return(function(_e){if(_e[0]!==":"||(_e=_e.substring(1)).includes(":")===!1)throw m(_e,V);const Ue=/(^.*?)(:)/g,Pe=Ue.exec(_e)[1];return _e=_e.substring(Ue.lastIndex),u((0,j.y4)(Pe),_e)})(S);if(/^[a-zA-Z*]/.test(P))return(function(_e,Ue){if(/^[a-zA-Z*]$/.test(_e[0])===!1)throw m(_e,tt);const Pe=/^([!#$%&'*+\-.^_`|~\w:/]+)/g,Je=Pe.exec(_e)[1];return _e=_e.substring(Pe.lastIndex),u(Ue?.useSymbol===!1?new je(Je):Symbol.for(Je),_e)})(S,ae);if(P==="@")return(function(_e){let Ue=0;if(_e[Ue]!=="@")throw m(_e,se);Ue++;const Pe=ue(_e.substring(Ue));if(Number.isInteger(Pe.value)===!1)throw m(_e,se);return u(new Date(1e3*Pe.value),Pe.src)})(S);throw m(S,T)}const z="Key";function he(S){let ae=0;if(/^[a-z*]$/.test(S[ae])===!1)throw m(S,z);let P="";for(;S.length>ae;){if(/^[a-z0-9_\-.*]$/.test(S[ae])===!1)return u(P,S.substring(ae));P+=S[ae],ae++}return u(P,S.substring(ae))}function we(S,ae){let P;for(;S.length>0&&S[0]===";";){const _e=he(S=S.substring(1).trim()),Ue=_e.value;let Pe=!0;if((S=_e.src)[0]==="="){const Je=re(S=S.substring(1),ae);Pe=Je.value,S=Je.src}P==null&&(P={}),P[Ue]=Pe}return u(P,S)}function Be(S,ae){const P=re(S,ae),_e=we(S=P.src,ae);return S=_e.src,u(new f(P.value,_e.value),S)}function pt(S,ae){return S[0]==="("?(function(P,_e){if(P[0]!=="(")throw m(P,b);P=P.substring(1);const Ue=[];for(;P.length>0;){if((P=P.trim())[0]===")"){const Je=we(P=P.substring(1),_e);return u(new f(Ue,Je.value),Je.src)}const Pe=Be(P,_e);if(Ue.push(Pe.value),(P=Pe.src)[0]!==" "&&P[0]!==")")throw m(P,b)}throw m(P,b)})(S,ae):Be(S,ae)}function ye(S,ae){try{const{src:P,value:_e}=(function(Ue,Pe){const Je={};for(;Ue.length>0;){let g;const y=he(Ue),R=y.value;if((Ue=y.src)[0]==="="){const ne=pt(Ue.substring(1),Pe);g=ne.value,Ue=ne.src}else{const ne=we(Ue,Pe);g=new f(!0,ne.value),Ue=ne.src}if(Je[R]=g,(Ue=Ue.trim()).length===0)return u(Je,Ue);if(Ue[0]!==","||(Ue=Ue.substring(1).trim()).length===0||Ue[0]===",")throw m(Ue,o)}return u(Je,Ue)})(S.trim(),ae);if(P!=="")throw m(P,o);return _e}catch(P){throw m(S,o,P)}}const mt="List";function Ze(S,ae){try{const{src:P,value:_e}=(function(Ue,Pe){const Je=[];for(;Ue.length>0;){const g=pt(Ue,Pe);if(Je.push(g.value),(Ue=g.src.trim()).length===0)return u(Je,Ue);if(Ue[0]!==","||(Ue=Ue.substring(1).trim()).length===0||Ue[0]===",")throw m(Ue,mt)}return u(Je,Ue)})(S.trim(),ae);if(P!=="")throw m(P,mt);return _e}catch(P){throw m(S,mt,P)}}function He(S,ae,P){return E("serialize",S,ae,P)}function U(S){if(ge(S))throw He(S,ce);return S.toString()}const Bt=/[\x00-\x1f\x7f"\\]/,Ut=/\\/g,kt=/"/g;function Kt(S){return S.description||S.toString().slice(7,-1)}const on=/^[a-zA-Z*][!#$%&'*+\-.^_`|~\w:/]*$/;function un(S){const ae=Kt(S);if(on.test(ae)===!1)throw He(ae,tt);return ae}function hn(S){switch(typeof S){case"number":if(!Number.isFinite(S))throw He(S,T);return Number.isInteger(S)?U(S):(function(ae){const P=(0,j.ut)(ae,3);if(Math.abs(P)>=1e12)throw He(ae,Y);const _e=P.toString();return _e.includes(".")?_e:`${_e}.0`})(S);case"string":return(function(ae){if(Bt.test(ae)===!1)return`"${ae}"`;if(ve.test(ae))throw He(ae,F);return`"${ae.replace(Ut,"\\\\").replace(kt,'\\"')}"`})(S);case"symbol":return un(S);case"boolean":return(function(ae){if(typeof ae!="boolean")throw He(ae,Q);return ae?"?1":"?0"})(S);case"object":if(S instanceof Date)return(function(ae){return`@${U(ae.getTime()/1e3)}`})(S);if(S instanceof Uint8Array)return(function(ae){if(ArrayBuffer.isView(ae)===!1)throw He(ae,V);return`:${(0,j.WG)(ae)}:`})(S);if(S instanceof je)return un(S);default:throw He(S,T)}}function Le(S){if(typeof S!="string"||S.length===0)throw He(S,z);let ae=S.charCodeAt(0);if((ae<97||ae>122)&&ae!==42)throw He(S,z);for(let P=1;P<S.length;P++)if(ae=S.charCodeAt(P),(ae<97||ae>122)&&(ae<48||ae>57)&&ae!==95&&ae!==45&&ae!==46&&ae!==42)throw He(S,z);return S}function Ee(S){if(S==null)return"";let ae="";for(const P of Object.keys(S)){const _e=S[P];ae+=`;${Le(P)}`,_e!==!0&&(ae+=`=${hn(_e)}`)}return ae}function Tt(S){return S instanceof f?`${hn(S.value)}${Ee(S.params)}`:hn(S)}function Ct(S,ae){let P;Array.isArray(S)?P=S:(P=S.value,ae=S.params);let _e="(";for(let Ue=0;Ue<P.length;Ue++)Ue>0&&(_e+=" "),_e+=Tt(P[Ue]);return`${_e})${Ee(ae)}`}function Ye(S,ae){const P=Le(S);if(ae instanceof f){const{value:_e,params:Ue}=ae;return _e===!0?`${P}${Ee(Ue)}`:Array.isArray(_e)?`${P}=${Ct(_e,Ue)}`:`${P}=${hn(_e)}${Ee(Ue)}`}return ae===!0?P:Array.isArray(ae)?`${P}=${Ct(ae)}`:`${P}=${hn(ae)}`}function K(S,ae){return(function(P,_e){if(typeof P!="object"||P==null)throw He(P,o);const Ue=[];if(P instanceof Map)P.forEach((Pe,Je)=>Ue.push(Ye(Je,Pe)));else for(const Pe of Object.keys(P))Ue.push(Ye(Pe,P[Pe]));return Ue.join(_e?.whitespace===!1?",":", ")})(S,ae)}},9259:function(Nt,Re,C){function j(ue){return new Uint8Array([...atob(ue)].map(F=>F.charCodeAt(0)))}C.d(Re,{$_:function(){return V},B1:function(){return u},Uh:function(){return ce},WG:function(){return o},g7:function(){return Q},gn:function(){return ge},uR:function(){return Te},ut:function(){return se},y4:function(){return j}});const f=32768;function o(ue){let F="";for(let ve=0;ve<ue.length;ve+=f){const je=ue.subarray(ve,ve+f);F+=String.fromCharCode.apply(null,je)}return btoa(F)}function u(ue){return ue instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&ue instanceof SharedArrayBuffer}const E="utf-16",m="utf-16be",b="utf-16le",T="utf-8";function Q(ue,F={}){let ve;ve=u(ue)?new DataView(ue):new DataView(ue.buffer,ue.byteOffset,ue.byteLength);let je=0,{encoding:tt}=F;if(!tt){const Be=ve.getUint8(0),pt=ve.getUint8(1);Be==239&&pt==187&&ve.getUint8(2)==191?(tt=T,je=3):Be==254&&pt==255?(tt=m,je=2):Be==255&&pt==254?(tt=b,je=2):tt=T}if(typeof TextDecoder<"u")return new TextDecoder(tt).decode(ve);const{byteLength:re}=ve,z=tt!==m;let he,we="";for(;je<re;){switch(tt){case T:if(he=ve.getUint8(je),he<128)je++;else if(he>=194&&he<=223)if(je+1<re){const Be=ve.getUint8(je+1);Be>=128&&Be<=191?(he=(31&he)<<6|63&Be,je+=2):je++}else je++;else if(he>=224&&he<=239)if(je+2<=re-1){const Be=ve.getUint8(je+1),pt=ve.getUint8(je+2);Be>=128&&Be<=191&&pt>=128&&pt<=191?(he=(15&he)<<12|(63&Be)<<6|63&pt,je+=3):je++}else je++;else if(he>=240&&he<=244)if(je+3<=re-1){const Be=ve.getUint8(je+1),pt=ve.getUint8(je+2),ye=ve.getUint8(je+3);Be>=128&&Be<=191&&pt>=128&&pt<=191&&ye>=128&&ye<=191?(he=(7&he)<<18|(63&Be)<<12|(63&pt)<<6|63&ye,je+=4):je++}else je++;else je++;break;case m:case E:case b:he=ve.getUint16(je,z),je+=2}we+=String.fromCodePoint(he)}return we}function V(ue){const F=typeof ue=="string"?new URL(ue):ue;return F.origin+F.pathname.substring(0,F.pathname.lastIndexOf("/")+1)}function se(ue,F){if(ue<0)return-se(-ue,F);const ve=Math.pow(10,F);if(Math.abs(ue*ve%1-.5)<Number.EPSILON){const je=Math.floor(ue*ve);return(je%2==0?je:je+1)/ve}return Math.round(ue*ve)/ve}const Y=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g;function ce(ue){return ue.indexOf("&")===-1?ue:ue.replace(Y,F=>{switch(F){case"&amp;":return"&";case"&lt;":return"<";case"&gt;":return">";case"&quot;":return'"';case"&apos;":return"'";case"&nbsp;":return"\xA0";case"&lrm;":return"\u200E";case"&rlm;":return"\u200F";default:if(F[1]==="#"){const ve=F[2]==="x"||F[2]==="X"?parseInt(F.slice(3),16):parseInt(F.slice(2),10);return String.fromCodePoint(ve)}return F}})}function ge(ue,F){let ve;try{ve=new URL(ue)}catch{return ue}const je=new URL(F);if(ve.origin!==je.origin)return ue;const tt=ve.pathname.split("/").slice(1),re=je.pathname.split("/").slice(1,-1);let z=0;for(;z<tt.length-1&&z<re.length&&tt[z]===re[z];)z++;const he=re.length-z;let we="../".repeat(he)+tt.slice(z).join("/");return he===0&&(we===""||we.startsWith("/")||tt[z].includes(":"))&&(we="./"+we),we+ve.search+ve.hash}function Te(){try{return crypto.randomUUID()}catch{try{const ue=crypto.getRandomValues(new Uint8Array(16));return ue[6]=15&ue[6]|64,ue[8]=63&ue[8]|128,(function(F){return new Uint8Array(F).reduce((ve,je)=>ve+je.toString(16).padStart(2,"0"),"")})(ue.buffer).replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5")}catch{const ue=URL.createObjectURL(new Blob),F=ue.toString();return URL.revokeObjectURL(ue),F.slice(F.lastIndexOf("/")+1)}}}},649:function(Nt,Re,C){var j=C(8850),f=C(3621),o=C(138);function u(m){m=m||{};const b=this.context,T=(0,j.A)(b).getInstance(),Q=m.settings,V=[];let se,Y,ce,ge;function Te(z){return z&&z.bind?z.bind(window.console):window.console.log.bind(window.console)}function ue(...z){re(1,this,...z)}function F(...z){re(2,this,...z)}function ve(...z){re(3,this,...z)}function je(...z){re(4,this,...z)}function tt(...z){re(5,this,...z)}function re(z,he,...we){let Be="",pt=null;Y&&(pt=new Date().getTime(),Be+="["+(pt-ge)+"]"),ce&&he&&he.getClassName&&(Be+="["+he.getClassName()+"]",he.getType&&(Be+="["+he.getType()+"]")),Be.length>0&&(Be+=" "),Array.apply(null,we).forEach(function(ye){Be+=ye+" "}),V[z]&&Q&&Q.get().debug.logLevel>=z&&V[z](Be),Q&&Q.get().debug.dispatchEvent&&T.trigger(f.A.LOG,{message:Be,level:z})}return se={getLogger:function(z){return{fatal:ue.bind(z),error:F.bind(z),warn:ve.bind(z),info:je.bind(z),debug:tt.bind(z)}},setLogTimestampVisible:function(z){Y=z},setCalleeNameVisible:function(z){ce=z}},Y=!0,ce=!0,ge=new Date().getTime(),typeof window<"u"&&window.console&&(V[1]=Te(window.console.error),V[2]=Te(window.console.error),V[3]=Te(window.console.warn),V[4]=Te(window.console.info),V[5]=Te(window.console.debug)),se}u.__dashjs_factory_name="Debug";const E=o.A.getSingletonFactory(u);E.LOG_LEVEL_NONE=0,E.LOG_LEVEL_FATAL=1,E.LOG_LEVEL_ERROR=2,E.LOG_LEVEL_WARNING=3,E.LOG_LEVEL_INFO=4,E.LOG_LEVEL_DEBUG=5,o.A.updateSingletonFactory(u.__dashjs_factory_name,E),Re.A=E},8850:function(Nt,Re,C){var j=C(138),f=C(1191);function o(){let E={};function m(Q,V,se,Y={},ce=!1){if(!Q)throw new Error("event type cannot be null or undefined");if(!V||typeof V!="function")throw new Error("listener must be a function: "+V);let ge=Y.priority||0;if(T(Q,V,se)>=0)return;E[Q]=E[Q]||[];const Te={callback:V,scope:se,priority:ge,executeOnlyOnce:ce};se&&se.getStreamId&&(Te.streamId=se.getStreamId()),se&&se.getType&&(Te.mediaType=se.getType()),Y&&Y.mode&&(Te.mode=Y.mode),E[Q].some((ue,F)=>{if(ue&&ge>ue.priority)return E[Q].splice(F,0,Te),!0})||E[Q].push(Te)}function b(Q,V,se){if(!Q||!V||!E[Q])return;const Y=T(Q,V,se);Y<0||E[Q].splice(Y,1)}function T(Q,V,se){let Y=-1;return E[Q]&&E[Q].some((ce,ge)=>{if(ce&&ce.callback===V&&(!se||se===ce.scope))return Y=ge,!0}),Y}return{on:function(Q,V,se,Y={}){m(Q,V,se,Y)},once:function(Q,V,se,Y={}){m(Q,V,se,Y,!0)},off:b,trigger:function(Q,V={},se={}){if(!Q||!E[Q])return;if((V=V||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");V.type=Q,se.streamId&&(V.streamId=se.streamId),se.mediaType&&(V.mediaType=se.mediaType);const Y=[];E[Q].filter(ce=>!(!ce||se.streamId&&ce.streamId&&ce.streamId!==se.streamId||se.mediaType&&ce.mediaType&&ce.mediaType!==se.mediaType||se.mode&&ce.mode&&ce.mode!==se.mode||!ce.mode&&se.mode&&se.mode===f.A.EVENT_MODE_ON_RECEIVE)).forEach(ce=>{ce&&ce.callback.call(ce.scope,V),ce.executeOnlyOnce&&Y.push(ce)}),Y.forEach(ce=>{b(Q,ce.callback,ce.scope)})},reset:function(){E={}}}}o.__dashjs_factory_name="EventBus";const u=j.A.getSingletonFactory(o);u.EVENT_PRIORITY_LOW=0,u.EVENT_PRIORITY_HIGH=5e3,j.A.updateSingletonFactory(o.__dashjs_factory_name,u),Re.A=u},138:function(Nt,Re){const C=(function(){let j,f=[];const o={},u={};function E(Q,V){for(const se in f){const Y=f[se];if(Y.context===Q&&Y.name===V)return Y.instance}return null}function m(Q,V){return V[Q]}function b(Q,V,se){Q in se&&(se[Q]=V)}function T(Q,V,se){let Y;const ce=Q.__dashjs_factory_name,ge=V[ce];if(ge){let Te=ge.instance;if(!ge.override)return Te.apply({context:V,factory:j},se);Y=Q.apply({context:V},se),Te=Te.apply({context:V,factory:j,parent:Y},se);for(const ue in Te)Y.hasOwnProperty(ue)&&(Y[ue]=Te[ue])}else Y=Q.apply({context:V},se);return Y.getClassName=function(){return ce},Y}return j={deleteSingletonInstances:function(Q){f=f.filter(V=>V.context!==Q)},extend:function(Q,V,se,Y){!Y[Q]&&V&&(Y[Q]={instance:V,override:se})},getClassFactory:function(Q){let V=m(Q.__dashjs_factory_name,u);return V||(V=function(se){return se===void 0&&(se={}),{create:function(){return T(Q,se,arguments)}}},u[Q.__dashjs_factory_name]=V),V},getClassFactoryByName:function(Q){return m(Q,u)},getSingletonFactory:function(Q){let V=m(Q.__dashjs_factory_name,o);return V||(V=function(se){let Y;return se===void 0&&(se={}),{getInstance:function(){return Y||(Y=E(se,Q.__dashjs_factory_name)),Y||(Y=T(Q,se,arguments),f.push({name:Q.__dashjs_factory_name,context:se,instance:Y})),Y}}},o[Q.__dashjs_factory_name]=V),V},getSingletonFactoryByName:function(Q){return m(Q,o)},getSingletonInstance:E,setSingletonInstance:function(Q,V,se){for(const Y in f){const ce=f[Y];if(ce.context===Q&&ce.name===V)return void(f[Y].instance=se)}f.push({name:V,context:Q,instance:se})},updateClassFactory:function(Q,V){b(Q,V,u)},updateSingletonFactory:function(Q,V){b(Q,V,o)}},j})();Re.A=C},8261:function(Nt,Re,C){var j=C(138),f=C(7263),o=C(649),u=C(5212),E=C(7568),m=C(8850),b=C(3621),T=C(4246);function Q(){let se;const Y=this.context,ce=(0,m.A)(Y).getInstance(),ge={"streaming.delay.liveDelay":b.A.SETTING_UPDATED_LIVE_DELAY,"streaming.delay.liveDelayFragmentCount":b.A.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,"streaming.liveCatchup.enabled":b.A.SETTING_UPDATED_CATCHUP_ENABLED,"streaming.liveCatchup.playbackRate.min":b.A.SETTING_UPDATED_PLAYBACK_RATE_MIN,"streaming.liveCatchup.playbackRate.max":b.A.SETTING_UPDATED_PLAYBACK_RATE_MAX,"streaming.abr.rules.throughputRule.active":b.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.bolaRule.active":b.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.insufficientBufferRule.active":b.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.switchHistoryRule.active":b.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.droppedFramesRule.active":b.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.abandonRequestsRule.active":b.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.l2ARule.active":b.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.loLPRule.active":b.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.maxBitrate.video":b.A.SETTING_UPDATED_MAX_BITRATE,"streaming.abr.maxBitrate.audio":b.A.SETTING_UPDATED_MAX_BITRATE,"streaming.abr.minBitrate.video":b.A.SETTING_UPDATED_MIN_BITRATE,"streaming.abr.minBitrate.audio":b.A.SETTING_UPDATED_MIN_BITRATE},Te={debug:{logLevel:o.A.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,seekDurationBackoff:.5,wallclockTimeUpdateInterval:100,manifestUpdateRetryInterval:100,liveUpdateTimeThresholdInMilliseconds:0,cacheInitSegments:!1,cacheInitSegmentsLimit:50,applyServiceDescription:!0,applyProducerReferenceTime:!0,applyContentSteering:!0,ignoreFinalStaticManifestOnDynamicToStaticTransition:!1,enableManifestDurationMismatchFix:!0,parseInbandPrft:!1,enableManifestTimescaleMismatchFix:!1,capabilities:{filterUnsupportedEssentialProperties:!0,supportedEssentialProperties:[{schemeIdUri:u.A.FONT_DOWNLOAD_DVB_SCHEME},{schemeIdUri:u.A.COLOUR_PRIMARIES_SCHEME_ID_URI,value:/1|5|6|7/},{schemeIdUri:u.A.URL_QUERY_INFO_SCHEME},{schemeIdUri:u.A.EXT_URL_QUERY_INFO_SCHEME},{schemeIdUri:u.A.MATRIX_COEFFICIENTS_SCHEME_ID_URI,value:/0|1|5|6/},{schemeIdUri:u.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI,value:/1|6|13|14|15/},{schemeIdUri:u.A.SEGMENT_SEQUENCE_REPRESENTATION_SCHEME_ID_URI},...u.A.THUMBNAILS_SCHEME_ID_URIS.map(ve=>({schemeIdUri:ve}))],useMediaCapabilitiesApi:!0,filterVideoColorimetryEssentialProperties:!0,filterHDRMetadataFormatEssentialProperties:!0,filterAudioChannelConfiguration:!1},events:{eventControllerRefreshDelay:100,deleteEventMessageDataTimeout:1e4},timeShiftBuffer:{calcFromSegmentTimeline:!1,fallbackToSegmentTimeline:!0},metrics:{maxListDepth:100},delay:{liveDelayFragmentCount:NaN,liveDelay:NaN,useSuggestedPresentationDelay:!0},protection:{keepProtectionMediaKeys:!1,keepProtectionMediaKeysMaximumOpenSessions:-1,ignoreEmeEncryptedEvent:!1,detectPlayreadyMessageFormat:!0,ignoreKeyStatuses:!1},buffer:{enableSeekDecorrelationFix:!1,fastSwitchEnabled:null,flushBufferAtTrackSwitch:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,initialBufferLevel:NaN,bufferTimeDefault:18,longFormContentDurationThreshold:600,stallThreshold:.3,lowLatencyStallThreshold:.3,useAppendWindow:!0,setStallState:!0,avoidCurrentTimeRangePruning:!1,useChangeType:!0,mediaSourceDurationInfinity:!0,resetSourceBuffersForTrackSwitch:!1,syntheticStallEvents:{enabled:!1,ignoreReadyState:!1}},gaps:{jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,threshold:.3,enableSeekFix:!0,enableStallFix:!1,stallSeek:.1,seekOffset:0,checkInterval:250},utcSynchronization:{enabled:!0,useManifestDateHeaderTimeSource:!0,backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-iso:2014",value:"https://time.akamai.com/?iso&ms"},artificialTimeOffsetToApply:0},scheduling:{defaultTimeout:500,lowLatencyTimeout:0,scheduleWhilePaused:!0,segmentListRetryDelay:1e4},text:{defaultEnabled:!0,dispatchForManualRendering:!1,extendSegmentedCues:!0,imsc:{displayForcedOnlyMode:!1,enableRollUp:!0},webvtt:{customRenderingEnabled:!1}},liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN},step:{start:{min:NaN,max:NaN},stop:{min:NaN,max:NaN}},liveThreshold:-1,playbackBufferMin:.5,enabled:null,mode:u.A.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},saveLastMediaSettingsForCurrentStreamingSession:!0,cacheLoadThresholds:{video:10,audio:5},trackSwitchMode:{audio:u.A.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:u.A.TRACK_SWITCH_MODE_NEVER_REPLACE},includePreselectionsInMediainfoArray:!0,includePreselectionsForInitialTrackSelection:!1,ignoreSelectionPriority:!1,prioritizeRoleMain:!0,assumeDefaultRoleAsMain:!0,selectionModeForInitialTrack:u.A.TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY,blacklistExpiryTime:-1,fragmentRequestTimeout:2e4,fragmentRequestProgressTimeout:-1,manifestRequestTimeout:1e4,retryIntervals:{[E.G.MPD_TYPE]:500,[E.G.XLINK_EXPANSION_TYPE]:500,[E.G.MEDIA_SEGMENT_TYPE]:1e3,[E.G.INIT_SEGMENT_TYPE]:1e3,[E.G.BITSTREAM_SWITCHING_SEGMENT_TYPE]:1e3,[E.G.INDEX_SEGMENT_TYPE]:1e3,[E.G.MSS_FRAGMENT_INFO_SEGMENT_TYPE]:1e3,[E.G.LICENSE]:1e3,[E.G.LICENSE_CERTIFICATE]:1e3,[E.G.OTHER_TYPE]:1e3,lowLatencyReductionFactor:10},retryAttempts:{[E.G.MPD_TYPE]:3,[E.G.XLINK_EXPANSION_TYPE]:1,[E.G.MEDIA_SEGMENT_TYPE]:3,[E.G.INIT_SEGMENT_TYPE]:3,[E.G.BITSTREAM_SWITCHING_SEGMENT_TYPE]:3,[E.G.INDEX_SEGMENT_TYPE]:3,[E.G.MSS_FRAGMENT_INFO_SEGMENT_TYPE]:3,[E.G.LICENSE]:3,[E.G.LICENSE_CERTIFICATE]:3,[E.G.OTHER_TYPE]:3,lowLatencyMultiplyFactor:5},abr:{limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,limitBitrateByPortalMinimum:0,enableSupplementalPropertyAdaptationSetSwitching:!0,hybridSwitchBufferTime:12,rules:{throughputRule:{active:!0,priority:T.A.PRIORITY.DEFAULT},bolaRule:{active:!0,priority:T.A.PRIORITY.DEFAULT},insufficientBufferRule:{active:!0,priority:T.A.PRIORITY.DEFAULT,parameters:{throughputSafetyFactor:.7,segmentIgnoreCount:2}},switchHistoryRule:{active:!0,priority:T.A.PRIORITY.DEFAULT,parameters:{sampleSize:8,switchPercentageThreshold:.075}},droppedFramesRule:{active:!1,priority:T.A.PRIORITY.DEFAULT,parameters:{minimumSampleSize:375,droppedFramesPercentageThreshold:.15}},abandonRequestsRule:{active:!0,priority:T.A.PRIORITY.DEFAULT,parameters:{abandonDurationMultiplier:1.8,minSegmentDownloadTimeThresholdInMs:500,minThroughputSamplesThreshold:6}},l2ARule:{active:!1,priority:T.A.PRIORITY.DEFAULT},loLPRule:{active:!1,priority:T.A.PRIORITY.DEFAULT}},throughput:{averageCalculationMode:u.A.THROUGHPUT_CALCULATION_MODES.EWMA,lowLatencyDownloadTimeCalculationMode:u.A.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING,useResourceTimingApi:!0,useNetworkInformationApi:{xhr:!1,fetch:!1},useDeadTimeLatency:!0,bandwidthSafetyFactor:.9,sampleSettings:{live:3,vod:4,enableSampleSizeAdjustment:!0,decreaseScale:.7,increaseScale:1.3,maxMeasurementsToKeep:20,averageLatencySampleAmount:4},ewma:{throughputSlowHalfLifeSeconds:8,throughputFastHalfLifeSeconds:3,latencySlowHalfLifeCount:2,latencyFastHalfLifeCount:1,weightDownloadTimeMultiplicationFactor:.0015}},maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},initialBitrate:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0}},cmcd:{applyParametersFromMpd:!0,enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,maxBufferedErrorCodes:10,mode:u.A.CMCD_MODE_QUERY,enabledKeys:u.A.CMCD_KEYS,includeInRequests:["segment","mpd","license"],version:1,eventTargets:[],customKeys:[]},cmsd:{enabled:!1,abr:{applyMb:!1,etpWeightRatio:0}},enhancement:{enabled:!1,codecs:["lvc1"]},defaultSchemeIdUri:{viewpoint:"",audioChannelConfiguration:"urn:mpeg:mpegB:cicp:ChannelConfiguration",role:"urn:mpeg:dash:role:2011",accessibility:"urn:mpeg:dash:role:2011"},dvbReporting:{reportingUrl:null}},errors:{recoverAttempts:{mediaErrorDecode:5}}};let ue=f.A.clone(Te);function F(ve,je,tt){for(let re in ve)ve.hasOwnProperty(re)&&(je.hasOwnProperty(re)?typeof ve[re]!="object"||ve[re]instanceof RegExp||ve[re]instanceof Array||ve[re]===null?(je[re]=f.A.clone(ve[re]),ge[tt+re]&&ce.trigger(ge[tt+re])):F(ve[re],je[re],tt.slice()+re+"."):console.error("Settings parameter "+tt+re+" is not supported"))}return se={get:function(){return ue},update:function(ve){typeof ve=="object"&&F(ve,ue,"")},reset:function(){ue=f.A.clone(Te)}},se}Q.__dashjs_factory_name="Settings";let V=j.A.getSingletonFactory(Q);Re.A=V},7263:function(Nt,Re,C){var j=C(3282),f=C(5212);class o{static mixin(E,m,b){let T,Q={};if(E)for(let V in m)m.hasOwnProperty(V)&&(T=m[V],V in E&&(E[V]===T||V in Q&&Q[V]===T)||(typeof E[V]=="object"&&E[V]!==null?E[V]=o.mixin(E[V],T,b):E[V]=b(T)));return E}static clone(E){if(!E||typeof E!="object")return E;if(E instanceof RegExp)return new RegExp(E);let m;if(E instanceof Array){m=[];for(let b=0,T=E.length;b<T;++b)b in E&&m.push(o.clone(E[b]))}else m={};return o.mixin(m,E,o.clone)}static addAdditionalQueryParameterToUrl(E,m){try{if(!m||m.length===0)return E;let b=E;return m.forEach(({key:T,value:Q})=>{const V=b.includes("?")?"&":"?";b+=`${V}${encodeURIComponent(T)}=${encodeURIComponent(Q)}`}),b}catch{return E}}static removeQueryParameterFromUrl(E,m){if(!E||!m)return E;const b=new URL(E),T=new URLSearchParams(b.search);if(!T||T.size===0||!T.has(m))return E;T.delete(m);const Q=Array.from(T.entries()).map(([se,Y])=>`${se}=${Y}`).join("&"),V=`${b.origin}${b.pathname}`;return Q?`${V}?${Q}`:V}static parseHttpHeaders(E){let m={};if(!E)return m;let b=E.trim().split(`\r
11
+ `);for(let T=0,Q=b.length;T<Q;T++){let V=b[T],se=V.indexOf(": ");se>0&&(m[V.substring(0,se)]=V.substring(se+2))}return m}static parseQueryParams(E){const m=[],b=new URLSearchParams(E);for(const[T,Q]of b.entries())m.push({key:decodeURIComponent(T),value:decodeURIComponent(Q)});return m}static generateUuid(){let E=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(m){const b=(E+16*Math.random())%16|0;return E=Math.floor(E/16),(m=="x"?b:3&b|8).toString(16)})}static generateHashCode(E){let m=0;if(E.length===0)return m;for(let b=0;b<E.length;b++)m=(m<<5)-m+E.charCodeAt(b),m|=0;return m}static getRelativeUrl(E,m){try{const b=new URL(E),T=new URL(m);if(b.protocol=T.protocol,b.origin!==T.origin)return m;let Q=j.relative(b.pathname.substr(0,b.pathname.lastIndexOf("/")),T.pathname.substr(0,T.pathname.lastIndexOf("/")));const V=Q.length===0?1:0;return Q+=T.pathname.substr(T.pathname.lastIndexOf("/")+V,T.pathname.length-1),T.pathname.length<Q.length?T.pathname:Q}catch{return m}}static getHostFromUrl(E){try{return new URL(E).host}catch{return null}}static parseUserAgent(E=null){try{const m=typeof E=="string"?E.toLowerCase():typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",b={name:""};return/edg/.test(m)?b.name="edge":/opr|opios/.test(m)?b.name="opera":/chrome|crios/.test(m)?b.name="chrome":/firefox|fxios/.test(m)?b.name="firefox":/safari/.test(m)&&(b.name="safari"),{browser:b}}catch{return{}}}static stringHasProtocol(E){return/(http(s?)):\/\//i.test(E)}static bufferSourceToDataView(E){return o.toDataView(E,DataView)}static bufferSourceToInt8(E){return o.toDataView(E,Uint8Array)}static uint8ArrayToString(E){return new TextDecoder("utf-8").decode(E)}static bufferSourceToHex(E){const m=o.bufferSourceToInt8(E);let b="";for(let T of m)T=T.toString(16),T.length===1&&(T="0"+T),b+=T;return b}static toDataView(E,m){const b=o.getArrayBuffer(E);let T=1;"BYTES_PER_ELEMENT"in DataView&&(T=DataView.BYTES_PER_ELEMENT);const Q=((E.byteOffset||0)+E.byteLength)/T,V=(E.byteOffset||0)/T,se=Math.floor(Math.max(0,Math.min(V,Q)));return new m(b,se,Math.floor(Math.min(se+Math.max(1/0,0),Q))-se)}static getArrayBuffer(E){return E instanceof ArrayBuffer?E:E.buffer}static getCodecFamily(E){const{base:m,profile:b}=o._getCodecParts(E);switch(m){case"mp4a":switch(b){case"69":case"6b":case"40.34":return f.A.CODEC_FAMILIES.MP3;case"66":case"67":case"68":case"40.2":case"40.02":case"40.5":case"40.05":case"40.29":case"40.42":return f.A.CODEC_FAMILIES.AAC;case"a5":return f.A.CODEC_FAMILIES.AC3;case"e6":return f.A.CODEC_FAMILIES.EC3;case"b2":return f.A.CODEC_FAMILIES.DTSX;case"a9":return f.A.CODEC_FAMILIES.DTSC}break;case"avc1":case"avc3":return f.A.CODEC_FAMILIES.AVC;case"hvc1":case"hvc3":return f.A.CODEC_FAMILIES.HEVC;default:return m}return m}static _getCodecParts(E){const[m,...b]=E.split(".");return{base:m,profile:b.join(".")}}}Re.A=o},8986:function(Nt,Re,C){C.d(Re,{i:function(){return f}});const j="5.3.0";function f(){return j}},893:function(Nt,Re,C){var j=C(8748);class f extends j.A{constructor(){super(),this.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,this.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,this.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,this.SEGMENT_BASE_LOADER_ERROR_CODE=15,this.TIME_SYNC_FAILED_ERROR_CODE=16,this.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,this.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,this.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,this.APPEND_ERROR_CODE=20,this.REMOVE_ERROR_CODE=21,this.DATA_UPDATE_FAILED_ERROR_CODE=22,this.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,this.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,this.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,this.DOWNLOAD_ERROR_ID_SIDX_CODE=26,this.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,this.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,this.DOWNLOAD_ERROR_ID_XLINK_CODE=29,this.MANIFEST_ERROR_ID_PARSE_CODE=31,this.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,this.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,this.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,this.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,this.NO_SUPPORTED_KEY_IDS=36,this.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE="parsing failed for ",this.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading manifest: ",this.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading Xlink element: ",this.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE="Segments update failed",this.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE="no segments are available yet",this.SEGMENT_BASE_LOADER_ERROR_MESSAGE="error loading segment ranges from sidx",this.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize client and server time",this.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE="request is null",this.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE="Failed to resolve a valid URL",this.APPEND_ERROR_MESSAGE="chunk is not defined",this.REMOVE_ERROR_MESSAGE="Removing data from the SourceBuffer",this.DATA_UPDATE_FAILED_ERROR_MESSAGE="Data update failed",this.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE="mediasource is not supported",this.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE="mediakeys is not supported",this.TIMED_TEXT_ERROR_MESSAGE_PARSE="parsing error :",this.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE="Error creating source buffer of type : ",this.NO_SUPPORTED_KEY_IDS_MESSAGE="All possible Adaptation Sets have an invalid key status"}}let o=new f;Re.A=o},8748:function(Nt,Re){Re.A=class{extend(C,j){if(!C)return;let f=!!j&&j.override,o=!!j&&j.publicOnly;for(const u in C)!C.hasOwnProperty(u)||this[u]&&!f||o&&C[u].indexOf("public_")===-1||(this[u]=C[u])}}},5734:function(Nt,Re,C){var j=C(7252);class f extends j.A{constructor(){super(),this.ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",this.BUFFERING_COMPLETED="bufferingCompleted",this.BUFFER_CLEARED="bufferCleared",this.BUFFER_REPLACEMENT_STARTED="bufferReplacementStarted",this.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",this.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",this.CMSD_STATIC_HEADER="cmsdStaticHeader",this.CURRENT_TRACK_CHANGED="currentTrackChanged",this.DATA_UPDATE_COMPLETED="dataUpdateCompleted",this.INBAND_EVENTS="inbandEvents",this.INITIAL_STREAM_SWITCH="initialStreamSwitch",this.INIT_FRAGMENT_LOADED="initFragmentLoaded",this.INIT_FRAGMENT_NEEDED="initFragmentNeeded",this.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",this.LOADING_ABANDONED="loadingAborted",this.LOADING_COMPLETED="loadingCompleted",this.LOADING_DATA_PROGRESS="loadingDataProgress",this.LOADING_PROGRESS="loadingProgress",this.MANIFEST_UPDATED="manifestUpdated",this.MEDIAINFO_UPDATED="mediaInfoUpdated",this.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",this.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",this.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",this.QUOTA_EXCEEDED="quotaExceeded",this.SEEK_TARGET="seekTarget",this.SEGMENT_LOCATION_BLACKLIST_ADD="segmentLocationBlacklistAdd",this.SEGMENT_LOCATION_BLACKLIST_CHANGED="segmentLocationBlacklistChanged",this.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD="serviceLocationBlacklistAdd",this.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",this.SERVICE_LOCATION_LOCATION_BLACKLIST_ADD="serviceLocationLocationBlacklistAdd",this.SERVICE_LOCATION_LOCATION_BLACKLIST_CHANGED="serviceLocationLocationBlacklistChanged",this.SETTING_UPDATED_ABR_ACTIVE_RULES="settingUpdatedAbrActiveRules",this.SETTING_UPDATED_CATCHUP_ENABLED="settingUpdatedCatchupEnabled",this.SETTING_UPDATED_LIVE_DELAY="settingUpdatedLiveDelay",this.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT="settingUpdatedLiveDelayFragmentCount",this.SETTING_UPDATED_MAX_BITRATE="settingUpdatedMaxBitrate",this.SETTING_UPDATED_MIN_BITRATE="settingUpdatedMinBitrate",this.SETTING_UPDATED_PLAYBACK_RATE_MAX="settingUpdatedPlaybackRateMax",this.SETTING_UPDATED_PLAYBACK_RATE_MIN="settingUpdatedPlaybackRateMin",this.SET_FRAGMENTED_TEXT_AFTER_DISABLED="setFragmentedTextAfterDisabled",this.SET_NON_FRAGMENTED_TEXT="setNonFragmentedText",this.SOURCE_BUFFER_ERROR="sourceBufferError",this.STREAMS_COMPOSED="streamsComposed",this.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",this.STREAM_REQUESTING_COMPLETED="streamRequestingCompleted",this.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",this.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",this.UPDATE_TIME_SYNC_OFFSET="updateTimeSyncOffset",this.URL_RESOLUTION_FAILED="urlResolutionFailed",this.VIDEO_CHUNK_RECEIVED="videoChunkReceived",this.VIDEO_ELEMENT_RESIZED="videoElementResized",this.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",this.XLINK_ELEMENT_LOADED="xlinkElementLoaded",this.XLINK_READY="xlinkReady"}}Re.A=f},3621:function(Nt,Re,C){var j=C(5734);class f extends j.A{}let o=new f;Re.A=o},7252:function(Nt,Re){Re.A=class{extend(C,j){if(!C)return;let f=!!j&&j.override,o=!!j&&j.publicOnly;for(const u in C)!C.hasOwnProperty(u)||this[u]&&!f||o&&C[u].indexOf("public_")===-1||(this[u]=C[u])}}},8854:function(Nt,Re){Re.A={ACCESSIBILITY:"Accessibility",ADAPTATION_SET:"AdaptationSet",ADAPTATION_SETS:"adaptationSets",ADAPTATION_SET_SWITCHING_SCHEME_ID_URI:"urn:mpeg:dash:adaptation-set-switching:2016",ADD:"add",ASSET_IDENTIFIER:"AssetIdentifier",AUDIO_CHANNEL_CONFIGURATION:"AudioChannelConfiguration",AUDIO_SAMPLING_RATE:"audioSamplingRate",AVAILABILITY_END_TIME:"availabilityEndTime",AVAILABILITY_START_TIME:"availabilityStartTime",AVAILABILITY_TIME_COMPLETE:"availabilityTimeComplete",AVAILABILITY_TIME_OFFSET:"availabilityTimeOffset",BANDWITH:"bandwidth",BASE_URL:"BaseURL",BITSTREAM_SWITCHING:"BitstreamSwitching",BITSTREAM_SWITCHING_MINUS:"bitstreamSwitching",BYTE_RANGE:"byteRange",CAPTION:"caption",CENC_DEFAULT_KID:"cenc:default_KID",CLIENT_DATA_REPORTING:"ClientDataReporting",CLIENT_REQUIREMENT:"clientRequirement",CMCD_PARAMETERS:"CMCDParameters",CODECS:"codecs",CODEC_PRIVATE_DATA:"codecPrivateData",CODING_DEPENDENCY:"codingDependency",CONTENT_COMPONENT:"ContentComponent",CONTENT_PROTECTION:"ContentProtection",CONTENT_STEERING:"ContentSteering",CONTENT_STEERING_RESPONSE:{VERSION:"VERSION",TTL:"TTL",RELOAD_URI:"RELOAD-URI",PATHWAY_PRIORITY:"PATHWAY-PRIORITY",PATHWAY_CLONES:"PATHWAY-CLONES",BASE_ID:"BASE-ID",ID:"ID",URI_REPLACEMENT:"URI-REPLACEMENT",HOST:"HOST",PARAMS:"PARAMS"},CONTENT_TYPE:"contentType",DEFAULT_SERVICE_LOCATION:"defaultServiceLocation",DEPENDENCY_ID:"dependencyId",DURATION:"duration",DVB_PRIORITY:"dvb:priority",DVB_WEIGHT:"dvb:weight",DVB_URL:"dvb:url",DVB_MIMETYPE:"dvb:mimeType",DVB_FONTFAMILY:"dvb:fontFamily",DYNAMIC:"dynamic",END_NUMBER:"endNumber",ESSENTIAL_PROPERTY:"EssentialProperty",EVENT:"Event",EVENT_STREAM:"EventStream",FORCED_SUBTITLE:"forced-subtitle",FRAMERATE:"frameRate",FRAME_PACKING:"FramePacking",GROUP_LABEL:"GroupLabel",HEIGHT:"height",ID:"id",INBAND:"inband",INBAND_EVENT_STREAM:"InbandEventStream",INDEX:"index",INDEX_RANGE:"indexRange",INITIALIZATION:"Initialization",INITIALIZATION_MINUS:"initialization",K:"k",LA_URL:"Laurl",LA_URL_LOWER_CASE:"laurl",CERT_URL:"Certurl",LABEL:"Label",LANG:"lang",LOCATION:"Location",MAIN:"main",MAXIMUM_SAP_PERIOD:"maximumSAPPeriod",MAX_PLAYOUT_RATE:"maxPlayoutRate",MAX_SEGMENT_DURATION:"maxSegmentDuration",MAX_SUBSEGMENT_DURATION:"maxSubsegmentDuration",MEDIA:"media",MEDIA_PRESENTATION_DURATION:"mediaPresentationDuration",MEDIA_RANGE:"mediaRange",MEDIA_STREAM_STRUCTURE_ID:"mediaStreamStructureId",METRICS:"Metrics",METRICS_MINUS:"metrics",MIME_TYPE:"mimeType",MINIMUM_UPDATE_PERIOD:"minimumUpdatePeriod",MIN_BUFFER_TIME:"minBufferTime",MP4_PROTECTION_SCHEME:"urn:mpeg:dash:mp4protection:2011",MPD:"MPD",MPD_TYPE:"mpd",MPD_PATCH_TYPE:"mpdpatch",ORDER:"order",ORIGINAL_MPD_ID:"mpdId",ORIGINAL_PUBLISH_TIME:"originalPublishTime",OUTPUT_PROTECTION:"OutputProtection",PATCH_LOCATION:"PatchLocation",PERIOD:"Period",PRESELECTION:"Preselection",PRESELECTION_COMPONENTS:"preselectionComponents",PRESENTATION_TIME:"presentationTime",PRESENTATION_TIME_OFFSET:"presentationTimeOffset",PRO:"pro",PRODUCER_REFERENCE_TIME:"ProducerReferenceTime",PRODUCER_REFERENCE_TIME_TYPE:{ENCODER:"encoder",CAPTURED:"captured",APPLICATION:"application"},PROFILES:"profiles",PSSH:"pssh",PUBLISH_TIME:"publishTime",QUALITY_RANKING:"qualityRanking",QUERY_BEFORE_START:"queryBeforeStart",QUERY_PART:"$querypart$",RANGE:"range",RATING:"Rating",REF:"ref",REF_ID:"refId",REMOVE:"remove",REPLACE:"replace",REPORTING:"Reporting",REPRESENTATION:"Representation",REPRESENTATION_INDEX:"RepresentationIndex",ROBUSTNESS:"robustness",ROLE:"Role",S:"S",SAR:"sar",SCAN_TYPE:"scanType",SEGMENT_ALIGNMENT:"segmentAlignment",SEGMENT_BASE:"SegmentBase",SEGMENT_LIST:"SegmentList",SEGMENT_PROFILES:"segmentProfiles",SEGMENT_SEQUENCE_PROPERTIES:"SegmentSequenceProperties",SEGMENT_TEMPLATE:"SegmentTemplate",SEGMENT_TIMELINE:"SegmentTimeline",SEGMENT_TYPE:"segment",SEGMENT_URL:"SegmentURL",SERVICE_DESCRIPTION:"ServiceDescription",SERVICE_DESCRIPTION_LATENCY:"Latency",SERVICE_DESCRIPTION_OPERATING_BANDWIDTH:"OperatingBandwidth",SERVICE_DESCRIPTION_OPERATING_QUALITY:"OperatingQuality",SERVICE_DESCRIPTION_PLAYBACK_RATE:"PlaybackRate",SERVICE_DESCRIPTION_SCOPE:"Scope",SERVICE_LOCATION:"serviceLocation",SERVICE_LOCATIONS:"serviceLocations",SOURCE_URL:"sourceURL",START:"start",START_NUMBER:"startNumber",START_WITH_SAP:"startWithSAP",STATIC:"static",STEERING_TYPE:"steering",SUBSET:"Subset",SUBTITLE:"subtitle",SUB_REPRESENTATION:"SubRepresentation",SUB_SEGMENT_ALIGNMENT:"subsegmentAlignment",SUGGESTED_PRESENTATION_DELAY:"suggestedPresentationDelay",SUPPLEMENTAL_PROPERTY:"SupplementalProperty",SUPPLEMENTAL_CODECS:"scte214:supplementalCodecs",TAG:"tag",TIMESCALE:"timescale",TIMESHIFT_BUFFER_DEPTH:"timeShiftBufferDepth",TTL:"ttl",TYPE:"type",UTC_TIMING:"UTCTiming",VALUE:"value",VIEWPOINT:"Viewpoint",WALL_CLOCK_TIME:"wallClockTime",WIDTH:"width"}},9302:function(Nt,Re,C){var j=C(8062),f=C(9415),o=C(9578),u=C(4770),E=C(5212),m=C(5915),b=C(6455),T=C(8854),Q=C(1944),V=C(649),se=C(1036),Y=C(893),ce=C(1465),ge=C(7153),Te=C(138),ue=C(5274),F=C(6517),ve=C(7393),je=C(4740),tt=C(7408),re=C(2436),z=C(2655),he=C(5876),we=C(6503),Be=C(5717),pt=C(7263),ye=C(7356);function mt(){let Ze,He,U,Bt;const Ut=this.context,kt=(0,we.A)(Ut).getInstance(),Kt=Number.isInteger||function(X){return typeof X=="number"&&isFinite(X)&&Math.floor(X)===X};function on(X,De){if(!X)throw new Error("adaptation is not defined");if(!De)throw new Error("type is not defined");if(X.Representation&&X.Representation.length){const dt=Pe(X.Representation[0]);if(dt&&dt.some(It=>E.A.THUMBNAILS_SCHEME_ID_URIS.indexOf(It.schemeIdUri)>=0))return De===E.A.IMAGE}if(X.ContentComponent&&X.ContentComponent.length>0){if(X.ContentComponent.length>1)return De===E.A.MUXED;if(X.ContentComponent[0].contentType===De)return!0}const it=De===E.A.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(De);if(X.Representation&&X.Representation.length){const dt=X.Representation[0].codecs;if(it.test(dt))return!0}if(X.hasOwnProperty(T.A.MIME_TYPE))return it.test(X.mimeType);if(X.Representation){let dt;for(let It=0;It<X.Representation.length;It++)if(dt=X.Representation[It],dt.hasOwnProperty(T.A.MIME_TYPE))return it.test(dt.mimeType)}return!1}function un(X){if(!X)throw new Error("adaptation is not defined");if(X.hasOwnProperty(T.A.SEGMENT_TEMPLATE)||X.hasOwnProperty(T.A.SEGMENT_TIMELINE)||X.hasOwnProperty(T.A.SEGMENT_LIST)||X.hasOwnProperty(T.A.SEGMENT_BASE))return!0;if(X.Representation&&X.Representation.length>0){const De=X.Representation[0];if(De.hasOwnProperty(T.A.SEGMENT_TEMPLATE)||De.hasOwnProperty(T.A.SEGMENT_TIMELINE)||De.hasOwnProperty(T.A.SEGMENT_LIST)||De.hasOwnProperty(T.A.SEGMENT_BASE))return!0}return!1}function hn(X){return on(X,E.A.TEXT)}function Le(X){return X&&X.Representation&&X.Representation.sort((De,it)=>De.bandwidth-it.bandwidth),X}function Ee(X,De){return X&&X.Period&&Kt(De)&&X.Period[De]?X.Period[De].AdaptationSet:[]}function Tt(X){return X&&X.Period?X.Period:[]}function Ct(X,De,it){let dt=null;if(X&&X.Representation&&X.Representation.length>0){const It=Kt(De)&&De>=0&&De<X.Representation.length?X.Representation[De]:X.Representation[0];It&&(dt=It.mimeType+';codecs="'+It.codecs+'"',it&&It.width!==void 0&&(dt+=';width="'+It.width+'";height="'+It.height+'"'))}return dt&&(dt=dt.replace(/\sprofiles=[^;]*/g,"")),dt}function Ye(X){const De=K(X);return De&&De.length>0}function K(X){let De=[];if(!X)return De;const it=S(X);return De=De.concat(it),X.hasOwnProperty(T.A.ADAPTATION_SET)&&X[T.A.ADAPTATION_SET].length>0&&X[T.A.ADAPTATION_SET].forEach(dt=>{const It=S(dt);De=De.concat(It)}),De}function S(X){return X&&X.hasOwnProperty(T.A.CONTENT_PROTECTION)&&X.ContentProtection.length!==0?X[T.A.CONTENT_PROTECTION].map(De=>{const it=new m.A;return it.init(De),it}):[]}function ae(X){let De=!1;return X&&X.hasOwnProperty("type")&&(De=X.type===T.A.DYNAMIC),De}function P(X){if(!X)return null;const De=X[T.A.FRAMERATE];if(!De)return null;if(typeof De=="string"&&De.includes("/")){const[it,dt]=De.split("/").map(It=>parseInt(It,10));if(!isNaN(it)&&!isNaN(dt)&&dt!==0)return it/dt}return parseInt(De)}function _e(X,De){return De&&De.hasOwnProperty(X)&&De[X].length?De[X].map(it=>{const dt=new se.A;return dt.init(it),dt}):[]}function Ue(X,De){if(!De)return[];let it=(function(dt,It){if(!It||!It.length)return[];let lt=It[0][dt]||[];return lt.length===0?[]:It.length===1?lt.slice():lt.filter(Yt=>It.slice(1).every(Xt=>Xt.hasOwnProperty(dt)&&Xt[dt].some(Zt=>Zt.schemeIdUri===Yt.schemeIdUri&&Zt.value===Yt.value)))})(X,De[T.A.REPRESENTATION]);return De.hasOwnProperty(X)&&De[X].length&&De[X].forEach(dt=>{it.some(It=>It.schemeIdUri===dt.schemeIdUri&&It.value===dt.value)||it.push(dt)}),it.map(dt=>{const It=new se.A;return It.init(dt),It})}function Pe(X){return _e(T.A.ESSENTIAL_PROPERTY,X)}function Je(X){return _e(T.A.SUPPLEMENTAL_PROPERTY,X)}function g(X){return X&&X.hasOwnProperty(T.A.SEGMENT_SEQUENCE_PROPERTIES)&&X[T.A.SEGMENT_SEQUENCE_PROPERTIES].length?X[T.A.SEGMENT_SEQUENCE_PROPERTIES].map(De=>{const it=new ye.A(De);return it.init(De),it}):[]}function y(X,De,it,dt,It,lt){const Yt=new he.A;(function(Gt,mn,sn,Me,Ce){if(Gt.index=Ce,Gt.adaptation=sn,Gt.mediaInfo=Me,mn.hasOwnProperty(T.A.ID)&&(Gt.id=mn.id),mn.hasOwnProperty(T.A.CODECS)&&(Gt.codecs=mn.codecs,Gt.codecFamily=pt.A.getCodecFamily(Gt.codecs)),mn.hasOwnProperty(T.A.DEPENDENCY_ID)){const Ve=mn[T.A.DEPENDENCY_ID].toString().split(" ")[0];Gt.dependencyId=Ve,Gt.dependentRepresentation=new he.A,Gt.dependentRepresentation.id=Ve}mn.hasOwnProperty(T.A.MIME_TYPE)&&(Gt.mimeType=mn[T.A.MIME_TYPE]),mn.hasOwnProperty(T.A.CODEC_PRIVATE_DATA)&&(Gt.codecPrivateData=mn.codecPrivateData),mn.hasOwnProperty(T.A.BANDWITH)&&(Gt.bandwidth=mn.bandwidth,Gt.bitrateInKbit=mn.bandwidth/1e3),mn.hasOwnProperty(T.A.WIDTH)&&(Gt.width=mn.width),mn.hasOwnProperty(T.A.HEIGHT)&&(Gt.height=mn.height),mn.hasOwnProperty(T.A.SCAN_TYPE)&&(Gt.scanType=mn.scanType),mn.hasOwnProperty(T.A.FRAMERATE)&&(Gt.frameRate=P(mn)),mn.hasOwnProperty(T.A.QUALITY_RANKING)&&(Gt.qualityRanking=mn[T.A.QUALITY_RANKING]),mn.hasOwnProperty(T.A.MAX_PLAYOUT_RATE)&&(Gt.maxPlayoutRate=mn.maxPlayoutRate),Gt.essentialProperties=Pe(mn),Gt.supplementalProperties=Je(mn),Gt.segmentSequenceProperties=g(mn),Gt.path=[sn.period.index,sn.index,Ce]})(Yt,De,it,X,lt);const{segmentInfo:Xt,segmentInfoType:Zt}=(function(Gt){let mn,sn;return Gt.hasOwnProperty(T.A.SEGMENT_BASE)?(mn=Gt.SegmentBase,sn=T.A.SEGMENT_BASE):Gt.hasOwnProperty(T.A.SEGMENT_LIST)?(mn=Gt.SegmentList,sn=mn.hasOwnProperty(T.A.SEGMENT_TIMELINE)?T.A.SEGMENT_TIMELINE:T.A.SEGMENT_LIST):Gt.hasOwnProperty(T.A.SEGMENT_TEMPLATE)?(mn=Gt.SegmentTemplate,sn=mn.hasOwnProperty(T.A.SEGMENT_TIMELINE)?T.A.SEGMENT_TIMELINE:T.A.SEGMENT_TEMPLATE):sn=T.A.BASE_URL,{segmentInfo:mn,segmentInfoType:sn}})(De);return Yt.segmentInfoType=Zt,(function(Gt,mn,sn,Me,Ce,Ve){if(Gt){if(Gt.hasOwnProperty(T.A.INITIALIZATION_MINUS)&&(sn.initialization=Gt.initialization.split("$Bandwidth$").join(Ce.bandwidth).split("$RepresentationID$").join(Ce.id)),Gt.hasOwnProperty(T.A.INITIALIZATION)){const Ne=Gt.Initialization;Ne.hasOwnProperty(T.A.SOURCE_URL)&&(sn.initialization=Ne.sourceURL),Ne.hasOwnProperty(T.A.RANGE)&&(sn.range=Ne.range)}else hn(Me)&&un(Me)&&Me.mimeType&&Me.mimeType.indexOf("application/mp4")===-1&&(sn.range=0);Gt.hasOwnProperty(T.A.TIMESCALE)&&(sn.timescale=Gt.timescale),Gt.hasOwnProperty(T.A.DURATION)?sn.segmentDuration=Gt.duration/sn.timescale:mn===T.A.SEGMENT_TIMELINE&&(sn.segmentDuration=(function(Ne){if(!Ne||!Ne.S||Ne.S.length===0)return NaN;let Ge=Ne.S[0],st=Ne.S[1];return Ge.hasOwnProperty("d")?Ge.d:st.t-Ge.t})(Gt.SegmentTimeline)/sn.timescale,sn.k=(function(Ne){if(!Ne||!Ne.S||Ne.S.length===0)return 1;const Ge=Ne.S[Ne.S.length-1];return Ge.hasOwnProperty(T.A.K)?Ge.k:1})(Gt.SegmentTimeline)),Gt.hasOwnProperty(T.A.MEDIA)&&(sn.media=Gt.media),Gt.hasOwnProperty(T.A.K)&&(sn.k=Gt.k||1),Gt.hasOwnProperty(T.A.START_NUMBER)&&(sn.startNumber=parseInt(Gt.startNumber)),Gt.hasOwnProperty(T.A.INDEX_RANGE)&&(sn.indexRange=Gt.indexRange),Gt.hasOwnProperty(T.A.PRESENTATION_TIME_OFFSET)&&(sn.presentationTimeOffset=Gt.presentationTimeOffset/sn.timescale),Gt.hasOwnProperty(T.A.AVAILABILITY_TIME_OFFSET)?sn.availabilityTimeOffset=Gt.availabilityTimeOffset:Ve&&Ve.availabilityTimeOffset!==void 0&&(sn.availabilityTimeOffset=Ve.availabilityTimeOffset),Gt.hasOwnProperty(T.A.AVAILABILITY_TIME_COMPLETE)?sn.availabilityTimeComplete=Gt.availabilityTimeComplete!=="false":Ve&&Ve.availabilityTimeComplete!==void 0&&(sn.availabilityTimeComplete=Ve.availabilityTimeComplete),Gt.hasOwnProperty(T.A.END_NUMBER)&&(sn.endNumber=Gt[T.A.END_NUMBER]),sn.mseTimeOffset=(function(Ne){const Ge=Ne.presentationTimeOffset;return Ne.adaptation.period.start-Ge})(sn)}})(Xt,Zt,Yt,dt,De,It),(function(Gt){isNaN(Gt.width)||isNaN(Gt.height)||isNaN(Gt.frameRate)||(Gt.pixelsPerSecond=Math.max(1,Gt.width*Gt.height*Gt.frameRate),isNaN(Gt.bandwidth)||(Gt.bitsPerPixel=Gt.bandwidth/Gt.pixelsPerSecond))})(Yt),Yt}function R(X){return on(X,E.A.MUXED)?E.A.MUXED:on(X,E.A.AUDIO)?E.A.AUDIO:(function(De){return on(De,E.A.VIDEO)})(X)?E.A.VIDEO:hn(X)?E.A.TEXT:(function(De){return on(De,E.A.IMAGE)})(X)?E.A.IMAGE:(He.warn("Unknown Preselection stream type"),null)}function ne(X,De){if(X&&X.hasOwnProperty(T.A.PRESELECTION_COMPONENTS)&&Array.isArray(De))return String(X.preselectionComponents).split(" ").map(it=>De.find(dt=>dt.id===it))}function Z(X,De){if(!X||!X.hasOwnProperty(T.A.PRESELECTION_COMPONENTS)||!Array.isArray(De))return;const it=String(X.preselectionComponents).split(" ");return De.find(dt=>dt.id===it[0])}function de(X,De){if(!X)throw new Error("Period cannot be null or undefined");let it=tt.A.DEFAULT_ID+"_"+De;return X.hasOwnProperty(T.A.ID)&&X.id.toString().length>0&&X.id!=="__proto__"&&(it=X.id.toString()),it}function qe(X,De,it){const dt=[];let It;if(!X)return dt;for(It=0;It<X.length;It++){const lt=new ge.A;if(lt.timescale=1,lt.representation=De,!X[It].hasOwnProperty(E.A.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");lt.schemeIdUri=X[It].schemeIdUri,X[It].hasOwnProperty(T.A.TIMESCALE)&&(lt.timescale=X[It].timescale),X[It].hasOwnProperty(T.A.VALUE)&&(lt.value=X[It].value),dt.push(lt),lt.period=it}return dt}function yt(X){const De=[],it=X.BaseURL||[X.baseUri];let dt=!1;return it.some(It=>{if(It){const lt=new f.A;let Yt=It.__text||It;return kt.isRelative(Yt)&&(dt=!0,X.baseUri&&(Yt=kt.resolve(Yt,X.baseUri))),lt.url=Yt,It.hasOwnProperty(T.A.SERVICE_LOCATION)&&It.serviceLocation.length?lt.serviceLocation=It.serviceLocation:lt.serviceLocation=Yt,It.hasOwnProperty(T.A.DVB_PRIORITY)&&(lt.dvbPriority=It[T.A.DVB_PRIORITY]),It.hasOwnProperty(T.A.DVB_WEIGHT)&&(lt.dvbWeight=It[T.A.DVB_WEIGHT]),It.hasOwnProperty(T.A.AVAILABILITY_TIME_OFFSET)&&(lt.availabilityTimeOffset=It[T.A.AVAILABILITY_TIME_OFFSET]),It.hasOwnProperty(T.A.AVAILABILITY_TIME_COMPLETE)&&(lt.availabilityTimeComplete=It[T.A.AVAILABILITY_TIME_COMPLETE]!=="false"),De.push(lt),dt}}),De}function Lt(X){const De=new b.A;return De.serverUrl=X.__text,X.hasOwnProperty(T.A.DEFAULT_SERVICE_LOCATION)&&(De.defaultServiceLocation=X[T.A.DEFAULT_SERVICE_LOCATION],De.defaultServiceLocationArray=De.defaultServiceLocation.split(" ")),X.hasOwnProperty(T.A.QUERY_BEFORE_START)&&(De.queryBeforeStart=X[T.A.QUERY_BEFORE_START].toLowerCase()==="true"),X.hasOwnProperty(T.A.CLIENT_REQUIREMENT)&&(De.clientRequirement=X[T.A.CLIENT_REQUIREMENT].toLowerCase()!=="false"),De}function Ft(X){var De;const it=new u.A,dt=X.schemeIdUri||((De=X[T.A.CMCD_PARAMETERS])==null?void 0:De.schemeIdUri),It=[E.A.CTA_5004_2023_SCHEME,E.A.CTA_5004_2025_SCHEME].includes(dt);return X.hasOwnProperty(T.A.CMCD_PARAMETERS)&&It&&(it.cmcdParameters=new o.A,it.cmcdParameters.init(X[T.A.CMCD_PARAMETERS])),X.hasOwnProperty(T.A.SERVICE_LOCATIONS)&&X[T.A.SERVICE_LOCATIONS]!==""&&(it.serviceLocations=X[T.A.SERVICE_LOCATIONS],it.serviceLocationsArray=it.serviceLocations.toString().split(" ")),X.hasOwnProperty(T.A.ADAPTATION_SETS)&&X[T.A.ADAPTATION_SETS]!==""&&(it.adaptationSets=X[T.A.ADAPTATION_SETS],it.adaptationSetsArray=it.adaptationSets.toString().split(" ")),it}return Ze={getAccessibilityForAdaptation:function(X){return _e(T.A.ACCESSIBILITY,X)},getAdaptationForId:function(X,De,it){const dt=Ee(De,it);let It,lt;for(It=0,lt=dt.length;It<lt;It++)if(dt[It].hasOwnProperty(T.A.ID)&&dt[It].id===X)return dt[It];return null},getAdaptationForIndex:function(X,De,it){const dt=Ee(De,it);return dt.length>0&&Kt(X)?dt[X]:null},getAdaptationsForPeriod:function(X){const De=X&&Kt(X.index)?X.mpd.manifest.Period[X.index]:null,it=[];let dt,It,lt;if(De&&De.AdaptationSet)for(lt=0;lt<De.AdaptationSet.length;lt++)It=De.AdaptationSet[lt],dt=new j.A,It.hasOwnProperty(T.A.ID)&&(dt.id=It.id),dt.index=lt,dt.period=X,dt.type=R(It),it.push(dt);return it},getAdaptationsForType:function(X,De,it){const dt=Ee(X,De);let It,lt;const Yt=[];for(It=0,lt=dt.length;It<lt;It++)on(dt[It],it)&&Yt.push(Le(dt[It]));return Yt},getAudioChannelConfigurationForAdaptation:function(X){return _e(T.A.AUDIO_CHANNEL_CONFIGURATION,X)},getAudioChannelConfigurationForRepresentation:function(X){return _e(T.A.AUDIO_CHANNEL_CONFIGURATION,X)},getAvailabilityStartTime:function(X){return X&&X.hasOwnProperty(T.A.AVAILABILITY_START_TIME)&&X.availabilityStartTime!==null?X.availabilityStartTime.getTime():null},getBandwidth:function(X){return X&&X.bandwidth?X.bandwidth:NaN},getBaseURLsFromElement:yt,getBitrateListForAdaptation:function(X){const De=Le(X);return(De&&De.Representation?De.Representation:[]).map(it=>({bandwidth:it.bandwidth,width:it.width||0,height:it.height||0,scanType:it.scanType||null,id:it.id||null}))},getCodec:Ct,getCodecForPreselection:function(X,De,it){let dt=null;if(X&&De){let It=Ct(Z(X,De),0,it);if(X.hasOwnProperty(T.A.CODECS)){let lt=X.codecs;dt=It.replace(/(codecs=")[^"]*(")/,`$1${lt}$2`),He.info("Preselection has own codecs-attribute: replacing in MainAdaptationSet (was: "+It+"), new Preselection codec is: "+dt)}else dt=It}return dt},getCombinedEssentialPropertiesForAdaptationSet:function(X){return Ue(T.A.ESSENTIAL_PROPERTY,X)},getCombinedSupplementalPropertiesForAdaptationSet:function(X){return Ue(T.A.SUPPLEMENTAL_PROPERTY,X)},getContentProtectionByAdaptation:function(X){return S(X)},getContentProtectionByManifest:function(X){let De=[];if(!X)return De;const it=S(X);return De=De.concat(it),X.hasOwnProperty(T.A.PERIOD)&&X[T.A.PERIOD].length>0&&X[T.A.PERIOD].forEach(dt=>{const It=K(dt);De=De.concat(It)}),De},getContentProtectionByPeriod:K,getContentSteering:function(X){if(X&&X.hasOwnProperty(T.A.CONTENT_STEERING))return Lt(X[T.A.CONTENT_STEERING][0])},getDuration:function(X){let De;return De=X&&X.hasOwnProperty(T.A.MEDIA_PRESENTATION_DURATION)?X.mediaPresentationDuration:X&&X.type==="dynamic"?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE,De},getEssentialProperties:Pe,getEventStreamForAdaptationSet:function(X,De,it){let dt,It,lt;return X&&X.Period&&De&&De.period&&Kt(De.period.index)&&(It=X.Period[De.period.index],It&&It.AdaptationSet&&Kt(De.index)&&(lt=It.AdaptationSet[De.index],lt&&(dt=lt.InbandEventStream))),qe(dt,null,it)},getEventStreamForRepresentation:function(X,De,it){let dt,It,lt,Yt;return X&&X.Period&&De&&De.adaptation&&De.adaptation.period&&Kt(De.adaptation.period.index)&&(It=X.Period[De.adaptation.period.index],It&&It.AdaptationSet&&Kt(De.adaptation.index)&&(lt=It.AdaptationSet[De.adaptation.index],lt&&lt.Representation&&Kt(De.index)&&(Yt=lt.Representation[De.index],Yt&&(dt=Yt.InbandEventStream)))),qe(dt,De,it)},getEventsForPeriod:function(X){const De=X&&X.mpd&&X.mpd.manifest?X.mpd.manifest:null,it=De?De.Period:null,dt=it&&X&&Kt(X.index)?it[X.index].EventStream:null,It=[];let lt,Yt;if(dt)for(lt=0;lt<dt.length;lt++){const Xt=new ge.A;if(Xt.period=X,Xt.timescale=1,!dt[lt].hasOwnProperty(E.A.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(Xt.schemeIdUri=dt[lt][E.A.SCHEME_ID_URI],dt[lt].hasOwnProperty(T.A.TIMESCALE)&&(Xt.timescale=dt[lt][T.A.TIMESCALE]),dt[lt].hasOwnProperty(T.A.VALUE)&&(Xt.value=dt[lt][T.A.VALUE]),dt[lt].hasOwnProperty(T.A.PRESENTATION_TIME_OFFSET)&&(Xt.presentationTimeOffset=dt[lt][T.A.PRESENTATION_TIME_OFFSET]),Yt=0;dt[lt].Event&&Yt<dt[lt].Event.length;Yt++){const Zt=dt[lt].Event[Yt],Gt=new ce.A;Gt.presentationTime=0,Gt.eventStream=Xt,Zt.hasOwnProperty(T.A.PRESENTATION_TIME)&&(Gt.presentationTime=Zt.presentationTime);const mn=Xt.presentationTimeOffset?Xt.presentationTimeOffset/Xt.timescale:0;Gt.calculatedPresentationTime=Gt.presentationTime/Xt.timescale+X.start-mn,Zt.hasOwnProperty(T.A.DURATION)&&(Gt.duration=Zt.duration/Xt.timescale),Zt.hasOwnProperty(T.A.ID)?Gt.id=parseInt(Zt.id):Gt.id=null,Zt.Signal&&Zt.Signal.Binary&&Zt.Signal.Binary.__text?Gt.messageData=Bt.decodeArray(Zt.Signal.Binary.__text.toString()):Gt.messageData=Zt.messageData||Zt.__cdata||Zt.__text,It.push(Gt)}}return It},getFramerate:P,getId:function(X){return X&&X[T.A.ID]||null},getIndexForAdaptation:function(X,De,it){if(!X)return-1;const dt=Ee(De,it);for(let It=0;It<dt.length;It++)if((0,ve.A)(Ut).getInstance().areEqual(dt[It],X))return It;return-1},getIsDynamic:ae,getIsFragmented:un,getIsText:hn,getIsTypeOf:on,getLabelsForAdaptation:function(X){if(!X||!X.Label)return[];const De=[];for(let it=0;it<X.Label.length;it++)De.push({lang:X.Label[it].lang,text:X.Label[it].__text||X.Label[it]});return De},getLanguageForAdaptation:function(X){let De="";return X&&X.hasOwnProperty(T.A.LANG)&&(De=X.lang),De},getLocation:function(X){return X&&X.hasOwnProperty(T.A.LOCATION)?X[T.A.LOCATION].map(De=>{const it=De.__text||De,dt=De.hasOwnProperty(T.A.SERVICE_LOCATION)?De[T.A.SERVICE_LOCATION]:null;return new F.A(it,dt)}):[]},getMainAdaptationSetForPreselection:Z,getCommonRepresentationForPreselection:function(X,De){if(!X||!Array.isArray(De))return;const it=Z(X,De);return it?it.Representation[0]:void 0},getManifestUpdatePeriod:function(X,De=0){let it=NaN;return X&&X.hasOwnProperty(T.A.MINIMUM_UPDATE_PERIOD)&&(it=X.minimumUpdatePeriod),isNaN(it)?it:Math.max(it-De,1)},getMimeType:function(X){return X&&X.Representation&&X.Representation.length>0?X.Representation[0].mimeType:null},getMpd:function(X){const De=new ue.A;return X&&(De.manifest=X,X.hasOwnProperty(T.A.AVAILABILITY_START_TIME)?De.availabilityStartTime=new Date(X.availabilityStartTime.getTime()):X.loadedTime&&(De.availabilityStartTime=new Date(X.loadedTime.getTime())),X.hasOwnProperty(T.A.AVAILABILITY_END_TIME)&&(De.availabilityEndTime=new Date(X.availabilityEndTime.getTime())),X.hasOwnProperty(T.A.MINIMUM_UPDATE_PERIOD)&&(De.minimumUpdatePeriod=X.minimumUpdatePeriod),X.hasOwnProperty(T.A.MEDIA_PRESENTATION_DURATION)&&(De.mediaPresentationDuration=X.mediaPresentationDuration),X.hasOwnProperty(T.A.SUGGESTED_PRESENTATION_DELAY)&&(De.suggestedPresentationDelay=X.suggestedPresentationDelay),X.hasOwnProperty(T.A.TIMESHIFT_BUFFER_DEPTH)&&(De.timeShiftBufferDepth=X.timeShiftBufferDepth),X.hasOwnProperty(T.A.MAX_SEGMENT_DURATION)&&(De.maxSegmentDuration=X.maxSegmentDuration),X.hasOwnProperty(T.A.PUBLISH_TIME)&&(De.publishTime=new Date(X.publishTime))),De},getPatchLocation:function(X){return X&&X.hasOwnProperty(T.A.PATCH_LOCATION)?X[T.A.PATCH_LOCATION].map(De=>{const it=De.__text||De,dt=De.hasOwnProperty(T.A.SERVICE_LOCATION)?De[T.A.SERVICE_LOCATION]:null;let It=De.hasOwnProperty(T.A.TTL)?1e3*parseFloat(De[T.A.TTL]):NaN;return new je.A(it,dt,It)}):[]},getPreselectionIsTypeOf:function(X,De,it){if(!X)throw new Error("preselection is not defined");if(!De)throw new Error("adaptations is not defined");if(!it)throw new Error("type is not defined");const dt=Z(X,De);return!!dt&&on(dt,it)},getPreselectionsForPeriod:function(X){const De=X&&Kt(X.index)?X.mpd.manifest.Period[X.index]:null,it=[];let dt,It,lt;if(De&&De.Preselection)for(lt=0;lt<De.Preselection.length;lt++){It=De.Preselection[lt],dt=new re.A;const Yt=ne(It,De.AdaptationSet);Yt.every(Xt=>!!Xt)&&Yt.length===1?(It.hasOwnProperty(T.A.ID)&&(dt.id=It.id),dt.index=lt,dt.period=X,It.hasOwnProperty(T.A.TAG)&&(dt.tag=It.tag),It.hasOwnProperty(T.A.PRESELECTION_COMPONENTS)?dt.preselectionComponents=Yt:He.warn("Preselection (index: "+dt.index+") missing component(s)"),It.hasOwnProperty(T.A.ORDER)&&(dt.order=It.order),dt.type=R(Yt[0]),it.push(dt)):He.warn("Preselection removed because we don't support multi-representation preselections or not all components available.")}return it},getProducerReferenceTimesForAdaptation:function(X){const De=X&&X.hasOwnProperty(T.A.PRODUCER_REFERENCE_TIME)?X[T.A.PRODUCER_REFERENCE_TIME]:[];(X&&X.hasOwnProperty(T.A.REPRESENTATION)?X[T.A.REPRESENTATION]:[]).forEach(dt=>{dt.hasOwnProperty(T.A.PRODUCER_REFERENCE_TIME)&&De.push(...dt[T.A.PRODUCER_REFERENCE_TIME])});const it=[];return De.forEach(dt=>{const It=new z.A;dt.hasOwnProperty(T.A.ID)&&(It[T.A.ID]=parseInt(dt[T.A.ID]),dt.hasOwnProperty(T.A.WALL_CLOCK_TIME)&&(It[T.A.WALL_CLOCK_TIME]=dt[T.A.WALL_CLOCK_TIME],dt.hasOwnProperty(T.A.PRESENTATION_TIME)&&(It[T.A.PRESENTATION_TIME]=dt[T.A.PRESENTATION_TIME],dt.hasOwnProperty(T.A.INBAND)&&(It[T.A.INBAND]=dt[T.A.INBAND]!=="false"),dt.hasOwnProperty(T.A.TYPE)&&(It[T.A.TYPE]=dt[T.A.TYPE]),it.push(It))))}),it},getPublishTime:function(X){return X&&X.hasOwnProperty(T.A.PUBLISH_TIME)?new Date(X[T.A.PUBLISH_TIME]):null},getRealPeriodForIndex:function(X,De){const it=Tt(De);return it.length>0&&Kt(X)?it[X]:null},getRealPeriods:Tt,getRegularPeriods:function(X){const De=!!X&&ae(X.manifest),it=[];let dt,It,lt=null,Yt=null,Xt=null,Zt=null;for(It=0,dt=X&&X.manifest&&X.manifest.Period?X.manifest.Period.length:0;It<dt;It++)Yt=X.manifest.Period[It],Yt.hasOwnProperty(T.A.START)?(Zt=new tt.A,Zt.start=Yt.start):lt!==null&&lt.hasOwnProperty(T.A.DURATION)&&Xt!==null?(Zt=new tt.A,Zt.start=parseFloat((Xt.start+Xt.duration).toFixed(5))):It!==0||De||(Zt=new tt.A,Zt.start=0),Xt!==null&&isNaN(Xt.duration)&&(Zt!==null?Xt.duration=parseFloat((Zt.start-Xt.start).toFixed(5)):He.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),Zt!==null&&(Zt.id=de(Yt,It),Zt.index=It,Zt.mpd=X,Zt.isEncrypted=Ye(Yt),Yt.hasOwnProperty(T.A.DURATION)&&(Zt.duration=Yt.duration),Xt&&(Xt.nextPeriodId=Zt.id),it.push(Zt),lt=Yt,Xt=Zt),Yt=null,Zt=null;return it.length===0||Xt!==null&&isNaN(Xt.duration)&&(Xt.duration=parseFloat(((function(Gt){(function(){if(!U||!U.hasOwnProperty("error"))throw new Error(E.A.MISSING_CONFIG_ERROR)})();const mn=ae(Gt.mpd.manifest);let sn;return Gt.mpd.manifest.mediaPresentationDuration?sn=Gt.mpd.manifest.mediaPresentationDuration:Gt.duration?sn=Gt.duration:mn?sn=Number.POSITIVE_INFINITY:U.error(new Q.A(Y.A.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",Gt)),sn})(Xt)-Xt.start).toFixed(5))),it},getRepresentationCount:function(X){return X&&X.Representation?X.Representation.length:0},getRepresentationFor:function(X,De){return De&&De.Representation&&De.Representation.length>0&&Kt(X)?De.Representation[X]:null},getRepresentationSortFunction:function(){return(X,De)=>X.bandwidth-De.bandwidth},getRepresentationsForAdaptation:function(X,De){const it=[],dt=(function(lt){if(lt&&lt.period&&Kt(lt.period.index)){const Yt=lt.period.mpd.manifest.Period[lt.period.index];if(Yt&&Yt.AdaptationSet&&Kt(lt.index))return Le(Yt.AdaptationSet[lt.index])}})(X);let It;if(dt&&dt.Representation){if(X&&X.period&&Kt(X.period.index)){const lt=yt(X.period.mpd.manifest);lt&&(It=lt[0])}for(let lt=0,Yt=dt.Representation.length;lt<Yt;++lt){const Xt=y(De,dt.Representation[lt],X,dt,It,lt);it.push(Xt)}}return it},getRolesForAdaptation:function(X){return X&&X.hasOwnProperty(T.A.ROLE)&&X[T.A.ROLE].length?X[T.A.ROLE].map(De=>{const it=new se.A;return it.init(De),De.schemeIdUri===E.A.DASH_ROLE_SCHEME_ID&&De.value==="Main"&&(it.value=T.A.MAIN),it}):[]},getSegmentAlignment:function(X){return!(!X||!X.hasOwnProperty(T.A.SEGMENT_ALIGNMENT))&&X[T.A.SEGMENT_ALIGNMENT]==="true"},getSegmentSequencePropertiesForAdaptationSet:function(X){const De=[];return X&&(De.push(...g(X)),X.Representation&&X.Representation.length&&X.Representation.forEach(it=>{De.push(...g(it))})),De},getSelectionPriority:function(X){try{const De=X&&X.selectionPriority!==void 0?parseInt(X.selectionPriority):1;return isNaN(De)?1:De}catch{return 1}},getServiceDescriptions:function(X){const De=[];if(X&&X.hasOwnProperty(T.A.SERVICE_DESCRIPTION))for(const it of X.ServiceDescription){let dt=null,It=null,lt=null,Yt=null,Xt=null,Zt=null,Gt=null,mn=null;for(const sn in it)if(it.hasOwnProperty(sn))if(sn===T.A.ID)dt=it[sn];else if(sn===T.A.SERVICE_DESCRIPTION_SCOPE)It=it[sn].schemeIdUri;else if(sn===T.A.SERVICE_DESCRIPTION_LATENCY)lt={target:parseInt(it[sn].target),max:parseInt(it[sn].max),min:parseInt(it[sn].min),referenceId:parseInt(it[sn].referenceId)};else if(sn===T.A.SERVICE_DESCRIPTION_PLAYBACK_RATE)Yt={max:parseFloat(it[sn].max),min:parseFloat(it[sn].min)};else if(sn===T.A.SERVICE_DESCRIPTION_OPERATING_QUALITY)Xt={mediaType:it[sn].mediaType,max:parseInt(it[sn].max),min:parseInt(it[sn].min),target:parseInt(it[sn].target),type:it[sn].type,maxQualityDifference:parseInt(it[sn].maxQualityDifference)};else if(sn===T.A.SERVICE_DESCRIPTION_OPERATING_BANDWIDTH)Zt={mediaType:it[sn].mediaType,max:parseInt(it[sn].max),min:parseInt(it[sn].min),target:parseInt(it[sn].target)};else if(sn===T.A.CONTENT_STEERING){let Me=it[sn];Me=Array.isArray(Me)?Me.at(Me.length-1):Me,Gt=Lt(Me)}else sn===T.A.CLIENT_DATA_REPORTING&&(mn=Ft(it[sn]));De.push({id:dt,schemeIdUri:It,latency:lt,playbackRate:Yt,operatingQuality:Xt,operatingBandwidth:Zt,contentSteering:Gt,clientDataReporting:mn})}return De},getSubSegmentAlignment:function(X){return!(!X||!X.hasOwnProperty(T.A.SUB_SEGMENT_ALIGNMENT))&&X[T.A.SUB_SEGMENT_ALIGNMENT]==="true"},getSuggestedPresentationDelay:function(X){return X&&X.hasOwnProperty(T.A.SUGGESTED_PRESENTATION_DELAY)?X.suggestedPresentationDelay:null},getSupplementalProperties:Je,getUTCTimingSources:function(X){const De=ae(X),it=!!X&&X.hasOwnProperty(T.A.AVAILABILITY_START_TIME),dt=X?X.UTCTiming:null,It=[];return(De||it)&&dt&&dt.forEach(function(lt){const Yt=new Be.A;lt.hasOwnProperty(E.A.SCHEME_ID_URI)&&(Yt.schemeIdUri=lt.schemeIdUri,lt.hasOwnProperty(T.A.VALUE)&&(Yt.value=lt.value.toString(),It.push(Yt)))}),It},getViewpointForAdaptation:function(X){return _e(T.A.VIEWPOINT,X)},hasProfile:function(X,De){let it=!1;return X&&X.profiles&&X.profiles.length>0&&(it=X.profiles.indexOf(De)!==-1),it},isPeriodEncrypted:Ye,setConfig:function(X){X&&(X.errHandler&&(U=X.errHandler),X.BASE64&&(Bt=X.BASE64))}},He=(0,V.A)(Ut).getInstance().getLogger(Ze),Ze}mt.__dashjs_factory_name="DashManifestModel",Re.A=Te.A.getSingletonFactory(mt)},8062:function(Nt,Re){Re.A=class{constructor(){this.period=null,this.index=-1,this.id=null,this.type=null}}},9415:function(Nt,Re){class C{constructor(f,o,u,E){this.url=f||"",this.serviceLocation=o||f||"",this.dvbPriority=u||1,this.dvbWeight=E||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0,this.queryParams={}}}C.DEFAULT_DVB_PRIORITY=1,C.DEFAULT_DVB_WEIGHT=1,Re.A=C},9578:function(Nt,Re,C){var j=C(1036),f=C(5212);class o extends j.A{constructor(){super(),this.version=null,this.sessionID=null,this.contentID=null,this.mode=null,this.keys=null,this.includeInRequests=null}init(E){super.init(E),E&&(this.version=E.version?parseInt(E.version):null,this.sessionID=E.sessionID,this.contentID=E.contentID,this.mode=E.mode??"query",this.keys=E.keys?E.keys.split(" "):null,this.includeInRequests=E.includeInRequests?E.includeInRequests.split(" "):[f.A.CMCD_DEFAULT_INCLUDE_IN_REQUESTS],this.schemeIdUri=E.schemeIdUri)}}Re.A=o},4770:function(Nt,Re){Re.A=class{constructor(){this.adaptationSets=null,this.adaptationSetsArray=[],this.cmcdParameters=null,this.serviceLocations=null,this.serviceLocationsArray=[]}}},5915:function(Nt,Re,C){var j=C(1349),f=C(1036),o=C(8854);class u extends f.A{constructor(){super(),this.ref=null,this.refId=null,this.robustness=null,this.keyId=null,this.cencDefaultKid=null,this.pssh=null,this.pro=null,this.laUrl=null,this.certUrls=[]}init(m){if(super.init(m),m){this.ref=m.hasOwnProperty(o.A.REF)?m[o.A.REF]:null,this.refId=m.hasOwnProperty(o.A.REF_ID)?m[o.A.REF_ID]:null,this.robustness=m.hasOwnProperty(o.A.ROBUSTNESS)?m[o.A.ROBUSTNESS]:null,this.cencDefaultKid=m.hasOwnProperty(o.A.CENC_DEFAULT_KID)?m[o.A.CENC_DEFAULT_KID]:null,this.pssh=m.hasOwnProperty(o.A.PSSH)?m[o.A.PSSH]:null,this.pro=m.hasOwnProperty(o.A.PRO)?m[o.A.PRO]:null,this.laUrl=m.hasOwnProperty(o.A.LA_URL)?m[o.A.LA_URL]:m.hasOwnProperty(o.A.LA_URL_LOWER_CASE)?m[o.A.LA_URL_LOWER_CASE]:null;const b=Object.keys(m).find(Q=>Q.toLowerCase()===o.A.CERT_URL.toLowerCase()),T=b?m[b]:null;this.certUrls=j.A.normalizeCertUrls(T)}}mergeAttributesFromReference(m){if(["schemeIdUri","value","id","robustness","cencDefaultKid","pro","pssh","laUrl"].forEach(b=>{this[b]===null&&(this[b]=m[b])}),m.certUrls&&m.certUrls.length){const b=new Set(this.certUrls.map(T=>`${T.url}||${T.certType||""}`));m.certUrls.forEach(T=>{const Q=`${T.url}||${T.certType||""}`;b.has(Q)||this.certUrls.push({url:T.url,certType:T.certType||null})})}}}Re.A=u},6455:function(Nt,Re){Re.A=class{constructor(){this.defaultServiceLocation=null,this.defaultServiceLocationArray=[],this.queryBeforeStart=!1,this.serverUrl=null,this.clientRequirement=!0}}},1036:function(Nt,Re,C){var j=C(8854);Re.A=class{constructor(){this.schemeIdUri=null,this.value=null,this.id=null}init(f){f&&(this.schemeIdUri=f.schemeIdUri?f.schemeIdUri:null,this.value=f.value!==null&&f.value!==void 0?f.value.toString():null,this.id=f.id?f.id:null,f[j.A.DVB_URL]&&(this.dvbUrl=f[j.A.DVB_URL]),f[j.A.DVB_MIMETYPE]&&(this.dvbMimeType=f[j.A.DVB_MIMETYPE]),f[j.A.DVB_FONTFAMILY]&&(this.dvbFontFamily=f[j.A.DVB_FONTFAMILY]))}inArray(f){return!!f&&f.some(o=>this.schemeIdUri===o.schemeIdUri&&(this.value?this.value.toString().match(o.value):"".match(o.value)))}}},1465:function(Nt,Re){Re.A=class{constructor(){this.type="",this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN,this.parsedMessageData=null}}},7153:function(Nt,Re){Re.A=class{constructor(){this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0}}},5274:function(Nt,Re){Re.A=class{constructor(){this.availabilityEndTime=Number.POSITIVE_INFINITY,this.availabilityStartTime=null,this.manifest=null,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.mediaPresentationDuration=NaN,this.minimumUpdatePeriod=NaN,this.publishTime=null,this.suggestedPresentationDelay=0,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY}}},6517:function(Nt,Re){Re.A=class{constructor(C,j){this.url=C||"",this.serviceLocation=j||null,this.queryParams={}}}},4740:function(Nt,Re){Re.A=class{constructor(C,j,f){this.url=C||"",this.serviceLocation=j||null,this.ttl=f||NaN,this.queryParams={}}}},7408:function(Nt,Re){class C{constructor(){this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null,this.nextPeriodId=null,this.isEncrypted=!1}}C.DEFAULT_ID="defaultId",Re.A=C},2436:function(Nt,Re){Re.A=class{constructor(){this.period=null,this.index=-1,this.id=1,this.type=null,this.tag=null,this.order="undefined",this.preselectionComponents=[]}}},2655:function(Nt,Re){Re.A=class{constructor(){this.id=null,this.inband=!1,this.type="encoder",this.applicationScheme=null,this.wallClockTime=null,this.presentationTime=NaN,this.UTCTiming=null}}},5876:function(Nt,Re,C){var j=C(8854);Re.A=class{constructor(){this.absoluteIndex=NaN,this.adaptation=null,this.availabilityTimeComplete=!0,this.availabilityTimeOffset=0,this.bandwidth=NaN,this.bitrateInKbit=NaN,this.bitsPerPixel=NaN,this.codecFamily=null,this.codecPrivateData=null,this.codecs=null,this.dependencyId=null,this.dependentRepresentation=null,this.endNumber=null,this.essentialProperties=[],this.fragmentDuration=null,this.frameRate=null,this.height=NaN,this.id=null,this.indexRange=null,this.initialization=null,this.k=1,this.maxPlayoutRate=NaN,this.mediaFinishedInformation={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN},this.mediaInfo=null,this.mimeType=null,this.mseTimeOffset=NaN,this.pixelsPerSecond=NaN,this.presentationTimeOffset=0,this.qualityRanking=NaN,this.range=null,this.scanType=null,this.segments=null,this.segmentDuration=NaN,this.segmentInfoType=null,this.segmentSequenceProperties=[],this.supplementalProperties=[],this.startNumber=1,this.timescale=1,this.width=NaN}usesPartialSegments(){return this.k>1}getEffectiveSegmentDuration(){return this.usesPartialSegments()?this.segmentDuration/this.k:this.segmentDuration}hasInitialization(){return this.initialization!==null||this.range!==null}hasSegments(){return this.segmentInfoType!==j.A.BASE_URL&&this.segmentInfoType!==j.A.SEGMENT_BASE&&!this.indexRange}isBootstrapRepresentation(){return!(!this.segmentSequenceProperties||this.segmentSequenceProperties.length===0)&&this.segmentSequenceProperties.some(f=>f.isBootstrapConfiguration())}}},7356:function(Nt,Re){Re.A=class{constructor(){this.cadence=1,this.sapType=0,this.event=!0,this.alignment=null}init(C){C&&(this.cadence=C.cadence===void 0||isNaN(C.cadence)?1:C.cadence,this.sapType=C.sapType===void 0||isNaN(C.sapType)?0:C.sapType,this.event=C.event===void 0||C.event,this.alignment=C.alignment!==void 0?C.alignment:null)}isBootstrapConfiguration(){return this.cadence===1&&(this.sapType===0||this.sapType===1)}}},5717:function(Nt,Re){Re.A=class{constructor(){this.schemeIdUri="",this.value=""}}},4355:function(Nt,Re,C){C.d(Re,{A:function(){return nu}});var j=C(649),f=C(893),o=C(138),u=C(1191),E=C(8261),m=C(8850);function b(){const n=this.context,e=(0,E.A)(n).getInstance();let t={},i=[];return{save:function(r){const c=r.streamId,A=r.representation.id;t[c]=t[c]||{};const p=!t[c][A];t[c][A]=r,p&&(i.push({streamId:c,representationId:A}),(function(){const l=e.get().streaming.cacheInitSegmentsLimit;for(;i.length>l;){const _=i.shift();t[_.streamId]&&t[_.streamId][_.representationId]&&(delete t[_.streamId][_.representationId],Object.keys(t[_.streamId]).length===0&&delete t[_.streamId])}})())},extract:function(r,c){return t&&t[r]&&t[r][c]?t[r][c]:null},reset:function(){t={},i=[]},getStats:function(){const r=Object.keys(t).length;let c=0;for(const A in t)c+=Object.keys(t[A]).length;return{entryCount:c,streamCount:r,maxSize:e.get().streaming.cacheInitSegmentsLimit,accessOrderLength:i.length}}}}b.__dashjs_factory_name="InitCache";var T=o.A.getSingletonFactory(b);function Q(){let n;return n={convertToTimeCode:function(e){e=Math.max(e,0);let t=Math.floor(e/3600),i=Math.floor(e%3600/60),r=Math.floor(e%3600%60);return(t===0?"":t<10?"0"+t.toString()+":":t.toString()+":")+(i<10?"0"+i.toString():i.toString())+":"+(r<10?"0"+r.toString():r.toString())},formatUTC:function(e,t,i,r=!1){const c=new Date(1e3*e),A=c.toLocaleDateString(t),p=c.toLocaleTimeString(t,{hour12:i});return r?p+" "+A:p},ntpToUTC:function(e){const t=new Date(Date.UTC(1900,0,1,0,0,0));return new Date(t.getTime()+e).getTime()}},n}Q.__dashjs_factory_name="TimeUtils";var V=o.A.getSingletonFactory(Q),se=C(8986);function Y(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c;return t={convertToTimeCode:function(A){return V(n).getInstance().convertToTimeCode(A)},formatUTC:function(A,p,l,_=!1){return V(n).getInstance().formatUTC(A,p,l,_)},getDashMetrics:function(){return i.dashMetrics},getDebug:function(){return c},getInitCache:function(){return T(n).getInstance()},getOfflineController:function(){return r.detectOffline()},getSettings:function(){return i.settings.get()},getVersion:function(){return(0,se.i)()},off:function(A,p,l){e.off(A,p,l)},on:function(A,p,l,_){e.on(A,p,l,_)},resetSettings:function(){i.settings.reset()},setConfig:function(A){A&&(A.state&&(i=A.state),A.wiring&&(r=A.wiring),A.debug&&(c=A.debug))},trigger:function(A,p,l){e.trigger(A,p,l)},updateSettings:function(A){i.settings.update(A)}},t}Y.__dashjs_factory_name="CoreApi";var ce=o.A.getClassFactory(Y),ge=C(5560);function Te(){let n,e;return n={addABRCustomRule:function(t,i,r){e.customParametersModel.addAbrCustomRule(t,i,r)},addExternalSubtitle:function(t){t instanceof ge.A||e.logger.error("Invalid external subtitle object. Must be an instance of dashjs.ExternalSubtitle"),e.customParametersModel.addExternalSubtitle(t)},addRequestInterceptor:function(t){e.customParametersModel.addRequestInterceptor(t)},addResponseInterceptor:function(t){e.customParametersModel.addResponseInterceptor(t)},addUTCTimingSource:function(t,i){e.customParametersModel.addUTCTimingSource(t,i)},clearDefaultUTCTimingSources:function(){e.customParametersModel.clearDefaultUTCTimingSources()},getABRCustomRules:function(){return e.customParametersModel.getAbrCustomRules()},getExternalSubtitles:function(){return e.customParametersModel.getExternalSubtitles()},getXHRWithCredentialsForType:function(t){return e.customParametersModel.getXHRWithCredentialsForType(t)},registerCertificateRequestFilter:function(t){e.customParametersModel.registerCertificateRequestFilter(t)},registerCertificateResponseFilter:function(t){e.customParametersModel.registerCertificateResponseFilter(t)},registerCustomCapabilitiesFilter:function(t){e.customParametersModel.registerCustomCapabilitiesFilter(t)},registerLicenseRequestFilter:function(t){e.customParametersModel.registerLicenseRequestFilter(t)},registerLicenseResponseFilter:function(t){e.customParametersModel.registerLicenseResponseFilter(t)},removeABRCustomRule:function(t){e.customParametersModel.removeAbrCustomRule(t)},removeAllABRCustomRule:function(){e.customParametersModel.removeAllAbrCustomRule()},removeExternalSubtitleById:function(t){e.customParametersModel.removeExternalSubtitleById(t)},removeExternalSubtitleByUrl:function(t){e.customParametersModel.removeExternalSubtitleByUrl(t)},removeRequestInterceptor:function(t){e.customParametersModel.removeRequestInterceptor(t)},removeResponseInterceptor:function(t){e.customParametersModel.removeResponseInterceptor(t)},removeUTCTimingSource:function(t,i){e.customParametersModel.removeUTCTimingSource(t,i)},resetCustomInitialTrackSelectionFunction:function(){e.customParametersModel.resetCustomInitialTrackSelectionFunction(null)},restoreDefaultUTCTimingSources:function(){e.customParametersModel.restoreDefaultUTCTimingSources()},setConfig:function(t){t&&t.state&&(e=t.state)},setCustomInitialTrackSelectionFunction:function(t){e.customParametersModel.setCustomInitialTrackSelectionFunction(t)},setXHRWithCredentialsForType:function(t,i){e.customParametersModel.setXHRWithCredentialsForType(t,i)},unregisterCertificateRequestFilter:function(t){e.customParametersModel.unregisterCertificateRequestFilter(t)},unregisterCertificateResponseFilter:function(t){e.customParametersModel.unregisterCertificateResponseFilter(t)},unregisterCustomCapabilitiesFilter:function(t){e.customParametersModel.unregisterCustomCapabilitiesFilter(t)},unregisterLicenseRequestFilter:function(t){e.customParametersModel.unregisterLicenseRequestFilter(t)},unregisterLicenseResponseFilter:function(t){e.customParametersModel.unregisterLicenseResponseFilter(t)}},n}Te.__dashjs_factory_name="CustomParametersApi";var ue=o.A.getClassFactory(Te),F=C(3621);const ve="You must first call initialize() and set a source before calling this method",je="You must first call initialize() and set a valid source and view before calling this method",tt="You must first call attachView() to set the video element before calling this method",re="You must first call attachSource() with a valid source before calling this method",z="MediaPlayer not initialized!";function he(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c;function A(){_(null),l(null),i.protectionData=null,i.protectionController&&(i.protectionController.reset(),i.protectionController=null),i.customParametersModel&&i.customParametersModel.reset(),i.settings.reset(),c.reset(),i.retrieveManifestRequest&&(i.retrieveManifestRequest.resetLoader(),i.retrieveManifestRequest=null)}function p(){return!!i.source&&!!i.videoModel.getElement()}function l(h){if(!i.mediaPlayerInitialized)throw z;i.videoModel.setElement(h),h&&(c.detectProtection(),c.detectMetricsReporting(),c.detectMss(),i.streamController&&i.streamController.switchToVideoElement(i.providedStartTime)),i.playbackInitialized&&(c.resetPlaybackControllers(),i.customParametersModel.resetPlaybackSessionSpecificSettings()),I(i.providedStartTime)}function _(h,d=NaN){if(!i.mediaPlayerInitialized)throw z;typeof h=="string"&&i.uriFragmentModel.initialize(h),d==null&&(d=NaN),isNaN(d)||(d=Math.max(0,d)),i.providedStartTime=d,i.source=h,(i.streamingInitialized||i.playbackInitialized)&&(c.resetPlaybackControllers(),i.customParametersModel.resetPlaybackSessionSpecificSettings()),p()&&I(i.providedStartTime)}function I(h=NaN){i.offlineController&&i.offlineController.resetRecords(),!i.streamingInitialized&&i.source&&(i.streamingInitialized=!0,i.logger.info("Streaming Initialized"),c.createPlaybackControllers(),typeof i.source=="string"?i.streamController.load(i.source,h):i.streamController.loadWithManifest(i.source,h)),!i.playbackInitialized&&p()&&(i.playbackInitialized=!0,e.trigger(u.A.PLAYBACK_INITIALIZED),i.logger.info("Playback Initialized"))}return t={attachProtectionController:function(h){i.protectionController=h},attachSource:_,attachView:l,destroy:function(){A(),i.videoModel&&(i.videoModel.destroy(),i.videoModel=null),i.adapter&&i.adapter.destroy(),o.A.deleteSingletonInstances(n)},getProtectionController:function(){return c.detectProtection()},getProtectionData:function(){return i.streamController?i.streamController.getProtectionData():null},getVideoElement:function(){if(!i.videoModel.getElement())throw tt;return i.videoModel.getElement()},initialize:function(h,d,N,v=NaN){c.supportsMediaSource()&&(i.mediaPlayerInitialized||(i.mediaPlayerInitialized=!0,c.createCoreControllers(),i.customParametersModel.restoreDefaultUTCTimingSources(),r.setAutoPlay(N===void 0||N),c.detectOffline()),h&&l(h),d&&_(d,v),i.logger.info("[dash.js "+r.getVersion()+"] MediaPlayer has been initialized"))},isReady:p,preload:function(){if(!i.videoModel.getElement()&&!i.streamingInitialized){if(!i.source)throw re;I(i.providedStartTime)}},reset:A,retrieveManifest:function(h,d){i.retrieveManifestRequest&&i.retrieveManifestRequest.resetLoader();const N=c.createManifestLoader(),v=()=>{e.off(F.A.INTERNAL_MANIFEST_LOADED,q,this),N.reset(),i.retrieveManifestRequest=null};i.retrieveManifestRequest={manifestLoader:N,resetLoader:v};const q=k=>{typeof d=="function"&&(k.error?d(null,k.error):d(k.manifest)),v()};e.on(F.A.INTERNAL_MANIFEST_LOADED,q,this),i.uriFragmentModel.initialize(h),N.load(h)},setConfig:function(h){h&&(h.state&&(i=h.state),h.mediaPlayer&&(r=h.mediaPlayer),h.wiring&&(c=h.wiring))},setProtectionData:function(h){i.protectionData=h,i.streamController&&i.streamController.setProtectionData(i.protectionData)}},t}he.__dashjs_factory_name="LifecycleApi";var we=o.A.getClassFactory(he);function Be(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r;return t={getActiveStream:function(){if(!i.streamingInitialized)throw ve;let c=i.streamController.getActiveStreamInfo();return c?i.streamController.getStreamById(c.id):null},getAvailableBaseUrls:function(){const c=i.manifestModel.getValue();return c?i.baseURLController.getBaseUrls(c):[]},getAvailableLocations:function(){const c=i.manifestModel.getValue();if(!c)return[];const A=i.adapter.getLocation(c),p=i.contentSteeringController.getSynthesizedLocationElements(A);return A.concat(p)},getCurrentSteeringResponseData:function(){if(i.contentSteeringController)return i.contentSteeringController.getCurrentSteeringResponseData()},getDashAdapter:function(){return i.adapter},getManifest:function(){return i.manifestModel.getValue()},getSource:function(){if(!i.source)throw re;return i.source},getStreamsFromManifest:function(c){if(!i.streamingInitialized)throw ve;return i.adapter.getStreamsInfo(c)},getTracksForTypeFromManifest:function(c,A,p){if(!i.streamingInitialized)throw ve;return(p=p||i.adapter.getStreamsInfo(A,1)[0])?i.adapter.getAllMediaInfoForType(p,c,A):[]},refreshManifest:function(c){if(!i.mediaPlayerInitialized)throw z;if(!r.isReady())return c(null,re);let A=this;if(typeof c=="function"){const p=function(l){e.off(F.A.INTERNAL_MANIFEST_LOADED,p,A),l.error?c(null,l.error):c(l.manifest)};e.on(F.A.INTERNAL_MANIFEST_LOADED,p,A)}i.streamController.refreshManifest()},setConfig:function(c){c&&(c.state&&(i=c.state),c.mediaPlayer&&(r=c.mediaPlayer))},triggerSteeringRequest:function(){if(i.contentSteeringController)return i.contentSteeringController.loadSteeringData()},updateSource:function(c){i.source=c,i.streamController.load(i.source)}},t}Be.__dashjs_factory_name="ManifestApi";var pt=o.A.getClassFactory(Be),ye=C(4246),mt={TCP_CONNECTION:"TcpList",HTTP_REQUEST:"HttpList",TRACK_SWITCH:"RepSwitchList",BUFFER_LEVEL:"BufferLevel",BUFFER_LOADED:"bufferLoaded",ABANDON_LOAD:"abandonload",ALLOW_LOAD:"allowload",BUFFER_EMPTY:"bufferStalled",BUFFER_STATE:"BufferState",DVR_INFO:"DVRInfo",DROPPED_FRAMES:"DroppedFrames",SCHEDULING_INFO:"SchedulingInfo",REQUESTS_QUEUE:"RequestsQueue",MANIFEST_UPDATE:"ManifestUpdate",MANIFEST_UPDATE_STREAM_INFO:"ManifestUpdatePeriodInfo",MANIFEST_UPDATE_TRACK_INFO:"ManifestUpdateRepresentationInfo",PLAY_LIST:"PlayList",DVB_ERRORS:"DVBErrors",HTTP_REQUEST_DVB_REPORTING_TYPE:"DVBReporting"};function Ze(n){n=n||{};const e=this.context,t=n.dashMetrics;let i,r,c;return i={getSwitchRequest:function(A){try{const p=(0,ye.A)(e).create();p.rule=this.getClassName();const l=A.getMediaInfo(),_=A.getMediaType(),I=t.getCurrentBufferState(_),h=A.getScheduleController(),d=A.getAbrController(),N=A.getStreamInfo(),v=N?N.id:null,q=N&&N.manifestInfo?N.manifestInfo.isDynamic:null,k=A.getThroughputController(),D=k.getSafeAverageThroughput(_),$=k.getAverageLatency(_);return isNaN(D)||!I||d.getAbandonmentStateFor(v,_)===mt.ALLOW_LOAD&&(I.state===mt.BUFFER_LOADED||q)&&(p.representation=d.getOptimalRepresentationForBitrate(l,D,!0),p.priority=r.get().streaming.abr.rules.throughputRule.priority,p.reason={throughput:D,latency:$,message:`[ThroughputRule]: Switching to Representation with bitrate ${p.representation?p.representation.bitrateInKbit:"n/a"} kbit/s. Throughput: ${D}`},h.setTimeToLoadDelay(0)),p}catch(p){return c.error(p),(0,ye.A)(e).create()}},reset:function(){}},c=(0,j.A)(e).getInstance().getLogger(i),r=(0,E.A)(e).getInstance(),i}Ze.__dashjs_factory_name="ThroughputRule";var He=o.A.getClassFactory(Ze),U=C(5212);function Bt(n){n=n||{};const e=this.context,t=(0,m.A)(e).getInstance(),i=n.dashMetrics,r=(0,E.A)(e).getInstance();let c,A,p;function l(){const h=r.get().streaming.abr.rules.insufficientBufferRule.parameters.segmentIgnoreCount;p={},p[U.A.VIDEO]={ignoreCount:h},p[U.A.AUDIO]={ignoreCount:h},p[U.A.ENHANCEMENT]={ignoreCount:h}}function _(){l()}function I(h){isNaN(h.startTime)||h.mediaType!==U.A.AUDIO&&h.mediaType!==U.A.VIDEO||p[h.mediaType].ignoreCount>0&&p[h.mediaType].ignoreCount--}return c={getSwitchRequest:function(h){const d=(0,ye.A)(e).create();if(d.rule=this.getClassName(),!h||!h.hasOwnProperty("getMediaType"))return d;const N=h.getMediaType(),v=i.getCurrentBufferState(N),q=h.getRepresentation().fragmentDuration;if(!(function($,B,ee){return!$.getLowLatencyModeEnabled()&&p[B].ignoreCount<=0&&ee})(h.getScheduleController().getPlaybackController(),N,q))return d;const k=h.getMediaInfo(),D=h.getAbrController();if(v&&v.state===mt.BUFFER_EMPTY)A.debug("["+N+"] Switch to index 0; buffer is empty."),d.representation=D.getOptimalRepresentationForBitrate(k,0,!0),d.reason={message:"[InsufficientBufferRule]: Switching to lowest Representation because buffer is empty"};else{const $=h.getThroughputController(),B=i.getCurrentBufferLevel(N),ee=$.getAverageThroughput(N,null,NaN)*r.get().streaming.abr.rules.insufficientBufferRule.parameters.throughputSafetyFactor*B/q;if(isNaN(ee)||ee<=0)return d;d.representation=D.getOptimalRepresentationForBitrate(k,ee,!0),d.priority=r.get().streaming.abr.rules.insufficientBufferRule.priority,d.reason={message:"[InsufficientBufferRule]: Limiting maximum bitrate to avoid a buffer underrun.",bitrate:ee}}return d},reset:function(){l(),t.off(u.A.PLAYBACK_SEEKING,_,c),t.off(F.A.BYTES_APPENDED_END_FRAGMENT,I,c)}},A=(0,j.A)(e).getInstance().getLogger(c),l(),t.on(u.A.PLAYBACK_SEEKING,_,c),t.on(F.A.BYTES_APPENDED_END_FRAGMENT,I,c),c}Bt.__dashjs_factory_name="InsufficientBufferRule";var Ut=o.A.getClassFactory(Bt);function kt(n){const e=(n=n||{}).mediaPlayerModel,t=n.dashMetrics,i=this.context,r=(0,E.A)(i).getInstance();let c,A,p;function l(){p={}}return c={shouldAbandon:function(_){const I=(0,ye.A)(i).create();I.rule=this.getClassName();try{if(!_)return I;const h=_.getCurrentRequest();if(!isNaN(h.index)){if(h.firstByteDate===null||p.hasOwnProperty(h.index))return I;const d=e.getBufferTimeDefault(),N=_.getMediaType();if(t.getCurrentBufferLevel(N)>d)return I;const v=Date.now()-h.firstByteDate.getTime();if(h.traces.length>=r.get().streaming.abr.rules.abandonRequestsRule.parameters.minThroughputSamplesThreshold&&v>r.get().streaming.abr.rules.abandonRequestsRule.parameters.minSegmentDownloadTimeThresholdInMs&&h.bytesLoaded<h.bytesTotal)return(function(q,k,D){const $=q.getMediaInfo(),B=q.getMediaType(),ee=k.traces.reduce((w,O)=>w+O.b[0],0)-k.traces[0].b[0],te=Math.max(k.traces.reduce((w,O)=>w+O.d,0)-k.traces[0].d,1),M=Math.round(8*ee/te),J=Number(8*k.bytesTotal/M/1e3).toFixed(2),L=q.getRepresentation(),H=q.getAbrController();if(J<k.duration*r.get().streaming.abr.rules.abandonRequestsRule.parameters.abandonDurationMultiplier||H.isPlayingAtLowestQuality(L))return D;if(!p.hasOwnProperty(k.index)){const w=q.getAbrController(),O=k.bytesTotal-k.bytesLoaded,x=w.getOptimalRepresentationForBitrate($,M,!0),G=k.representation;O>k.bytesTotal*x.bitrateInKbit/G.bitrateInKbit&&(D.representation=x,D.priority=r.get().streaming.abr.rules.abandonRequestsRule.priority,D.reason={throughputInKbit:M,message:`[AbandonRequestRule][${B} is asking to abandon and switch to quality to ${x.absoluteIndex}. The measured bandwidth was ${M} kbit/s`},p[k.index]=!0)}return D})(_,h,I)}return I}catch(h){return A.error(h),I}},reset:l},A=(0,j.A)(i).getInstance().getLogger(c),l(),c}kt.__dashjs_factory_name="AbandonRequestsRule";var Kt=o.A.getClassFactory(kt);function on(){const n=this.context,e=(0,E.A)(n).getInstance();let t;return t={getSwitchRequest:function(i){const r=(0,ye.A)(n).create();if(r.rule=this.getClassName(),!i||!i.hasOwnProperty("getDroppedFramesHistory"))return r;const c=i.getDroppedFramesHistory();if(!c)return r;const A=i.getStreamInfo().id,p=i.getMediaInfo(),l=i.getAbrController(),_=c.getFrameHistory(A);if(!_||Object.keys(_).length===0)return r;let I=0,h=0;const d=l.getPossibleVoRepresentationsFilteredBySettings(p,!0);let N=null;for(let v=1;v<d.length;v++){const q=d[v];if(q&&_[q.id]&&(I=_[q.id].droppedVideoFrames,h=_[q.id].totalVideoFrames,h>e.get().streaming.abr.rules.droppedFramesRule.parameters.minimumSampleSize&&I/h>e.get().streaming.abr.rules.droppedFramesRule.parameters.droppedFramesPercentageThreshold)){N=d[v-1];break}}return N&&(r.representation=N,r.priority=e.get().streaming.abr.rules.droppedFramesRule.priority,r.reason={droppedFrames:I,message:`[DroppedFramesRule]: Switching to index ${N.absoluteIndex}. Dropped Frames: ${I}, Total Frames: ${h}`}),r}},t}on.__dashjs_factory_name="DroppedFramesRule";var un=o.A.getClassFactory(on);function hn(){const n=this.context,e=(0,E.A)(n).getInstance();let t;return t={getSwitchRequest:function(i){const r=(0,ye.A)(n).create();if(r.rule=this.getClassName(),!i)return r;const c=i.getStreamInfo().id,A=i.getMediaType(),p=i?i.getSwitchRequestHistory():null,l=p?p.getSwitchRequests(c,A):{},_=i.getAbrController(),I=i.getMediaInfo(),h=_.getPossibleVoRepresentationsFilteredBySettings(I,!0);let d=0,N=0;for(let v=0;v<h.length;v++){const q=h[v];if(q&&l[q.id]&&(d+=l[q.id].drops,N+=l[q.id].noDrops,d+N>=e.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize&&d/N>e.get().streaming.abr.rules.switchHistoryRule.parameters.switchPercentageThreshold)){r.representation=v>0&&l[q.id].drops>0?h[v-1]:q,r.priority=e.get().streaming.abr.rules.switchHistoryRule.priority,r.reason={drops:d,noDrops:N,message:`[SwitchHistoryRule]: Switch to index: ${r.representation.absoluteIndex} samples: ${d+N} drops: ${d}`};break}}return r}},t}hn.__dashjs_factory_name="SwitchHistoryRule";var Le=o.A.getClassFactory(hn),Ee=C(7568);const Tt="BOLA_STATE_ONE_BITRATE",Ct="BOLA_STATE_STARTUP",Ye="BOLA_STATE_STEADY",K=10;function S(n){n=n||{};const e=this.context,t=n.dashMetrics,i=n.mediaPlayerModel,r=(0,m.A)(e).getInstance(),c=Dt(e).getInstance();let A,p,l,_;function I(H){const w=H.mediaType,O=H.streamId,x=w===U.A.AUDIO?[U.A.AUDIO]:_[O];for(const G in x)_[O]&&_[O].hasOwnProperty(G)&&_[O][G].state===Ye&&(_[O][G].placeholderBuffer=0)}function h(H){const w=H.streamId;for(const O in _[w])if(_[w].hasOwnProperty(O)){const x=_[w][O];x.state!==Tt&&(x.state=Ct,d(x))}}function d(H){H.placeholderBuffer=0,H.mostAdvancedSegmentStart=NaN,H.lastSegmentWasReplacement=!1,H.lastSegmentStart=NaN,H.lastSegmentDurationS=NaN,H.lastSegmentRequestTimeMs=NaN,H.lastSegmentFinishTimeMs=NaN}function N(H){try{if(H&&H.metric===mt.HTTP_REQUEST&&H.value&&H.value.type===Ee.G.MEDIA_SEGMENT_TYPE&&H.value.trace&&H.value.trace.length){const w=_[H.value._streamId]&&_[H.value._streamId][H.mediaType]?_[H.value._streamId][H.mediaType]:null;w&&w.state!==Tt&&(w.lastSegmentRequestTimeMs=H.value.trequest.getTime(),w.lastSegmentFinishTimeMs=H.value._tfinish.getTime(),v(w,H.mediaType))}}catch(w){p.error(w)}}function v(H,w){if(!isNaN(H.lastSegmentStart)&&!isNaN(H.lastSegmentRequestTimeMs)&&!isNaN(H.placeholderBuffer)){if(H.placeholderBuffer*=.99,!isNaN(H.lastSegmentFinishTimeMs)){const O=t.getCurrentBufferLevel(w)+.001*(H.lastSegmentFinishTimeMs-H.lastSegmentRequestTimeMs),x=$(H,H.currentRepresentation),G=Math.max(0,x-O);H.placeholderBuffer=Math.min(G,H.placeholderBuffer)}H.lastSegmentWasReplacement&&!isNaN(H.lastSegmentDurationS)&&(H.placeholderBuffer+=H.lastSegmentDurationS),H.lastSegmentStart=NaN,H.lastSegmentRequestTimeMs=NaN}}function q(H){if(H&&_[H.streamId]&&_[H.streamId][H.mediaType]){const w=_[H.streamId][H.mediaType];w&&w.state!==Tt&&(w.currentRepresentation=H.newRepresentation)}}function k(H,w,O){const x=O.reduce((ie,oe,Ae)=>oe>O[ie]?Ae:ie,0);if(x===0)return null;const G=Math.max(H,K+2*w.length),W=(O[x]-1)/(G/K-1);return{gp:W,Vp:K/W}}function D(H,w){const O=i.getBufferTimeDefault();if(H.bufferTimeDefault!==O){const x=k(O,H.representations,H.utilities);if(x.Vp!==H.Vp||x.gp!==H.gp){const G=t.getCurrentBufferLevel(w);let W=G+H.placeholderBuffer;W-=K,W*=x.Vp/H.Vp,W+=K,H.bufferTimeDefault=O,H.Vp=x.Vp,H.gp=x.gp,H.placeholderBuffer=Math.max(0,W-G)}}}function $(H,w){return H.Vp*(H.utilities[w.absoluteIndex]+H.gp)}function B(H){if(H&&H.chunk&&H.chunk.representation.mediaInfo&&_[H.streamId]){const w=_[H.streamId][H.chunk.representation.mediaInfo.type];if(w&&w.state!==Tt){const O=H.chunk.start;isNaN(w.mostAdvancedSegmentStart)||O>w.mostAdvancedSegmentStart?(w.mostAdvancedSegmentStart=O,w.lastSegmentWasReplacement=!1):w.lastSegmentWasReplacement=!0,w.lastSegmentStart=O,w.lastSegmentDurationS=H.chunk.duration,w.currentRepresentation=H.chunk.representation,v(w,H.chunk.representation.mediaInfo.type)}}}function ee(){L()}function te(){l.get().streaming.abr.limitBitrateByPortal&&L()}function M(H,w){const O=w.absoluteIndex,x=w.bandwidth,G=H.utilities[O];let W=0;for(let ie=O-1;ie>=0;--ie)if(H.utilities[ie]<H.utilities[O]){const oe=H.representations[ie].bandwidth,Ae=H.utilities[ie],ke=H.Vp*(H.gp+(x*Ae-oe*G)/(x-oe));W=Math.max(W,ke)}return W}function J(H){if(H&&_[H.streamId]){const w=_[H.streamId][H.mediaType];if(w&&w.state!==Tt){const O=t.getCurrentBufferLevel(H.mediaType);let x;x=w.currentRepresentation.absoluteIndex>0?M(w,w.currentRepresentation):K;const G=Math.max(0,x-O);w.placeholderBuffer=Math.min(w.placeholderBuffer,G)}}}function L(){_={}}return A={getSwitchRequest:function(H){try{const w=(0,ye.A)(e).create();H.getScheduleController().setTimeToLoadDelay(0),w.rule=this.getClassName(),w.reason=w.reason||{};const O=(function(x){const G=x.getMediaType(),W=x.getStreamInfo().id;_[W]||(_={},_[W]={});let ie=_[W][G];return ie?ie.state!==Tt&&D(ie,G):(ie=(function(oe){const Ae={},ke=oe.getMediaInfo(),Ie=c.getPossibleVoRepresentationsFilteredBySettings(ke,!0);let be=Ie.map(Ke=>Ke.bandwidth).map(Ke=>Math.log(Ke));be=be.map(Ke=>Ke-be[0]+1);const me=i.getBufferTimeDefault(),Oe=k(me,Ie,be);return Oe?(Ae.state=Ct,Ae.representations=Ie,Ae.utilities=be,Ae.bufferTimeDefault=me,Ae.Vp=Oe.Vp,Ae.gp=Oe.gp,Ae.currentRepresentation=null,d(Ae)):Ae.state=Tt,Ae})(x),_[W][G]=ie),ie})(H);switch(w.reason.state=O.state,O.state){case Tt:break;case Ct:(function(x,G,W){const ie=G.getMediaType(),oe=G.getThroughputController().getSafeAverageThroughput(ie);if(isNaN(oe))return;const Ae=G.getMediaInfo(),ke=c.getOptimalRepresentationForBitrate(Ae,oe,!0),Ie=t.getCurrentBufferLevel(ie);x.representation=ke,x.reason.throughput=oe,W.placeholderBuffer=Math.max(0,M(W,ke)-Ie),W.currentRepresentation=ke,!isNaN(W.lastSegmentDurationS)&&Ie>=W.lastSegmentDurationS&&(W.state=Ye)})(w,H,O);break;case Ye:(function(x,G,W){const ie=G.getMediaType(),oe=G.getThroughputController(),Ae=G.getMediaInfo(),ke=oe.getSafeAverageThroughput(ie),Ie=G.getScheduleController();(function(le,fe){const pe=Date.now();if(isNaN(le.lastSegmentFinishTimeMs)){if(!isNaN(le.lastCallTimeMs)){const ze=.001*(pe-le.lastCallTimeMs);le.placeholderBuffer+=Math.max(0,ze)}}else{const ze=.001*(pe-le.lastSegmentFinishTimeMs);le.placeholderBuffer+=Math.max(0,ze)}le.lastCallTimeMs=pe,le.lastSegmentStart=NaN,le.lastSegmentRequestTimeMs=NaN,le.lastSegmentFinishTimeMs=NaN,D(le,fe)})(W,ie);const be=t.getCurrentBufferLevel(ie);let me=(function(le,fe){const pe=le.representations.length;let ze=NaN,$e=NaN;for(let ot=0;ot<pe;++ot){let Se=(le.Vp*(le.utilities[ot]-1+le.gp)-fe)/le.representations[ot].bandwidth;(isNaN($e)||Se>=$e)&&($e=Se,ze=ot)}return le.representations[ze]})(W,be+W.placeholderBuffer);const Oe=c.getOptimalRepresentationForBitrate(Ae,ke,!0);me.absoluteIndex>W.currentRepresentation.absoluteIndex&&me.absoluteIndex>Oe.absoluteIndex&&(me=Oe.absoluteIndex>W.currentRepresentation.absoluteIndex?Oe:W.currentRepresentation);let Ke=Math.max(0,be+W.placeholderBuffer-$(W,me));Ke<=W.placeholderBuffer?(W.placeholderBuffer-=Ke,Ke=0):(Ke-=W.placeholderBuffer,W.placeholderBuffer=0,c.isPlayingAtTopQuality(me)?Ke=0:Ie.setTimeToLoadDelay(1e3*Ke)),x.representation=me,x.reason.throughput=ke,x.reason.bufferLevel=be,x.reason.placeholderBuffer=W.placeholderBuffer,x.reason.delay=Ke,W.currentRepresentation=me})(w,H,O);break;default:(function(x,G,W){p.debug("BOLA ABR rule invoked in bad state.");const ie=G.getMediaInfo(),oe=G.getMediaType(),Ae=G.getThroughputController().getSafeAverageThroughput(oe);x.representation=c.getOptimalRepresentationForBitrate(ie,Ae,!0),x.reason.state=W.state,x.reason.throughput=Ae,W.state=Ct,d(W)})(w,H,O)}return w.priority=l.get().streaming.abr.rules.bolaRule.priority,w}catch(w){return p.error(w),(0,ye.A)(e).create()}},handleNewMediaInfo:function(H){H&&H.streamInfo&&H.type&&_[H.streamInfo.id]&&_[H.streamInfo.id][H.type]&&delete _[H.streamInfo.id][H.type]},reset:function(){L(),r.off(u.A.BUFFER_EMPTY,I,A),r.off(u.A.PLAYBACK_SEEKING,h,A),r.off(u.A.METRIC_ADDED,N,A),r.off(u.A.QUALITY_CHANGE_REQUESTED,q,A),r.off(u.A.FRAGMENT_LOADING_ABANDONED,J,A),r.off(F.A.MEDIA_FRAGMENT_LOADED,B,A),r.off(F.A.SETTING_UPDATED_MAX_BITRATE,ee,A),r.off(F.A.SETTING_UPDATED_MIN_BITRATE,ee,A),r.off(F.A.VIDEO_ELEMENT_RESIZED,te,A)}},p=(0,j.A)(e).getInstance().getLogger(A),l=(0,E.A)(e).getInstance(),L(),r.on(u.A.BUFFER_EMPTY,I,A),r.on(u.A.PLAYBACK_SEEKING,h,A),r.on(u.A.METRIC_ADDED,N,A),r.on(u.A.QUALITY_CHANGE_REQUESTED,q,A),r.on(u.A.FRAGMENT_LOADING_ABANDONED,J,A),r.on(F.A.MEDIA_FRAGMENT_LOADED,B,A),r.on(F.A.SETTING_UPDATED_MAX_BITRATE,ee,A),r.on(F.A.SETTING_UPDATED_MIN_BITRATE,ee,A),r.on(F.A.VIDEO_ELEMENT_RESIZED,te,A),A}S.__dashjs_factory_name="BolaRule";var ae=o.A.getClassFactory(S);const P="L2A_STATE_ONE_BITRATE",_e="L2A_STATE_STARTUP",Ue="L2A_STATE_STEADY",Pe=Math.pow(4,.99);function Je(n){n=n||{};const e=this.context,t=n.dashMetrics,i=(0,m.A)(e).getInstance(),r=(0,E.A)(e).getInstance();let c,A,p,l;function _(k){k.placeholderBuffer=0,k.mostAdvancedSegmentStart=NaN,k.lastSegmentWasReplacement=!1,k.lastSegmentStart=NaN,k.lastSegmentDurationS=NaN,k.lastSegmentRequestTimeMs=NaN,k.lastSegmentFinishTimeMs=NaN,k.lastSegmentUrl=""}function I(){for(const k in A)if(A.hasOwnProperty(k)){const D=A[k];D.state!==P&&(D.state=_e,_(D))}}function h(k){if(k&&k.chunk&&k.chunk.representation&&k.chunk.representation.mediaInfo){const D=A[k.chunk.representation.mediaInfo.type],$=p[k.chunk.representation.mediaInfo.type];if(D&&D.state!==P){const B=k.chunk.start;isNaN(D.mostAdvancedSegmentStart)||B>D.mostAdvancedSegmentStart?(D.mostAdvancedSegmentStart=B,D.lastSegmentWasReplacement=!1):D.lastSegmentWasReplacement=!0,D.lastSegmentStart=B,D.lastSegmentDurationS=k.chunk.duration,D.currentRepresentation=k.chunk.representation,N(D,$)}}}function d(k){if(k&&k.metric===mt.HTTP_REQUEST&&k.value&&k.value.type===Ee.G.MEDIA_SEGMENT_TYPE&&k.value.trace&&k.value.trace.length){const D=A[k.mediaType],$=p[k.mediaType];D&&D.state!==P&&(D.lastSegmentRequestTimeMs=k.value.trequest.getTime(),D.lastSegmentFinishTimeMs=k.value._tfinish.getTime(),N(D,$))}}function N(k,D){isNaN(k.lastSegmentStart)||isNaN(k.lastSegmentRequestTimeMs)||(D.segment_request_start_s=.001*k.lastSegmentRequestTimeMs,D.segment_download_finish_s=.001*k.lastSegmentFinishTimeMs,k.lastSegmentStart=NaN,k.lastSegmentRequestTimeMs=NaN)}function v(k,D){if(k.length!==D.length)return-1;let $=0;for(let B=0;B<k.length;B++)$+=k[B]*D[B];return $}function q(){A={},p={}}return c={getSwitchRequest:function(k){try{const D=(0,ye.A)(e).create();D.rule=this.getClassName();const $=k.getMediaType(),B=k.getScheduleController();if(D.reason=D.reason||{},$===U.A.AUDIO)return D;B.setTimeToLoadDelay(0);const ee=(function(te){const M=te.getMediaType();let J=A[M];return J||(J=(function(L){const H={},w=L.getMediaInfo();return H.state=_e,H.currentRepresentation=null,(function(O){O&&O.type&&(p[O.type]={},p[O.type].w=[],p[O.type].prev_w=[],p[O.type].Q=0,p[O.type].segment_request_start_s=0,p[O.type].segment_download_finish_s=0,p[O.type].B_target=1.5)})(w),_(H),H})(te),A[M]=J),J})(k);if(!p[$])return D;switch(D.reason.state=ee.state,ee.state){case P:break;case _e:(function(te,M,J){const L=te.getMediaInfo(),H=te.getMediaType(),w=te.getThroughputController().getSafeAverageThroughput(H);if(isNaN(w))return M;const O=te.getAbrController(),x=O.getOptimalRepresentationForBitrate(L,w,!0),G=t.getCurrentBufferLevel(H,!0),W=p[H],ie=O.getPossibleVoRepresentationsFilteredBySettings(L,!0);if(M.representation=x,M.reason.throughput=w,J.currentRepresentation=x,!isNaN(J.lastSegmentDurationS)&&G>=W.B_target){J.state=Ue,W.Q=Pe;for(let oe=0;oe<ie.length;++oe)ie[oe].id===J.currentRepresentation.id?W.prev_w[oe]=1:W.prev_w[oe]=0}})(k,D,ee);break;case Ue:(function(te,M,J){let L=[];const H=te.getThroughputController(),w=te.getMediaType();let O=H.getAverageThroughput(w,U.A.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN,1),x=t.getCurrentHttpRequest(w),G=null;const W=p[w];if(O<1&&(O=1),x.url===J.lastSegmentUrl||x.type===Ee.G.INIT_SEGMENT_TYPE)G=J.currentRepresentation;else{let ie=J.lastSegmentDurationS,oe=1;const Ae=te.getAbrController(),ke=te.getMediaInfo(),Ie=Ae.getPossibleVoRepresentationsFilteredBySettings(ke,!0);let be=te.getVideoModel().getPlaybackRate();const me=Math.max(Math.pow(4,1),Pe*Math.sqrt(4));for(let fe=0;fe<Ie.length;++fe){const pe=Ie[fe];be*pe.bitrateInKbit>O&&(oe=-1),W.w[fe]=W.prev_w[fe]+oe*(ie/(2*me))*((W.Q+Pe)*(be*pe.bitrateInKbit/O))}W.w=(function(fe){const pe=fe.length;let ze=!1,$e=[];for(let gt=0;gt<pe;++gt)$e[gt]=fe[gt];let ot=fe.sort(function(gt,Ot){return Ot-gt}),Se=0,We=0,rt=[];for(let gt=0;gt<pe-1;++gt)if(Se+=ot[gt],We=(Se-1)/(gt+1),We>=ot[gt+1]){ze=!0;break}ze||(We=(Se+ot[pe-1]-1)/pe);for(let gt=0;gt<pe;++gt)rt[gt]=Math.max($e[gt]-We,0);return rt})(W.w);for(let fe=0;fe<Ie.length;++fe)L[fe]=W.w[fe]-W.prev_w[fe],W.prev_w[fe]=W.w[fe];const Oe=Ie.map(fe=>fe.bandwidth);W.Q=Math.max(0,W.Q-ie+ie*be*((v(Oe,W.prev_w)+v(Oe,L))/O));let Ke=[];for(let fe=0;fe<Oe.length;++fe)Ke[fe]=Math.abs(Oe[fe]-v(W.w,Oe));const le=Ke.indexOf(Math.min(...Ke));G=Ae.getRepresentationByAbsoluteIndex(le,ke,!0),G.absoluteIndex>J.currentRepresentation.absoluteIndex&&Oe[J.currentRepresentation.absoluteIndex+1]<=O&&(G=Ae.getRepresentationByAbsoluteIndex(J.currentRepresentation.absoluteIndex+1,ke,!0)),G.bitrateInKbit>=O&&(W.Q=2*Math.max(Pe,W.Q)),J.lastSegmentUrl=x.url}M.representation=G,J.currentRepresentation=M.representation})(k,D,ee);break;default:(function(te,M,J){const L=te.getAbrController(),H=te.getMediaInfo(),w=te.getMediaType(),O=te.getThroughputController().getSafeAverageThroughput(w);M.representation=L.getOptimalRepresentationForBitrate(H,O,!0),M.reason.throughput=O,J.state=_e,_(J)})(k,D,ee)}return D.priority=r.get().streaming.abr.rules.l2ARule.priority,D}catch(D){return l.error(D),(0,ye.A)(e).create()}},reset:function(){q(),i.off(F.A.PLAYBACK_SEEKING,I,c),i.off(F.A.MEDIA_FRAGMENT_LOADED,h,c),i.off(F.A.METRIC_ADDED,d,c)}},l=(0,j.A)(e).getInstance().getLogger(c),q(),i.on(F.A.PLAYBACK_SEEKING,I,c),i.on(F.A.MEDIA_FRAGMENT_LOADED,h,c),i.on(F.A.METRIC_ADDED,d,c),c}Je.__dashjs_factory_name="L2ARule";var g=o.A.getClassFactory(Je);function y(){const n=this.context;let e,t,i,r,c,A,p,l,_;function I(){i=null,r=1,c=100,A=0,p=null,l=null,_="dynamic_weight_selection"}function h(){let k=0;if(i)for(let D=0;D<i.length;D++){let $=i[D];$.state.throughput>k&&(k=$.state.throughput)}return k}function d(k,D,$){let B=k.map((ee,te)=>$[te]*Math.pow(ee-D[te],2)).reduce((ee,te)=>ee+te);return(B<0?-1:1)*Math.sqrt(Math.abs(B))}function N(k,D){return d([k.state.throughput,k.state.latency,k.state.rebuffer,k.state.switch],[D.state.throughput,D.state.latency,D.state.rebuffer,D.state.switch],[1,1,1,1])}function v(k,D){for(let $=0;$<i.length;$++){let B=i[$],ee=.1;const te=N(B,k);q(B,D,Math.exp(-1*Math.pow(te,2)/(2*Math.pow(ee,2))))}}function q(k,D,$){let B=k.state,ee=[.01,.01,.01,.01];B.throughput=B.throughput+(D[0]-B.throughput)*ee[0]*$,B.latency=B.latency+(D[1]-B.latency)*ee[1]*$,B.rebuffer=B.rebuffer+(D[2]-B.rebuffer)*ee[2]*$,B.switch=B.switch+(D[3]-B.switch)*ee[3]*$}return e={getNextQuality:function(k,D,$,B,ee,te,M,J){let L=B,H=$;(function(ke,Ie){if(!i){i=[];const be=Ie.getPossibleVoRepresentationsFilteredBySettings(ke,!0),me=be.map(Oe=>Oe.bandwidth);A=Math.min(...me),r=(function(Oe){const Ke=Oe.map(le=>Math.pow(le,2)).reduce((le,fe)=>le+fe);return Math.sqrt(Ke)})(me),be.forEach(Oe=>{let Ke={representation:Oe,state:{throughput:Oe.bandwidth/r,latency:0,rebuffer:0,switch:0}};i.push(Ke)}),l=(function(Oe){let Ke=[],le=(function(ot){let Se=[];for(let We=0;We<ot;We++){let rt=[Math.random()*h(),Math.random(),Math.random(),Math.random()];Se.push(rt)}return Se})(Math.pow(Oe.length,2));Ke.push(le[0]);let fe=[1,1,1,1];for(let ot=1;ot<Oe.length;ot++){let Se=null,We=null;for(let rt=0;rt<le.length;rt++){let gt=le[rt],Ot=null;for(let zt=0;zt<Ke.length;zt++){let Wt=d(gt,Ke[zt],fe);(Ot===null||Wt<Ot)&&(Ot=Wt)}(We===null||Ot>We)&&(Se=gt,We=Ot)}Ke.push(Se)}let pe=null,ze=null;for(let ot=0;ot<Ke.length;ot++){let Se=0;for(let We=0;We<Ke.length;We++)ot!==We&&(Se+=d(Ke[ot],Ke[We],fe));(pe===null||Se>pe)&&(pe=Se,ze=ot)}let $e=[];for($e.push(Ke[ze]),Ke.splice(ze,1);Ke.length>0;){let ot=null,Se=null;for(let We=0;We<Ke.length;We++){let rt=d($e[0],Ke[We],fe);(ot===null||rt<ot)&&(ot=rt,Se=We)}$e.push(Ke[Se]),Ke.splice(Se,1)}return $e})(i)}})(D,k);let w=$/r;w>1&&(w=h()),B/=c;let O=i.find(ke=>ke.representation.id===M.id),x=O.representation.bandwidth*J.getSegmentDuration()/H,G=Math.max(0,x-ee);if(ee-x<J.getMinBuffer())return t.debug(`Buffer is low for bitrate= ${O.representation.bandwidth} downloadTime=${x} currentBuffer=${ee} rebuffer=${G}`),(function(ke,Ie){let be=0,me=ke;if(i)for(let Oe=0;Oe<i.length;Oe++){let Ke=i[Oe];Ke.representation.bandwidth<ke.representation.bandwidth&&Ke.representation.bandwidth>be&&Ie>Ke.representation.bandwidth&&(be=Ke.representation.bandwidth,me=Ke)}return me})(O,H).representation;switch(_){case"manual_weight_selection":p=[.4,.4,.4,.4];break;case"random_weight_selection":p=(function(ke){let Ie=[],be=Math.sqrt(2/ke);for(let me=0;me<4;me++)Ie.push(Math.random()*be);return p=Ie,p})(i.length);break;default:(function(ke,Ie,be,me,Oe,Ke){p||(p=l[l.length-1]);let le=ke.findWeightVector(i,Ie,be,me,Oe,Ke);le!==null&&le!==-1&&(p=le)})(J,L,ee,G,H,te)}let W=null,ie=null,oe=null;for(let ke=0;ke<i.length;ke++){let Ie=i[ke],be=Ie.state,me=[be.throughput,be.latency,be.rebuffer,be.switch],Oe=p.slice(),Ke=J.getNextBufferWithBitrate(Ie.representation.bandwidth,ee,H),le=Ke<J.getMinBuffer();le&&t.debug(`Buffer is low for bitrate=${Ie.representation.bandwidth} downloadTime=${x} currentBuffer=${ee} nextBuffer=${Ke}`),(Ie.representation.bandwidth>$-1e4||le)&&Ie.representation.bandwidth!==A&&(Oe[0]=100);let fe=d(me,[w,0,0,0],Oe);(W===null||fe<W)&&(W=fe,ie=Ie.representation,oe=Ie)}let Ae=Math.abs(O.representation.bandwidth-oe.representation.bandwidth)/r;return v(O,[w,B,G,Ae]),v(oe,[w,0,0,Ae]),ie},reset:function(){I()}},t=(0,j.A)(n).getInstance().getLogger(e),I(),e}y.__dashjs_factory_name="LearningAbrController";var R=o.A.getClassFactory(y),ne=class{constructor(){this.type=null,this.lastBitrate=null,this.weights={},this.weights.bitrateReward=null,this.weights.bitrateSwitchPenalty=null,this.weights.rebufferPenalty=null,this.weights.latencyPenalty=null,this.weights.playbackSpeedPenalty=null,this.bitrateWSum=0,this.bitrateSwitchWSum=0,this.rebufferWSum=0,this.latencyWSum=0,this.playbackSpeedWSum=0,this.totalQoe=0}};function Z(){let n,e,t,i,r;function c(){e=null,t=null,i=null,r=null}function A(l,_,I,h){let d=new ne;return d.type=l,d.weights.bitrateReward=_||1,d.weights.bitrateSwitchPenalty=1,d.weights.rebufferPenalty=I||1e3,d.weights.latencyPenalty=[],d.weights.latencyPenalty.push({threshold:1.1,penalty:.05*h}),d.weights.latencyPenalty.push({threshold:1e8,penalty:.1*I}),d.weights.playbackSpeedPenalty=h||200,d}function p(l,_,I,h,d){d.bitrateWSum+=d.weights.bitrateReward*l,d.lastBitrate&&(d.bitrateSwitchWSum+=d.weights.bitrateSwitchPenalty*Math.abs(l-d.lastBitrate)),d.lastBitrate=l,d.rebufferWSum+=d.weights.rebufferPenalty*_;for(let N=0;N<d.weights.latencyPenalty.length;N++){let v=d.weights.latencyPenalty[N];if(I<=v.threshold){d.latencyWSum+=v.penalty*I;break}}d.playbackSpeedWSum+=d.weights.playbackSpeedPenalty*Math.abs(1-h),d.totalQoe=d.bitrateWSum-d.bitrateSwitchWSum-d.rebufferWSum-d.latencyWSum-d.playbackSpeedWSum}return n={setupPerSegmentQoe:function(l,_,I){e=A("segment",l,_,I),t=l,i=_,r=I},logSegmentMetrics:function(l,_,I,h){e&&p(l,_,I,h,e)},getPerSegmentQoe:function(){return e},calculateSingleUseQoe:function(l,_,I,h){let d=null;return t&&i&&r&&(d=A("segment",t,i,r)),d?(p(l,_,I,h,d),d.totalQoe):0},reset:function(){c()}},c(),n}Z.__dashjs_factory_name="LoLpQoeEvaluator";var de=o.A.getClassFactory(Z);function qe(n){let e,t,i,r,c=n.targetLatency,A=n.bufferMin,p=n.segmentDuration,l=n.qoeEvaluator;function _(){return p}function I(h,d){const N=_();let v;return v=d>N?h-N:h+N-d,v}return e={getMinBuffer:function(){return A},getSegmentDuration:_,getNextBufferWithBitrate:function(h,d,N){return I(d,h*p/N)},getNextBuffer:I,findWeightVector:function(h,d,N,v,q,k){let D=null,$=null,B=null,ee=Math.abs(d-r);return h.forEach(te=>{i.forEach(M=>{M[0];let J,L=M[1],H=M[2],w=(M[3],te.representation.bandwidth*p/q),O=I(N,w);J=H===0?10:1/H;let x=J*Math.max(1e-5,w-O);J=L===0?10:1/L;let G=J*te.state.latency,W=l.calculateSingleUseQoe(te.representation.bandwidth,x,G,k);(D===null||W>D)&&(function(ie,oe,Ae){return!(ie>c+Ae)&&oe>=A})(d,O,ee)&&(D=W,$=M,B=te.representation.bandwidth)})}),$===null&&B===null&&($=-1),r=d,$}},t=[.2,.4,.6,.8,1],i=(function(h){let d=h.map(function(v){return[v]}),N=function(v,q,k){if(k===q)return v;let D=v.length;for(let $=0;$<D;$++){let B=v.shift();for(let ee=0;ee<h.length;ee++)v.push(B.concat(h[ee]))}return N(v,q,k+1)};return N(d,4,1)})(t),r=0,e}qe.__dashjs_factory_name="LoLpWeightSelector";var yt=o.A.getClassFactory(qe);function Lt(n){let e,t,i,r,c,A=(n=n||{}).dashMetrics,p=this.context;return i={getSwitchRequest:function(l){try{let _=(0,ye.A)(p).create();_.rule=this.getClassName();let I=l.getMediaInfo().type,h=l.getAbrController();const d=l.getStreamInfo();let N=l.getRepresentation();const v=l.getMediaInfo(),q=A.getCurrentBufferState(I),k=l.getScheduleController(),D=A.getCurrentBufferLevel(I,!0),$=k.getPlaybackController();let B=$.getCurrentLiveLatency();if(I===U.A.AUDIO)return _;B||(B=0);const ee=$.getPlaybackRate(),te=l.getThroughputController().getSafeAverageThroughput(I);if(e.debug(`Throughput ${Math.round(te)} kbps`),isNaN(te)||!q||h.getAbandonmentStateFor(d.id,I)===mt.ABANDON_LOAD)return _;let M=h.getPossibleVoRepresentationsFilteredBySettings(v,!0).map(ie=>ie.bandwidth),J=l.getRepresentation().fragmentDuration,L=Math.min(...M)/1e3,H=Math.max(...M)/1e3,w=N.bandwidth/1e3,O=A.getCurrentHttpRequest(I,!0),x=(O.tresponse.getTime()-O.trequest.getTime())/1e3,G=x>J?x-J:0;c.setupPerSegmentQoe(J,H,L),c.logSegmentMetrics(w,G,B,ee);let W=yt(p).create({targetLatency:1.5,bufferMin:.3,segmentDuration:J,qoeEvaluator:c});return _.representation=r.getNextQuality(h,v,1e3*te,B,D,ee,N,W),_.reason={throughput:te,latency:B},_.priority=t.get().streaming.abr.rules.loLPRule.priority,k.setTimeToLoadDelay(0),_}catch(_){throw _}},reset:function(){r.reset(),c.reset()}},e=(0,j.A)(p).getInstance().getLogger(i),r=R(p).create(),c=de(p).create(),t=(0,E.A)(p).getInstance(),i}Lt.__dashjs_factory_name="LoLPRule";var Ft=o.A.getClassFactory(Lt);function X(n){n=n||{};const e=this.context,t=n.mediaPlayerModel,i=n.customParametersModel,r=n.dashMetrics,c=n.settings,A=(0,m.A)(e).getInstance();let p,l,_,I;function h(){Object.values(U.A.QUALITY_SWITCH_RULES).forEach(k=>{l=d(k,l)}),Object.values(U.A.ABANDON_FRAGMENT_RULES).forEach(k=>{_=d(k,_)}),i.getAbrCustomRules().forEach(function(k){k.type===U.A.RULES_TYPES.QUALITY_SWITCH_RULES&&l.push(k.rule(e).create()),k.type===U.A.RULES_TYPES.ABANDON_FRAGMENT_RULES&&_.push(k.rule(e).create())}),l.length===0&&(l.push(ae(e).create({dashMetrics:r,mediaPlayerModel:t,settings:c})),l.push(He(e).create({dashMetrics:r})))}function d(k,D){const $=k.charAt(0).toLowerCase()+k.slice(1);return c.get().streaming.abr.rules[$].active&&!(function(B,ee){return B.filter(te=>te.getClassName()===ee).length>0})(D,k)?(D.push((function(B){switch(B){case U.A.QUALITY_SWITCH_RULES.BOLA_RULE:return ae(e).create({dashMetrics:r,mediaPlayerModel:t,settings:c});case U.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE:return He(e).create({dashMetrics:r});case U.A.QUALITY_SWITCH_RULES.INSUFFICIENT_BUFFER_RULE:return Ut(e).create({dashMetrics:r,settings:c});case U.A.QUALITY_SWITCH_RULES.SWITCH_HISTORY_RULE:return Le(e).create();case U.A.QUALITY_SWITCH_RULES.DROPPED_FRAMES_RULE:return un(e).create();case U.A.QUALITY_SWITCH_RULES.LEARN_TO_ADAPT_RULE:return g(e).create({dashMetrics:r,settings:c});case U.A.QUALITY_SWITCH_RULES.LOL_PLUS_RULE:return Ft(e).create({dashMetrics:r});case U.A.ABANDON_FRAGMENT_RULES.ABANDON_REQUEST_RULE:return Kt(e).create({dashMetrics:r,mediaPlayerModel:t,settings:c})}})(k)),D):c.get().streaming.abr.rules[$].active?D:(function(B,ee){return B.filter(te=>te.getClassName()!==ee)})(D,k)}function N(k){return k.filter(D=>D.representation!==ye.A.NO_CHANGE)}function v(k){const D={};let $,B,ee,te=null;if(k.length!==0){for(D[ye.A.PRIORITY.STRONG]=null,D[ye.A.PRIORITY.WEAK]=null,D[ye.A.PRIORITY.DEFAULT]=null,$=0,B=k.length;$<B;$+=1)ee=k[$],ee.representation!==ye.A.NO_CHANGE&&(D[ee.priority]===null||D[ee.priority].representation!==ye.A.NO_CHANGE&&ee.representation.bitrateInKbit<D[ee.priority].representation.bitrateInKbit)&&(D[ee.priority]=ee);return D[ye.A.PRIORITY.WEAK]&&D[ye.A.PRIORITY.WEAK].representation!==ye.A.NO_CHANGE&&(te=D[ye.A.PRIORITY.WEAK]),D[ye.A.PRIORITY.DEFAULT]&&D[ye.A.PRIORITY.DEFAULT].representation!==ye.A.NO_CHANGE&&(te=D[ye.A.PRIORITY.DEFAULT]),D[ye.A.PRIORITY.STRONG]&&D[ye.A.PRIORITY.STRONG].representation!==ye.A.NO_CHANGE&&(te=D[ye.A.PRIORITY.STRONG]),te}}function q(){h()}return p={clearDataForStream:function(k){[l,_].forEach(D=>{D&&D.length&&D.forEach($=>$.clearDataForStream&&typeof $.clearDataForStream=="function"&&$.clearDataForStream(k))})},getAbandonFragmentRules:function(){return _},getBestPossibleSwitchRequest:function(k){return k&&v(N(l.filter(D=>{const $=D.getClassName();if($!==U.A.QUALITY_SWITCH_RULES.BOLA_RULE&&$!==U.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE)return!0;const B=k.getMediaType();return I[B]&&$===U.A.QUALITY_SWITCH_RULES.BOLA_RULE||!I[B]&&$===U.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE}).map(D=>D.getSwitchRequest(k))))||(0,ye.A)(e).create()},getBolaState:function(k){return I[k]},getMinSwitchRequest:v,getQualitySwitchRules:function(){return l},handleNewMediaInfo:function(k){l.forEach(D=>D.handleNewMediaInfo&&D.handleNewMediaInfo(k)),_.forEach(D=>D.handleNewMediaInfo&&D.handleNewMediaInfo(k))},initialize:function(){l=[],_=[],I={},h(),A.on(F.A.SETTING_UPDATED_ABR_ACTIVE_RULES,q,p)},reset:function(){[l,_].forEach(k=>{k&&k.length&&k.forEach(D=>D.reset&&D.reset())}),l=[],_=[],I={},A.off(F.A.SETTING_UPDATED_ABR_ACTIVE_RULES,q,p)},setBolaState:function(k,D){I[k]=D},shouldAbandonFragment:function(k){if(!k)return(0,ye.A)(e).create();const D=v(N(_.map($=>$.shouldAbandon(k))));return D&&D.reason&&(D.reason.forceAbandon=!0),D||(0,ye.A)(e).create()}},p}X.__dashjs_factory_name="ABRRulesCollection";const De=o.A.getClassFactory(X);o.A.updateSingletonFactory(X.__dashjs_factory_name,De);var it=De,dt=C(2842);const It="loading",lt="executed",Yt="failed";function Xt(n){const e=(n=n||{}).eventBus,t=n.events,i=n.dashMetrics,r=n.fragmentLoader,c=n.debug,A=n.streamInfo,p=n.type;let l,_,I,h;function d(M){return!!M&&(function(J){let L=!1;return J.some(H=>{if(w=M,O=H,!isNaN(w.index)&&w.startTime===O.startTime&&w.adaptationIndex===O.adaptationIndex&&w.type===O.type||(function(x,G){return x.representation.id===G.representation.id})(M,H)||(function(x,G){return x.action===dt.A.ACTION_COMPLETE&&x.action===G.action})(M,H))return L=!0,L;var w,O}),L})(I)}function N(M){return isNaN(M.duration)?.25:Math.min(M.duration/8,.5)}function v(M){I=I.filter(J=>{const L=N(J);return isNaN(J.startTime)||M!==void 0&&J.startTime>=M-L})}function q(M,J){J<=M+.5||(I=I.filter(L=>{const H=N(L);return isNaN(L.startTime)||L.startTime>=J-H||isNaN(L.duration)||L.startTime+L.duration<=M+H}))}function k(M,J,L){for(let H=M.length-1;H>=0;H--){const w=M[H],O=w.startTime,x=O+w.duration;if(L=isNaN(L)?N(w):L,!isNaN(O)&&!isNaN(x)&&J+L>=O&&J-L<x||isNaN(O)&&isNaN(J))return w}return null}function D(M,J){i.addSchedulingInfo(M,J),i.addRequestsQueue(M.mediaType,h,I)}function $(M){M.sender===r&&(h.splice(h.indexOf(M.request),1),M.response&&!M.error&&I.push(M.request),D(M.request,M.error?Yt:lt),e.trigger(t.FRAGMENT_LOADING_COMPLETED,{request:M.request,response:M.response,error:M.error,sender:this},{streamId:A.id,mediaType:p}))}function B(M){M.sender===r&&e.trigger(t.FRAGMENT_LOADING_PROGRESS,{request:M.request,response:M.response,error:M.error,sender:this},{streamId:A.id,mediaType:p})}function ee(M){M.sender===r&&e.trigger(t.FRAGMENT_LOADING_ABANDONED,{request:M.request},{streamId:A.id,mediaType:p})}function te(){I=[],h=[],r&&r.resetInitialSettings()}return l={abortRequests:function(){_.debug("abort requests"),r.abort(),h=[]},executeRequest:function(M){M.action===dt.A.ACTION_DOWNLOAD?(D(M,It),h.push(M),(function(J){e.trigger(t.FRAGMENT_LOADING_STARTED,{request:J},{streamId:A.id,mediaType:p}),r.load(J)})(M)):_.warn("Unknown request action.")},getRequests:function(M){const J=M?M.state instanceof Array?M.state:[M.state]:[];let L=[];return J.forEach(H=>{const w=(function(O){let x;switch(O){case It:x=h;break;case lt:x=I;break;default:x=[]}return x})(H);L=L.concat((function(O,x){return x.hasOwnProperty("time")?[k(O,x.time,x.threshold)]:O.filter(G=>{for(const W in x)if(W!=="state"&&x.hasOwnProperty(W)&&G[W]!=x[W])return!1;return!0})})(w,M))}),L},getStreamId:function(){return A.id},getType:function(){return p},isFragmentLoaded:d,isFragmentLoadedOrPending:function(M){let J,L=!1,H=0;if(L=d(M),!L)for(H=0;H<h.length;H++)J=h[H],M.url===J.url&&M.startTime===J.startTime&&(L=!0);return L},removeExecutedRequestsAfterTime:function(M){I=I.filter(J=>isNaN(J.startTime)||M!==void 0&&J.startTime<M)},removeExecutedRequestsBeforeTime:v,reset:function(){e.off(t.LOADING_COMPLETED,$,this),e.off(t.LOADING_DATA_PROGRESS,B,this),e.off(t.LOADING_ABANDONED,ee,this),r&&r.reset(),te()},resetInitialSettings:te,syncExecutedRequestsWithBufferedRange:function(M,J){if(!M||M.length===0)return void v();let L=0;for(let H=0,w=M.length;H<w;H++)q(L,M.start(H)),L=M.end(H);J>0&&q(L,J)}},_=c.getLogger(l),te(),e.on(t.LOADING_COMPLETED,$,l),e.on(t.LOADING_DATA_PROGRESS,B,l),e.on(t.LOADING_ABANDONED,ee,l),l}Xt.__dashjs_factory_name="FragmentModel";const Zt=o.A.getClassFactory(Xt);Zt.FRAGMENT_MODEL_LOADING=It,Zt.FRAGMENT_MODEL_EXECUTED=lt,Zt.FRAGMENT_MODEL_CANCELED="canceled",Zt.FRAGMENT_MODEL_FAILED=Yt,o.A.updateClassFactory(Xt.__dashjs_factory_name,Zt);var Gt=Zt;function mn(n){let e;const t=(n=n||{}).abrController,i=n.throughputController,r=n.switchRequestHistory,c=n.droppedFramesHistory,A=n.currentRequest,p=n.streamProcessor?n.streamProcessor.getScheduleController():null,l=n.streamProcessor?n.streamProcessor.getRepresentation():null,_=n.videoModel?n.videoModel:null;function I(){return l?l.mediaInfo:null}return e={getAbrController:function(){return t},getCurrentRequest:function(){return A},getDroppedFramesHistory:function(){return c},getMediaInfo:I,getMediaType:function(){const h=I();return h?h.type:null},getRepresentation:function(){return l},getScheduleController:function(){return p},getStreamInfo:function(){const h=I();return h?h.streamInfo:null},getSwitchRequestHistory:function(){return r},getThroughputController:function(){return i},getVideoModel:function(){return _}},e}mn.__dashjs_factory_name="RulesContext";var sn=o.A.getClassFactory(mn);function Me(){let n={},e={};const t=this.context,i=(0,E.A)(t).getInstance();return{clearForStream:function(r){delete n[r],delete e[r]},getSwitchRequests:function(r,c){return r!=null&&c!=null&&n[r]&&n[r][c]?n[r][c]:{}},push:function(r){const c=r.currentRepresentation,A=r.newRepresentation;if(c.mediaInfo.streamInfo.id!==A.mediaInfo.streamInfo.id||A.mediaInfo.id!==c.mediaInfo.id)return;const p=c.mediaInfo.streamInfo.id;n[p]||(function(q){n[q]={},e[q]={}})(p);const l=c.mediaInfo.type;n[p][l]||(function(q,k){n[q][k]={},e[q][k]=[]})(p,l);const _=r.currentRepresentation.id;n[p][l][_]||(function(q,k,D){n[q][k][D]={noDrops:0,drops:0,dropSize:0}})(p,l,_);let I=r.newRepresentation.absoluteIndex-r.currentRepresentation.absoluteIndex,h=I<0?1:0,d=h?-I:0,N=h?0:1;n[p][l][r.currentRepresentation.id].drops+=h,n[p][l][r.currentRepresentation.id].dropSize+=d,n[p][l][r.currentRepresentation.id].noDrops+=N,e[p][l].push({id:r.currentRepresentation.id,noDrop:N,drop:h,dropSize:d});const v=(function(q,k){return e[q][k].length>i.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize?e[q][k].shift():null})(p,l);v&&(function(q,k,D){n[q][k][D.id].drops-=D.drop,n[q][k][D.id].dropSize-=D.dropSize,n[q][k][D.id].noDrops-=D.noDrop})(p,l,v)},reset:function(){n={},e={}}}}Me.__dashjs_factory_name="SwitchRequestHistory";var Ce=o.A.getClassFactory(Me);function Ve(){let n={},e={},t={};return{clearForStream:function(i){delete n[i],delete e[i],delete t[i]},getFrameHistory:function(i){return n[i]},push:function(i,r,c){if(!r)return;n[i]||(function(h){n[h]=[],e[h]=0,t[h]=0})(i);let A=c&&c.droppedVideoFrames?c.droppedVideoFrames:0,p=c&&c.totalVideoFrames?c.totalVideoFrames:0,l=A-e[i];e[i]=A;let _=p-t[i];t[i]=p;const I=n[i];I[r]?(I[r].droppedVideoFrames+=l,I[r].totalVideoFrames+=_):I[r]={droppedVideoFrames:l,totalVideoFrames:_}},reset:function(){n={},e={},t={}}}}Ve.__dashjs_factory_name="DroppedFramesHistory";var Ne=o.A.getClassFactory(Ve);function Ge(){const n=this.context,e=(0,j.A)(n).getInstance(),t=(0,m.A)(n).getInstance();let i,r,c,A,p,l,_,I,h,d,N,v,q,k,D,$,B,ee,te,M,J,L;function H(){i={},v={},te={},$=new Map,N&&N.reset(),M&&M.reset(),_=void 0,N=void 0,M=void 0,clearTimeout(r),r=null}function w(Se,We,rt=!0){const gt=O(Se,rt);if(!gt||gt.length===0)return null;const Ot=gt.reduce((Wt,Qt)=>Wt.bandwidth<Qt.bandwidth?Wt:Qt);if(We<=0)return Ot;const zt=gt.filter(Wt=>Wt.bitrateInKbit<=We);return zt&&zt.length!==0?zt.reduce((Wt,Qt)=>Qt.absoluteIndex>Wt.absoluteIndex?Qt:Wt):Ot}function O(Se,We=!0){let rt=G(Se,We);return rt=(function(gt){const Ot=gt.filter(zt=>!(x(zt)||zt.dependentRepresentation&&x(zt.dependentRepresentation)));return Ot.length===0?gt:Ot})(rt),rt=(function(gt){try{return(function(Ot){try{if(!B.get().streaming.cmsd.enabled||!B.get().streaming.cmsd.abr.applyMb)return Ot;const zt=Ot.filter(Wt=>{const Qt=Wt.mediaInfo.type;let fn=l.getMaxBitrate(Qt);if(Qt!==U.A.VIDEO||fn<0)return!0;const En=Wt.mediaInfo.streamInfo.id;return fn-=te[En][U.A.AUDIO].getRepresentation().bitrateInKbit||0,Wt.bitrateInKbit<=fn});return zt.length>0?zt:Ot}catch(zt){return k.error(zt),Ot}})(gt=(function(Ot){try{if(!B.get().streaming.abr.limitBitrateByPortal)return Ot;const zt=1e3*B.get().streaming.abr.limitBitrateByPortalMinimum||0,{elementWidth:Wt}=L.getVideoElementSize(),Qt=Ot.filter(fn=>fn.mediaInfo.type!==U.A.VIDEO||fn.width<=Wt||fn.bandwidth<=zt);return Qt.length>0?Qt:Ot}catch(zt){return k.error(zt),Ot}})(gt=(function(Ot){try{const zt=Ot.filter(Wt=>{const Qt=Wt.mediaInfo.type,fn=Wt.bitrateInKbit,En=D.getAbrBitrateParameter("maxBitrate",Qt),bn=D.getAbrBitrateParameter("minBitrate",Qt);return!(En>-1&&fn>En||bn>-1&&fn<bn)});return zt.length>0?zt:Ot}catch(zt){return k.error(zt),Ot}})(gt)))}catch(Ot){return k.error(Ot),gt}})(rt),rt}function x(Se){var We,rt,gt,Ot,zt;const Wt=(zt=(Ot=v[(rt=(We=Se.mediaInfo)==null?void 0:We.streamInfo)==null?void 0:rt.id])==null?void 0:Ot[(gt=Se.mediaInfo)==null?void 0:gt.type])==null?void 0:zt.get(Se.id);return Wt!==void 0&&Date.now()<Wt}function G(Se,We){let rt=[];return Se&&((function(gt){try{const Ot=[];if(gt&&Ot.push(gt),!B.get().streaming.abr.enableSupplementalPropertyAdaptationSetSwitching||!gt.adaptationSetSwitchingCompatibleIds||gt.adaptationSetSwitchingCompatibleIds.length===0)return Ot;const zt=te[gt.streamInfo.id][gt.type].getAllMediaInfos().filter(Wt=>gt.adaptationSetSwitchingCompatibleIds.includes(Wt.id));return Ot.concat(zt)}catch{return[gt]}})(Se).forEach(gt=>{let Ot=A.getVoRepresentations(gt);Ot&&Ot.length>0&&(rt=rt.concat(Ot))}),rt=(function(gt){return gt.forEach(Ot=>{if(Ot.dependentRepresentation&&Ot.dependentRepresentation.mediaInfo===null){let zt=Ot.dependentRepresentation.id,Wt=gt.find(Qt=>Qt.id===zt);Wt&&(Ot.dependentRepresentation=Wt)}}),gt})(rt),rt=(function(gt){return gt=(function(Ot){let zt=null;return Ot.filter(Wt=>(zt||(zt=Wt.mediaInfo),!isNaN(Wt.qualityRanking)&&A.areMediaInfosEqual(zt,Wt.mediaInfo))).length===Ot.length})(gt)?(function(Ot){return Ot.sort((zt,Wt)=>Wt.qualityRanking-zt.qualityRanking),Ot})(gt):(function(Ot){return Ot.sort((zt,Wt)=>A.areMediaInfosEqual(zt.mediaInfo,Wt.mediaInfo)?(function(Qt,fn){return W(Qt,fn)})(zt,Wt):(function(Qt,fn){if(Qt.codecFamily&&fn.codecFamily&&Qt.codecFamily===fn.codecFamily)return(function(bn,Fn){const et=ie(bn,Fn);return et!==0?et:W(bn,Fn)})(Qt,fn);if(!isNaN(Qt.pixelsPerSecond)&&!isNaN(fn.pixelsPerSecond)&&Qt.pixelsPerSecond!==fn.pixelsPerSecond)return Qt.pixelsPerSecond-fn.pixelsPerSecond;if(!isNaN(Qt.bitsPerPixel)&&!isNaN(fn.bitsPerPixel)&&Qt.bitsPerPixel!==fn.bitsPerPixel)return fn.bitsPerPixel-Qt.bitsPerPixel;const En=Qt.bandwidth-fn.bandwidth;return En!==0?En:oe(Qt,fn)})(zt,Wt)),Ot})(gt)})(rt),rt.forEach((gt,Ot)=>{gt.absoluteIndex=Ot}),rt=rt.filter(gt=>{const Ot=!!We||A.areMediaInfosEqual(gt.mediaInfo,Se),zt=!gt||!gt.mediaInfo||p.areKeyIdsUsable(gt.mediaInfo);return Ot&&zt})),rt}function W(Se,We){if(!isNaN(Se.pixelsPerSecond)&&!isNaN(We.pixelsPerSecond)&&Se.pixelsPerSecond!==We.pixelsPerSecond)return Se.pixelsPerSecond-We.pixelsPerSecond;const rt=Se.bandwidth-We.bandwidth;return rt!==0?rt:oe(Se,We)}function ie(Se,We){const rt=Se.isBootstrapRepresentation();return rt===We.isBootstrapRepresentation()?0:rt?-1:1}function oe(Se,We){const rt=ie(Se,We);return rt!==0?rt:We.k-Se.k}function Ae(Se){const We=Se.request.mediaType,rt=Se.streamId;if(!(We&&rt&&te[rt]&&B.get().streaming.abr.autoSwitchBitrate[We]))return;const gt=te[rt][We];if(!gt)return;var Ot;if(!(!((Ot=gt.getLastSegment())&&Ot.isPartialSegment&&!isNaN(Ot.totalNumberOfPartialSegments)&&!isNaN(Ot.replacementSubNumber))||Ot.replacementSubNumber===0))return;const zt=Ie(gt,Se.request),Wt=c.shouldAbandonFragment(zt);Wt&&Wt.representation!==ye.A.NO_CHANGE&&(function(Qt,fn,En,bn,Fn){if(bn.getFragmentModel().getRequests({state:Gt.FRAGMENT_MODEL_LOADING,index:Qt.request.index})[0]){const et=(function(wt,Rt){return i[wt]&&i[wt][Rt]?i[wt][Rt]:null})(fn,En);et&&(et.state=mt.ABANDON_LOAD),M.reset(),fe(En,ee.getActiveStreamInfo(),Fn.representation,Fn.reason),clearTimeout(r),r=setTimeout(()=>{et&&(i[fn][En].state=mt.ALLOW_LOAD),r=null},B.get().streaming.abandonLoadTimeout)}})(Se,rt,We,gt,Wt)}function ke(){if(B.get().streaming.abr.limitBitrateByPortal)for(const Se in te)for(const We in te[Se])Oe(We,Se)}function Ie(Se,We){return sn(n).create({abrController:q,adapter:A,currentRequest:We,droppedFramesHistory:N,streamProcessor:Se,switchRequestHistory:M,throughputController:J,videoModel:L})}function be(Se){Se.mediaType===U.A.VIDEO&&(le(Se.streamId),_=Se.newRepresentation.id)}function me(Se){!$e()||Se.metric!==mt.BUFFER_LEVEL||Se.mediaType!==U.A.AUDIO&&Se.mediaType!==U.A.VIDEO||(function(We,rt){try{const gt=B.get().streaming.abr.hybridSwitchBufferTime,Ot=gt,zt=.5*gt,Wt=c.getBolaState(We),Qt=rt>=(Wt?zt:Ot);c.setBolaState(We,Qt),Qt!==Wt&&(Qt?k.info("["+We+"] switching from throughput to buffer occupancy ABR rule (buffer: "+rt.toFixed(3)+")."):k.info("["+We+"] switching from buffer occupancy to throughput ABR rule (buffer: "+rt.toFixed(3)+")."))}catch(gt){k.error(gt)}})(Se.mediaType,.001*Se.value.level)}function Oe(Se,We){var rt;try{if(!(Se&&te&&te[We]&&te[We][Se]))return!1;le(We);const gt=te[We][Se],Ot=gt.getLastSegment(),zt=(rt=gt.getRepresentationController())==null?void 0:rt.getCurrentCompositeRepresentation(),Wt=Ke(Ot,zt);if(!B.get().streaming.abr.autoSwitchBitrate[Se]||!Wt)return!1;const Qt=Ie(gt),fn=c.getBestPossibleSwitchRequest(Qt);if(!fn||!fn.representation)return!1;let En=fn.representation;return(function(bn,Fn){M.push({currentRepresentation:bn,newRepresentation:Fn})})(zt,En),En.id!==zt.id&&(i[We][Se].state===mt.ALLOW_LOAD||En.absoluteIndex<zt.absoluteIndex)&&(ze(Se,zt,En,fn.reason),!0)}catch(gt){return k.error(gt),!1}}function Ke(Se,We){return!(Se&&Se.isPartialSegment&&!isNaN(Se.totalNumberOfPartialSegments)&&!isNaN(Se.replacementSubNumber))||Se.replacementSubNumber===Se.totalNumberOfPartialSegments-1||(function(rt,gt){if(!gt||!gt.segmentSequenceProperties||gt.segmentSequenceProperties.length<=0||gt&&gt.mediaInfo&&gt.mediaInfo.adaptationSetSwitchingCompatibleIds&&gt.mediaInfo.adaptationSetSwitchingCompatibleIds.length>0)return!1;const Ot=gt.segmentSequenceProperties.filter(Wt=>!isNaN(Wt.sapType)&&Wt.sapType<=1);if(Ot.length===0)return!1;let zt=(rt.replacementSubNumber+1)%rt.totalNumberOfPartialSegments;return Ot.some(Wt=>zt%Wt.cadence===0)})(Se,We)}function le(Se){if(N){const We=L.getPlaybackQuality();We&&N.push(Se,_,We)}}function fe(Se,We,rt,gt={}){var Ot;if(!(We&&We.id&&Se&&te&&te[We.id]&&te[We.id][Se]&&rt))return!1;const zt=te[We.id][Se],Wt=(Ot=zt.getRepresentationController())==null?void 0:Ot.getCurrentCompositeRepresentation();return(!Wt||rt.id!==Wt.id)&&ze(Se,Wt,rt,gt)}function pe(Se,We){return`${Se}-${We}`}function ze(Se,We,rt,gt){const Ot=rt.mediaInfo.streamInfo.id;if(!Se||!te[Ot]||!te[Ot][Se])return!1;const zt=te[Ot][Se].getStreamInfo(),Wt=h.getCurrentBufferLevel(Se),Qt=We!==null&&!A.areMediaInfosEqual(We.mediaInfo,rt.mediaInfo),fn=We?We.bitrateInKbit:0;return k.info(`[AbrController]: Switching quality in period ${Ot} for media type ${Se}. Switch from bitrate ${fn} to bitrate ${rt.bitrateInKbit}. Current buffer level: ${Wt}. Reason:`+(gt?JSON.stringify(gt):"/")),t.trigger(u.A.QUALITY_CHANGE_REQUESTED,{isAdaptationSetSwitch:Qt,mediaType:Se,newRepresentation:rt,oldRepresentation:We,reason:gt,streamInfo:zt},{streamId:zt.id,mediaType:Se}),(function(En){const bn=J.getAverageThroughput(En);isNaN(bn)||d.setSavedBitrateSettings(En,bn)})(Se),!0}function $e(){return B.get().streaming.abr.rules.bolaRule.active&&B.get().streaming.abr.rules.throughputRule.active}function ot(Se){c.handleNewMediaInfo(Se)}return q={canPerformQualitySwitch:Ke,checkPlaybackQuality:Oe,clearDataForStream:function(Se){N&&N.clearForStream(Se),te[Se]&&delete te[Se],M&&M.clearForStream(Se),i[Se]&&delete i[Se],delete v[Se],c.clearDataForStream(Se)},excludeRepresentation:function(Se,We=1/0){var rt,gt,Ot,zt;const Wt=Se.mediaInfo,Qt=Wt.streamInfo.id;v[Qt]=v[Qt]||{},v[Qt][Wt.type]=v[Qt][Wt.type]||new Map,v[Qt][Wt.type].set(Se.id,Date.now()+We),ot(Wt);const fn=(Ot=(gt=(rt=te[Qt])==null?void 0:rt[Wt.type])==null?void 0:gt.getRepresentationController())==null?void 0:Ot.getCurrentCompositeRepresentation();if(!fn||fn.id!==Se.id&&((zt=fn.dependentRepresentation)==null?void 0:zt.id)!==Se.id)return void k.warn(`Excluded representation ${Se.id} for ${Wt.type}`);const En=w(Wt,Se.bitrateInKbit);En&&En.id!==Se.id?(k.warn(`Excluded representation ${Se.id} for ${Wt.type}, switching to representation ${En.id}`),fe(Wt.type,Wt.streamInfo,En,{message:`[AbrController]: Representation ${Se.id} is excluded`})):k.error(`Excluded representation ${Se.id} for ${Wt.type}, no other representation left to switch to`)},getAbandonmentStateFor:function(Se,We){return i[Se]&&i[Se][We]?i[Se][We].state:null},getInitialBitrateFor:function(Se){if(Se===U.A.TEXT)return NaN;let We=D.getAbrBitrateParameter("initialBitrate",Se);if(We>0)return We;let rt=NaN;if(d&&d.hasOwnProperty("getSavedBitrateSettings")&&(rt=d.getSavedBitrateSettings(Se)),!isNaN(rt))return rt;const gt=J.getAverageThroughput(Se);return!isNaN(gt)&&gt>0?gt:Se===U.A.VIDEO?1e3:100},getOptimalRepresentationForBitrate:w,getPossibleVoRepresentations:function(Se,We=!0){return G(Se,We)},getPossibleVoRepresentationsFilteredBySettings:O,getRepresentationByAbsoluteIndex:function(Se,We,rt=!0){return isNaN(Se)||Se<0?null:O(We,rt).find(gt=>gt.absoluteIndex===Se)},handleNewMediaInfo:ot,handlePendingManualQualitySwitch:function(Se,We){try{const rt=pe(Se,We);let gt=null;if($.has(rt)&&(gt=$.get(rt)),!gt)return!1;const Ot=te[Se][We],zt=Ot.getLastSegment();if(!Ke(zt,Ot.getRepresentation()))return!1;const{type:Wt,streamInfo:Qt,representation:fn,reason:En}=gt;return $.delete(rt),fe(Wt,Qt,fn,En),!0}catch(rt){k.error(`Can not handle pending manual quality switch: ${rt}`)}},initialize:function(){N=Ne(n).create(),M=Ce(n).create(),c=it(n).create({dashMetrics:h,customParametersModel:I,mediaPlayerModel:D,settings:B}),c.initialize(),t.on(u.A.QUALITY_CHANGE_RENDERED,be,q),t.on(u.A.METRIC_ADDED,me,q),t.on(F.A.LOADING_PROGRESS,Ae,q),t.on(F.A.VIDEO_ELEMENT_RESIZED,ke,q)},isPlayingAtLowestQuality:function(Se){return O(Se.mediaInfo,!0)[0].id===Se.id},isPlayingAtTopQuality:function(Se){if(!Se)return!0;const We=O(Se.mediaInfo,!0);return We[We.length-1].id===Se.id},manuallySetPlaybackQuality:function(Se,We,rt,gt={}){const Ot=te[We.id][Se];if(Ke(Ot.getLastSegment(),Ot.getRepresentation()))return fe(Se,We,rt,gt);(function(zt,Wt,Qt,fn){try{k.debug(`[AbrController] Queuing manual quality switch for stream ${Wt.id} and type ${zt} to representation ${Qt.id}`);const En=pe(Wt.id,zt);$.set(En,{type:zt,streamInfo:Wt,representation:Qt,reason:fn})}catch(En){k.error(`Can not queue manual quality switch: ${En}`)}})(Se,We,rt,gt)},registerStreamType:function(Se,We){const rt=We.getStreamInfo().id;te[rt]||(te[rt]={}),te[rt][Se]=We,i[rt]||(i[rt]={}),i[rt][Se]={},i[rt][Se].state=mt.ALLOW_LOAD,c.getBolaState(Se)===void 0&&c.setBolaState(Se,B.get().streaming.abr.rules.bolaRule.active&&!$e())},reset:function(){H(),t.off(u.A.QUALITY_CHANGE_RENDERED,be,q),t.off(u.A.METRIC_ADDED,me,q),t.off(F.A.LOADING_PROGRESS,Ae,q),t.off(F.A.VIDEO_ELEMENT_RESIZED,ke,q),c&&c.reset()},setConfig:function(Se){Se&&(Se.streamController&&(ee=Se.streamController),Se.throughputController&&(J=Se.throughputController),Se.domStorage&&(d=Se.domStorage),Se.mediaPlayerModel&&(D=Se.mediaPlayerModel),Se.customParametersModel&&(I=Se.customParametersModel),Se.cmsdModel&&(l=Se.cmsdModel),Se.dashMetrics&&(h=Se.dashMetrics),Se.adapter&&(A=Se.adapter),Se.videoModel&&(L=Se.videoModel),Se.settings&&(B=Se.settings),Se.capabilities&&(p=Se.capabilities))},setPlaybackQuality:fe,unRegisterStreamType:function(Se,We){try{te[Se]&&te[Se][We]&&delete te[Se][We],i[Se]&&i[Se][We]&&delete i[Se][We]}catch{}}},k=e.getLogger(q),H(),q}Ge.__dashjs_factory_name="AbrController";const st=o.A.getSingletonFactory(Ge);o.A.updateSingletonFactory(Ge.__dashjs_factory_name,st);var nt,ft,Pt,_t,Et,Dt=st,pn=function(n){for(var e=[],t=0;t<n.length;++t){var i=n.charCodeAt(t);i<128?e.push(i):i<2048?(e.push(192|i>>6),e.push(128|63&i)):i<65536?(e.push(224|i>>12),e.push(128|63&i>>6),e.push(128|63&i)):(e.push(240|i>>18),e.push(128|63&i>>12),e.push(128|63&i>>6),e.push(128|63&i))}return e},cn=function(n){for(var e=[],t=0;t<n.length;){var i=n[t++];i<128||(i<224?(i=(31&i)<<6,i|=63&n[t++]):i<240?(i=(15&i)<<12,i|=(63&n[t++])<<6,i|=63&n[t++]):(i=(7&i)<<18,i|=(63&n[t++])<<12,i|=(63&n[t++])<<6,i|=63&n[t++])),e.push(String.fromCharCode(i))}return e.join("")},qt={};nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ft=function(n){for(var e=0,t=[],i=0|n.length/3;0<i--;){var r=(n[e]<<16)+(n[e+1]<<8)+n[e+2];e+=3,t.push(nt.charAt(63&r>>18)),t.push(nt.charAt(63&r>>12)),t.push(nt.charAt(63&r>>6)),t.push(nt.charAt(63&r))}return n.length-e==2?(r=(n[e]<<16)+(n[e+1]<<8),t.push(nt.charAt(63&r>>18)),t.push(nt.charAt(63&r>>12)),t.push(nt.charAt(63&r>>6)),t.push("=")):n.length-e==1&&(r=n[e]<<16,t.push(nt.charAt(63&r>>18)),t.push(nt.charAt(63&r>>12)),t.push("==")),t.join("")},Pt=(function(){for(var n=[],e=0;e<64;++e)n[nt.charCodeAt(e)]=e;return n[61]=0,n})(),_t=function(n){for(var e=0,t=[],i=0|n.length/4;0<i--;){var r=(Pt[n.charCodeAt(e)]<<18)+(Pt[n.charCodeAt(e+1)]<<12)+(Pt[n.charCodeAt(e+2)]<<6)+Pt[n.charCodeAt(e+3)];t.push(255&r>>16),t.push(255&r>>8),t.push(255&r),e+=4}return t&&(n.charAt(e-2)=="="?(t.pop(),t.pop()):n.charAt(e-1)=="="&&t.pop()),t},Et={encode:function(n){for(var e=[],t=0;t<n.length;++t)e.push(n.charCodeAt(t));return e},decode:function(n){for(var e=0;e<s.length;++e)a[e]=String.fromCharCode(a[e]);return a.join("")}},qt.decodeArray=function(n){var e=_t(n);return new Uint8Array(e)},qt.encodeASCII=function(n){var e=Et.encode(n);return ft(e)},qt.decodeASCII=function(n){var e=_t(n);return Et.decode(e)},qt.encode=function(n){var e=pn(n);return ft(e)},qt.decode=function(n){var e=_t(n);return cn(e)};var dn=qt,Mn=C(7393);const yn=NaN;class gn{constructor(e,t){this.data={baseUrls:e||null,selectedIdx:t||yn},this.children=[]}}function $t(){let n,e,t,i,r;const c=this.context,A=(0,Mn.A)(c).getInstance();function p(h,d,N){const v=l(N);t.childBaseUrls.push(...v),h[d]?A.areEqual(v,h[d].data.baseUrls)||(h[d].data.baseUrls=v,h[d].data.selectedIdx=yn):h[d]=new gn(v)}function l(h){let d=i.getBaseURLsFromElement(h);const N=r.getSynthesizedBaseUrlElements(d);return N&&N.length>0&&N.forEach(v=>{const q=d.findIndex(k=>k.serviceLocation===v.serviceLocation);q!==-1?d[q]=v:d.push(v)}),d}function _(h,d){const N=d||e;h(N.data),N.children&&N.children.forEach(v=>_(h,v))}function I(){e=new gn,t={rootBaseUrls:[],childBaseUrls:[]}}return n={getAvailableBaseUrlsForElement:function(h){return l(h)},getBaseUrlsForPayload:function(){return{rootBaseUrls:t.rootBaseUrls.slice(),childBaseUrls:t.childBaseUrls.slice()}},getForPath:function(h){let d=e;const N=[d.data];return h&&h.forEach(v=>{d=d.children[v],d&&N.push(d.data)}),N.filter(v=>v.baseUrls.length)},invalidateSelectedIndexes:function(h){_(d=>{isNaN(d.selectedIdx)||h===d.baseUrls[d.selectedIdx].serviceLocation&&(d.selectedIdx=yn)})},reset:I,setConfig:function(h){h.adapter&&(i=h.adapter),h.contentSteeringController&&(r=h.contentSteeringController)},update:function(h){(function(d){(function(){if(!i||!i.hasOwnProperty("getBaseURLsFromElement")||!i.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")})();const N=l(d);t={rootBaseUrls:N,childBaseUrls:[]},A.areEqual(N,e.data.baseUrls)||(e.data.baseUrls=N,e.data.selectedIdx=yn),d&&d.Period&&d.Period.forEach((v,q)=>{p(e.children,q,v),v.AdaptationSet&&v.AdaptationSet.forEach((k,D)=>{p(e.children[q].children,D,k),k.Representation&&k.Representation.sort(i.getRepresentationSortFunction()).forEach(($,B)=>{p(e.children[q].children[D].children,B,$)})})})})(h)}},I(),n}$t.__dashjs_factory_name="BaseURLTreeModel";var At=o.A.getClassFactory($t),ct=C(3773),Vt=class{constructor(n){this.url=n||null,this.type=Ee.G.CONTENT_STEERING_TYPE,this.responseType="json"}},jt=class{constructor(){this.version=null,this.ttl=300,this.reloadUri=null,this.pathwayPriority=[],this.pathwayClones=[]}},Fe=C(8854),ln=C(6503),Pn=C(9415),zn=C(6517),Xn=C(7263);function ar(){const n=this.context,e=(0,ln.A)(n).getInstance();let t,i,r,c,A,p,l,_,I,h,d,N,v,q,k,D;function $(G){te(G,"baseUrl")}function B(G){te(G,"location")}function ee(G){var W,ie;G&&G.throughputValues&&G.throughputValues.serviceLocation&&(W=G.throughputValues.serviceLocation,ie=G.throughputValues,q[W]||(q[W]=[]),q[W].push(ie),q[W].length>4&&q[W].shift())}function te(G,W){if(G&&G.request&&G.request.serviceLocation){const ie=G.request.serviceLocation;N[W].all.indexOf(ie)===-1&&N[W].all.push(ie),N[W].current=ie}}function M(){const G=_.getValue();let W=t.getContentSteering(G);return W||(W=d.getServiceDescriptionSettings().contentSteering),!W&&i&&(W=i),i=W,W}function J(){return new Promise(G=>{try{const W=M();if(!W||!W.serverUrl)return void G();const ie=(function(Ae){let ke=Ae.serverUrl;r&&r.reloadUri&&(ke=e.isRelative(r.reloadUri)?e.resolve(r.reloadUri,Ae.serverUrl):r.reloadUri);const Ie=[],be=N.baseUrl.all.concat(N.location.all);if(be.length>0){const me=be.map(le=>{const fe=(function(pe){if(!pe||!q[pe]||q[pe].length===0)return-1;const ze=v.getArithmeticMean(q[pe],q[pe].length,!0);return parseInt(1e3*ze)})(le);return{serviceLocation:le,throughput:fe}});let Oe="",Ke="";me.forEach((le,fe)=>{fe!==0&&(Oe+=",",Ke+=","),Oe+=le.serviceLocation,Ke+=le.throughput>-1?le.throughput:""}),Ie.push({key:"_DASH_pathway",value:`"${Oe}"`}),Ie.push({key:"_DASH_throughput",value:Ke})}return ke=Xn.A.addAdditionalQueryParameterToUrl(ke,Ie),ke})(W),oe=new Vt(ie);k.load({request:oe,success:Ae=>{(function(ke){ke&&ke[Fe.A.CONTENT_STEERING_RESPONSE.VERSION]&&parseInt(ke[Fe.A.CONTENT_STEERING_RESPONSE.VERSION])===1&&(r=new jt,r.version=ke[Fe.A.CONTENT_STEERING_RESPONSE.VERSION],ke[Fe.A.CONTENT_STEERING_RESPONSE.TTL]&&!isNaN(ke[Fe.A.CONTENT_STEERING_RESPONSE.TTL])&&(r.ttl=ke[Fe.A.CONTENT_STEERING_RESPONSE.TTL]),ke[Fe.A.CONTENT_STEERING_RESPONSE.RELOAD_URI]&&(r.reloadUri=ke[Fe.A.CONTENT_STEERING_RESPONSE.RELOAD_URI]),ke[Fe.A.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]&&(r.pathwayPriority=ke[Fe.A.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]),ke[Fe.A.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES]&&(r.pathwayClones=ke[Fe.A.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES],r.pathwayClones=r.pathwayClones.filter(Ie=>(function(be){return be[Fe.A.CONTENT_STEERING_RESPONSE.BASE_ID]&&be[Fe.A.CONTENT_STEERING_RESPONSE.ID]&&be[Fe.A.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT]&&be[Fe.A.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][Fe.A.CONTENT_STEERING_RESPONSE.HOST]})(Ie))),w())})(Ae),p.trigger(u.A.CONTENT_STEERING_REQUEST_COMPLETED,{currentSteeringResponseData:r,url:ie}),G()},error:(Ae,ke,Ie,be)=>{(function(me,Oe){try{switch(l.warn("Error fetching data from content steering server",me),Oe.status){case 404:case 410:i=null;break;case 429:const Ke=Oe&&Oe.headers&&Oe.headers["retry-after"];Ke!==null&&(r||(r={}),r.ttl=parseInt(Ke)),w();break;default:w()}}catch(Ke){l.error(Ke)}})(Ae,be),G(Ae)},complete:()=>{N.baseUrl.all=L(N.baseUrl),N.location.all=L(N.location)}})}catch(W){G(W)}})}function L(G){return G.all&&G.all.length!==0&&G.current?G.all.filter(W=>W===G.current):[]}function H(G){try{const W=[];return G&&G.length!==0&&r&&r.pathwayClones&&r.pathwayClones.length!==0&&r.pathwayClones.forEach(ie=>{let oe=G.filter(ke=>ie[Fe.A.CONTENT_STEERING_RESPONSE.BASE_ID]===ke.serviceLocation),Ae=null;if(oe&&oe.length>0&&(Ae=oe[0]),Ae){const ke=new URL(Ae.url);let Ie=ie[Fe.A.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][Fe.A.CONTENT_STEERING_RESPONSE.HOST];Ie=Xn.A.stringHasProtocol(Ie)?Ie:`${ke.protocol}//${Ie}`;const be={synthesizedUrl:`${Ie}${ke.pathname}`,serviceLocation:ie[Fe.A.CONTENT_STEERING_RESPONSE.ID],queryParams:ie[Fe.A.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][Fe.A.CONTENT_STEERING_RESPONSE.PARAMS],reference:Ae};W.push(be)}}),W}catch(W){return l.error(W),[]}}function w(){r&&r.ttl&&!isNaN(r.ttl)&&(h&&clearTimeout(h),h=setTimeout(()=>{J()},1e3*r.ttl))}function O(){h&&clearTimeout(h),h=null}function x(){r=null,i=null,q={},N={baseUrl:{current:null,all:[]},location:{current:null,all:[]}},O()}return D={reset:function(){x(),p.off(u.A.FRAGMENT_LOADING_STARTED,$,D),p.off(u.A.MANIFEST_LOADING_STARTED,B,D),p.off(u.A.THROUGHPUT_MEASUREMENT_STORED,ee,D)},setConfig:function(G){G&&(G.adapter&&(t=G.adapter),G.errHandler&&(A=G.errHandler),G.dashMetrics&&(c=G.dashMetrics),G.mediaPlayerModel&&(I=G.mediaPlayerModel),G.manifestModel&&(_=G.manifestModel),G.serviceDescriptionController&&(d=G.serviceDescriptionController),G.throughputController&&(v=G.throughputController),G.eventBus&&(p=G.eventBus))},loadSteeringData:J,getCurrentSteeringResponseData:function(){return r},shouldQueryBeforeStart:function(){const G=M();return!!G&&G.queryBeforeStart},getSteeringDataFromManifest:M,stopSteeringRequestTimer:O,getSynthesizedBaseUrlElements:function(G){try{return H(G).map(W=>{const ie=new Pn.A(W.synthesizedUrl,W.serviceLocation);return ie.queryParams=W.queryParams,ie.dvbPriority=W.reference.dvbPriority,ie.dvbWeight=W.reference.dvbWeight,ie.availabilityTimeOffset=W.reference.availabilityTimeOffset,ie.availabilityTimeComplete=W.reference.availabilityTimeComplete,ie})}catch(W){return l.error(W),[]}},getSynthesizedLocationElements:function(G){try{return H(G).map(W=>{const ie=new zn.A(W.synthesizedUrl,W.serviceLocation);return ie.queryParams=W.queryParams,ie})}catch(W){return l.error(W),[]}},initialize:function(){k=(0,ct.A)(n).create({errHandler:A,dashMetrics:c,mediaPlayerModel:I,errors:f.A}),p.on(u.A.FRAGMENT_LOADING_STARTED,$,D),p.on(u.A.MANIFEST_LOADING_STARTED,B,D),p.on(u.A.THROUGHPUT_MEASUREMENT_STORED,ee,D)}},l=(0,j.A)(n).getInstance().getLogger(D),x(),D}ar.__dashjs_factory_name="ContentSteeringController";var tr=o.A.getSingletonFactory(ar);function Ir(n){let e;n=n||{};let t=[];const i=(0,m.A)(this.context).getInstance(),r=(0,E.A)(this.context).getInstance(),c=tr(this.context).getInstance(),A=n.updateEventName,p=n.addBlacklistEventName;function l(h){if(t.findIndex(N=>N.entry===h)!==-1)return;const d=n.enableExpiry?(function(){const N=c?c.getCurrentSteeringResponseData():null;return N&&Number.isFinite(N.ttl)?N.ttl:r.get().streaming.blacklistExpiryTime})():NaN;if(n.enableExpiry&&d&&d>0){const N=setTimeout(()=>{_(h)},1e3*d);t.push({entry:h,timeoutId:N})}else t.push({entry:h});i.trigger(A,{entry:h})}function _(h){const d=t.findIndex(N=>N.entry===h);d!==-1&&t.splice(d,1)}function I(h){l(h.entry)}return e={add:l,remove:_,contains:function(h){return!!(t.length&&h&&h.length)&&t.findIndex(d=>d.entry===h)!==-1},initialize:function(){p&&i.on(p,I,e)},reset:function(){p&&i.off(p,I,e);for(const h of t)h.timeoutId&&clearTimeout(h.timeoutId);t=[]}},e}Ir.__dashjs_factory_name="BlackListController";var ir=o.A.getClassFactory(Ir);function Or(n){let e;const t=(n=n||{}).blacklistController;return e={select:function(i){return i&&(function(r){let c,A,p=0,l=[],_=0;if(A=r.sort(function(I,h){let d=I.dvbPriority-h.dvbPriority;return isNaN(d)?0:d}).filter(function(I,h,d){return!h||d[0].dvbPriority&&I.dvbPriority&&d[0].dvbPriority===I.dvbPriority}),A.length)return A.length>1&&(A.forEach(I=>{p+=I.dvbWeight,l.push(p)}),c=Math.floor(Math.random()*p),l.every((I,h)=>(_=h,!(c<I)))),A[_]})((function(r){let c=[];return r.filter(function(A){return!t.contains(A.serviceLocation)||(A.dvbPriority&&c.push(A.dvbPriority),!1)}).filter(function(A){return!c.length||!A.dvbPriority||c.indexOf(A.dvbPriority)===-1})})(i))}},e}Or.__dashjs_factory_name="DVBSelector";var cr=o.A.getClassFactory(Or);function kr(n){let e;const t=(n=n||{}).blacklistController;return e={select:function(i){let r,c=0;return i&&i.some((A,p)=>(c=p,!t.contains(A.serviceLocation)))&&(r=i[c]),r}},e}kr.__dashjs_factory_name="BasicSelector";var Lr=o.A.getClassFactory(kr),Hn=C(1944),Rr=C(656);function ui(){const n=this.context;let e,t,i;function r(c=[],A=[]){let p=0,l=NaN;for(;p<c.length;){const _=c[p],I=A.findIndex(h=>h.serviceLocation&&h.serviceLocation===_);if(I!==-1&&!i.contains(A[I].serviceLocation)){l=I;break}p+=1}return l}return e={selectBaseUrlIndex:function(c){let A=NaN;if(isNaN(c.selectedIdx)){const l=t.getSteeringDataFromManifest();l&&l.defaultServiceLocationArray.length>0&&(A=r(l.defaultServiceLocationArray,c.baseUrls))}const p=t.getCurrentSteeringResponseData();return c.baseUrls&&c.baseUrls.length&&p&&p.pathwayPriority&&p.pathwayPriority.length&&(A=r(p.pathwayPriority,c.baseUrls)),A},setConfig:function(c){c.blacklistController&&(i=c.blacklistController),c.contentSteeringController&&(t=c.contentSteeringController)}},t=tr(n).getInstance(),e}ui.__dashjs_factory_name="ContentSteeringSelector";var pi=o.A.getClassFactory(ui);function ci(){const n=this.context,e=(0,m.A)(n).getInstance(),t=(0,E.A)(n).getInstance();let i,r,c,A,p,l;function _(){r.reset()}return i={chooseSelector:function(I){(0,Rr.sq)(I,"boolean"),l=I?A:c},initialize:function(){r.initialize()},select:function(I){if(!I)return;if(t.get().streaming.applyContentSteering){const d=p.selectBaseUrlIndex(I);isNaN(d)||d===-1||(I.selectedIdx=d)}if(!isNaN(I.selectedIdx))return I.baseUrls[I.selectedIdx];let h=l.select(I.baseUrls);return h?(I.selectedIdx=I.baseUrls.indexOf(h),h):(e.trigger(F.A.URL_RESOLUTION_FAILED,{error:new Hn.A(f.A.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,f.A.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(l===c&&_()))},reset:_,setConfig:function(I){I.selector&&(l=I.selector),I.contentSteeringSelector&&(p=I.contentSteeringSelector)}},r=ir(n).create({updateEventName:F.A.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,addBlacklistEventName:F.A.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD,enableExpiry:!0}),c=Lr(n).create({blacklistController:r}),A=cr(n).create({blacklistController:r}),p=pi(n).create(),p.setConfig({blacklistController:r,addBlacklistEventName:F.A.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD}),l=c,i}ci.__dashjs_factory_name="BaseURLSelector";var Cr=o.A.getClassFactory(ci);function di(){let n,e;const t=this.context,i=(0,m.A)(t).getInstance(),r=(0,ln.A)(t).getInstance();let c,A,p;function l(d){c.invalidateSelectedIndexes(d.entry)}function _(d){c.update(d),A.chooseSelector(e.getIsDVB(d)),i.trigger(u.A.BASE_URLS_UPDATED,{baseUrls:I(d)})}function I(d){const{rootBaseUrls:N,childBaseUrls:v}=c.getBaseUrlsForPayload(),q=[],k={};return((function(D,$){return!(D&&!D.BaseURL&&$.length!==0)||!!$.some(B=>r.isRelative(B.url))||!D.Period||D.Period.length===0||D.Period.some(B=>h(B))})(d,v)?N.concat(v):v).forEach(D=>{const $=`${D.serviceLocation}_${D.url}`;k[$]||(q.push(D),k[$]=!0)}),q}function h(d){if(!d||d.BaseURL)return!1;const N=d.AdaptationSet||d.Representation;return!N||N.length===0||N.some(v=>h(v))}return n={getBaseUrls:function(d){return c.getAvailableBaseUrlsForElement(d)},initialize:function(d){i.on(F.A.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,l,n),c.setConfig({adapter:e,contentSteeringController:p}),A.initialize(),_(d)},reset:function(){i.off(F.A.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,l,n),c.reset(),A.reset()},resolve:function(d){const N=c.getForPath(d).reduce((v,q)=>{const k=A.select(q);return k?(r.isRelative(k.url)?v.url=r.resolve(k.url,v.url):(v.url=k.url,v.serviceLocation=k.serviceLocation),v.availabilityTimeOffset=k.availabilityTimeOffset,v.availabilityTimeComplete=k.availabilityTimeComplete,v.queryParams=k.queryParams,v):new Pn.A},new Pn.A);if(!r.isRelative(N.url))return N},setConfig:function(d){d.baseURLTreeModel&&(c=d.baseURLTreeModel),d.baseURLSelector&&(A=d.baseURLSelector),d.adapter&&(e=d.adapter),d.contentSteeringController&&(p=d.contentSteeringController)},update:_},c=At(t).create(),A=Cr(t).create(),n}di.__dashjs_factory_name="BaseURLController";var mi=o.A.getClassFactory(di);class Hr{constructor(e){if(this.offset=e._offset,this.type=e.type,this.size=e.size,this.boxes=[],e.boxes)for(let t=0;t<e.boxes.length;t++)this.boxes.push(new Hr(e.boxes[t]));switch(this.isComplete=!0,e.type){case"sidx":if(this.timescale=e.timescale,this.earliest_presentation_time=e.earliest_presentation_time,this.first_offset=e.first_offset,this.references=e.references,e.references){this.references=[];for(let t=0;t<e.references.length;t++){let i={reference_type:e.references[t].reference_type,referenced_size:e.references[t].referenced_size,subsegment_duration:e.references[t].subsegment_duration};this.references.push(i)}}break;case"emsg":this.id=e.id,this.version=e.version===1?1:0,this.value=e.value,this.timescale=e.timescale,this.scheme_id_uri=e.scheme_id_uri,this.presentation_time_delta=e.version===1?e.presentation_time:e.presentation_time_delta,this.event_duration=e.event_duration,this.message_data=e.message_data;break;case"mdhd":this.timescale=e.timescale;break;case"mfhd":this.sequence_number=e.sequence_number;break;case"subs":this.entry_count=e.entry_count,this.entries=e.entries;break;case"tfhd":this.base_data_offset=e.base_data_offset,this.sample_description_index=e.sample_description_index,this.default_sample_duration=e.default_sample_duration,this.default_sample_size=e.default_sample_size,this.default_sample_flags=e.default_sample_flags,this.flags=e.flags;break;case"tfdt":this.version=e.version,this.baseMediaDecodeTime=e.baseMediaDecodeTime,this.flags=e.flags;break;case"trun":if(this.sample_count=e.sample_count,this.first_sample_flags=e.first_sample_flags,this.data_offset=e.data_offset,this.flags=e.flags,this.samples=e.samples,e.samples){this.samples=[];for(let t=0,i=e.samples.length;t<i;t++){let r={sample_size:e.samples[t].sample_size,sample_duration:e.samples[t].sample_duration,sample_composition_time_offset:e.samples[t].sample_composition_time_offset};this.samples.push(r)}}break;case"prft":this.version=e.version,this.reference_track_ID=e.reference_track_ID,this.ntp_timestamp_sec=e.ntp_timestamp_sec,this.ntp_timestamp_frac=e.ntp_timestamp_frac,this.media_time=e.media_time,this.flags=e.flags}}getChildBox(e){for(let t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}getChildBoxes(e){let t=[];for(let i=0;i<this.boxes.length;i++)this.boxes[i].type===e&&t.push(this.boxes[i]);return t}}var Ei=Hr;function jr(){let n,e;function t(r){let c=[];if(!r||!e||typeof e.fetchAll!="function")return c;let A,p=e.fetchAll(r);for(let l=0,_=p.length;l<_;l++)A=i(p[l]),A&&c.push(A);return c}function i(r){if(!r)return null;let c=new Ei(r);return r.hasOwnProperty("_incomplete")&&(c.isComplete=!r._incomplete),c}return n={getBox:function(r){return r&&e&&e.boxes&&e.boxes.length!==0&&typeof e.fetch=="function"?i(e.fetch(r)):null},getBoxes:t,setData:function(r){e=r},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;let r=t(e.boxes[e.boxes.length-1].type);return r.length>0?r[r.length-1]:null}},n}jr.__dashjs_factory_name="IsoFile";var fi=o.A.getClassFactory(jr),Gr=C(6877),vt=class{constructor({found:n,sizeOfLastCompletedBox:e,sizeOfLastFoundTargetBox:t,startOffsetOfLastCompletedBox:i,startOffsetOfLastFoundTargetBox:r,typeOfLastCompletedBox:c,typeOfLastTargetBox:A}){this.found=n!==void 0&&n,this.sizeOfLastCompletedBox=e!==void 0?e:0,this.sizeOfLastFoundTargetBox=t!==void 0?t:0,this.startOffsetOfLastCompletedBox=i!==void 0?i:0,this.startOffsetOfLastFoundTargetBox=r!==void 0?r:0,this.typeOfLastCompletedBox=c!==void 0?c:null,this.typeOfLastTargetBox=A!==void 0?A:null}};function Jt(){let n,e,t=this.context;function i(A){if(!A)return null;A.fileStart===void 0&&(A.fileStart=0);let p=Gr.parseBuffer(A),l=fi(t).create();return l.setData(p),l}function r(A,p){return A[p+3]>>>0|A[p+2]<<8>>>0|A[p+1]<<16>>>0|A[p]<<24>>>0}function c(A,p){return String.fromCharCode(A[p++])+String.fromCharCode(A[p++])+String.fromCharCode(A[p++])+String.fromCharCode(A[p])}return e={findInitRange:function(A){let p,l,_=null;const I=i(A);if(!I)return _;const h=I.getBox("ftyp"),d=I.getBox("moov");return n.debug("Searching for initialization."),d&&d.isComplete&&(p=h?h.offset:d.offset,l=d.offset+d.size-1,_=p+"-"+l,n.debug("Found the initialization. Range: "+_)),_},findLastTopIsoBoxCompleted:function(A,p,l){if(l===void 0&&(l=0),!p||l+8>=p.byteLength)return new vt({found:!1});const _=p instanceof ArrayBuffer?new Uint8Array(p):p;let I,h=0,d=0,N=null;for(;l<_.byteLength;){const v=r(_,l),q=c(_,l+4);if(v===0)break;l+v<=_.byteLength&&(A.indexOf(q)>=0?I=new vt({found:!0,startOffsetOfLastFoundTargetBox:l,sizeOfLastFoundTargetBox:v,typeOfLastTargetBox:q}):(h=l,d=v,N=q)),l+=v}return I||new vt({found:!1,startOffsetOfLastCompletedBox:h,sizeOfLastCompletedBox:d,typeOfLastCompletedBox:N})},getMediaTimescaleFromMoov:function(A){let p=i(A),l=p?p.getBox("mdhd"):void 0;return l?l.timescale:NaN},getSamplesInfo:function(A){if(!A||A.byteLength===0)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};let p,l,_,I,h,d,N,v,q,k,D,$,B,ee,te,M,J,L=i(A),H=L.getBoxes("moof"),w=L.getBoxes("mfhd");if(H.length===0||w.length===0)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};M=L.getBoxes("moof").length,te=w[w.length-1].sequence_number,_=0,d=[];let O=-1,x=-1;for(D=0;D<H.length;D++){let G=H[D],W=G.getChildBoxes("traf");for(q=0;q<W.length;q++){let ie=W[q],oe=ie.getChildBox("tfhd"),Ae=ie.getChildBox("tfdt");h=Ae.baseMediaDecodeTime;let ke=ie.getChildBoxes("trun"),Ie=ie.getChildBoxes("subs");for(k=0;k<ke.length;k++){let be=ke[k];for(_=be.sample_count,ee=(oe.base_data_offset||0)+(be.data_offset||0),v=0;v<_;v++){N=be.samples[v],p=N.sample_duration!==void 0?N.sample_duration:oe.default_sample_duration,I=N.sample_size!==void 0?N.sample_size:oe.default_sample_size,l=N.sample_composition_time_offset!==void 0?N.sample_composition_time_offset:0;let me={dts:h,cts:h+l,duration:p,offset:G.offset+ee,size:I,subSizes:[I]};if(Ie)for($=0;$<Ie.length;$++){let Oe=Ie[$];if(O<Oe.entry_count-1&&v>x&&(O++,x+=Oe.entries[O].sample_delta),v==x){me.subSizes=[];let Ke=Oe.entries[O];for(B=0;B<Ke.subsample_count;B++)me.subSizes.push(Ke.subsamples[B].subsample_size)}}d.push(me),ee+=I,h+=p}}J=h-Ae.baseMediaDecodeTime}}return{sampleList:d,lastSequenceNumber:te,totalDuration:J,numSequences:M}},parse:i},n=(0,j.A)(t).getInstance().getLogger(e),e}Jt.__dashjs_factory_name="BoxParser";var An=o.A.getSingletonFactory(Jt),Un=C(559);const Dn={0:void 0,1:{channels:1,lfe:0},2:{channels:2,lfe:0},3:{channels:3,lfe:0},4:{channels:4,lfe:0},5:{channels:5,lfe:0},6:{channels:5,lfe:1},7:{channels:7,lfe:1},8:{channels:2,lfe:0},9:{channels:3,lfe:0},10:{channels:4,lfe:0},11:{channels:6,lfe:1},12:{channels:7,lfe:1},13:{channels:22,lfe:2},14:{channels:7,lfe:1},15:{channels:10,lfe:2},16:{channels:9,lfe:1},17:{channels:11,lfe:1},18:{channels:13,lfe:1},19:{channels:11,lfe:1},20:{channels:13,lfe:1}};function Ln(n){return n==0?0:n.toString(2).match(/1/g).length}function qn(n,e){let t,i=parseInt("0x"+n,16),r=i&e[0],c=i&e[1];return t=Ln(r)+2*Ln(c),t}var Cn=function(n,e=!1){let t;if(!n||!n.schemeIdUri||!n.value)return;const i=n.schemeIdUri,r=n.value;if(i==="urn:mpeg:dash:23003:3:audio_channel_configuration:2011"||i==="urn:mpeg:mpegB:cicp:ChannelConfiguration"){const c=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/.test(r)?Number(r):NaN,A=Dn[c];t=A&&A.channels+(e?A.lfe:0)}else i==="tag:dolby.com,2014:dash:audio_channel_configuration:2011"?t=(function(c,A){if(c.length===4)return qn(c,[63880+(A?6:0),1648])})(r,e):i==="tag:dolby.com,2015:dash:audio_channel_configuration:2015"?t=(function(c,A){if(c.length===6)return c==="800000"?24:qn(c,[56834+(A?4160:0),205245])})(r,e):i==="tag:dts.com,2014:dash:audio_channel_configuration:2012"?t=parseInt(r):i==="tag:dts.com,2018:uhd:audio_channel_configuration"&&(t=(function(c,A){if(!(c.length>8))return qn(c,[4294901727+(A?65568:0),0])})(r,e));return t};function Sn(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c,A,p,l;function _($,B){const ee=i.getMainAdaptationSetForPreselection($,B);return ee&&ee.Representation?ee.Representation:[]}function I($,B,ee,te=void 0){const M=d($,B,ee,te);return r.isCodecSupportedBasedOnTestedConfigurations(M,$)}function h($,B,ee,te,M,J=void 0){const L=d($,B,ee,J),H=JSON.stringify(L);te.has(H)||(te.add(H),M.push(L))}function d($,B,ee,te){let M=null;switch($){case U.A.VIDEO:M=(function(J,L,H){let w={codec:L,width:J&&J.width||null,height:J&&J.height||null,framerate:i.getFramerate(J)||null,bitrate:J&&J.bandwidth||null,isSupported:!0};if(J.tagName===Fe.A.PRESELECTION&&H&&(w.width||(w.width=H.width||null),w.height||(w.height=H.height||null),w.bitrate||(w.bitrate=H.bandwidth||null),w.framerate||(w.framerate=i.getFramerate(H)||null)),c.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&(Object.assign(w,v(J)),J.tagName===Fe.A.PRESELECTION&&H)){let G=v(H),W=G.isSupported;delete G.isSupported,w.isSupported=w.isSupported&&W,N(w,G)}let O=w.isSupported;if(c.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&(Object.assign(w,q(J)),J.tagName===Fe.A.PRESELECTION&&H)){let G=q(H),W=G.isSupported;delete G.isSupported,w.isSupported=w.isSupported&&W,N(w,G)}let x=w.isSupported;return O&&x||(w.isSupported=!1),w})(B,ee,te);break;case U.A.AUDIO:M=(function(J,L,H){let w={codec:L,samplerate:J&&J.audioSamplingRate||null,bitrate:J&&J.bandwidth||null,isSupported:!0};return J.tagName===Fe.A.PRESELECTION&&H&&(w.samplerate||(w.samplerate=H.audioSamplingRate||null),w.bitrate||(w.bitrate=H.bandwidth||null)),c.get().streaming.capabilities.filterAudioChannelConfiguration&&Object.assign(w,(function(O,x){let G=O[Fe.A.AUDIO_CHANNEL_CONFIGURATION]||[],W=null;G.length==0&&x&&(G=x[Fe.A.AUDIO_CHANNEL_CONFIGURATION]||[]);const ie=G.map(oe=>Cn(oe,!0));return ie.every(oe=>oe==ie[0])&&(W=ie[0]),{channels:W}})(J,H)),w})(B,ee,te);break;default:return M}return te&&(M=k(te,M)),k(B,M)}function N($,B){for(const ee in B)Object.prototype.hasOwnProperty.call(B,ee)&&!(ee in $)&&($[ee]=B[ee]);return $}function v($){let B={colorGamut:null,transferFunction:null,isSupported:!0};for(const ee of $.EssentialProperty||[]){const te=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/.test(ee.value)?Number(ee.value):NaN;ee.schemeIdUri===U.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&[1,5,6,7].includes(te)?B.colorGamut=U.A.MEDIA_CAPABILITIES_API.COLORGAMUT.SRGB:ee.schemeIdUri===U.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&[11,12].includes(te)?B.colorGamut=U.A.MEDIA_CAPABILITIES_API.COLORGAMUT.P3:ee.schemeIdUri===U.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&[9].includes(te)?B.colorGamut=U.A.MEDIA_CAPABILITIES_API.COLORGAMUT.REC2020:ee.schemeIdUri===U.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&[2].includes(te)?B.colorGamut=null:ee.schemeIdUri===U.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&(B.isSupported=!1),ee.schemeIdUri===U.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&[1,6,13,14,15].includes(te)?B.transferFunction=U.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.SRGB:ee.schemeIdUri===U.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&[16].includes(te)?B.transferFunction=U.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.PQ:ee.schemeIdUri===U.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&[18].includes(te)?B.transferFunction=U.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.HLG:ee.schemeIdUri===U.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&[2].includes(te)?B.transferFunction=null:ee.schemeIdUri===U.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&(B.isSupported=!1)}return B}function q($){let B={isSupported:!0,hdrMetadataType:null};for(const ee of $.EssentialProperty||[])ee.schemeIdUri===U.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&ee.value===U.A.HDR_METADATA_FORMAT_VALUES.ST2094_10?B.hdrMetadataType=U.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_10:ee.schemeIdUri===U.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&ee.value===U.A.HDR_METADATA_FORMAT_VALUES.SL_HDR2?B.hdrMetadataType=U.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SLHDR2:ee.schemeIdUri===U.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&ee.value===U.A.HDR_METADATA_FORMAT_VALUES.ST2094_40?B.hdrMetadataType=U.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_40:ee.schemeIdUri===U.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&(B.isSupported=!1);return B}function k($,B){return p&&$&&$[Fe.A.CONTENT_PROTECTION]&&$[Fe.A.CONTENT_PROTECTION].length>0&&(B.keySystemsMetadata=p.getSupportedKeySystemMetadataFromContentProtection($[Fe.A.CONTENT_PROTECTION])),B}function D($){if(!$||$.length===0)return!0;let B=0;for(;B<$.length;){if(!r.supportsEssentialProperty($[B]))return l.debug("[Stream] EssentialProperty not supported: "+$[B].schemeIdUri),!1;B+=1}return!0}return t={setConfig:function($){$&&($.adapter&&(i=$.adapter),$.capabilities&&(r=$.capabilities),$.settings&&(c=$.settings),$.protectionController&&(p=$.protectionController),$.customParametersModel&&(A=$.customParametersModel))},filterUnsupportedFeatures:function($){return new Promise(B=>{const ee=[U.A.VIDEO,U.A.AUDIO],te=[];ee.forEach(M=>{(function(J,L){if(!J||!J.Period||J.Period.length===0)return[];const H=new Set,w=[];return J.Period.forEach(O=>{O.AdaptationSet.forEach(x=>{i.getIsTypeOf(x,L)&&x.Representation.forEach((G,W)=>{const ie=i.getCodec(x,W,!1);h(L,G,ie,H,w);const oe=i.getSupplementalCodecs(G);oe.length>0&&h(L,G,oe[0],H,w)})}),O.Preselection&&O.Preselection.length&&O.Preselection.forEach(x=>{if(i.getPreselectionIsTypeOf(x,O.AdaptationSet,L)){const G=i.getCodecForPreselection(x,O.AdaptationSet);_(x,O.AdaptationSet).forEach(W=>{h(L,x,G,H,w,W)})}})}),w})($,M).forEach(J=>{te.push(r.runCodecSupportCheck(J,M))})}),Promise.allSettled(te).then(()=>(ee.forEach(M=>{(function(J,L){L&&L.Period&&L.Period.length!==0&&L.Period.forEach(H=>{(function(w,O){if(!w||!w.AdaptationSet||w.AdaptationSet.length===0)return;const x=new Set,G=w.AdaptationSet;w.AdaptationSet=G.filter(W=>{i.getIsTypeOf(W,O)&&(function(oe,Ae){oe.Representation&&oe.Representation.length!==0&&(oe.Representation=oe.Representation.filter((ke,Ie)=>{const be=i.getCodec(oe,Ie,!1),me=I(Ae,ke,be);let Oe=(function(Ke,le){let fe=!1;const pe=i.getSupplementalCodecs(Ke);return pe.length>0&&(pe.length>1&&l.warn("[CapabilitiesFilter] Multiple supplemental codecs not supported; using the first in list"),fe=I(le,Ke,pe[0])),fe})(ke,Ae);return Oe&&(l.debug(`[CapabilitiesFilter] Codec supported. Upgrading codecs string of Representation with ID ${ke.id}`),ke.codecs=ke[Fe.A.SUPPLEMENTAL_CODECS]),me||Oe||l.warn(`[CapabilitiesFilter] Codec ${be} not supported. Removing Representation with ID ${ke.id}`),me||Oe}))})(W,O);const ie=W.Representation&&W.Representation.length>0;if(!ie){x.add(W);const oe=G.filter(Ae=>Ae!==W&&i.getIsTypeOf(Ae,O)&&!x.has(Ae));e.trigger(F.A.ADAPTATION_SET_REMOVED_NO_CAPABILITIES,{adaptationSet:W,remainingAdaptationSets:oe}),l.warn(`[CapabilitiesFilter] AdaptationSet with ID ${W.id?W.id:"undefined"} and codec ${W.codecs?W.codecs:"undefined"} has been removed because of no supported Representation`)}return ie})})(H,J),(function(w,O){w&&w.Preselection&&w.Preselection.length!==0&&(w.Preselection=w.Preselection.filter(x=>{if(i.getPreselectionIsTypeOf(x,w.AdaptationSet,O)){const G=i.getCodecForPreselection(x,w.AdaptationSet),W=!G||_(x,w.AdaptationSet).every(ie=>I(O,x,G,ie));return W||l.warn(`[CapabilitiesFilter] Preselection@codecs ${G} not supported. Removing Preselection with ID ${x.id}`),W}return!0}))})(H,J)})})(M,$)}),c.get().streaming.capabilities.filterUnsupportedEssentialProperties&&(function(M){M&&M.Period&&M.Period.length!==0&&M.Period.forEach(J=>{J.AdaptationSet=J.AdaptationSet.filter(L=>{if(!L.Representation||L.Representation.length===0)return!0;if(!D(i.getEssentialProperties(L)))return l.warn(`[CapabilitiesFilter] removed AdaptationSet (id: ${L.id}) with unsupported EssentialProperty`),!1;L.Representation=L.Representation.filter(w=>D(i.getEssentialProperties(w)));const H=L.Representation&&L.Representation.length>0;return H||l.warn(`[CapabilitiesFilter] removed AdaptationSet (id: ${L.id}) with unsupported EssentialProperty on all Representations`),H}),J.Preselection&&J.Preselection.length&&(J.Preselection=J.Preselection.filter(L=>!!D(i.getEssentialProperties(L))||(l.warn(`[CapabilitiesFilter] removed Preselection (id: ${L.id}) with unsupported EssentialProperty`),!1)))})})($),(function(M){M&&M.Period&&M.Period.length!==0&&M.Period.forEach(J=>{J.Preselection&&(J.Preselection=J.Preselection.filter(L=>{const H=String(L.preselectionComponents).split(" ").length;return H!==1&&l.warn(`Multi-Representation Preselection (id: ${L.id}) removed as not supported.`),H===1}))})})($),(function(M){M&&M.Period&&M.Period.length!==0&&M.Period.forEach(J=>{J.Preselection&&(J.Preselection=J.Preselection.filter(L=>{const H=String(L.preselectionComponents).split(" "),w=J.AdaptationSet.map(O=>O.id);return H.every(O=>w.includes(O))}))})})($),(function(M){if(!M||!M.Period||M.Period.length===0)return Promise.resolve();const J=[];return M.Period.forEach(L=>{J.push((function(H){return new Promise(w=>{if(!H||!H.AdaptationSet||H.AdaptationSet.length===0)return void w();const O=[];H.AdaptationSet.forEach(x=>{O.push((function(G){return new Promise(W=>{if(!G.Representation||G.Representation.length===0)return void W();const ie=[];G.Representation.forEach(oe=>{ie.push((function(Ae){const ke=[],Ie=A.getCustomCapabilitiesFilters();return Ie&&Ie.length!==0?Ie.forEach(be=>{ke.push(new Promise(me=>me(be(Ae))))}):ke.push(Promise.resolve(!0)),Promise.all(ke)})(oe))}),Promise.all(ie).then(oe=>{G.Representation=G.Representation.filter((Ae,ke)=>{let Ie=oe[ke].every(be=>be);return Ie||l.debug("[Stream] Representation "+Ae.id+" has been removed because of unsupported CustomFilter"),Ie}),W()}).catch(oe=>{l.warn("[Stream] at least one promise rejected in CustomFilter with error: ",oe),W()})})})(x))}),Promise.all(O).then(()=>{H.AdaptationSet=H.AdaptationSet.filter(x=>x.Representation&&x.Representation.length>0),w()}).catch(()=>{w()})})})(L))}),Promise.all(J)})($))).then(()=>{B()}).catch(M=>{l.error(M),B()})})}},l=(0,j.A)(n).getInstance().getLogger(t),t}Sn.__dashjs_factory_name="CapabilitiesFilter";var Yn=o.A.getSingletonFactory(Sn);function Kn(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c,A,p,l,_,I,h;function d(){i=!1;const M=Xn.A.parseUserAgent();r=M&&M.browser&&M.browser.name&&M.browser.name.toLowerCase()==="safari"}function N(){i=!1}function v(M){if(M.streamId!==p.getActiveStreamInfo().id||!I)return;const J=l.getLiveDelay();l.getBufferLevel()>J/2&&(I=!1)}function q(M){M.streamId===p.getActiveStreamInfo().id&&(I=M.state===mt.BUFFER_EMPTY)}function k(){_.getCatchupModeEnabled()||c.setPlaybackRate(1)}function D(){l.getIsDynamic()&&_.getCatchupModeEnabled()&&(_.getCatchupPlaybackRates().max>0||_.getCatchupPlaybackRates().min<0)&&!l.isPaused()&&!l.isSeeking()&&(function(){try{if(l.getTime()<=0||i||I&&c.getPlaybackRate()===0)return!1;const M=ee();return M===U.A.LIVE_CATCHUP_MODE_LOLP?(function(J,L){try{return Math.abs($())>0||J<L}catch{return!1}})(l.getBufferLevel(),A.get().streaming.liveCatchup.playbackBufferMin):M===U.A.LIVE_CATCHUP_MODE_STEP?(function(){try{const J=_.getCatchupStepSettings(),L=B();if(L<-1*J.start.min||L>J.start.max)return h.debug(`[_stepNeedToCatchUp] latency offset ${L}`),!0;if(l.getPlaybackRate()!==1)return!0}catch{return!1}})():(function(){try{return Math.abs($())>0}catch{return!1}})()}catch{return!1}})()&&(function(){if(!i&&c){let M;const J=c.getPlaybackRate(),L=_.getCatchupPlaybackRates(),H=l.getBufferLevel(),w=$(),O=B(),x=A.get().streaming.liveCatchup.liveThreshold,G=_.getCatchupMaxDrift();if(!isNaN(G)&&G>0&&w>G)h.info("[CatchupController]: Low Latency catchup mechanism. Latency too high, doing a seek to live point"),i=!0,l.seekToCurrentLive(!0,!1);else if(!isNaN(x)&&x>0&&O>x)J>1&&(h.info("[CatchupController]: Past live threshold, setting playback rate to 1.0"),c.setPlaybackRate(1));else{const W=l.getCurrentLiveLatency(),ie=l.getLiveDelay();M=ee()===U.A.LIVE_CATCHUP_MODE_LOLP?(function(Ae,ke,Ie,be,me){let Oe;if(me<be){const Ke=Math.abs(Ae.min),le=5*(me-be);Oe=1-Ke+2*Ke/(1+Math.pow(Math.E,-le)),h.debug("[LoL+ playback control_buffer-based] bufferLevel: "+me+", newRate: "+Oe)}else{if(Math.abs(ke-Ie)<=.02*Ie)Oe=1;else{const Ke=ke-Ie,le=Ke<0?Math.abs(Ae.min):Ae.max,fe=5*Ke;Oe=1-le+2*le/(1+Math.pow(Math.E,-fe))}h.debug("[LoL+ playback control_latency-based] latency: "+ke+", newRate: "+Oe)}return Oe})(L,W,ie,A.get().streaming.liveCatchup.playbackBufferMin,H):ee()===U.A.LIVE_CATCHUP_MODE_STEP?(function(Ae,ke,Ie){let be=1;const me=_.getCatchupStepSettings();if(!I){const Oe=B();Oe>me.stop.max&&Oe>0?be=1+Ae.max:Oe<-1*me.stop.min&&Oe<0&&(be=1+Ae.min),(Oe>-1*me.stop.min&&Oe<0||Oe<me.stop.max&&Oe>0||Oe===0)&&(be=1),l.getPlaybackStalled()&&Ie<=ke/2&&Oe>0&&(be=1)}return h.debug(`[_calculateNewPlaybackRateStep] rate should be ${be}`),be})(L,ie,H):(function(Ae,ke,Ie,be){if(I)return 1;const me=ke-Ie,Oe=me<0?Math.abs(Ae.min):Ae.max,Ke=5*me;let le=1-Oe+2*Oe/(1+Math.pow(Math.E,-Ke));return l.getPlaybackStalled()&&be<=Ie/2&&me>0&&(le=1),le})(L,W,ie,H);const oe=r?.25:.02/(.5/L.max);(M&&Math.abs(J-M)>=oe||M==1)&&(h.debug(`[CatchupController]: Setting playback rate to ${M}`),c.setPlaybackRate(M))}}})()}function $(){return l.getCurrentLiveLatency()-l.getLiveDelay()}function B(){return l.getCurrentLiveLatency()-l.getOriginalLiveDelay()}function ee(){const M=A.get().streaming.liveCatchup.playbackBufferMin;let J=U.A.LIVE_CATCHUP_MODE_DEFAULT;return A.get().streaming.liveCatchup.mode===U.A.LIVE_CATCHUP_MODE_STEP?J=U.A.LIVE_CATCHUP_MODE_STEP:A.get().streaming.liveCatchup.mode!==U.A.LIVE_CATCHUP_MODE_LOLP||M===null||isNaN(M)||(J=U.A.LIVE_CATCHUP_MODE_LOLP),J}function te(){_.getCatchupPlaybackRates(!0)}return t={reset:function(){e.off(u.A.BUFFER_LEVEL_UPDATED,v,t),e.off(u.A.BUFFER_LEVEL_STATE_CHANGED,q,t),e.off(u.A.PLAYBACK_PROGRESS,D,t),e.off(u.A.PLAYBACK_TIME_UPDATED,D,t),e.off(u.A.PLAYBACK_SEEKED,N,t),e.off(F.A.SETTING_UPDATED_CATCHUP_ENABLED,k,t),e.off(F.A.SETTING_UPDATED_PLAYBACK_RATE_MIN,te,t),e.off(F.A.SETTING_UPDATED_PLAYBACK_RATE_MAX,te,t),e.off(u.A.STREAM_INITIALIZED,te,t),d(),c.setPlaybackRate(1,!0)},setConfig:function(M){M&&(M.settings&&(A=M.settings),M.videoModel&&(c=M.videoModel),M.streamController&&(p=M.streamController),M.playbackController&&(l=M.playbackController),M.mediaPlayerModel&&(_=M.mediaPlayerModel))},initialize:function(){e.on(u.A.BUFFER_LEVEL_UPDATED,v,t),e.on(u.A.BUFFER_LEVEL_STATE_CHANGED,q,t),e.on(u.A.PLAYBACK_PROGRESS,D,t),e.on(u.A.PLAYBACK_TIME_UPDATED,D,t),e.on(u.A.PLAYBACK_SEEKED,N,t),e.on(F.A.SETTING_UPDATED_CATCHUP_ENABLED,k,t),e.on(F.A.SETTING_UPDATED_PLAYBACK_RATE_MIN,te,t),e.on(F.A.SETTING_UPDATED_PLAYBACK_RATE_MAX,te,t),e.on(u.A.STREAM_INITIALIZED,te,t),te()}},h=(0,j.A)(n).getInstance().getLogger(t),d(),t}Kn.__dashjs_factory_name="CatchupController";var Qn=o.A.getSingletonFactory(Kn);function er(){let n,e;return n={setConfig:function(t){t&&t.serviceDescriptionController&&(e=t.serviceDescriptionController)},isAdaptationsIncluded:function(t){var i;const{adaptationSetsArray:r}=((i=e?.getServiceDescriptionSettings())==null?void 0:i.clientDataReporting)??{};return!r||r?.length===0||r.includes(t)},isServiceLocationIncluded:function(t,i){var r;if(t===Ee.G.CONTENT_STEERING_TYPE)return!0;const{serviceLocationsArray:c}=((r=e?.getServiceDescriptionSettings())==null?void 0:r.clientDataReporting)??{};return!c||c?.length===0||c.includes(i)}},n}er.__dashjs_factory_name="ClientDataReportingController";var br=o.A.getSingletonFactory(er),Tr=C(1234),zr=C(6066),vr=C(1926);const dr=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}],gr="dashjs_?_bitrate",Ai="dashjs_?_settings",Yr="localStorage",Ti="lastBitrate",yi="lastMediaSettings";function _i(n){n=n||{};const e=this.context,t=n.settings;let i,r,c;function A(I){if(c!==void 0)return c;let h;c=!1;try{typeof window<"u"&&(h=window[I])}catch(d){return r.warn("DOMStorage access denied: "+d.message),c}if(!h||I!==Yr)return c;try{h.setItem("1","1"),h.removeItem("1"),c=!0}catch(d){r.warn("DOMStorage is supported, but cannot be used: "+d.message)}return c}function p(){return Math.round(new Date().getTime()/6e5)*6e5}function l(I,h){return A(I)&&t.get().streaming[h+"CachingInfo"].enabled}function _(){if(!t)throw new Error(U.A.MISSING_CONFIG_ERROR)}return i={getSavedBitrateSettings:function(I){if(_(),!t.get().streaming.lastBitrateCachingInfo.enabled)return NaN;let h=NaN;if(l(Yr,Ti)){const d=gr.replace(/\?/,I);try{const N=JSON.parse(localStorage.getItem(d))||{},v=new Date().getTime()-parseInt(N.timestamp,10)>=t.get().streaming.lastBitrateCachingInfo.ttl||!1,q=parseFloat(N.bitrate);isNaN(q)||v?v&&localStorage.removeItem(d):(h=q,r.debug("Last saved bitrate for "+I+" was "+q))}catch{return null}}return h},setSavedBitrateSettings:function(I,h){if(l(Yr,Ti)&&h){const d=gr.replace(/\?/,I);try{localStorage.setItem(d,JSON.stringify({bitrate:h.toFixed(3),timestamp:p()}))}catch(N){r.error(N.message)}}},getSavedMediaSettings:function(I){if(_(),!t.get().streaming.lastMediaSettingsCachingInfo.enabled)return null;let h=null;if(l(Yr,yi)){const d=Ai.replace(/\?/,I);try{const N=JSON.parse(localStorage.getItem(d))||{},v=new Date().getTime()-parseInt(N.timestamp,10)>=t.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;h=N.settings,v&&(localStorage.removeItem(d),h=null)}catch{return null}}return h},setSavedMediaSettings:function(I,h){if(l(Yr,yi)){const d=Ai.replace(/\?/,I);try{localStorage.setItem(d,JSON.stringify({settings:h,timestamp:p()}))}catch(N){r.error(N.message)}}}},r=(0,j.A)(e).getInstance().getLogger(i),A(Yr)&&dr.forEach(I=>{const h=localStorage.getItem(I.oldKey);if(h){localStorage.removeItem(I.oldKey);try{localStorage.setItem(I.newKey,h)}catch(d){r.error(d.message)}}}),i}_i.__dashjs_factory_name="DOMStorage";var Pi=o.A.getSingletonFactory(_i),Jr=class{constructor(){this.accessibility=null,this.adaptationSetSwitchingCompatibleIds=[],this.audioChannelConfiguration=null,this.bitrateList=null,this.codec=null,this.contentProtection=null,this.essentialProperties=[],this.id=null,this.index=null,this.isEmbedded=null,this.isFragmented=null,this.isPreselection=!1,this.isText=!1,this.labels=null,this.lang=null,this.mimeType=null,this.normalizedKeyIds=new Set,this.representationCount=0,this.roles=null,this.segmentAlignment=!1,this.segmentSequenceProperties=[],this.selectionPriority=1,this.streamInfo=null,this.subSegmentAlignment=!1,this.supplementalProperties=[],this.type=null,this.viewpoint=null}},Si=class{constructor(){this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0,this.isEncrypted=!1}},Ii=class{constructor(){this.availableFrom=null,this.duration=NaN,this.dvrWindowSize=NaN,this.isDynamic=!1,this.loadedTime=null,this.maxFragmentDuration=null,this.minBufferTime=NaN,this.protocol=null,this.serviceDescriptions=[]}},Oi=C(1465),Wn=C(9302),Wr=class{constructor(n){this.valid=n[0]=="/",this.path=n.split("/").filter(e=>e.length!==0).map(e=>{let t={name:e},i=e.indexOf("[");if(i!=-1){t.name=e.substring(0,i);let r=e.substring(i+1,e.length-1);this.valid=this.valid&&r.indexOf("[")==-1;let c=r.indexOf("=");c!=-1?(t.attribute={name:r.substring(1,c),value:r.substring(c+1)},["'",'"'].indexOf(t.attribute.value[0])!=-1&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(r,10)-1}return t})}isValid(){return this.valid}findsElement(){return!this.findsAttribute()}findsAttribute(){return this.path[this.path.length-1].name.startsWith("@")}findsTextReplace(){return this.path[this.path.length-1].name==="text()"}getMpdTarget(n,e){let t=null,i=n,r=1,c="MPD";for(;r<this.path.length&&i!==null;){t=i;let A=this.path[r];if(c=A.name,r!==this.path.length-1||!c.startsWith("@")&&c!=="text()"){let p=t[c]||[];if(p.length===0&&t[c]&&p.push(t[c]),A.position)i=p[A.position]||null;else if(A.attribute){let l=A.attribute;i=p.filter(_=>_[l.name]==l.value)[0]||null}else i=Array.isArray(p)?p[0]:p}r++}return i===null?null:c.startsWith("@")?{name:c.substring(1),leaf:i,target:i}:c==="text()"?{name:"__text",leaf:i,target:i}:{name:c,leaf:i,target:e?t:i}}},Zr=class{constructor(n,e,t){this.action=n,this.xpath=e,this.value=t,this.position=null}getMpdTarget(n){let e=this.action==="remove"||this.action==="replace"||this.position==="before"||this.position==="after";return this.xpath.getMpdTarget(n,e)}};function qr(){let n,e;const t=this.context;return n={getIsPatch:function(i){return i&&i.hasOwnProperty(Fe.A.ORIGINAL_MPD_ID)||!1},getMpdId:function(i){return i&&i[Fe.A.ORIGINAL_MPD_ID]||null},getOriginalPublishTime:function(i){return i&&i.hasOwnProperty(Fe.A.ORIGINAL_PUBLISH_TIME)?new Date(i[Fe.A.ORIGINAL_PUBLISH_TIME]):null},getPatchOperations:function(i){return i?(i.__children||[]).map(r=>{const c=r.tagName;if(c!=="add"&&c!=="remove"&&c!=="replace")return e.warn(`Ignoring node of invalid action: ${c}`),null;let A=r.sel;if(c==="add"&&r.type){if(!r.type.startsWith("@"))return e.warn(`Ignoring add action for prefixed namespace declaration: ${r.type}=${r.__text}`),null;A=`${A}/${r.type}`}let p=new Wr(A);if(!p.isValid())return e.warn(`Ignoring action with invalid selector: ${c} - ${A}`),null;let l=null;p.findsAttribute()||p.findsTextReplace()?l=r.__text||"":c!=="remove"&&(l=r.__children.reduce((I,h)=>{let d=h.tagName;return d!=="#text"&&(I[d]=I[d]||[],I[d].push(h)),I},{}));let _=new Zr(c,p,l);return c==="add"&&(_.position=r.pos),_}).filter(r=>!!r):[]},getPublishTime:function(i){return i&&i.hasOwnProperty(Fe.A.PUBLISH_TIME)?new Date(i[Fe.A.PUBLISH_TIME]):null}},e=(0,j.A)(t).getInstance().getLogger(n),n}qr.__dashjs_factory_name="PatchManifestModel";var Li=o.A.getSingletonFactory(qr),mr=C(5876);const Fi=Object.create(null,Object.getOwnPropertyDescriptors({aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"})),Dr=Object.create(null,Object.getOwnPropertyDescriptors({"art-lojban":"jbo","en-gb-oed":"en-GB-oxendict","i-ami":"ami","i-bnn":"bnn","i-hak":"hak","i-klingon":"tlh","i-lux":"lb","i-navajo":"nv","i-pwn":"pwn","i-tao":"tao","i-tay":"tay","i-tsu":"tsu","no-bok":"nb","no-nyn":"nn","sgn-be-fr":"sfb","sgn-be-nl":"vgt","sgn-ch-de":"sgg","zh-guoyu":"cmn","zh-hakka":"hak","zh-min-nan":"nan","zh-xiang":"hsn","sgn-br":"bzs","sgn-co":"csn","sgn-de":"gsg","sgn-dk":"dsl","sgn-es":"ssp","sgn-fr":"fsl","sgn-gb":"bfi","sgn-gr":"gss","sgn-ie":"isg","sgn-it":"ise","sgn-jp":"jsl","sgn-mx":"mfs","sgn-ni":"ncs","sgn-nl":"dse","sgn-no":"nsl","sgn-pt":"psr","sgn-se":"swl","sgn-us":"ase","sgn-za":"sfs"})),Hs=Object.create(null,Object.getOwnPropertyDescriptors({in:"id",iw:"he",ji:"yi",jw:"jv",mo:"ro"})),js=Object.create(null,Object.getOwnPropertyDescriptors({BU:"MM",DD:"DE",FX:"FR",TP:"TL",YD:"YE",ZR:"CD"})),Ui=Object.create(null);function Xi(n){for(let e=Math.min(3,n.length);e>1;e--){const t=Dr[n.slice(0,e).join("-")];if(t)return t.toLowerCase().split("-").concat(n.slice(e))}return n}function Qr(n){if(!n||typeof n!="string")return n;let e=Xi(n.toLowerCase().split("-"));if(e[0].length===1)return e.join("-");e[0]=Hs[e[0]]||Fi[e[0]]||e[0];for(let A=1;A<e.length&&e[A].length!==1;A++){const p=js[e[A].toUpperCase()];e[A].length===2&&p&&(e[A]=p.toLowerCase())}e=Xi(e),Ui[e[0]]&&e.unshift(Ui[e[0]]);let t=1;for(;t<e.length&&e[t].length!==1;t++)e[t].length===4?e[t]=e[t].charAt(0).toUpperCase()+e[t].slice(1):e[t].length===2&&/^[a-z]+$/.test(e[t])&&(e[t]=e[t].toUpperCase());const i=e.indexOf("x",t),r=i===-1?e.length:i,c=[];for(let A=t;A<r;A++)e[A].length===1?c.push([e[A]]):c[c.length-1].push(e[A]);return c.sort((A,p)=>A[0]<p[0]?-1:1),e.slice(0,t).concat(...c,e.slice(r)).join("-")}[["zh","cdo cjy cmn cpx czh czo gan hak hsn lzh mnp nan wuu yue"],["ar","acm afb aeb ajp apc apd arb arq ars ary arz ayl"],["ms","min zlm zsm"],["sw","swc swh"],["sgn","ase bfi bzs csn dse dsl fsl gsg gss isg ise jsl mfs ncs nsl psr sfb sfs sgg ssp swl vgt"]].forEach(([n,e])=>e.split(" ").forEach(t=>Ui[t]=n));var ei=C(9259);function zs(n,e){return e+10<=n.length&&n[e]===73&&n[e+1]===68&&n[e+2]===51&&n[e+3]<255&&n[e+4]<255&&n[e+6]<128&&n[e+7]<128&&n[e+8]<128&&n[e+9]<128}function Ji(n,e){let t=0;return t=(127&n[e])<<21,t|=(127&n[e+1])<<14,t|=(127&n[e+2])<<7,t|=127&n[e+3],t}function Ws(n,e){return e+10<=n.length&&n[e]===51&&n[e+1]===68&&n[e+2]===73&&n[e+3]<255&&n[e+4]<255&&n[e+6]<128&&n[e+7]<128&&n[e+8]<128&&n[e+9]<128}function xi(n,e=0,t=1/0){return(function(i,r,c,A){const p=(l=i,(0,ei.B1)(l)?l:l.buffer);var l;let _=1;"BYTES_PER_ELEMENT"in A&&(_=A.BYTES_PER_ELEMENT);const I=(v=i)&&(0,ei.B1)(v.buffer)&&v.byteLength!==void 0&&v.byteOffset!==void 0?i.byteOffset:0,h=(I+i.byteLength)/_,d=(I+r)/_,N=Math.floor(Math.max(0,Math.min(d,h)));var v;return new A(p,N,Math.floor(Math.min(N+Math.max(c,0),h))-N)})(n,e,t,Uint8Array)}function Mr(n,e=!1){const t=e?n.indexOf(0):n.length,i=(0,ei.g7)(new DataView(n.buffer,n.byteOffset,t),{encoding:"utf-8"});return e?i:i.replace(/\0/g,"")}function $s(n){return n.type==="PRIV"?(function(e){if(e.size<2)return;const t=Mr(e.data,!0),i=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:i.buffer}})(n):n.type[0]==="W"?(function(e){if(e.type==="WXXX"){if(e.size<2)return;let i=1;const r=Mr(e.data.subarray(i),!0);i+=r.length+1;const c=Mr(e.data.subarray(i));return{key:e.type,info:r,data:c}}const t=Mr(e.data);return{key:e.type,info:"",data:t}})(n):n.type==="APIC"?(function(e){const t={key:e.type,description:"",data:"",mimeType:null,pictureType:null};if(e.size<2)return;if(e.data[0]!==3)return void console.log("Ignore frame with unrecognized character encoding");const i=e.data.subarray(1).indexOf(0);if(i===-1)return;const r=Mr(xi(e.data,1,i)),c=e.data[2+i],A=e.data.subarray(3+i).indexOf(0);if(A===-1)return;const p=Mr(xi(e.data,3+i,A));let l;var _;return r==="-->"?l=Mr(xi(e.data,4+i+A)):(_=e.data.subarray(4+i+A),l=(0,ei.B1)(_)?_:_.byteOffset==0&&_.byteLength==_.buffer.byteLength?_.buffer:new Uint8Array(_).buffer),t.mimeType=r,t.pictureType=c,t.description=p,t.data=l,t})(n):(function(e){if(e.size<2)return;if(e.type==="TXXX"){let i=1;const{data:r}=e,c=Mr(r.subarray(i),!0);i+=c.length+1;const A=Mr(r.subarray(i));return{key:e.type,info:c,data:A}}const t=Mr(e.data.subarray(1));return{key:e.type,info:"",data:t}})(n)}function Xs(n){const e=String.fromCharCode(n[0],n[1],n[2],n[3]),t=Ji(n,4);return{type:e,size:t,data:n.subarray(10,10+t)}}function Zi(){let n,e,t,i,r,c,A,p;const l=this.context;function _(w){return t.getRolesForAdaptation(w).filter(function(O){return O.schemeIdUri===U.A.DASH_ROLE_SCHEME_ID&&O.value===Fe.A.MAIN})[0]}function I(w,O){const x=O?O.index:0,G=t.getAdaptationsForType(c[x].mpd.manifest,x,w);if(!G||G.length===0)return null;if(G.length>1&&O){for(let W=0,ie=G.length;W<ie;W++)if(_(G[W]))return G[W]}return G[0]}function h(w,O,x,G,W,ie){let oe,Ae,ke,Ie,be,me,Oe=[];if(!G||G.length===0)return[];const Ke=t.getAdaptationsForPeriod(O);for(Ie=0,me=G.length;Ie<me;Ie++)if(oe=G[Ie],ke=t.getIndexForAdaptation(oe,w,x.index),Ae=$(Ke[ke]),Ae)if(ie){let le=Ae.accessibility.length;for(be=0;be<le;be++){if(!Ae)continue;let fe=Ae.accessibility[be];if(fe.schemeIdUri===A.ACCESSIBILITY_CEA608_SCHEME)if(fe.value&&fe.value!==""){let pe=fe.value.split(";");if(pe[0].substring(0,2)==="CC")for(be=0;be<pe.length;be++)Ae||(Ae=$.call(this,Ke[ke])),ee(Ae,pe[be].substring(0,3),pe[be].substring(4)),Oe.push(Ae),Ae=null;else for(be=0;be<pe.length;be++)Ae||(Ae=$.call(this,Ke[ke])),ee(Ae,"CC"+(be+1),pe[be]),Oe.push(Ae),Ae=null}else ee(Ae,A.CC1,"eng"),Oe.push(Ae),Ae=null}}else W===A.IMAGE?(te(Ae),Oe.push(Ae),Ae=null):Ae&&Oe.push(Ae);if(r.get().streaming.includePreselectionsInMediainfoArray){const le=t.getPreselectionsForPeriod(O);for(Ie=0,me=le.length;Ie<me;Ie++){const fe=le[Ie];fe.hasOwnProperty("type")&&fe.type===W&&(Ae=B(le[Ie]),Ae&&Oe.push(Ae))}}return Oe}function d(w){const O=N(w);return t.getRegularPeriods(O)}function N(w){const O=q(w);return t.getMpd(O)}function v(){c=[]}function q(w){return w||(c.length>0?c[0].mpd.manifest:null)}function k(w){try{const O=D(w.streamInfo,c),x=t.getAdaptationsForPeriod(O);return w&&w.streamInfo&&w.streamInfo.id!==void 0&&x?x[w.index]:null}catch{return null}}function D(w,O){const x=O.length;for(let G=0;G<x;G++){let W=O[G];if(w&&w.id===W.id)return W}return null}function $(w){if(!w)return null;let O=new Jr;const x=w.period.mpd.manifest.Period[w.period.index].AdaptationSet[w.index];O.id=w.id,O.index=w.index,O.codec=t.getCodec(x);const G=r.get().streaming.enhancement.codecs;return O.type=G.some(W=>{var ie;return(ie=O.codec)==null?void 0:ie.includes(W)})?U.A.ENHANCEMENT:w.type,O.streamInfo=M(w.period),O.representationCount=t.getRepresentationCount(x),O.labels=t.getLabelsForAdaptation(x),O.lang=t.getLanguageForAdaptation(x),O.segmentAlignment=t.getSegmentAlignment(x),O.subSegmentAlignment=t.getSubSegmentAlignment(x),O.viewpoint=t.getViewpointForAdaptation(x),O.accessibility=t.getAccessibilityForAdaptation(x),O.accessibility.filter(function(W){if(W.schemeIdUri&&W.schemeIdUri.search("cea-608")>=0&&p!==void 0)return!0})[0]&&(O.embeddedCaptions=!0),O.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(x),O.audioChannelConfiguration.length===0&&x.Representation&&x.Representation.length>0&&(O.audioChannelConfiguration=t.getAudioChannelConfigurationForRepresentation(x.Representation[0])),O.roles=t.getRolesForAdaptation(x),O.mimeType=t.getMimeType(x),O.contentProtection=t.getContentProtectionByAdaptation(x),O.bitrateList=t.getBitrateListForAdaptation(x),O.selectionPriority=t.getSelectionPriority(x),O.contentProtection&&O.contentProtection.length>0&&(O.contentProtection=(function(W,ie){if(!W||!W.length||!ie)return W;const oe=t.getContentProtectionByManifest(ie);if(!oe||!oe.length)return W;const Ae=oe.reduce((ke,Ie)=>(Ie.refId&&ke.set(Ie.refId,Ie),ke),new Map);return W.map(ke=>{if(ke.ref){const Ie=Ae.get(ke.ref);Ie&&ke.mergeAttributesFromReference(Ie)}return ke})})(O.contentProtection,w.period.mpd.manifest),O.contentProtection=(function(W){const ie=W.map(oe=>oe.cencDefaultKid).filter(oe=>oe!==null);if(ie.length){const oe=ie[0];W.forEach(Ae=>{Ae.keyId=oe})}return W})(O.contentProtection),O.normalizedKeyIds=(function(W){const ie=new Set;return W.forEach(oe=>{oe.cencDefaultKid&&typeof oe.cencDefaultKid=="string"&&ie.add(oe.cencDefaultKid.replace(/-/g,"").toLowerCase())}),ie})(O.contentProtection)),O.isText=t.getIsText(x),O.essentialProperties=t.getCombinedEssentialPropertiesForAdaptationSet(x),O.supplementalProperties=t.getCombinedSupplementalPropertiesForAdaptationSet(x),O.isFragmented=t.getIsFragmented(x),O.isEmbedded=!1,O.adaptationSetSwitchingCompatibleIds=(function(W){if(!W||!W.supplementalProperties)return[];let ie=[];const oe=W.supplementalProperties.filter(Ae=>Ae.schemeIdUri===Fe.A.ADAPTATION_SET_SWITCHING_SCHEME_ID_URI);return oe&&oe.length>0&&(ie=oe[0].value.toString().split(",").filter(Ae=>Ae!==W.id)),ie})(O),O.segmentSequenceProperties=t.getSegmentSequencePropertiesForAdaptationSet(x),O}function B(w){if(!w)return null;let O=new Jr;const x=w.period.mpd.manifest.Period[w.period.index].Preselection[w.index],G=w.period.mpd.manifest.Period[w.period.index].AdaptationSet,W=t.getAdaptationsForPeriod(w.period);return O=$(t.getMainAdaptationSetForPreselection(x,W)),O&&(O.isPreselection=!0,O.tag=w.tag,O.id=w.id,O.codec=t.getCodecForPreselection(x,G),O.selectionPriority=t.getSelectionPriority(x),O.labels=t.getLabelsForAdaptation(x),O.lang=t.getLanguageForAdaptation(x),O.viewpoint=t.getViewpointForAdaptation(x),O.accessibility=t.getAccessibilityForAdaptation(x),O.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(x),O.roles=t.getRolesForAdaptation(x),O.essentialProperties=t.getCombinedEssentialPropertiesForAdaptationSet(x),O.supplementalProperties=t.getCombinedSupplementalPropertiesForAdaptationSet(x)),O}function ee(w,O,x){w.id=O,w.index=100+parseInt(O.substring(2,3)),w.type=A.TEXT,w.codec="cea-608-in-SEI",w.isEmbedded=!0,w.isFragmented=!1,w.lang=Qr(x),w.roles=[{schemeIdUri:"urn:mpeg:dash:role:2011",value:"caption"}]}function te(w){w.type=A.IMAGE}function M(w){let O=new Si;return O.id=w.id,O.index=w.index,O.start=w.start,O.duration=w.duration,O.manifestInfo=(function(x){let G=new Ii;return G.dvrWindowSize=x.timeShiftBufferDepth,G.loadedTime=x.manifest.loadedTime,G.availableFrom=x.availabilityStartTime,G.minBufferTime=x.manifest.minBufferTime,G.maxFragmentDuration=x.maxSegmentDuration,G.duration=t.getDuration(x.manifest),G.isDynamic=t.getIsDynamic(x.manifest),G.serviceDescriptions=t.getServiceDescriptions(x.manifest),G.protocol=x.manifest.protocol,G})(w.mpd),O.isLast=w.mpd.manifest.Period.length===1||Math.abs(O.start+O.duration-O.manifestInfo.duration)<1,O.isEncrypted=w.isEncrypted,O}function J(){if(!A)throw new Error("setConfig function has to be called previously")}function L(w){return c.length>0?c[0].mpd.manifest.Period[w]:null}function H(w,O,x){let G,W,ie,oe,Ae,ke;if(w){for(W=w.AdaptationSet,Ae=0;Ae<W.length;Ae+=1)for(G=W[Ae],oe=G.Representation,ke=0;ke<oe.length;ke+=1)if(ie=oe[ke],O===ie.id)return x?ke:ie}return null}return n={applyPatchToManifest:function(w,O){i.getPatchOperations(O).forEach(x=>{let G=x.getMpdTarget(w);if(G===null)return;let{name:W,target:ie,leaf:oe}=G;if(x.xpath.findsAttribute()||W==="__text"){switch(x.action){case"add":case"replace":ie[W]=x.value;break;case"remove":delete ie[W]}return}let Ae=(ie[W]||[]).indexOf(oe),ke=x.position==="prepend"||x.position==="before";if(x.action==="remove"||x.action==="replace")if(Array.isArray(ie[W])){if(Ae!=-1){let Ie=ie[W];Ie.splice(Ae,1),Ie.length>0?ie[W]=Ie:delete ie[W]}}else delete ie[W];x.action!=="add"&&x.action!=="replace"||Object.keys(x.value).forEach(Ie=>{let be=x.value[Ie],me=ie[Ie]||[];if(me.length===0&&ie[Ie]&&me.push(ie[Ie]),me.length===0)me=be;else{let Oe=me.length;Oe=Ie==W&&Ae!=-1?Ae+(ke?0:1)+(x.action==="replace"?-1:0):ke?0:me.length,me.splice.apply(me,[Oe,0].concat(be))}ie[Ie]=me})})},areMediaInfosEqual:function(w,O){if(!w||!O)return!1;const x=w.id===O.id,G=w.codec===O.codec,W=JSON.stringify(w.viewpoint)===JSON.stringify(O.viewpoint),ie=w.lang===O.lang,oe=JSON.stringify(w.roles)===JSON.stringify(O.roles),Ae=JSON.stringify(w.accessibility)===JSON.stringify(O.accessibility),ke=JSON.stringify(w.audioChannelConfiguration)===JSON.stringify(O.audioChannelConfiguration);return x&&G&&W&&ie&&oe&&Ae&&ke},convertAdaptationToMediaInfo:$,destroy:function(){p=null},getAllMediaInfoForType:function(w,O,x){let G=c,W=x,ie=[];if(W)J(),G=d(W);else{if(!(c.length>0))return ie;W=c[0].mpd.manifest}const oe=D(w,G);let Ae=t.getAdaptationsForType(W,w?w.index:null,O);return ie=h(W,oe,w,Ae,O),O===A.TEXT&&(Ae=t.getAdaptationsForType(W,w?w.index:null,A.VIDEO),ie=ie.concat(h(W,oe,w,Ae,O,!0))),ie},getAvailabilityStartTime:function(w){const O=N(w);return t.getAvailabilityStartTime(O)},getBandwidthForRepresentation:function(w,O){let x;return x=H(L(O),w),x?x.bandwidth:null},getBaseURLsFromElement:function(w){return t.getBaseURLsFromElement(w)},getCodec:function(w,O,x){return t.getCodec(w,O,x)},getCodecForPreselection:function(w,O){return t.getCodecForPreselection(w,O)},getContentSteering:function(w){return t.getContentSteering(w)},getDuration:function(w){const O=q(w);return t.getDuration(O)},getEssentialProperties:function(w){try{return t.getEssentialProperties(w)}catch{return[]}},getEvent:function(w,O,x,G){try{if(!w||!O||isNaN(x)||!G)return null;const W=w.scheme_id_uri,ie=w.value;if(!O[W+"/"+ie])return null;const oe=new Oi.A,Ae=w.timescale||1,ke=G.adaptation.period.start,Ie=O[W+"/"+ie],be=isNaN(G.presentationTimeOffset)?isNaN(Ie.presentationTimeOffset)?0:Ie.presentationTimeOffset:G.presentationTimeOffset;let me,Oe=w.presentation_time_delta/Ae;me=w.version===0?ke+x-be+Oe:ke-be+Oe;const Ke=w.event_duration===4294967295?NaN:w.event_duration/Ae,le=w.id,fe=w.message_data;return oe.eventStream=Ie,oe.eventStream.value=ie,oe.eventStream.timescale=Ae,oe.duration=Ke,oe.id=le,oe.calculatedPresentationTime=me,oe.messageData=fe,oe.presentationTimeDelta=Oe,oe.parsedMessageData=W===U.A.ID3_SCHEME_ID_URI?(function(pe){let ze=0;const $e=[];for(;zs(pe,ze);){const ot=Ji(pe,ze+6);pe[ze+5]>>6&1&&(ze+=10),ze+=10;const Se=ze+ot;for(;ze+10<Se;){const We=Xs(pe.subarray(ze)),rt=$s(We);rt&&$e.push(rt),ze+=We.size+10}Ws(pe,ze)&&(ze+=10)}return $e})(fe):null,oe}catch{return null}},getEventsFor:function(w,O,x){let G=[];if(c.length>0){const W=c[0].mpd.manifest;if(w instanceof Si){const ie=D(w,c);G=t.getEventsForPeriod(ie)}else if(w instanceof Jr){const ie=D(x,c);G=t.getEventStreamForAdaptationSet(W,k(w),ie)}else if(w instanceof mr.A){const ie=D(x,c);G=t.getEventStreamForRepresentation(W,O,ie)}}return G},getFragmentDurationForLiveDelayCalculation:function(w){const O=w?w.manifestInfo:null,x=O&&Number.isFinite(O.maxFragmentDuration)?O.maxFragmentDuration:NaN;try{let G=!1,W=NaN;const ie=D(w,c);return t.getAdaptationsForPeriod(ie).forEach(oe=>{oe.type!==U.A.VIDEO&&oe.type!==U.A.AUDIO&&oe.type!==U.A.TEXT||t.getRepresentationsForAdaptation(oe).forEach(Ae=>{if(Ae&&!isNaN(Ae.segmentDuration)&&Ae.segmentDuration>0){Ae.usesPartialSegments()&&(G=!0);const ke=Ae.getEffectiveSegmentDuration();W=isNaN(W)?ke:Math.max(W,ke)}})}),G?W:x}catch(G){return e.warn("Could not derive effective segment duration for live delay calculation, falling back to maxFragmentDuration: "+G),x}},getFramerate:function(w){return t.getFramerate(w)},getIndexForRepresentation:function(w,O){return(function(x,G){const W=H(x,G,!0);return W!==null?W:-1})(L(O),w)},getIsDVB:function(w){return t.hasProfile(w,"urn:dvb:dash:profile:dvb-dash:2014")},getIsDynamic:function(w){const O=q(w);return t.getIsDynamic(O)},getIsPatch:function(w){return i.getIsPatch(w)},getIsTextTrack:function(w){return t.getIsText(w)},getIsTypeOf:function(w,O){return t.getIsTypeOf(w,O)},getLocation:function(w){return t.getLocation(w)},getMainAdaptationForType:I,getMainAdaptationSetForPreselection:function(w,O){return t.getMainAdaptationSetForPreselection(w,O)},getCommonRepresentationForPreselection:function(w,O){return t.getCommonRepresentationForPreselection(w,O)},getManifestUpdatePeriod:function(w,O=0){return t.getManifestUpdatePeriod(w,O)},getMediaInfoForType:function(w,O){if(c.length===0||!w)return null;let x=D(w,c);if(!x)return null;const G=t.getAdaptationsForPeriod(x);let W=I(O,w);return W?$(G[t.getIndexForAdaptation(W,c[0].mpd.manifest,w.index)]):null},getMpd:N,getPatchLocation:function(w){const O=t.getPatchLocation(w),x=t.getPublishTime(w);return O&&O.length!==0&&x?O.filter(G=>isNaN(G.ttl)||x.getTime()+G.ttl>new Date().getTime()):[]},getPeriodById:function(w){if(!w||c.length===0)return null;const O=c.filter(x=>x.id===w);return O&&O.length>0?O[0]:null},getPreselectionIsTypeOf:function(w,O,x){return t.getPreselectionIsTypeOf(w,O,x)},getProducerReferenceTimes:function(w,O){let x,G;const W=D(w,c);return x=O?O.id:null,c.length>0&&W&&(G=x?t.getAdaptationForId(x,c[0].mpd.manifest,W.index):t.getAdaptationForIndex(O?O.index:null,c[0].mpd.manifest,W.index)),G?t.getProducerReferenceTimesForAdaptation(G):[]},getPublishTime:function(w){return t.getPublishTime(w)},getRealAdaptation:function(w,O){let x,G;const W=D(w,c);return x=O?O.id:null,c.length>0&&W&&(G=x?t.getAdaptationForId(x,c[0].mpd.manifest,W.index):t.getAdaptationForIndex(O?O.index:null,c[0].mpd.manifest,W.index)),G},getRealPeriodByIndex:function(w){return t.getRealPeriodForIndex(w,c[0].mpd.manifest)},getRegularPeriods:d,getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getStreamsInfo:function(w,O){const x=[];let G=c;if(w&&(J(),G=d(w)),G.length>0){(!O||O>G.length)&&(O=G.length);for(let W=0;W<O;W++)x.push(M(G[W]))}return x},getSuggestedPresentationDelay:function(){const w=c.length>0?c[0].mpd:null;return t.getSuggestedPresentationDelay(w)},getSupplementalCodecs:function(w){const O=w[Fe.A.SUPPLEMENTAL_CODECS];return O?O.split(" ").map(x=>w.mimeType+';codecs="'+x+'"'):[]},getUTCTimingSources:function(){const w=q();return t.getUTCTimingSources(w)},getVoRepresentations:function(w){let O;const x=k(w);return O=t.getRepresentationsForAdaptation(x,w),O},isPatchValid:function(w,O){let x=t.getId(w),G=i.getMpdId(O),W=t.getPublishTime(w),ie=i.getPublishTime(O),oe=i.getOriginalPublishTime(O);return!!(x&&G&&x==G&&W&&oe&&W.getTime()==oe.getTime()&&ie&&W.getTime()<ie.getTime())},reset:v,setConfig:function(w){w&&(w.constants&&(A=w.constants),w.cea608parser&&(p=w.cea608parser),w.errHandler&&t.setConfig({errHandler:w.errHandler}),w.BASE64&&t.setConfig({BASE64:w.BASE64}))},updatePeriods:function(w){if(!w)return null;J(),c=d(w)}},e=(0,j.A)(l).getInstance().getLogger(n),t=(0,Wn.A)(l).getInstance(),i=Li(l).getInstance(),r=(0,E.A)(l).getInstance(),v(),n}Zi.__dashjs_factory_name="DashAdapter";var Js=o.A.getSingletonFactory(Zi);class Zs{static round10(e,t){return(function(i,r,c){return c===void 0||+c==0?Math[i](r):(c=+c,(r=+r)===null||isNaN(r)||typeof c!="number"||c%1!=0?NaN:(r=r.toString().split("e"),+((r=(r=Math[i](+(r[0]+"e"+(r[1]?+r[1]-c:-c)))).toString().split("e"))[0]+"e"+(r[1]?+r[1]+c:c))))})("round",e,t)}}var Qs=class{constructor(){this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]}},ea=class{constructor(){this.t=null,this.mt=null,this.to=null,this.lto=null}},ta=class{constructor(){this.t=null,this.level=null}},na=class{constructor(){this.target=null,this.state=mt.BUFFER_EMPTY}},ra=class{constructor(){this.time=null,this.range=null,this.manifestInfo=null}},ia=class{constructor(){this.time=null,this.droppedFrames=null}};class oa{constructor(){this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]}}class sa{constructor(){this.id=null,this.index=null,this.start=null,this.duration=null}}class aa{constructor(){this.id=null,this.index=null,this.mediaType=null,this.presentationTimeOffset=null,this.startNumber=null}}var la=class{constructor(){this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.bandwidth=null,this.range=null,this.state=null}},ua=class{constructor(){this.loadingRequests=[],this.executedRequests=[]}};function Qi(n){const e=(n=n||{}).settings;let t,i,r=this.context,c=(0,m.A)(r).getInstance();function A(){c.trigger(F.A.METRICS_CHANGED)}function p(N){c.trigger(F.A.METRIC_CHANGED,{mediaType:N}),A()}function l(N,v,q){c.trigger(F.A.METRIC_UPDATED,{mediaType:N,metric:v,value:q}),p(N)}function _(N,v,q){c.trigger(F.A.METRIC_ADDED,{mediaType:N,metric:v,value:q}),p(N)}function I(N,v){let q=null;return N&&(i.hasOwnProperty(N)?q=i[N]:v||(q=new Qs,i[N]=q)),q}function h(N,v,q){let k=I(N);k!==null&&(k[v].push(q),k[v].length>e.get().streaming.metrics.maxListDepth&&k[v].shift())}function d(N,v,q){h(N,v,q),_(N,v,q)}return t={addBufferLevel:function(N,v,q){let k=new ta;k.t=v,k.level=q,d(N,mt.BUFFER_LEVEL,k)},addBufferState:function(N,v,q){let k=new na;k.target=q,k.state=v,d(N,mt.BUFFER_STATE,k)},addDVBErrors:function(N){d(U.A.STREAM,mt.DVB_ERRORS,N)},addDVRInfo:function(N,v,q,k){let D=new ra;D.time=v,D.range=k,D.manifestInfo=q,d(N,mt.DVR_INFO,D)},addDroppedFrames:function(N,v){let q=new ia,k=I(N).DroppedFrames;v&&(q.time=v.creationTime,q.droppedFrames=v.droppedVideoFrames,k.length>0&&k[k.length-1]==q||d(N,mt.DROPPED_FRAMES,q))},addHttpRequest:function N(v,q,k,D){let $=new Ee.G;q.url&&q.url!==v.url&&(N({mediaType:v.mediaType,type:v.type,url:v.url,serviceLocation:null,range:v.range,startDate:v.startDate,firstByteDate:null,endDate:null,duration:v.duration,fileLoaderType:v.fileLoaderType,resourceTimingValues:v.resourceTimingValues},{url:null,status:null,headers:null},null,null),$.actualurl=q.url),$.tcpid=null,$.type=v.type,$.url=v.url,$.range=v.range||null,$.trequest=v.startDate,$.tresponse=v.firstByteDate,$.responsecode=q.status,$._tfinish=v.endDate,$._stream=v.mediaType,$._mediaduration=v.duration,$._responseHeaders="";for(const B in q.headers)$._responseHeaders+=B+": "+q.headers[B]+`\r
12
+ `;$._serviceLocation=v.serviceLocation||null,$._fileLoaderType=v.fileLoaderType,$._resourceTimingValues=v.resourceTimingValues,$._cmsd=D||null,$._streamId=v&&v.representation&&v.representation.mediaInfo&&v.representation.mediaInfo.streamInfo?v.representation.mediaInfo.streamInfo.id:null,k?k.forEach(B=>{(function(ee,te,M,J){let L=new Ee.N;L.s=te,L.d=M,L.b=J,ee.trace.push(L),ee.interval||(ee.interval=0),ee.interval+=M})($,B.s,B.d,B.b,B.t)}):(delete $.interval,delete $.trace),d(v.mediaType,mt.HTTP_REQUEST,$)},addManifestUpdate:function(N,v,q,k){let D=new oa;D.mediaType=N,D.type=v,D.requestTime=q,D.fetchTime=k,h(U.A.STREAM,mt.MANIFEST_UPDATE,D),_(N,mt.MANIFEST_UPDATE,D)},addManifestUpdateRepresentationInfo:function(N,v,q){if(N&&N.representationInfo){const k=new aa;k.id=v?v.id:null,k.index=v?v.index:null,k.mediaType=q,k.startNumber=v?v.startNumber:null,k.presentationTimeOffset=v?v.presentationTimeOffset:null,N.representationInfo.push(k),l(N.mediaType,mt.MANIFEST_UPDATE_TRACK_INFO,N)}},addManifestUpdateStreamInfo:function(N,v,q,k,D){if(N){let $=new sa;$.id=v,$.index=q,$.start=k,$.duration=D,N.streamInfo.push($),l(N.mediaType,mt.MANIFEST_UPDATE_STREAM_INFO,N)}},addPlayList:function(N){N.trace&&Array.isArray(N.trace)?N.trace.forEach(v=>{v.hasOwnProperty("subreplevel")&&!v.subreplevel&&delete v.subreplevel}):delete N.trace,d(U.A.STREAM,mt.PLAY_LIST,N)},addRepresentationSwitch:function(N,v,q,k,D){let $=new ea;$.t=v,$.mt=q,$.to=k,D?$.lto=D:delete $.lto,d(N,mt.TRACK_SWITCH,$)},addRequestsQueue:function(N,v,q){let k=new ua;k.loadingRequests=v,k.executedRequests=q,I(N).RequestsQueue=k,_(N,mt.REQUESTS_QUEUE,k)},addSchedulingInfo:function(N,v,q,k,D,$,B,ee,te){let M=new la;M.mediaType=N,M.t=v,M.type=q,M.startTime=k,M.availabilityStartTime=D,M.duration=$,M.bandwidth=B,M.range=ee,M.state=te,d(N,mt.SCHEDULING_INFO,M)},clearAllCurrentMetrics:function(){i={},A()},clearCurrentMetricsForType:function(N){delete i[N],p(N)},getMetricsFor:I,updateManifestUpdateInfo:function(N,v){if(N){for(let q in v)N[q]=v[q];l(N.mediaType,mt.MANIFEST_UPDATE,N)}}},i={},t}Qi.__dashjs_factory_name="MetricsModel";var ca=o.A.getSingletonFactory(Qi);class Vr{constructor(){this.start=null,this.mstart=null,this.starttype=null,this.trace=[]}}Vr.INITIAL_PLAYOUT_START_REASON="initial_playout",Vr.SEEK_START_REASON="seek",Vr.RESUME_FROM_PAUSE_START_REASON="resume",Vr.METRICS_COLLECTION_START_REASON="metrics_collection_start";class lr{constructor(){this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null}}function eo(n){n=n||{};const e=this.context;let t,i,r,c,A=n.metricsModel;function p(I){const h=A.getMetricsFor(I,!0);if(!h)return null;const d=h.HttpList;let N,v=null;if(!d||d.length<=0)return null;for(N=d.length-1;N>=0;){if(d[N].responsecode){v=d[N];break}N--}return v}function l(I){const h=A.getMetricsFor(I,!0);return h&&h.HttpList?h.HttpList:[]}function _(I,h){if(!I)return null;const d=I[h];return d&&d.length!==0?d[d.length-1]:null}return t={addBufferLevel:function(I,h,d){A.addBufferLevel(I,h,d)},addBufferState:function(I,h,d){A.addBufferState(I,h,d)},addDVBErrors:function(I){A.addDVBErrors(I)},addDVRInfo:function(I,h,d,N){A.addDVRInfo(I,h,d,N)},addDroppedFrames:function(I){A.addDroppedFrames(U.A.VIDEO,I)},addHttpRequest:function(I,h,d,N,v,q){const k={status:d,headers:N,url:h};A.addHttpRequest(I,k,v,q)},addManifestUpdate:function(I){A.addManifestUpdate(U.A.STREAM,I.type,I.startDate,I.endDate)},addManifestUpdateRepresentationInfo:function(I,h){if(I){const d=this.getCurrentManifestUpdate();A.addManifestUpdateRepresentationInfo(d,I,h)}},addManifestUpdateStreamInfo:function(I){if(I){const h=this.getCurrentManifestUpdate();A.addManifestUpdateStreamInfo(h,I.id,I.index,I.start,I.duration)}},addPlayList:function(){c&&(A.addPlayList(c),c=null)},addRepresentationSwitch:function(I,h,d,N,v){A.addRepresentationSwitch(I,h,d,N,v)},addRequestsQueue:function(I,h,d){A.addRequestsQueue(I,h,d)},addSchedulingInfo:function(I,h){A.addSchedulingInfo(I.mediaType,new Date,I.type,I.startTime,I.availabilityStartTime,I.duration,I.bandwidth,I.range,h)},clearAllCurrentMetrics:function(){A.clearAllCurrentMetrics()},createPlaylistMetrics:function(I,h){c=new Vr,c.start=new Date,c.mstart=I,c.starttype=h},createPlaylistTraceMetrics:function(I,h,d){i===!0&&(i=!1,r=new lr,r.representationid=I,r.start=new Date,r.mstart=h,r.playbackspeed=d!==null?d.toString():null)},getCurrentBufferLevel:function(I){const h=_(A.getMetricsFor(I,!0),mt.BUFFER_LEVEL);return h?Zs.round10(h.level/1e3,-3):0},getCurrentBufferState:function(I){return _(A.getMetricsFor(I,!0),mt.BUFFER_STATE)},getCurrentDVRInfo:function(I){return _(I?A.getMetricsFor(I,!0):A.getMetricsFor(U.A.VIDEO,!0)||A.getMetricsFor(U.A.AUDIO,!0),mt.DVR_INFO)},getCurrentDroppedFrames:function(){return _(A.getMetricsFor(U.A.VIDEO,!0),mt.DROPPED_FRAMES)},getCurrentHttpRequest:p,getCurrentManifestUpdate:function(){return _(A.getMetricsFor(U.A.STREAM),mt.MANIFEST_UPDATE)},getCurrentRepresentationSwitch:function(I){return _(A.getMetricsFor(I,!0),mt.TRACK_SWITCH)},getCurrentSchedulingInfo:function(I){return _(A.getMetricsFor(I,!0),mt.SCHEDULING_INFO)},getHttpRequests:l,getLatestFragmentRequestHeaderValueByID:function(I,h){if(!h)return null;let d={},N=p(I);N&&(d=Xn.A.parseHttpHeaders(N._responseHeaders));const v=d[h.toLowerCase()];return v===void 0?null:v},getLatestMPDRequestHeaderValueByID:function(I){if(!I)return null;let h,d,N,v={};for(h=l(U.A.STREAM),N=h.length-1;N>=0;N--)if(d=h[N],d.type===Ee.G.MPD_TYPE){v=Xn.A.parseHttpHeaders(d._responseHeaders);break}const q=v[I.toLowerCase()];return q===void 0?null:q},pushPlayListTraceMetrics:function(I,h){if(i===!1&&c&&r&&r.start){const d=r.start;r.duration=I.getTime()-d.getTime(),r.stopreason=h,c.trace.push(r),i=!0}},updateManifestUpdateInfo:function(I){const h=this.getCurrentManifestUpdate();A.updateManifestUpdateInfo(h,I)},updatePlayListTraceMetrics:function(I){if(r)for(let h in r)r[h]=I[h]}},A=A||ca(e).getInstance({settings:n.settings}),i=!0,r=null,c=null,t}lr.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",lr.REBUFFERING_REASON="rebuffering",lr.USER_REQUEST_STOP_REASON="user_request",lr.END_OF_PERIOD_STOP_REASON="end_of_period",lr.END_OF_CONTENT_STOP_REASON="end_of_content",lr.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",lr.FAILURE_STOP_REASON="failure",eo.__dashjs_factory_name="DashMetrics";var da=o.A.getSingletonFactory(eo);function to(){let n;const e=this.context,t=(0,m.A)(e).getInstance();return n={error:function(i){t.trigger(F.A.ERROR,{error:i})}},n}to.__dashjs_factory_name="ErrorHandler";var fa=o.A.getSingletonFactory(to);function no(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c,A,p,l,_,I,h,d,N;function v(){N.debug("Stopping the gap controller"),A&&(clearInterval(A),A=null),(function(){e.off(F.A.WALLCLOCK_TIME_UPDATED,B,this),e.off(F.A.INITIAL_STREAM_SWITCH,$,this),e.off(F.A.PLAYBACK_SEEKING,q,this),e.off(F.A.BUFFER_REPLACEMENT_STARTED,k,t),e.off(F.A.TRACK_CHANGE_RENDERED,D,t)})(),A=null,p=NaN,c=0,h=null,d={}}function q(){h&&(clearTimeout(h),h=null)}function k(M){try{if(M.streamId!==_.getActiveStreamInfo().id||M.mediaType!==U.A.VIDEO&&M.mediaType!==U.A.AUDIO)return;M.streamId===_.getActiveStreamInfo().id&&(d[M.mediaType]=!0)}catch(J){N.error(J)}}function D(M){M&&M.mediaType&&(d[M.mediaType]=!1)}function $(){A||(function(){try{A||(N.debug("Starting the gap controller"),A=setInterval(()=>{ee()&&te(l.getTime())},r.get().streaming.gaps.checkInterval))}catch{}})()}function B(){if(ee(r.get().streaming.gaps.enableSeekFix)&&(c++,c>=10)){const M=l.getTime();i===M?te(M,!0):(i=M,p=NaN),c=0}}function ee(M=!1){if(!_.getActiveStream())return!1;let J=!1;for(const H in d)if(d[H]){J=!0;break}const L=!!M&&(function(){const H=_.getActiveStream(),w=parseFloat((H.getStartTime()+H.getDuration()).toFixed(5));return l.getTime()+r.get().streaming.gaps.threshold>=w})();return!J&&r.get().streaming.gaps.jumpGaps&&_.getActiveStreamProcessors().length>0&&(!l.isSeeking()||L)&&!l.isPaused()&&!_.getIsStreamSwitchInProgress()&&!_.getHasMediaOrInitialisationError()}function te(M,J=!1){const L=r.get().streaming.gaps,H=L.enableStallFix,w=L.stallSeek,O=L.smallGapLimit,x=L.jumpLargeGaps,G=L.seekOffset,W=I.getBufferRange();let ie,oe=NaN,Ae=!1;if(ie=(function(Ie,be){try{if(!Ie||Ie.length<=1&&be>0)return NaN;let me=NaN,Oe=0;for(;isNaN(me)&&Oe<Ie.length;){const Ke=Oe>0?Ie.end(Oe-1):0;be<Ie.start(Oe)&&Ke-be<r.get().streaming.gaps.threshold&&(me=Oe),Oe+=1}return me}catch{return null}})(W,M),!isNaN(ie)){const Ie=W.start(ie),be=Ie-M;be>0&&(be<=O||x)&&(oe=Ie)}const ke=l.getTimeToStreamEnd();if(isNaN(oe)&&J&&isFinite(ke)&&!isNaN(ke)&&ke<O&&(oe=parseFloat(l.getStreamEndTime().toFixed(5)),Ae=!0),H&&isNaN(oe)&&J&&isNaN(ie)&&(function(Ie,be){for(let me=0,Oe=Ie.length;me<Oe;me++)if(be>=Ie.start(me)&&be<=Ie.end(me))return!0;return!1})(W,M)&&(w===0?(N.warn("Toggle play pause to break stall"),I.pause(),I.play()):(N.warn(`Jumping ${w}s to break stall`),oe=M+w)),oe>0&&p!==oe&&oe>M&&!h){const Ie=oe-M;if(Ae){const be=_.getStreamForTime(oe),me=be&&!!be.getPreloaded();N.warn(`Jumping to end of stream because of gap from ${M} to ${oe}. Gap duration: ${Ie}`),l.seek(oe+G,!0,me)}else{const be=l.getIsDynamic(),me=ie>0?W.end(ie-1):M,Oe=be?1e3*Math.max(0,Ie-.1):0;h=window.setTimeout(()=>{l.seek(oe+G,!0,!0);const Ke=_.getActiveStream();Ke&&N.warn(`Jumping gap occuring in period ${Ke.getStreamId()} starting at ${me} and ending at ${oe}. Jumping by: ${oe+G-me}`),h=null},Oe)}p=oe}}return t={reset:v,setConfig:function(M){M&&(M.settings&&(r=M.settings),M.playbackController&&(l=M.playbackController),M.streamController&&(_=M.streamController),M.videoModel&&(I=M.videoModel))},initialize:function(){(function(){e.on(F.A.WALLCLOCK_TIME_UPDATED,B,this),e.on(F.A.INITIAL_STREAM_SWITCH,$,this),e.on(F.A.PLAYBACK_SEEKING,q,this),e.on(F.A.BUFFER_REPLACEMENT_STARTED,k,t),e.on(F.A.TRACK_CHANGE_RENDERED,D,t)})()}},N=(0,j.A)(n).getInstance().getLogger(t),v(),t}no.__dashjs_factory_name="GapController";var ga=o.A.getSingletonFactory(no);class ha extends dt.A{constructor(e,t){super(),this.url=e||null,this.type=t||null,this.mediaType=U.A.STREAM,this.responseType=""}}var ro=ha;function io(n){n=n||{};const e=this.context,t=(0,m.A)(e).getInstance();let i,r=(0,ct.A)(e).create({errHandler:n.errHandler,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,errors:f.A});return i={load:function(c,A,p){const l=function(_,I){A.resolved=!0,A.resolvedContent=_||null,t.trigger(F.A.XLINK_ELEMENT_LOADED,{element:A,resolveObject:p,error:_||I?null:new Hn.A(f.A.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,f.A.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+c)})};if(c==="urn:mpeg:dash:resolve-to-zero:2013")l(null,!0);else{const _=new ro(c,Ee.G.XLINK_EXPANSION_TYPE);r.load({request:_,success:function(I){l(I)},error:function(){l(null)}})}},reset:function(){r&&(r.abort(),r=null)}},i}io.__dashjs_factory_name="XlinkLoader";var pa=o.A.getClassFactory(io);const ti="onLoad";function oo(n){n=n||{};let e=this.context,t=(0,m.A)(e).getInstance();const i=(0,ln.A)(e).getInstance();let r,c,A,p;function l(v,q,k){let D,$,B={};B.elements=v,B.type=q,B.resolveType=k,B.elements.length===0&&I(B);for(let ee=0;ee<B.elements.length;ee++)D=B.elements[ee],$=i.isHTTPURL(D.url)?D.url:D.originalContent.BaseURL+D.url,p.load($,D,B)}function _(v){let q,k,D="";if(q=v.element,k=v.resolveObject,q.resolvedContent){let $=0;q.resolvedContent.indexOf("<?xml")===0&&($=q.resolvedContent.indexOf("?>")+2),D=q.resolvedContent.substr(0,$)+"<response>"+q.resolvedContent.substr($)+"</response>",q.resolvedContent=c.parseXml(D).response}(function($){let B,ee;for(B=0;B<$.elements.length;B++)if(ee=$.elements[B],ee.resolved===!1)return!1;return!0})(k)&&I(k)}function I(v){let q,k,D=[];if((function($){let B,ee,te,M,J,L,H=[];for(M=$.elements.length-1;M>=0;M--){if(B=$.elements[M],ee=B.type,!B.resolvedContent||N())delete B.originalContent["xlink:actuate"],delete B.originalContent["xlink:href"],H.push(B.originalContent);else if(B.resolvedContent)for(J=0;J<B.resolvedContent[ee].length;J++)te=B.resolvedContent[ee][J],H.push(te);for(B.parentElement[ee].splice(B.index,1),L=0;L<H.length;L++)B.parentElement[ee].splice(B.index+L,0,H[L]);H=[]}$.elements.length>0&&c.getIron().run(A)})(v),v.resolveType==="onActuate"&&t.trigger(F.A.XLINK_READY,{manifest:A}),v.resolveType===ti)switch(v.type){case Fe.A.PERIOD:for(q=0;q<A[Fe.A.PERIOD].length;q++)k=A[Fe.A.PERIOD][q],k.hasOwnProperty(Fe.A.ADAPTATION_SET)&&(D=D.concat(h(k[Fe.A.ADAPTATION_SET],k,Fe.A.ADAPTATION_SET,ti))),k.hasOwnProperty(Fe.A.EVENT_STREAM)&&(D=D.concat(h(k[Fe.A.EVENT_STREAM],k,Fe.A.EVENT_STREAM,ti)));l(D,Fe.A.ADAPTATION_SET,ti);break;case Fe.A.ADAPTATION_SET:t.trigger(F.A.XLINK_READY,{manifest:A})}}function h(v,q,k,D){let $,B,ee,te=[];for(B=v.length-1;B>=0;B--)$=v[B],$.hasOwnProperty("xlink:href")&&$["xlink:href"]==="urn:mpeg:dash:resolve-to-zero:2013"&&v.splice(B,1);for(B=0;B<v.length;B++)$=v[B],$.hasOwnProperty("xlink:href")&&$.hasOwnProperty("xlink:actuate")&&$["xlink:actuate"]===D&&(ee=d($["xlink:href"],q,k,B,D,$),te.push(ee));return te}function d(v,q,k,D,$,B){return{url:v,parentElement:q,type:k,index:D,resolveType:$,originalContent:B,resolvedContent:null,resolved:!1}}function N(){return!1}return r={resolveManifestOnLoad:function(v){let q;A=v,A.Period?(q=h(A.Period,A,Fe.A.PERIOD,ti),l(q,Fe.A.PERIOD,ti)):t.trigger(F.A.XLINK_READY,{manifest:A})},setParser:function(v){v&&(c=v)},reset:function(){t.off(F.A.XLINK_ELEMENT_LOADED,_,r),p&&(p.reset(),p=null)}},t.on(F.A.XLINK_ELEMENT_LOADED,_,r),p=pa(e).create({errHandler:n.errHandler,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,settings:n.settings}),r}oo.__dashjs_factory_name="XlinkController";var ma=o.A.getClassFactory(oo);function so(n){function e(r,c,A,p,l){(function(_,I){let h=!0;if(I)for(const[d,N]of Object.entries(I)){let v=_[d];v&&N.some(q=>v.match(q))&&(h=!1)}return h})(p,r)&&(l[c]?A?l[c].push(p):(function(_,I){if(typeof _=="object")for(let h in _)I.hasOwnProperty(h)||(I[h]=_[h])})(p,l[c]):l[c]=A?[p]:p)}function t(r,c,A,p){for(let l=0,_=r.length;l<_;++l){const I=r[l];if(A[I]){const h=A[I];Array.isArray(h)?h.forEach(d=>{e(c[I],I,!0,d,p)}):e(c[I],I,!1,h,p)}}}function i(r,c){for(let A=0,p=r.children.length;A<p;++A){const l=r.children[A],_=c[l.name];if(_)for(let I=0,h=_.length;I<h;++I){const d=_[I];t(r.properties,r.exceptions,c,d),i(l,d)}}}return{run:function(r){if(r===null||typeof r!="object")return r;if(r.Period&&"period"in n){const c=n.period,A=r.Period;for(let p=0,l=A.length;p<l;++p){const _=A[p];if(i(c,_),"adaptationset"in n){const I=_.AdaptationSet;if(I){const h=n.adaptationset;for(let d=0,N=I.length;d<N;++d)i(h,I[d])}}}}return r}}}so.__dashjs_factory_name="ObjectIron";var Ea=o.A.getClassFactory(so),Ri=class{constructor(n,e){this._test=n,this._converter=e}get test(){return this._test}get converter(){return this._converter}};const ao=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/;var Aa=class extends Ri{constructor(){super((n,e,t)=>{const i=[Fe.A.MIN_BUFFER_TIME,Fe.A.MEDIA_PRESENTATION_DURATION,Fe.A.MINIMUM_UPDATE_PERIOD,Fe.A.TIMESHIFT_BUFFER_DEPTH,Fe.A.MAX_SEGMENT_DURATION,Fe.A.MAX_SUBSEGMENT_DURATION,Fe.A.SUGGESTED_PRESENTATION_DELAY,Fe.A.START,U.A.START_TIME,Fe.A.DURATION],r=i.length;for(let c=0;c<r;c++)if(e===i[c])return ao.test(t);return!1},n=>{const e=ao.exec(n);let t=31536e3*parseFloat(e[3]||0)+2592e3*parseFloat(e[5]||0)+86400*parseFloat(e[7]||0)+3600*parseFloat(e[9]||0)+60*parseFloat(e[11]||0)+parseFloat(e[13]||0);return e[1]!==void 0&&(t=-t),t})}};const lo=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})(?::?)([0-9]{2}))?/,uo={[Fe.A.MPD]:[Fe.A.AVAILABILITY_START_TIME,Fe.A.AVAILABILITY_END_TIME,Fe.A.PUBLISH_TIME],Patch:[Fe.A.PUBLISH_TIME,Fe.A.ORIGINAL_PUBLISH_TIME],LeapSecondInformation:["nextLeapChangeTime"],[Fe.A.PRODUCER_REFERENCE_TIME]:[Fe.A.WALL_CLOCK_TIME]};var Ta=class extends Ri{constructor(){super((n,e,t)=>uo.hasOwnProperty(n)&&uo[n].includes(e)&&lo.test(t),n=>{const e=lo.exec(n);let t;if(t=Date.UTC(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10),parseInt(e[4],10),parseInt(e[5],10),e[6]&&parseInt(e[6],10)||0,e[7]&&1e3*parseFloat(e[7])||0),e[9]&&e[10]){const i=60*parseInt(e[9],10)+parseInt(e[10],10);t+=(e[8]==="+"?-1:1)*i*60*1e3}return new Date(t)})}};const ya=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,_a=[Fe.A.ID],Sa=[Fe.A.ACCESSIBILITY,Fe.A.ASSET_IDENTIFIER,Fe.A.AUDIO_CHANNEL_CONFIGURATION,Fe.A.CLIENT_DATA_REPORTING,Fe.A.CONTENT_PROTECTION,Fe.A.ESSENTIAL_PROPERTY,Fe.A.FRAME_PACKING,Fe.A.OUTPUT_PROTECTION,Fe.A.RATING,Fe.A.REPORTING,Fe.A.ROLE,Fe.A.SERVICE_DESCRIPTION_SCOPE,Fe.A.SUPPLEMENTAL_PROPERTY,Fe.A.UTC_TIMING,Fe.A.VIEWPOINT];var Ia=class extends Ri{constructor(){super((n,e,t)=>ya.test(t)&&_a.indexOf(e)===-1&&!(e===Fe.A.VALUE&&Sa.indexOf(n)!==-1),n=>parseFloat(n))}},Ra=class extends Ri{constructor(){super((n,e)=>{const t={[Fe.A.ADAPTATION_SET]:[Fe.A.LANG],[Fe.A.REPRESENTATION]:[Fe.A.LANG],[Fe.A.CONTENT_COMPONENT]:[Fe.A.LANG],[Fe.A.LABEL]:[Fe.A.LANG],[Fe.A.GROUP_LABEL]:[Fe.A.LANG]};if(t.hasOwnProperty(n)){let i=t[n];return i!==void 0&&i.indexOf(e)>=0}return!1},n=>Qr(n)||String(n))}},ni=class{constructor(n,e,t,i){this._name=n||"",this._properties=e||[],this._exceptions=t||{},this._children=i||[]}get name(){return this._name}get children(){return this._children}get properties(){return this._properties}get exceptions(){return this._exceptions}},Na=class extends ni{constructor(){const n=[Fe.A.AUDIO_CHANNEL_CONFIGURATION,Fe.A.AUDIO_SAMPLING_RATE,Fe.A.CODECS,Fe.A.CODING_DEPENDENCY,Fe.A.CONTENT_PROTECTION,Fe.A.ESSENTIAL_PROPERTY,Fe.A.FRAMERATE,Fe.A.FRAME_PACKING,Fe.A.HEIGHT,Fe.A.INBAND_EVENT_STREAM,Fe.A.MAXIMUM_SAP_PERIOD,Fe.A.MAX_PLAYOUT_RATE,Fe.A.MIME_TYPE,Fe.A.PROFILES,Fe.A.SAR,Fe.A.SCAN_TYPE,Fe.A.SEGMENT_PROFILES,Fe.A.SEGMENT_SEQUENCE_PROPERTIES,Fe.A.START_WITH_SAP,Fe.A.SUPPLEMENTAL_CODECS,Fe.A.SUPPLEMENTAL_PROPERTY,Fe.A.WIDTH],e={[Fe.A.SUPPLEMENTAL_PROPERTY]:{schemeIdUri:[U.A.URL_QUERY_INFO_SCHEME,U.A.EXT_URL_QUERY_INFO_SCHEME,U.A.ADV_URL_QUERY_INFO_SCHEME,U.A.URL_QUERY_STATE_PREFIX]},[Fe.A.ESSENTIAL_PROPERTY]:{schemeIdUri:[U.A.URL_QUERY_INFO_SCHEME,U.A.EXT_URL_QUERY_INFO_SCHEME,U.A.ADV_URL_QUERY_INFO_SCHEME,U.A.URL_QUERY_STATE_PREFIX]}};super(Fe.A.ADAPTATION_SET,n,e,[new ni(Fe.A.REPRESENTATION,n,e,[new ni(Fe.A.SUB_REPRESENTATION,n,e)])])}},Ca=class extends ni{constructor(){const n=[Fe.A.SEGMENT_BASE,Fe.A.SEGMENT_TEMPLATE,Fe.A.SEGMENT_LIST],e={};super(Fe.A.PERIOD,n,e,[new ni(Fe.A.ADAPTATION_SET,n,e,[new ni(Fe.A.REPRESENTATION,n,e)])])}};const ri=32,ii=13,oi=10;function Bi(n,e,t){const i=n.substring(0,e).split(`
13
+ `);return new Error(t+`
14
+ Line: `+(i.length-1)+`
15
+ Column: `+(i[i.length-1].length+1)+`
16
+ Char: `+(e<n.length?n[e]:"end of input"))}function co(n){return n.nodeName.charCodeAt(0)===35?null:n}function Ni(n,e){const t=e?(r,c,A)=>({nodeName:c,nodeValue:A,attributes:{},childNodes:[],parentElement:co(r)}):(r,c,A)=>({nodeName:c,nodeValue:A,attributes:{},childNodes:[]}),i=(r,c,A)=>{r.childNodes.push(t(r,c,A))};return{createDocument:e?()=>({nodeName:"#document",nodeValue:null,childNodes:[],attributes:{},parentElement:null}):()=>({nodeName:"#document",nodeValue:null,childNodes:[],attributes:{}}),createElement:e?(r,c,A,p,l)=>({nodeName:c,nodeValue:null,attributes:A,childNodes:[],prefix:l,localName:p,parentElement:co(r)}):(r,c,A,p,l)=>({nodeName:c,nodeValue:null,attributes:A,childNodes:[],prefix:l,localName:p}),appendChild:(r,c)=>{r.childNodes.push(c)},appendText:(r,c)=>i(r,"#text",c),appendCdata:(r,c)=>i(r,"#cdata",c),appendComment:n?(r,c)=>i(r,"#comment",c):void 0,appendDoctype:(r,c)=>i(r,"#doctype",c)}}const ba=[Ni(!1,!1),Ni(!0,!1),Ni(!1,!0),Ni(!0,!0)],va=[Fe.A.ACCESSIBILITY,Fe.A.ADAPTATION_SET,Fe.A.ADD,Fe.A.AUDIO_CHANNEL_CONFIGURATION,Fe.A.BASE_URL,Fe.A.CONTENT_COMPONENT,Fe.A.CONTENT_PROTECTION,Fe.A.CONTENT_STEERING,Fe.A.ESSENTIAL_PROPERTY,Fe.A.EVENT,Fe.A.EVENT_STREAM,Fe.A.INBAND_EVENT_STREAM,Fe.A.LABEL,Fe.A.LOCATION,Fe.A.METRICS,Fe.A.PATCH_LOCATION,Fe.A.PERIOD,Fe.A.PRESELECTION,Fe.A.PRODUCER_REFERENCE_TIME,Fe.A.REMOVE,Fe.A.REPLACE,Fe.A.REPORTING,Fe.A.REPRESENTATION,Fe.A.ROLE,Fe.A.S,Fe.A.SEGMENT_SEQUENCE_PROPERTIES,Fe.A.SEGMENT_URL,Fe.A.SERVICE_DESCRIPTION,Fe.A.SUPPLEMENTAL_PROPERTY,Fe.A.UTC_TIMING,Fe.A.VIEWPOINT];function fo(n){n=n||{};const e=this.context,t=n.debug;let i,r,c,A;function p(l){try{const _=(function(I){const h=(function(N,v={}){const q=ba[(v.keepComments?1:0)|(v.includeParentElement?2:0)],k=q.createDocument();return(function(D,$,B,ee,te,M){const J=ee.createElement,L=ee.appendChild,H=ee.appendText,w=ee.appendCdata,O=ee.appendComment,x=ee.appendDoctype,G=D.length;let W=te[te.length-1],ie=M[M.length-1],oe=$;for(;oe<G;){let Ae=D.charCodeAt(oe);if(Ae!==60){const fe=oe;let pe=!1,ze=!0;do Ae!==ri&&Ae!==oi&&Ae!==ii&&Ae!==9&&(ze=!1,Ae===38&&(pe=!0)),Ae=++oe<G?D.charCodeAt(oe):0;while(oe<G&&Ae!==60);if(H!==void 0&&(B||!ze)){let $e=D.slice(fe,oe);pe&&($e=(0,ei.Uh)($e)),B||($e=$e.trim()),$e.length>0&&H(W,$e)}continue}const ke=oe+1<G?D.charCodeAt(oe+1):0;if(ke===47){const fe=oe+2,pe=fe+ie.length,ze=pe<G?D.charCodeAt(pe):0,$e=D.startsWith(ie,fe)&&(pe>=G||ie!==""&&(ze===62||ze===ri||ze===9||ze===ii||ze===oi)),ot=D.indexOf(">",fe);if(oe=ot===-1?G:ot,!$e)throw Bi(D,oe,"Unexpected close tag");if(oe<G&&oe++,te.length>1){const Se=W;te.pop(),M.pop(),W=te[te.length-1],ie=M[M.length-1],L!==void 0&&L(W,Se)}continue}if(ke===63){const fe=D.indexOf(">",oe+2);oe=fe===-1?G:fe+1;continue}if(ke===33){const fe=oe+2<G?D.charCodeAt(oe+2):0;if(fe===45){const $e=D.indexOf("-->",oe+2),ot=$e===-1?G:$e+3;O!==void 0&&O(W,D.slice(oe,ot)),oe=ot;continue}if(fe===91&&oe+8<G&&D.charCodeAt(oe+8)===91&&D.startsWith("CDATA",oe+3)){const $e=D.indexOf("]]>",oe+9);w!==void 0&&w(W,$e===-1?D.slice(oe+9):D.slice(oe+9,$e)),oe=$e===-1?G:$e+3;continue}const pe=oe+1;let ze=!1;for(oe+=2;oe<G&&(Ae=D.charCodeAt(oe),Ae!==62||ze);)Ae===91?ze=!0:ze&&Ae===93&&(ze=!1),oe++;x!==void 0&&x(W,D.slice(pe,oe)),oe++;continue}const Ie=++oe;let be=-1;for(Ae=oe<G?D.charCodeAt(oe):0;oe<G&&Ae!==ri&&Ae!==62&&Ae!==47&&Ae!==61&&Ae!==oi&&Ae!==ii&&Ae!==9;)Ae===58&&be===-1&&(be=oe),Ae=++oe<G?D.charCodeAt(oe):0;const me=D.slice(Ie,oe),Oe={};for(;oe<G&&Ae!==62;){if(Ae>=65&&Ae<=90||Ae>=97&&Ae<=122){const fe=oe;for(Ae=++oe<G?D.charCodeAt(oe):0;oe<G&&Ae!==ri&&Ae!==62&&Ae!==47&&Ae!==61&&Ae!==oi&&Ae!==ii&&Ae!==9;)Ae=++oe<G?D.charCodeAt(oe):0;const pe=D.slice(fe,oe);if(Ae!==61){for(;Ae===ri||Ae===9||Ae===ii||Ae===oi;)Ae=++oe<G?D.charCodeAt(oe):0;if(Ae!==61)throw Bi(D,oe,'Malformed attribute "'+pe+'": expected "=" after name')}if(Ae=++oe<G?D.charCodeAt(oe):0,Ae!==39&&Ae!==34){for(;Ae===ri||Ae===9||Ae===ii||Ae===oi;)Ae=++oe<G?D.charCodeAt(oe):0;if(Ae!==39&&Ae!==34)throw Bi(D,oe,'Malformed attribute "'+pe+'": expected quoted value after "="')}const ze=Ae,$e=++oe;let ot=!1;for(Ae=oe<G?D.charCodeAt(oe):0;oe<G&&Ae!==ze;)Ae===38&&(ot=!0),Ae=++oe<G?D.charCodeAt(oe):0;if(oe>=G)throw new Error("Missing closing quote");const Se=D.slice($e,oe);Oe[pe]=ot?(0,ei.Uh)(Se):Se,Ae=++oe<G?D.charCodeAt(oe):0;continue}Ae=++oe<G?D.charCodeAt(oe):0}const Ke=D.charCodeAt(oe-1)===47;oe++;const le=J(W,me,Oe,be===-1?me:me.slice(be-Ie+1),be===-1?null:me.slice(0,be-Ie));Ke?L!==void 0&&L(W,le):(te.push(le),M.push(me),W=le,ie=me)}for(;te.length>1;){const Ae=W;te.pop(),M.pop(),W=te[te.length-1],L!==void 0&&L(W,Ae)}})(N,v.pos||0,!!v.keepWhitespace,q,[k],[""]),k})(I),d=h.childNodes.find(N=>N.nodeName==="MPD"||N.nodeName==="Patch")||h.childNodes[0];return(function N(v){v.nodeName.indexOf(":")!==-1&&(v.__prefix=v.prefix,v.nodeName=v.localName);const{childNodes:q,attributes:k,nodeName:D}=v;v.tagName=D;for(let B in k){let ee=k[B];if(D==="S")ee=parseInt(ee);else for(let te=0,M=c.length;te<M;te++){const J=c[te];if(J.test(D,B,ee)){ee=J.converter(ee);break}}v[B]=ee}const $=q?.length;for(let B=0;B<$;B++){const ee=q[B];if(ee.nodeName==="#text"){v.__text=ee.nodeValue;continue}N(ee);const{nodeName:te}=ee;Array.isArray(v[te])?v[te].push(ee):va.indexOf(te)!==-1?(v[te]||(v[te]=[]),v[te].push(ee)):v[te]=ee}v.__children=q})(d),d})(l);return{[_.tagName]:_}}catch{return null}}return i={getIron:function(){return A},parseXml:p,parse:function(l){let _;const I=window.performance.now();if(_=p(l),!_||!_.MPD&&!_.Patch)throw new Error("failed to parse the manifest");_.Patch?(_=_.Patch,_.add&&_.add.forEach(d=>A.run(d)),_.replace&&_.replace.forEach(d=>A.run(d))):(_=_.MPD,A.run(_));const h=window.performance.now();return r.info("Parsing complete: "+(h-I).toPrecision(3)+"ms"),_.protocol="DASH",_}},r=t.getLogger(i),c=[new Aa,new Ta,new Ia,new Ra],A=Ea(e).create({adaptationset:new Na,period:new Ca}),i}fo.__dashjs_factory_name="DashParser";var Da=o.A.getClassFactory(fo);function go(n){n=n||{};const e=this.context,t=n.debug,i=n.settings,r=(0,m.A)(e).getInstance(),c=(0,ln.A)(e).getInstance();let A,p,l,_,I,h=n.mssHandler,d=n.errHandler;function N(v){r.trigger(F.A.INTERNAL_MANIFEST_LOADED,{manifest:v.manifest})}return A={load:function(v,q=null,k=null){const D=new Date,$=new ro(v,Ee.G.MPD_TYPE);q&&($.serviceLocation=q),k&&($.queryParams=k),$.startDate||($.startDate=D),r.trigger(F.A.MANIFEST_LOADING_STARTED,{request:$}),l.load({request:$,success:function(B,ee,te){var M;if(!_)return;let J,L,H;if(te&&te!==v?(L=c.parseBaseUrl(te),J=te):(c.isRelative(v)&&(v=c.resolve(v,window.location.href)),L=c.parseBaseUrl(v)),ee!="No Content")if(I===null&&(I=(function(w){let O=null;return w.indexOf("SmoothStreamingMedia")>-1?(h&&(O=h.createMssParser(),h.createMssFragmentProcessor(),h.registerEvents()),O):w.indexOf("MPD")>-1||w.indexOf("Patch")>-1?Da(e).create({debug:t}):O})(B)),I!==null){_.setParser(I);try{H=I.parse(B)}catch{return void r.trigger(F.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Hn.A(f.A.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,f.A.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${v}`)})}if(H){if(H.url=J||v,H.originalUrl||(H.originalUrl=H.url),i&&i.get().streaming.enableManifestDurationMismatchFix&&H.mediaPresentationDuration&&((M=H.Period)==null?void 0:M.length)>1){const w=H.Period.reduce((O,x)=>O+x.duration,0);!isNaN(w)&&H.mediaPresentationDuration>w&&(p.warn("Media presentation duration greater than duration of all periods. Setting duration to total period duration"),H.mediaPresentationDuration=w)}H.baseUri=L,H.loadedTime=new Date,_.resolveManifestOnLoad(H),r.trigger(F.A.ORIGINAL_MANIFEST_LOADED,{originalManifest:B})}else r.trigger(F.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Hn.A(f.A.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,f.A.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${v}`)})}else r.trigger(F.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Hn.A(f.A.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,f.A.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${v}`)});else r.trigger(F.A.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(B,ee,te){r.trigger(F.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Hn.A(f.A.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,f.A.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+`${v}, ${te}`)})}})},reset:function(){r.off(F.A.XLINK_READY,N,A),h&&h.reset(),_&&(_.reset(),_=null),l&&(l.abort(),l=null)}},p=t.getLogger(A),r.on(F.A.XLINK_READY,N,A),l=(0,ct.A)(e).create({errHandler:n.errHandler,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,urlUtils:c,constants:U.A,dashConstants:Fe.A,errors:f.A}),_=ma(e).create({errHandler:d,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,settings:n.settings}),I=null,A}go.__dashjs_factory_name="ManifestLoader";var Ma=o.A.getClassFactory(go);function ho(){let n,e,t=this.context,i=(0,m.A)(t).getInstance();return n={getValue:function(){return e},setValue:function(r){e=r,r&&i.trigger(F.A.MANIFEST_LOADED,{data:r})}},n}ho.__dashjs_factory_name="ManifestModel";var wa=o.A.getSingletonFactory(ho);function po(){const n=this.context,e=(0,E.A)(n).getInstance();let t,i,r;return t={initialize:function(){i.initialize()},select:function(c){if(!c||c.length===0)return null;let A=null;return e.get().streaming.applyContentSteering&&(A=(function(p){const l=r.getCurrentSteeringResponseData();return l&&l.pathwayPriority&&l.pathwayPriority.length>0?(function(_=[],I=[]){let h=0,d=null;for(;h<_.length;){const N=_[h],v=I.findIndex(q=>q.serviceLocation&&q.serviceLocation===N);if(v!==-1&&!i.contains(I[v].serviceLocation)){d=I[v];break}h+=1}return d})(l.pathwayPriority,p):null})(c)),A||(A=(function(p){return p[0]})(c)),A},setConfig:function(c){c.blacklistController&&(i=c.blacklistController),c.contentSteeringController&&(r=c.contentSteeringController)},reset:function(){i.reset()}},i=ir(n).create({updateEventName:F.A.SERVICE_LOCATION_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:F.A.SERVICE_LOCATION_LOCATION_BLACKLIST_ADD,enableExpiry:!1}),r=tr(n).getInstance(),t}po.__dashjs_factory_name="LocationSelector";var Pa=o.A.getClassFactory(po);function mo(){const n=this.context,e=(0,m.A)(n).getInstance(),t=(0,ln.A)(n).getInstance();let i,r,c,A,p,l,_,I,h,d,N,v,q,k,D;function $(){q=NaN,I=!1,l=!0,_=!1,B()}function B(){k!==null&&(clearTimeout(k),k=null)}function ee(G){B(),_||(isNaN(G)&&!isNaN(q)&&(G=1e3*q),isNaN(G)||(d.debug("Refresh manifest in "+G+" milliseconds."),k=setTimeout(J,G)))}function te(G=!1){I=!0;const W=v.getValue();let ie=W.url;ie&&(ie=Xn.A.removeQueryParameterFromUrl(ie,U.A.CMCD_QUERY_KEY));let oe=null;const Ae=i.getPatchLocation(W),ke=h.select(Ae);let Ie=null;if(ke&&!G)ie=ke.url,oe=ke.serviceLocation,Ie=ke.queryParams;else{const be=(function(Oe){const Ke=i.getLocation(Oe),le=r.getSynthesizedLocationElements(Ke);return Ke.concat(le)})(W),me=h.select(be);me&&(ie=me.url,oe=me.serviceLocation,Ie=me.queryParams)}t.isRelative(ie)&&(ie=t.resolve(ie,W.url)),N.load(ie,oe,Ie)}function M(G){if(G){if(i.getIsPatch(G)){let Ae=G;G=v.getValue();let ke=i.isPatchValid(G,Ae),Ie=ke;if(ke){let be=i.getPublishTime(G);i.applyPatchToManifest(G,Ae);let me=i.getPublishTime(G);Ie=be.getTime()!==me.getTime()}if(!Ie)return d.debug("Patch provided is invalid, performing full manifest refresh"),void te(!0);G.loadedTime=new Date}}else(G=v.getValue()).loadedTime=new Date;const W=v.getValue();if(W&&W.type===Fe.A.DYNAMIC&&G.type===Fe.A.STATIC&&(e.trigger(F.A.DYNAMIC_TO_STATIC),_=!0,D.get().streaming.ignoreFinalStaticManifestOnDynamicToStaticTransition))return void(I=!1);v.setValue(G);const ie=new Date,oe=(ie.getTime()-G.loadedTime.getTime())/1e3;q=i.getManifestUpdatePeriod(G,oe),1e3*q>2147483647&&(q=2147483647e-3),e.trigger(F.A.MANIFEST_UPDATED,{manifest:G}),d.info("Manifest has been refreshed at "+ie+"["+ie.getTime()/1e3+"] "),l||ee()}function J(){l||(I?ee(D.get().streaming.manifestUpdateRetryInterval):te())}function L(G){if(G.error)G.error.code===f.A.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&A.error(G.error);else{const W=G.manifest;(function(ie){(function(oe){const Ae=c.getExternalSubtitles();if(!Ae||Ae.length===0)return;const ke=oe&&oe.Period?oe.Period.length:0;Ae.forEach(Ie=>{if(Ie.periodId===null&&ke>1)d.warn(`External subtitle with id ${Ie.id} has no periodId and the MPD contains more than one period. Unable to add the external subtitle as it is not clear which period shall be used.`);else if(ke===1)H(oe.Period[0],Ie);else{const be=oe.Period.find(me=>me.id===Ie.periodId);be?H(be,Ie):d.warn(`External subtitle with id ${Ie.id} has periodId ${Ie.periodId} but the MPD does not contain a period with that id. Unable to add the external subtitle.`)}})})(ie)})(W),M(W)}}function H(G,W){if(!G||!G.AdaptationSet)return G;G.AdaptationSet.push(W.serializeToMpdParserFormat())}function w(){l=!1,ee()}function O(){l=!D.get().streaming.scheduling.scheduleWhilePaused,l&&B()}function x(){I=!1}return p={getIsUpdating:function(){return I},initialize:function(){$(),h.initialize(),e.on(F.A.STREAMS_COMPOSED,x,this),e.on(u.A.PLAYBACK_STARTED,w,this),e.on(u.A.PLAYBACK_PAUSED,O,this),e.on(F.A.INTERNAL_MANIFEST_LOADED,L,this)},refreshManifest:te,reset:function(){e.off(u.A.PLAYBACK_STARTED,w,this),e.off(u.A.PLAYBACK_PAUSED,O,this),e.off(F.A.STREAMS_COMPOSED,x,this),e.off(F.A.INTERNAL_MANIFEST_LOADED,L,this),h.reset(),$()},setConfig:function(G){G&&(G.manifestModel&&(v=G.manifestModel),G.adapter&&(i=G.adapter),G.manifestLoader&&(N=G.manifestLoader),G.errHandler&&(A=G.errHandler),G.locationSelector&&(h=G.locationSelector),G.settings&&(D=G.settings),G.contentSteeringController&&(r=G.contentSteeringController),G.customParametersModel&&(c=G.customParametersModel))},setManifest:function(G){M(G)}},d=(0,j.A)(n).getInstance().getLogger(p),h=Pa(n).create(),c=(0,vr.A)(n).getInstance(),p}mo.__dashjs_factory_name="ManifestUpdater";var Eo=o.A.getClassFactory(mo);function ki(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c,A,p,l,_,I,h,d;function N(le){if(!(le&&le.currentRepresentation&&le.currentRepresentation.mediaInfo&&le.currentRepresentation.mediaInfo.type))return;const fe=le.currentRepresentation.mediaInfo.type;l[fe]=le.currentRepresentation}function v(le,fe){return le&&r[fe]&&r[fe][le]?r[fe][le].list:[]}function q(le,fe){return le&&r[fe]&&r[fe][le]?r[fe][le].current:null}function k(le,fe={}){if(!le||!le.streamInfo)return;const pe=le.type,ze=le.streamInfo.id,$e=q(pe,ze);if(r[ze]&&r[ze][pe]&&(r[ze][pe].current=le,r[ze][pe].current&&(pe!==U.A.TEXT&&!B(le,$e)||pe===U.A.TEXT&&le.isFragmented)&&e.trigger(F.A.CURRENT_TRACK_CHANGED,{oldMediaInfo:$e,newMediaInfo:le,switchMode:c.get().streaming.trackSwitchMode[pe],options:fe},{streamId:ze}),!fe.hasOwnProperty("noSettingsSave")||!fe.noSettingsSave)){let ot=(function(Se){const We={lang:Se.lang,viewpoint:Se.viewpoint,roles:Se.roles,accessibility:Se.accessibility,audioChannelConfiguration:Se.audioChannelConfiguration,codec:Se.codec};return We.lang||We.viewpoint||We.role&&We.role.length>0||We.accessibility&&We.accessibility.length>0||We.audioChannelConfiguration&&We.audioChannelConfiguration.length>0?We:null})(le);if(!ot||!r[ze][pe].storeLastSettings)return;ot.roles&&(ot.role=ot.roles[0],delete ot.roles),ot.viewpoint&&(ot.viewpoint=ot.viewpoint[0]),ot.accessibility&&(ot.accessibility=ot.accessibility[0]),ot.audioChannelConfiguration&&(ot.audioChannelConfiguration=ot.audioChannelConfiguration[0]),p[pe]=ot,d.setSavedMediaSettings(pe,ot)}}function D(le,fe){le&&fe&&(A[le]=fe)}function $(le){return le?A[le]:null}function B(le,fe){if(!le&&!fe)return!0;if(!le||!fe||le.isPreselection!==fe.isPreselection)return!1;let pe=(0,Mn.A)(n).getInstance();const ze=le.id===fe.id,$e=pe.areEqual(le.viewpoint,fe.viewpoint),ot=le.lang===fe.lang,Se=le.codec===fe.codec,We=pe.areEqual(le.roles,fe.roles),rt=pe.areEqual(le.accessibility,fe.accessibility),gt=pe.areEqual(le.audioChannelConfiguration,fe.audioChannelConfiguration),Ot=pe.areEqual(le.supplementalProperties,fe.supplementalProperties),zt=pe.areEqual(le.essentialProperties,fe.essentialProperties);return ze&&Se&&$e&&ot&&We&&rt&&gt&&Ot&&zt}function ee(){r={},p={},l={},A={audio:null,video:null,text:null},e.off(u.A.REPRESENTATION_SWITCH,N,t)}function te(le,fe,pe){let ze=[];return le.forEach(function($e){fe(pe,$e)&&ze.push($e)}),ze.length!==0?(i.info("Filter-Function ("+fe.name+") resulted in "+ze.length+" tracks"),ze):fe===O&&c.get().streaming.assumeDefaultRoleAsMain&&Ke(pe.role,{schemeIdUri:U.A.DASH_ROLE_SCHEME_ID,value:Fe.A.MAIN})&&(i.info("no track with Role set to main - assuming main as default and searching again"),ze=te(le,x,null),ze.length!==0)?ze:(i.info("Filter-Function ("+fe.name+") resulted in no tracks; setting ignored"),le)}function M(le,fe){const pe=fe.lang,ze=(function(Se){const We=new Set;return Se.forEach(rt=>{rt.lang&&We.add(rt.lang)}),Array.from(We)})(le),$e=ze.map(Se=>Qr(Se));if(!pe||pe instanceof RegExp)return pe;const ot=Array.isArray(pe)?pe:[pe];return[...new Set(ot.flatMap(Se=>(function(We,rt){if(!rt||typeof rt!="string")return[];const gt=Qr(rt),Ot=Qt=>We.filter((fn,En)=>Qt($e[En]));let zt=Ot(Qt=>Qt===gt);if(zt=zt.length?zt:Ot(Qt=>Qt.startsWith(gt+"-")),zt.length)return zt;const Wt=Math.max(-1,...$e.filter(Qt=>gt.startsWith(Qt+"-")).map(Qt=>Qt.length));return zt=Ot(Qt=>Qt.length===Wt&&gt.startsWith(Qt+"-")),zt.length?zt:Ot(Qt=>Qt.split("-")[0]===gt.split("-")[0])})(ze,Se)))]}function J(le,fe){try{if(!le.lang)return!0;if(le.lang instanceof RegExp)return!!fe.lang.match(le.lang);const pe=Qr(fe.lang);return!!pe&&[].concat(le.lang).some(ze=>Qr(ze)===pe)}catch{return!1}}function L(le,fe){return le.index===void 0||le.index===null||fe.index===le.index}function H(le,fe){return le.id===void 0||le.id===null||fe.id===le.id}function w(le,fe){return!le.viewpoint||!!fe.viewpoint.filter(function(pe){return Ke(pe,le.viewpoint)})[0]}function O(le,fe,pe=!1){return!!fe.roles&&(!le.role||!!fe.roles.filter(function(ze){return Ke(ze,le.role)})[0]||fe.type===U.A.AUDIO&&pe)}function x(le,fe){return!fe.roles||fe.roles.length===0}function G(le,fe){let pe;return pe=le.accessibility?!!fe.accessibility.filter(function(ze){return Ke(ze,le.accessibility)})[0]:!fe.accessibility.length,pe}function W(le,fe){return!le.audioChannelConfiguration||!!fe.audioChannelConfiguration.filter(function(pe){return Ke(pe,le.audioChannelConfiguration)})[0]}function ie(le,fe){return!le.codec||le.codec===fe.codec}function oe(le){let fe=0,pe=[];return le.forEach(ze=>{isNaN(ze.selectionPriority)||(ze.selectionPriority>fe?(fe=ze.selectionPriority,pe=[ze]):ze.selectionPriority===fe&&pe.push(ze))}),pe}function Ae(le){let fe,pe=0,ze=[];return le.forEach(function($e){fe=Math.max.apply(Math,$e.bitrateList.map(function(ot){return ot.bandwidth})),fe>pe?(pe=fe,ze=[$e]):fe===pe&&ze.push($e)}),ze}function ke(le){return le[0]&&le[0].type===U.A.VIDEO?(function(fe){let pe,ze=1/0,$e=[];return fe.forEach(function(ot){pe=ot.bitrateList.reduce(function(Se,We){const rt=Math.max(1,We.width*We.height);return Se+We.bandwidth/rt},0)/ot.bitrateList.length,pe<ze?(ze=pe,$e=[ot]):pe===ze&&$e.push(ot)}),$e})(le):le[0]&&le[0].type===U.A.AUDIO?(function(fe){let pe=1/0,ze=[];return fe.forEach(function($e){let ot=$e.audioChannelConfiguration.reduce(function(We,rt){return We+(Cn(rt)||0)},0)/$e.audioChannelConfiguration.length;$e.hasOwnProperty("supplementalProperties")&&$e.supplementalProperties.some(We=>We.schemeIdUri==="tag:dolby.com,2018:dash:EC3_ExtensionType:2018"&&We.value==="JOC")&&(ot=16),ot||(ot=1);let Se=$e.bitrateList.reduce(function(We,rt){return We+rt.bandwidth/ot},0)/$e.bitrateList.length;Se<pe?(pe=Se,ze=[$e]):Se===pe&&ze.push($e)}),ze})(le):le}function Ie(le){let fe,pe=0,ze=[];return le.forEach(function($e){fe=$e.representationCount,fe>pe?(pe=fe,ze=[$e]):fe===pe&&ze.push($e)}),ze}function be(le,fe){if(le===U.A.TEXT)return(function($e){if(!$e||$e.length===0)return null;const ot=$e.filter(Se=>!(Se&&Se.roles&&Se.roles.length>0)||Se.roles.every(We=>We.schemeIdUri!==U.A.DASH_ROLE_SCHEME_ID||We.value!==Fe.A.FORCED_SUBTITLE));return ot.length>0?ot[0]:$e[0]})(fe);let pe;const ze=_.getCustomInitialTrackSelectionFunction();if(pe=(function($e){try{let ot;return ot=(function(Se){try{const We=Se.filter(rt=>{const gt=rt.type;return rt.bitrateList.some(Ot=>{const zt=I.getAbrBitrateParameter("maxBitrate",gt),Wt=I.getAbrBitrateParameter("minBitrate",gt);return!(zt>-1&&Ot.bandwidth>1e3*zt||Wt>-1&&Ot.bandwidth<1e3*Wt)})});return We.length>0?We:Se}catch(We){return i.error(We),Se}})($e),ot=(function(Se){try{if(!c.get().streaming.abr.limitBitrateByPortal)return Se;const{elementWidth:We}=h.getVideoElementSize(),rt=Se.filter(gt=>gt.type!==U.A.VIDEO||gt.bitrateList.some(Ot=>Ot.width<=We));return rt.length>0?rt:Se}catch(We){return i.error(We),Se}})(ot),ot}catch(ot){return i.error(ot),$e}})(fe),ze&&typeof ze=="function")pe=ze(pe);else if(l[le])pe=(function($e,ot){if(!$e||$e.length===0||!ot||!l[ot])return $e;const Se=l[ot].bandwidth;if(!Se||isNaN(Se))return $e;let We={min:NaN,track:null};return $e.forEach(rt=>{rt.bitrateList.forEach(gt=>{const Ot=Math.abs(gt.bandwidth-Se);(isNaN(We.min)||Ot<We.min)&&(We.min=Ot,We.track=rt)})}),We.track?[We.track]:$e})(pe,le);else if(c.get().streaming.ignoreSelectionPriority||(i.info("Trying to find track with highest selectionPriority"),pe=(function($e){return oe($e)})(pe)),pe.length>1&&c.get().streaming.prioritizeRoleMain&&(i.info("Trying to find a main track"),pe=te(pe,O,{role:{schemeIdUri:U.A.DASH_ROLE_SCHEME_ID,value:Fe.A.MAIN}})),pe.length>1){i.info("Selecting track based on selectionModeForInitialTrack");let $e=c.get().streaming.selectionModeForInitialTrack;switch($e){case U.A.TRACK_SELECTION_MODE_HIGHEST_BITRATE:pe=(function(ot){let Se=Ae(ot);return Se.length>1&&(Se=Ie(Se)),Se})(pe);break;case U.A.TRACK_SELECTION_MODE_FIRST_TRACK:pe=me(pe);break;case U.A.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:pe=Oe(pe);break;case U.A.TRACK_SELECTION_MODE_WIDEST_RANGE:pe=(function(ot){let Se=Ie(ot);return Se.length>1&&(Se=Ae(ot)),Se})(pe);break;case U.A.TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY:pe=(function(ot){let Se=ot.filter(We=>!(!We.segmentSequenceProperties||We.segmentSequenceProperties.length===0)&&We.segmentSequenceProperties.some(rt=>rt.isBootstrapConfiguration()));return Oe(Se.length>0?Se:ot)})(pe);break;default:i.warn(`Track selection mode ${$e} is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK`),pe=me(pe)}}return pe.length>0?pe[0]:fe[0]}function me(le){return le[0]}function Oe(le){let fe=ke(le);return fe.length>1&&(fe=Ae(fe)),fe}function Ke(le,fe){return!(!le||!fe)&&JSON.stringify({schemeIdUri:le.schemeIdUri,value:le.value})===JSON.stringify({schemeIdUri:fe.schemeIdUri,value:fe.value})}return t={addTrack:function(le){if(!le)return;const fe=le.type;if((pe=fe)!==U.A.AUDIO&&pe!==U.A.VIDEO&&pe!==U.A.TEXT&&pe!==U.A.IMAGE)return void i.info("track not added (_isMultiTrackSupportedByType), track.index="+le.index);var pe;let ze=le.streamInfo.id;r[ze]||(r[ze]=(function(){const ot=c.get().streaming.saveLastMediaSettingsForCurrentStreamingSession;return{audio:{list:[],storeLastSettings:ot,current:null},video:{list:[],storeLastSettings:ot,current:null},text:{list:[],storeLastSettings:ot,current:null},image:{list:[],storeLastSettings:ot,current:null}}})());const $e=r[ze][fe].list;for(let ot=0,Se=$e.length;ot<Se;++ot)if(B($e[ot],le))return void i.info("track not added as it is already set (this track-index="+le.index+" - existing track.index="+$e[ot].index+")");i.info("addTrack with track.codec='"+le.codec+"', track.type='"+le.type+"', track.id='"+le.id+"', track.index="+le.index),$e.push(le)},areTracksEqual:B,clearDataForStream:function(le){r[le]&&delete r[le]},filterTracksBySettings:te,getAvailablePreferredLanguages:M,getCurrentTrackFor:q,getInitialSettings:$,getTracksFor:v,getTracksWithHighestSelectionPriority:oe,getTracksWithHighestBitrate:Ae,getTracksWithHighestEfficiency:ke,getTracksWithWidestRange:Ie,initialize:function(){e.on(u.A.REPRESENTATION_SWITCH,N,t)},isCurrentTrack:function(le){if(!le)return!1;const fe=le.type,pe=le.streamInfo.id;return r[pe]&&r[pe][fe]&&B(r[pe][fe].current,le)},matchSettings:function(le,fe,pe=!1){try{const ze=J(le,fe),$e=le.index===void 0||le.index===null||fe.index===le.index,ot=!le.viewpoint||!!fe.viewpoint.filter(function(gt){return Ke(gt,le.viewpoint)})[0],Se=!le.role||!!fe.roles.filter(function(gt){return Ke(gt,le.role)})[0];let We=!le.accessibility||!!fe.accessibility.filter(function(gt){return Ke(gt,le.accessibility)})[0],rt=!le.audioChannelConfiguration||!!fe.audioChannelConfiguration.filter(function(gt){return Ke(gt,le.audioChannelConfiguration)})[0];return ze&&$e&&ot&&(Se||fe.type===U.A.AUDIO&&pe)&&We&&rt}catch(ze){return i.error(ze),!1}},matchSettingsAccessibility:G,matchSettingsAudioChannelConfig:W,matchSettingsIndex:L,matchSettingsLang:J,matchSettingsRole:O,matchSettingsViewPoint:w,reset:ee,saveTextSettingsDisabled:function(){d.setSavedMediaSettings(U.A.TEXT,null)},selectInitialTrack:be,setConfig:function(le){le&&(le.domStorage&&(d=le.domStorage),le.settings&&(c=le.settings),le.customParametersModel&&(_=le.customParametersModel),le.mediaPlayerModel&&(I=le.mediaPlayerModel),le.videoModel&&(h=le.videoModel))},setInitialMediaSettingsForType:function(le,fe){let pe=p[le]||$(le);const ze=v(le,fe.id);let $e=[];pe&&Object.keys(pe).length!==0||(pe=d.getSavedMediaSettings(le),pe&&delete pe.codec,D(le,pe)),ze&&ze.length!==0&&($e=c.get().streaming.includePreselectionsForInitialTrackSelection?Array.from(ze):ze.filter(ot=>!ot.isPreselection),pe&&(i.info("Filtering "+$e.length+" "+le+" tracks based on settings"),$e=te($e,H,pe),$e=te($e,J,{lang:M($e,pe)}),$e=te($e,L,pe),$e=te($e,w,pe),le===U.A.AUDIO&&p[le]||($e=te($e,O,pe)),$e=te($e,G,pe),$e=te($e,ie,pe),$e=te($e,W,pe),i.info("Filtering "+le+" tracks ended, found "+$e.length+" matching track(s).")),$e.length>1?k(be(le,$e)):k($e[0]))},setInitialSettings:D,setTrack:k},i=(0,j.A)(n).getInstance().getLogger(t),ee(),t}ki.__dashjs_factory_name="MediaController";const Ao=o.A.getSingletonFactory(ki);o.A.updateSingletonFactory(ki.__dashjs_factory_name,Ao);var Oa=Ao;function To(){let n,e,t,i;const r=this.context,c=(0,E.A)(r).getInstance();function A(d,N){return isNaN(d)?0:d>0?(N&&e.warn("Supplied minimum playback rate is a positive value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):d<-.5?(N&&e.warn("Supplied minimum playback rate is out of range and will be limited to -0.5: -50% playback speed."),-.5):d}function p(d,N){return isNaN(d)?0:d<0?(N&&e.warn("Supplied maximum playback rate is a negative value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):d>1?(N&&e.warn("Supplied maximum playback rate is out of range and will be limited to 1: 200% playback speed."),1):d}function l(d,N){return isNaN(d)?0:d<0?(N&&e.warn("Supplied step algorithm value is a negative value when it should be positive or 0. The supplied value will not be applied and set to 0."),0):d<0?(N&&e.warn("Supplied step algorithm value is out of range and will be limited to 0"),0):d}function _(){const d=I(),N=t.getLiveDelay();return!isNaN(N)&&N>0?Math.min(d,N):d}function I(){return c.get().streaming.buffer.bufferTimeDefault>0?c.get().streaming.buffer.bufferTimeDefault:h()?20:12}function h(){return c.get().streaming.buffer.fastSwitchEnabled!==null?c.get().streaming.buffer.fastSwitchEnabled:!t.getLowLatencyModeEnabled()}return n={getAbrBitrateParameter:function(d,N){try{const v=c.get().streaming.abr[d][N];if(!isNaN(v)&&v!==-1)return v;const q=i.getServiceDescriptionSettings();return q&&q[d]&&!isNaN(q[d][N])?q[d][N]:-1}catch{return-1}},getBufferTimeDefault:_,getBufferTimeDefaultUnadjusted:I,getCatchupMaxDrift:function(){if(!isNaN(c.get().streaming.liveCatchup.maxDrift))return c.get().streaming.liveCatchup.maxDrift;const d=i.getServiceDescriptionSettings();return d&&d.liveCatchup&&!isNaN(d.liveCatchup.maxDrift)&&d.liveCatchup.maxDrift>=0?d.liveCatchup.maxDrift:12},getCatchupModeEnabled:function(){return c.get().streaming.liveCatchup.enabled!==null?c.get().streaming.liveCatchup.enabled:t.getInitialCatchupModeActivated()},getCatchupPlaybackRates:function(d){const N=c.get().streaming.liveCatchup.playbackRate;if(!isNaN(N.min)||!isNaN(N.max))return{min:A(N.min,d),max:p(N.max,d)};const v=i.getServiceDescriptionSettings();if(v&&v.liveCatchup&&(!isNaN(v.liveCatchup.playbackRate.min)||!isNaN(v.liveCatchup.playbackRate.max))){const q=v.liveCatchup.playbackRate;return{min:A(q.min,d),max:p(q.max,d)}}return{min:-.5,max:.5}},getCatchupStepSettings:function(d){const N=c.get().streaming.liveCatchup.step;return isNaN(N.start.min)&&isNaN(N.start.max)&&isNaN(N.stop.min)&&isNaN(N.stop.max)?{start:{min:0,max:1},stop:{min:0,max:1}}:{start:{min:l(N.start.min,d),max:l(N.start.max,d)},stop:{min:l(N.stop.min,d),max:l(N.stop.max,d)}}},getFastSwitchEnabled:h,getInitialBufferLevel:function(){const d=c.get().streaming.buffer.initialBufferLevel;return isNaN(d)||d<0?0:Math.min(_(),d)},getRetryAttemptsForType:function(d){const N=isNaN(c.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:c.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return t.getLowLatencyModeEnabled()?c.get().streaming.retryAttempts[d]*N:c.get().streaming.retryAttempts[d]},getRetryIntervalsForType:function(d){const N=isNaN(c.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:c.get().streaming.retryIntervals.lowLatencyReductionFactor;return t.getLowLatencyModeEnabled()?c.get().streaming.retryIntervals[d]/N:c.get().streaming.retryIntervals[d]},getScheduleTimeout:function(){return t.getLowLatencyModeEnabled()?c.get().streaming.scheduling.lowLatencyTimeout:c.get().streaming.scheduling.defaultTimeout},reset:function(){},setConfig:function(d){d.playbackController&&(t=d.playbackController),d.serviceDescriptionController&&(i=d.serviceDescriptionController)}},e=(0,j.A)(r).getInstance().getLogger(n),n}To.__dashjs_factory_name="MediaPlayerModel";var La=o.A.getSingletonFactory(To);function yo(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c,A,p,l,_,I,h,d,N,v,q,k,D,$,B,ee,te,M,J,L,H;function w(){W(),k=!1,h=0,q=0,i=0,v=!1,N=!1,c=!1,$=NaN,I=NaN,L&&(e.off(F.A.DATA_UPDATE_COMPLETED,$e,A),e.off(F.A.MANIFEST_UPDATED,at,A),e.off(F.A.STREAMS_COMPOSED,St,A),e.off(u.A.PLAYBACK_ENDED,Ht,A),e.off(u.A.STREAM_INITIALIZING,xe,A),e.off(u.A.REPRESENTATION_SWITCH,Qe,A),e.off(u.A.BUFFER_LEVEL_STATE_CHANGED,We,A),ze(),L.removeEventListener("canplay",ot),L.removeEventListener("canplaythrough",Se),L.removeEventListener("ended",wt),L.removeEventListener("error",rn),L.removeEventListener("loadeddata",et),L.removeEventListener("loadedmetadata",Fn),L.removeEventListener("pause",zt),L.removeEventListener("play",rt),L.removeEventListener("playing",Ot),L.removeEventListener("progress",En),L.removeEventListener("ratechange",bn),L.removeEventListener("seeked",Qt),L.removeEventListener("seeking",Wt),L.removeEventListener("stalled",ht),L.removeEventListener("timeupdate",fn),L.removeEventListener("volumechange",Rt),L.removeEventListener("waiting",gt)),H=null,L=null,M=null,l=null}function O(ut=null){return parseFloat((x(ut)-ke()).toFixed(5))}function x(ut){const xt=ut||M;return xt.start+xt.duration}function G(ut=!1){M&&L&&L.getElement()?(ut&&l&&Ae(ke()),L.play()):k=!0}function W(){M&&L&&L.pause()}function ie(ut,xt=!1,en=!1,an=!1){M&&L&&L.getElement()&&ut!==(isNaN($)?L.getTime():$)&&(p=en===!0,p||($=ut),d.info("Requesting seek to time: "+ut+(p?" (internal)":"")),l&&an&&Ae(ut),L.setCurrentTime(ut,xt))}function oe(){if(!M||!L||!l)return;const ut=te&&te.hasVideoTrack()?U.A.VIDEO:U.A.AUDIO,xt=r.getCurrentDVRInfo(ut);return xt&&xt.range?xt.range.end:0}function Ae(ut){const xt=new Date(J.getClientReferenceTime()),en=t.getRegularPeriods()[0];h=J.calcPresentationTimeFromWallTime(xt,en)-ut}function ke(){return M&&L?L.getTime():null}function Ie(){return M&&L?L.isPaused():null}function be(){return M&&L?L.isSeeking():null}function me(){return M&&L?L.isStalled():null}function Oe(){return M&&L?L.getPlaybackRate():null}function Ke(){return M&&L?L.getEnded():null}function le(){return l}function fe(ut=null){if(Ie()||!l||L.getReadyState()===0||be()||v)return;ut||(ut=te.hasVideoTrack()?U.A.VIDEO:U.A.AUDIO);const xt=ke(),en=(function(an,In){const On=r.getCurrentDVRInfo(In),Gn=On?On.range:null;let $n;return Gn?($n=an>Gn.end?Math.max(Gn.end-h,Gn.start):an>0&&an+.25<Gn.start&&Math.abs(an-Gn.start)<31536e4?N?Math.max(Gn.end-h,Gn.start):Gn.start:an,$n):NaN})(xt,ut);!isNaN(en)&&en!==xt&&!be()&&(me()||D||L.getReadyState()===1)&&(d.debug(`UpdateCurrentTime: Seek to actual time: ${en} from currentTime: ${xt}`),ie(en,!1,!1))}function pe(){H===null&&(H=setInterval(()=>{(function(){if(e.trigger(F.A.WALLCLOCK_TIME_UPDATED,{isDynamic:l,time:new Date}),le()){const ut=Date.now();(isNaN(I)||ut>I+ee.get().streaming.liveUpdateTimeThresholdInMilliseconds)&&(te.addDVRMetric(),Ie()?(function(){const xt=Date.now();(!_||xt>_+500)&&(_=xt,fn())})():fe(),I=ut)}})()},ee.get().streaming.wallclockTimeUpdateInterval))}function ze(){clearInterval(H),H=null}function $e(ut){const xt=ut.currentRepresentation,en=xt?xt.mediaInfo.streamInfo:null;en!==null&&M.id===en.id&&(M=en)}function ot(){e.trigger(F.A.CAN_PLAY)}function Se(){e.trigger(F.A.CAN_PLAY_THROUGH)}function We(ut){ut.streamId===te.getActiveStreamInfo().id&&(D=ut.state===mt.BUFFER_EMPTY,ee.get().streaming.buffer.setStallState&&L.setStallState(ut.mediaType,ut.state===mt.BUFFER_EMPTY))}function rt(){d.info("Native video element event: play"),fe(),pe(),e.trigger(F.A.PLAYBACK_STARTED,{startTime:ke()})}function gt(){d.info("Native video element event: waiting"),e.trigger(F.A.PLAYBACK_WAITING,{playingTime:ke()})}function Ot(){d.info("Native video element event: playing"),p=!1,e.trigger(F.A.PLAYBACK_PLAYING,{playingTime:ke()})}function zt(){d.info("Native video element event: pause"),e.trigger(F.A.PLAYBACK_PAUSED,{ended:Ke()})}function Wt(){if(p)return;let ut=ke();isNaN($)||$===ut||(ut=$),$=NaN,d.info("Seeking to: "+ut),pe(),e.trigger(F.A.PLAYBACK_SEEKING,{seekTime:ut,streamId:M.id})}function Qt(){d.info("Native video element event: seeked"),p=!1,e.trigger(F.A.PLAYBACK_SEEKED,{streamId:M.id})}function fn(){M&&e.trigger(F.A.PLAYBACK_TIME_UPDATED,{timeToEnd:O(),time:ke(),streamId:M.id})}function En(){e.trigger(F.A.PLAYBACK_PROGRESS,{streamId:M.id})}function bn(){const ut=Oe();d.info("Native video element event: ratechange: ",ut),e.trigger(F.A.PLAYBACK_RATE_CHANGED,{playbackRate:ut})}function Fn(){d.info("Native video element event: loadedmetadata"),e.trigger(F.A.PLAYBACK_METADATA_LOADED),pe()}function et(){d.info("Native video element event: loadeddata"),e.trigger(F.A.PLAYBACK_LOADED_DATA)}function wt(){d.info("Native video element event: ended"),W(),ze();const ut=te?te.getActiveStreamInfo():null;ut&&e.trigger(F.A.PLAYBACK_ENDED,{isLast:ut.isLast})}function Rt(){e.trigger(F.A.PLAYBACK_VOLUME_CHANGED)}function Ht(ut){if(H&&ut.isLast){d.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");const xt=ut.seekTime?ut.seekTime:x();L.setCurrentTime(xt),W(),ze()}}function rn(ut){const xt=ut.target||ut.srcElement;e.trigger(F.A.PLAYBACK_ERROR,{error:xt.error})}function Rn(){l=!1}function ht(ut){e.trigger(F.A.PLAYBACK_STALLED,{e:ut})}function xe(ut){var xt;(xt=ut.mediaInfo)&&xt.supplementalProperties&&xt.supplementalProperties.find(en=>en.schemeIdUri===U.A.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME)&&(d.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),N=!0)}function Qe(ut){const xt=te.getActiveStreamInfo();ut&&xt&&ut.currentRepresentation&&ut.streamId&&ut.streamId===xt.id&&ut.mediaType&&(ut.mediaType===U.A.VIDEO||ut.mediaType===U.A.AUDIO)&&(N=ut.currentRepresentation.availabilityTimeComplete===!1||ut.currentRepresentation.k>1,N&&!c&&(c=!0))}function at(){v=!0}function St(){v=!1;const ut=te?te.getActiveStreamInfo():null;ut&&M&&ut.id===M.id&&(M=ut)}return A={computeAndSetLiveDelay:function(ut,xt){let en,an,In;const On=!isNaN(ut)&&isFinite(ut)?ut:NaN;let Gn=t.getSuggestedPresentationDelay();const $n=B.getServiceDescriptionSettings();return en=isNaN(ee.get().streaming.delay.liveDelay)?ee.get().streaming.delay.liveDelayFragmentCount===null||isNaN(ee.get().streaming.delay.liveDelayFragmentCount)||isNaN(On)?$n&&!isNaN($n.liveDelay)&&$n.liveDelay>0?$n.liveDelay:ee.get().streaming.delay.useSuggestedPresentationDelay===!0&&Gn!==null&&!isNaN(Gn)&&Gn>0?Gn:isNaN(On)?xt&&!isNaN(xt.minBufferTime)?4*xt.minBufferTime:4*M.manifestInfo.minBufferTime:4*On:On*ee.get().streaming.delay.liveDelayFragmentCount:ee.get().streaming.delay.liveDelay,In=t.getAvailabilityStartTime(),In!==null&&(i=In),an=xt&&xt.dvrWindowSize>0?Math.min(en,xt.dvrWindowSize):en,h=an,q=an,an},getAvailabilityStartTime:function(){return i},getBufferLevel:function(ut=null){let xt=null;return te.getActiveStreamProcessors().forEach(en=>{if(!ut||ut.length===0||ut.indexOf(en.getType())===-1){const an=en.getBufferLevel();xt=xt===null?an:Math.min(xt,an)}}),xt},getBufferedRanges:function(){return M&&L?L.getBufferRange():null},getCurrentLiveLatency:function(){if(!l||isNaN(i))return NaN;let ut=ke();if(isNaN(ut)||ut===0)return 0;const xt=new Date().getTime()+1e3*J.getClientTimeOffset();return Math.max(((xt-i-1e3*ut)/1e3).toFixed(3),0)},getEnded:Ke,getInitialCatchupModeActivated:function(){return c},getIsDynamic:le,getIsManifestUpdateInProgress:function(){return v},getLiveDelay:function(){return h},getLowLatencyModeEnabled:function(){return N},getOriginalLiveDelay:function(){return q},getPlaybackRate:Oe,getPlaybackStalled:function(){return D},getPlayedRanges:function(){return M&&L?L.getPlayedRanges():null},getStreamController:function(){return te},getStreamEndTime:x,getTime:ke,getTimeToStreamEnd:O,initialize:function(ut,xt){M=ut,xt!==!0&&(L.addEventListener("canplay",ot),L.addEventListener("canplaythrough",Se),L.addEventListener("ended",wt),L.addEventListener("error",rn),L.addEventListener("loadeddata",et),L.addEventListener("loadedmetadata",Fn),L.addEventListener("pause",zt),L.addEventListener("play",rt),L.addEventListener("playing",Ot),L.addEventListener("progress",En),L.addEventListener("ratechange",bn),L.addEventListener("seeked",Qt),L.addEventListener("seeking",Wt),L.addEventListener("stalled",ht),L.addEventListener("timeupdate",fn),L.addEventListener("volumechange",Rt),L.addEventListener("waiting",gt),l=M.manifestInfo.isDynamic,D=!1,p=!1,e.on(F.A.DATA_UPDATE_COMPLETED,$e,A),e.on(F.A.MANIFEST_UPDATED,at,A),e.on(F.A.STREAMS_COMPOSED,St,A),e.on(u.A.PLAYBACK_ENDED,Ht,A,{priority:m.A.EVENT_PRIORITY_HIGH}),e.on(u.A.STREAM_INITIALIZING,xe,A),e.on(u.A.REPRESENTATION_SWITCH,Qe,A),e.on(u.A.BUFFER_LEVEL_STATE_CHANGED,We,A),e.on(u.A.DYNAMIC_TO_STATIC,Rn,A),k&&(k=!1,G()))},isPaused:Ie,isProgressing:function(ut=500){return new Promise(xt=>{let en=-1,an=null;const In=Gn=>{clearTimeout(an),an=null,e.off(u.A.PLAYBACK_TIME_UPDATED,On,A),xt(Gn)},On=Gn=>{en<0?en=Gn.time:Gn.time>en+.1&&In(!0)};an=setTimeout(()=>{In(!1)},ut),e.on(u.A.PLAYBACK_TIME_UPDATED,On,A)})},isSeeking:be,isStalled:me,pause:W,play:G,reset:w,seek:ie,seekToCurrentLive:function(ut=!1,xt=!1,en=!1){const an=oe();an!==0&&ie(an-h,ut,xt,en)},seekToOriginalLive:function(ut=!1,xt=!1,en=!1){const an=oe();an!==0&&(h=q,ie(an-h,ut,xt,en))},setConfig:function(ut){ut&&(ut.streamController&&(te=ut.streamController),ut.serviceDescriptionController&&(B=ut.serviceDescriptionController),ut.dashMetrics&&(r=ut.dashMetrics),ut.adapter&&(t=ut.adapter),ut.videoModel&&(L=ut.videoModel),ut.timelineConverter&&(J=ut.timelineConverter),ut.settings&&(ee=ut.settings))},updateCurrentTime:fe},d=(0,j.A)(n).getInstance().getLogger(A),w(),A}yo.__dashjs_factory_name="PlaybackController";var Fa=o.A.getSingletonFactory(yo),Ua=C(1721),_o=class{constructor(){this.availabilityEndTime=NaN,this.availabilityStartTime=NaN,this.duration=NaN,this.index=null,this.indexRange=null,this.isPartialSegment=!1,this.media=null,this.mediaRange=null,this.mediaUrl=null,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.replacementNumber=NaN,this.replacementTime=null,this.representation=null,this.wallStartTime=NaN}assignAttributes(n){for(let e in n)n.hasOwnProperty(e)&&this.hasOwnProperty(e)&&(this[e]=n[e])}},Gi=class extends _o{constructor(){super()}};function So(){const n=this.context;let e,t,i,r,c,A,p,l,_,I,h,d;function N(D,$,B,ee){let te=null;const M=D?d.resolve(D.path):null,J=ee||{init:!0,url:M?M.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:$,representation:D};t.debug("Start searching for initialization.");const L=k(J);p.load({request:L,success:function(H){if(J.bytesLoaded=J.range.end,te=r.findInitRange(H),!te)return J.range.end=J.bytesLoaded+J.bytesToLoad,N(D,$,B,J);D.range=te,B(D)},error:function(){B(D)}}),t.debug("Perform init search: "+J.url)}function v(D,$,B,ee,te,M){if(B&&(B.start===void 0||B.end===void 0)){const G=B?B.toString().split("-"):null;B=G?{start:parseFloat(G[0]),end:parseFloat(G[1])}:null}te=te||q;let J=null,L=null;const H=!!B,w=D?d.resolve(D.path):null,O={init:!1,url:w?w.url:void 0,range:H?B:{start:0,end:1500},searching:!H,bytesLoaded:M?M.bytesLoaded:0,bytesToLoad:1500,mediaType:$,representation:D},x=k(O);p.load({request:x,success:function(G){const W=O.bytesToLoad,ie=G.byteLength;if(O.bytesLoaded=O.range.end-O.range.start,J=r.parse(G),L=J.getBox("sidx"),L&&L.isComplete){const oe=L.references;let Ae,ke;if(oe!=null&&oe.length>0&&(Ae=oe[0].reference_type===1),Ae){let Ie,be,me,Oe,Ke;t.debug("Initiate multiple SIDX load."),O.range.end=O.range.start+L.size;let le=[],fe=0,pe=(L.offset||O.range.start)+L.size;const ze=function($e){$e?(le=le.concat($e),fe++,fe>=be&&(le.sort(function(ot,Se){return ot.startTime-Se.startTime<0?-1:0}),te(le,D,ee))):te(null,D,ee)};for(Ie=0,be=oe.length;Ie<be;Ie++)me=pe,Oe=pe+oe[Ie].referenced_size-1,pe+=oe[Ie].referenced_size,Ke={start:me,end:Oe},v(D,$,Ke,ee,ze,O)}else t.debug("Parsing segments from SIDX. representation "+$+" - id: "+D.id+" for range : "+O.range.start+" - "+O.range.end),ke=(function(Ie,be){const me=Ie.references,Oe=me.length,Ke=Ie.timescale;let le=Ie.earliest_presentation_time,fe=be.range.start+Ie.offset+Ie.first_offset+Ie.size;const pe=[];let ze,$e,ot,Se;for(let We=0;We<Oe;We++)ot=me[We].subsegment_duration,Se=me[We].referenced_size,ze=new Gi,ze.duration=ot,ze.startTime=le,ze.timescale=Ke,$e=fe+Se-1,ze.mediaRange=fe+"-"+$e,pe.push(ze),le+=ot,fe+=Se;return pe})(L,O),te(ke,D,ee)}else{if(L)O.range.start=L.offset||O.range.start,O.range.end=O.range.start+(L.size||W);else{if(ie<O.bytesLoaded)return void te(null,D,ee);{const oe=J.getLastBox();oe&&oe.size?(O.range.start=oe.offset+oe.size,O.range.end=O.range.start+W):O.range.end+=W}}v(D,$,O.range,ee,null,O)}},error:function(){te(null,D,ee)}}),t.debug(`Perform SIDX load for type ${$} : ${O.url} with range ${O.range.start} - ${O.range.end}`)}function q(D,$,B){B({segments:D,representation:$,error:D?void 0:new Hn.A(l.SEGMENT_BASE_LOADER_ERROR_CODE,l.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function k(D){if(!D.url)return;const $=new dt.A;return $.setInfo(D),$}return e={setConfig:function(D){D.baseURLController&&(d=D.baseURLController),D.dashMetrics&&(c=D.dashMetrics),D.mediaPlayerModel&&(A=D.mediaPlayerModel),D.errHandler&&(i=D.errHandler),D.boxParser&&(r=D.boxParser),D.debug&&(t=D.debug.getLogger(e)),D.errors&&(l=D.errors),D.urlUtils&&(h=D.urlUtils),D.constants&&(_=D.constants),D.dashConstants&&(I=D.dashConstants)},initialize:function(){p=(0,ct.A)(n).create({errHandler:i,dashMetrics:c,mediaPlayerModel:A,boxParser:r,errors:l,urlUtils:h,constants:_,dashConstants:I})},loadInitialization:function(D,$){return new Promise(B=>{N(D,$,B)})},loadSegments:function(D,$,B){return new Promise(ee=>{v(D,$,B,ee)})},reset:function(){p&&(p.abort(),p=null)}},e}So.__dashjs_factory_name="SegmentBaseLoader";var xa=o.A.getSingletonFactory(So);function Io(n){let e;n=n||{};let t=new DataView(n.data),i=0;function r(A,p){let l,_,I=!0,h=0;if(p===void 0&&(p=!1),A.tag>16777215?(t.getUint32(i)!==A.tag&&(I=!1),h=4):A.tag>65535?(l=t.getUint16(i),_=t.getUint8(i+2),256*l+_!==A.tag&&(I=!1),h=3):A.tag>255?(t.getUint16(i)!==A.tag&&(I=!1),h=2):(t.getUint8(i)!==A.tag&&(I=!1),h=1),!I&&A.required&&!p)throw new Error("required tag not found");return I&&(i+=h),I}function c(A){let p=1,l=128,_=-1,I=0,h=t.getUint8(i),d=0;for(d=0;d<8;d+=1){if((h&l)===l){I=A===void 0?h&~l:h,_=d;break}l>>=1}for(d=0;d<_;d+=1,p+=1)I=I<<8|255&t.getUint8(i+p);return i+=p,I}return e={getPos:function(){return i},setPos:function(A){i=A},consumeTag:r,consumeTagAndSize:function(A,p){let l=r(A,p);return l&&c(),l},parseTag:function(A){let p;return r(A),p=c(),e[A.parse](p)},skipOverElement:function(A,p){let l,_=r(A,p);return _&&(l=c(),i+=l),_},getMatroskaCodedNum:c,getMatroskaFloat:function(A){let p;switch(A){case 4:p=t.getFloat32(i),i+=4;break;case 8:p=t.getFloat64(i),i+=8}return p},getMatroskaUint:function(A){if(A>4)return(function(l){const _=Math.floor(Number.MAX_SAFE_INTEGER/256);let I=0;for(let h=0;h<l;h+=1){if(I>_)throw new Error("Value exceeds safe integer limit");I*=256;const d=t.getUint8(i+h);if(I>Number.MAX_SAFE_INTEGER-d)throw new Error("Value exceeds safe integer limit");I+=d}return i+=l,I})(A);let p=0;for(let l=0;l<A;l+=1)p<<=8,p|=255&t.getUint8(i+l);return i+=A,p>>>0},moreData:function(){return i<t.byteLength}},e}Io.__dashjs_factory_name="EBMLParser";var Ro=o.A.getClassFactory(Io);function No(){const n=this.context;let e,t,i,r,c,A,p,l,_;function I(h){const d=new dt.A;return d.setInfo(h),d}return e={setConfig:function(h){if(!(h.baseURLController&&h.dashMetrics&&h.mediaPlayerModel&&h.errHandler))throw new Error(U.A.MISSING_CONFIG_ERROR);_=h.baseURLController,c=h.dashMetrics,A=h.mediaPlayerModel,r=h.errHandler,l=h.errors,t=h.debug.getLogger(e)},initialize:function(){p=(0,ct.A)(n).create({errHandler:r,dashMetrics:c,mediaPlayerModel:A,errors:l})},loadInitialization:function(h,d){return new Promise(N=>{let v=null,q=h?_.resolve(h.path):null,k=h?h.range.split("-"):null,D={range:{start:k?parseFloat(k[0]):null,end:k?parseFloat(k[1]):null},request:v,url:q?q.url:void 0,init:!0,mediaType:d};t.info("Start loading initialization."),v=I(D),p.load({request:v,success:function(){N(h)},error:function(){N(h)}}),t.debug("Perform init load: "+D.url)})},loadSegments:function(h,d,N){return new Promise(v=>{let q=null,k=h?_.resolve(h.path):null,D=k?k.url:void 0;q=I({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:q,url:D,init:!1,mediaType:d,representation:h}),t.debug("Parsing ebml header"),p.load({request:q,success:function($){(function(B,ee,te,M){if(!B||B.byteLength===0)return void M(null);let J,L,H,w,O=Ro(n).create({data:B}),x=te?te.split("-"):null,G=null,W={url:ee,range:{start:x?parseFloat(x[0]):null,end:x?parseFloat(x[1]):null},request:G};for(t.debug("Parse EBML header: "+W.url),O.skipOverElement(i.EBML),O.consumeTag(i.Segment),H=O.getMatroskaCodedNum(),H+=O.getPos(),w=O.getPos();O.moreData()&&!O.consumeTagAndSize(i.Segment.Info,!0);)if(!(O.skipOverElement(i.Segment.SeekHead,!0)||O.skipOverElement(i.Segment.Tracks,!0)||O.skipOverElement(i.Segment.Cues,!0)||O.skipOverElement(i.Void,!0)))throw new Error("no valid top level element found");for(;J===void 0;){let ie=O.getMatroskaCodedNum(!0),oe=O.getMatroskaCodedNum();ie===i.Segment.Info.Duration.tag?J=O[i.Segment.Info.Duration.parse](oe):O.setPos(O.getPos()+oe)}G=I(W),p.load({request:G,success:function(ie){L=(function(oe,Ae,ke,Ie){let be,me,Oe,Ke,le,fe,pe,ze;for(me=(function($e){let ot,Se,We=[],rt=Ro(n).create({data:$e});for(rt.consumeTagAndSize(i.Segment.Cues);rt.moreData()&&rt.consumeTagAndSize(i.Segment.Cues.CuePoint,!0);){for(ot={},ot.CueTime=rt.parseTag(i.Segment.Cues.CuePoint.CueTime),ot.CueTracks=[];rt.moreData()&&rt.consumeTag(i.Segment.Cues.CuePoint.CueTrackPositions,!0);){const gt=rt.getMatroskaCodedNum(),Ot=rt.getPos();if(Se={},Se.Track=rt.parseTag(i.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),Se.Track===0)throw new Error("Cue track cannot be 0");Se.ClusterPosition=rt.parseTag(i.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),ot.CueTracks.push(Se),rt.setPos(Ot+gt)}if(ot.CueTracks.length===0)throw new Error("Mandatory cuetrack not found");We.push(ot)}if(We.length===0)throw new Error("mandatory cuepoint not found");return We})(oe),Oe=[],le=0,fe=me.length;le<fe;le+=1)Ke=new Gi,be=0,be=le<me.length-1?me[le+1].CueTime-me[le].CueTime:Ie-me[le].CueTime,Ke.duration=be,Ke.startTime=me[le].CueTime,Ke.timescale=1e3,pe=me[le].CueTracks[0].ClusterPosition+Ae,ze=le<me.length-1?me[le+1].CueTracks[0].ClusterPosition+Ae-1:ke-1,Ke.mediaRange=pe+"-"+ze,Oe.push(Ke);return t.debug("Parsed cues: "+Oe.length+" cues."),Oe})(ie,w,H,J),M(L)},error:function(){t.error("Download Error: Cues "+W.url),M(null)}}),t.debug("Perform cues load: "+W.url+" bytes="+W.range.start+"-"+W.range.end)})($,D,N,function(B){v({segments:B,representation:h,error:B?void 0:new Hn.A(l.SEGMENT_BASE_LOADER_ERROR_CODE,l.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})})},error:function(){v({representation:h,error:new Hn.A(l.SEGMENT_BASE_LOADER_ERROR_CODE,l.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}})})},reset:function(){p&&(p.abort(),p=null)}},i={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},e}No.__dashjs_factory_name="WebmSegmentBaseLoader";var Ba=o.A.getSingletonFactory(No);function Co(n){n=n||{};const e=this.context,t=n.eventBus,i=n.events,r=n.dashMetrics,c=n.mediaPlayerModel,A=n.errHandler,p=n.baseURLController,l=n.debug,_=n.boxParser,I=n.errors;let h,d,N;function v(q){return(q?q.split("/")[1]:"").toLowerCase()==="webm"}return h={initialize:function(){d.initialize(),N.initialize()},getSegmentBaseInitSegment:function(q){return v(q.representation.mimeType)?N.loadInitialization(q.representation,q.mediaType):d.loadInitialization(q.representation,q.mediaType)},getSegmentList:function(q){return v(q.mimeType)?N.loadSegments(q.representation,q.mediaType,q.representation?q.representation.indexRange:null):d.loadSegments(q.representation,q.mediaType,q.representation?q.representation.indexRange:null)},reset:function(){d.reset(),N.reset()}},d=xa(e).getInstance(),N=Ba(e).getInstance(),d.setConfig({baseURLController:p,dashMetrics:r,mediaPlayerModel:c,errHandler:A,eventBus:t,events:i,errors:I,debug:l,boxParser:_}),N.setConfig({baseURLController:p,dashMetrics:r,mediaPlayerModel:c,errHandler:A,eventBus:t,events:i,errors:I,debug:l}),h}Co.__dashjs_factory_name="SegmentBaseController";var ka=o.A.getSingletonFactory(Co);const Ga=[U.A.SERVICE_DESCRIPTION_DVB_LL_SCHEME],bo="video",vo="audio";function Do(){const n=this.context;let e,t,i,r,c;function A(){t={liveDelay:NaN,liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN}},minBitrate:{},maxBitrate:{},initialBitrate:{},contentSteering:null,clientDataReporting:null},i=[]}function p(l,_,I){try{t[l][_]=I/1e3}catch(h){r.error(h)}}return e={applyServiceDescription:function(l){if(!l||!l.serviceDescriptions)return;const _=l.serviceDescriptions.filter(d=>Ga.includes(d.schemeIdUri)),I=l.serviceDescriptions.filter(d=>d.schemeIdUri==null);let h=_.length>0?_[_.length-1]:I[I.length-1];h&&(h.latency&&h.latency.target>0&&(function(d){let N;if(d.schemeIdUri,U.A.SERVICE_DESCRIPTION_DVB_LL_SCHEME,N=(function(v){return{liveDelay:v.latency.target/1e3,maxDrift:!isNaN(v.latency.max)&&v.latency.max>v.latency.target?(v.latency.max-v.latency.target+500)/1e3:NaN,referenceId:v.latency.referenceId||NaN}})(d),i.length>0){let{to:v,id:q}=(function(k){let D,$=0,B=i.filter(ee=>ee.id===k.referenceId);return B.length===0?($=i.length>0?i[0].to:0,D=i[0].id||NaN):($=B[0].to||0,D=B[0].id||NaN),{to:$,id:D}})(N);t.liveDelay=N.liveDelay-v,t.liveCatchup.maxDrift=N.maxDrift,r.debug(`
17
+ Found latency properties coming from service description. Applied time offset of ${v} from ProducerReferenceTime element with id ${q}.
18
+ Live Delay: ${N.liveDelay-v}, Live catchup max drift: ${N.maxDrift}
19
+ `)}else t.liveDelay=N.liveDelay,t.liveCatchup.maxDrift=N.maxDrift,r.debug(`Found latency properties coming from service description: Live Delay: ${N.liveDelay}, Live catchup max drift: ${N.maxDrift}`)})(h),h.playbackRate&&(function(d){const N=d.playbackRate.min?Math.round(1e3*(d.playbackRate.min-1))/1e3:NaN,v=d.playbackRate.max?Math.round(1e3*(d.playbackRate.max-1))/1e3:NaN;t.liveCatchup.playbackRate.min=N,t.liveCatchup.playbackRate.max=v,r.debug(`Found latency properties coming from service description: Live catchup min playback rate: ${N}`),r.debug(`Found latency properties coming from service description: Live catchup max playback rate: ${v}`)})(h),h.operatingQuality,h.operatingBandwidth&&(function(d){if(!d||!d.operatingBandwidth||!d.operatingBandwidth.mediaType||d.operatingBandwidth.mediaType==="all")return;const N={};N.minBandwidth=d.operatingBandwidth.min,N.maxBandwidth=d.operatingBandwidth.max,N.targetBandwidth=d.operatingBandwidth.target;const v=[];d.operatingBandwidth.mediaType===bo||d.operatingBandwidth.mediaType===vo?v.push(d.operatingBandwidth.mediaType):d.operatingBandwidth.mediaType==="any"&&(v.push(vo),v.push(bo)),v.forEach(q=>{isNaN(N.minBandwidth)||p("minBitrate",q,N.minBandwidth),isNaN(N.maxBandwidth)||p("maxBitrate",q,N.maxBandwidth),isNaN(N.targetBandwidth)||p("initialBitrate",q,N.targetBandwidth)})})(h),h.contentSteering&&(function(d){t.contentSteering=d.contentSteering})(h),h.clientDataReporting&&(function(d){t.clientDataReporting=d.clientDataReporting})(h))},calculateProducerReferenceTimeOffsets:function(l){try{let _=[];if(l&&l.length>0){const I=[U.A.VIDEO,U.A.AUDIO,U.A.TEXT],h=c.getAvailabilityStartTime()/1e3;l.forEach(d=>{const N=I.reduce((v,q)=>v.concat(c.getAllMediaInfoForType(d,q)),[]).reduce((v,q)=>(c.getProducerReferenceTimes(d,q).forEach(k=>{const D=c.getVoRepresentations(q);if(D&&D.length>0&&D[0].adaptation&&D[0].segmentInfoType===Fe.A.SEGMENT_TEMPLATE){const $=D[0],B=new Date(k[Fe.A.WALL_CLOCK_TIME]).getTime()/1e3-(k[Fe.A.PRESENTATION_TIME]/$[Fe.A.TIMESCALE]-$[Fe.A.PRESENTATION_TIME_OFFSET]+d.start),ee=h-B;v.push({id:k[Fe.A.ID],to:ee})}}),v),[]);_=_.concat(N)})}i=_}catch(_){r.error(_),i=[]}},getProducerReferenceTimeOffsets:function(){return i},getServiceDescriptionSettings:function(){return t},reset:function(){A()},setConfig:function(l){l&&l.adapter&&(c=l.adapter)}},r=(0,j.A)(n).getInstance().getLogger(e),A(),e}Do.__dashjs_factory_name="ServiceDescriptionController";var Ya=o.A.getSingletonFactory(Do);class qa{constructor(e){this._ranges=[];for(const t of e){const i=this._ranges,r={start:t.start,end:t.end},c=i.length?i[i.length-1]:null;!c||r.start>c.end?i.push(r):c.end=r.end}}get length(){return this._ranges.length}start(e){return this._ranges[e].start}end(e){return this._ranges[e].end}}var Mo=class{constructor(n,e){this.eventBus=e,this.mimeType=n,this.updating=!1,this.chunks=[],this.appendWindowStart=0,this.appendWindowEnd=1/0,this.timestampOffset=0,this.mode="segments"}appendBuffer(n,e,t){if(this.updating)throw new Error("SourceBuffer is currently updating");this.updating=!0,this.eventBus.trigger("externalSourceBufferUpdateStart",{mimeType:this.mimeType,request:"appendBuffer",data:n,start:e,end:t}),Number.isNaN(e)||(this.chunks.push({data:n,start:e,end:t}),this.chunks.sort((i,r)=>i.start-r.start)),setTimeout(()=>{this.updating=!1,this.eventBus.trigger("externalSourceBufferUpdating",{mimeType:this.mimeType}),this.eventBus.trigger("externalSourceBufferUpdateEnd",{mimeType:this.mimeType})},10)}abort(){this.updating&&(this.updating=!1,this.eventBus.trigger("externalSourceBufferAbort",{mimeType:this.mimeType}),this.eventBus.trigger("externalSourceBufferUpdateEnd",{mimeType:this.mimeType}))}remove(n,e){if(this.updating)throw new Error("SourceBuffer is currently updating");this.updating=!0,this.eventBus.trigger("externalSourceBufferUpdateStart",{mimeType:this.mimeType,request:"remove",start:n,end:e}),this.chunks=this.chunks.filter(t=>t.end<=n||t.start>=e),setTimeout(()=>{this.updating=!1,this.eventBus.trigger("externalSourceBufferUpdating",{mimeType:this.mimeType}),this.eventBus.trigger("externalSourceBufferUpdateEnd",{mimeType:this.mimeType})},10)}get buffered(){return new qa(this.chunks)}},Va=class{constructor(n){this.eventBus=n,this.reset()}get duration(){return this._duration}set duration(n){if(this._readyState!=="open")throw new Error("ExternalMediaSource is not open");this._duration=n}get readyState(){return this._readyState}addSourceBuffer(n){if(this._readyState!=="open")throw new Error("ExternalMediaSource is not open");const e=new Mo(n,this.eventBus);return this.sourceBuffers.set(e,n),e}removeSourceBuffer(n){if(!this.sourceBuffers.has(n))throw new Error("ExternalSourceBuffer not found");this.sourceBuffers.delete(n)}open(){this._readyState="open",this.eventBus.trigger("externalMediaSourceOpen",{})}endOfStream(){if(this._readyState!=="open")throw new Error("ExternalMediaSource is not open");this._readyState="ended",this.eventBus.trigger("externalMediaSourceEnded",{})}close(){this._readyState="closed",this.eventBus.trigger("externalMediaSourceClosed",{})}reset(){this.sourceBuffers=new Map,this._duration=NaN,this._readyState="closed"}},Ka=class{constructor(){this.streamId=null,this.segmentType=null,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representation=null,this.endFragment=null}};class Ha extends dt.A{constructor(e){super(e),this.checkForExistenceOnly=!0}}var ja=Ha;function wo(n){n=n||{};const e=this.context,t=n.eventBus,i=n.events,r=n.urlUtils,c=n.errors,A=n.streamId;let p,l;return p={abort:function(){l&&l.abort()},checkForExistence:function(_){const I=function(h){t.trigger(i.CHECK_FOR_EXISTENCE_COMPLETED,{request:_,exists:h})};if(_){let h=new ja(_.url);l.load({request:h,success:function(){I(!0)},error:function(){I(!1)}})}else I(!1)},load:function(_){const I=function(h,d){t.trigger(i.LOADING_COMPLETED,{request:_,response:h||null,error:d||null,sender:p})};_?l.load({request:_,progress:function(h){t.trigger(i.LOADING_PROGRESS,{request:_,stream:h.stream,streamId:A}),h.data&&t.trigger(i.LOADING_DATA_PROGRESS,{request:_,response:h.data||null,error:null,sender:p})},success:function(h){I(h)},error:function(h,d,N){I(void 0,new Hn.A(c.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,N,d))},abort:function(h){h&&t.trigger(i.LOADING_ABANDONED,{mediaType:h.mediaType,request:h,sender:p})}}):I(void 0,new Hn.A(c.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,c.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},reset:function(){l&&(l.abort(),l.reset(),l=null)},resetInitialSettings:function(){l&&l.resetInitialSettings()}},l=(0,ct.A)(e).create({errHandler:n.errHandler,errors:c,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,urlUtils:r,constants:U.A,boxParser:n.boxParser,dashConstants:n.dashConstants}),p}wo.__dashjs_factory_name="FragmentLoader";var za=o.A.getClassFactory(wo);function Po(n){n=n||{};const e=this.context,t=(0,m.A)(e).getInstance(),i=n.errHandler,r=n.mediaPlayerModel,c=n.dashMetrics,A=(0,j.A)(e).getInstance(),p=n.streamInfo;let l,_,I;function h(){return p.id}function d(){for(let v in I)I[v].reset();I={}}function N(v){if(!v.sender)return;const q=v.request,k=v.response,D=q.isInitializationRequest(),$=q.representation.mediaInfo.streamInfo;if(v.error&&(q.mediaType===U.A.AUDIO||q.mediaType===U.A.VIDEO||q.mediaType===U.A.TEXT&&q.representation.mediaInfo.isFragmented)&&t.trigger(F.A.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD,{entry:v.request.serviceLocation}),!k||!$)return void _.warn("No "+q.mediaType+" bytes to push or stream is inactive.");const B=(function(ee,te,M,J){const L=new Ka;return L.streamId=M,L.segmentType=te.type,L.start=te.startTime,L.duration=te.duration,L.end=L.start+L.duration,L.bytes=ee,L.index=te.index,L.representation=te.representation,L.endFragment=J,L})(k,q,p.id,v.type!==F.A.FRAGMENT_LOADING_PROGRESS);t.trigger(D?F.A.INIT_FRAGMENT_LOADED:F.A.MEDIA_FRAGMENT_LOADED,{chunk:B,request:q},{streamId:$.id,mediaType:q.mediaType})}return l={getStreamId:h,getModel:function(v){let q=I[v];return q||(q=Gt(e).create({streamInfo:p,type:v,dashMetrics:c,fragmentLoader:za(e).create({dashMetrics:c,mediaPlayerModel:r,errHandler:i,settings:n.settings,boxParser:n.boxParser,eventBus:t,events:F.A,errors:f.A,dashConstants:n.dashConstants,urlUtils:n.urlUtils,streamId:h()}),debug:A,eventBus:t,events:F.A}),I[v]=q),q},reset:function(){t.off(u.A.FRAGMENT_LOADING_COMPLETED,N,this),t.off(u.A.FRAGMENT_LOADING_PROGRESS,N,this),d()}},_=A.getLogger(l),d(),t.on(u.A.FRAGMENT_LOADING_COMPLETED,N,l),t.on(u.A.FRAGMENT_LOADING_PROGRESS,N,l),l}Po.__dashjs_factory_name="FragmentController";var Wa=o.A.getClassFactory(Po),Fr=class{constructor(n){this.newMediaInfo=n.newMediaInfo,this.previouslySelectedRepresentation=n.previouslySelectedRepresentation,this.newRepresentation=n.newRepresentation}};function Oo(n){const e=this.context,t=(0,E.A)(e).getInstance(),i=n.textController,r=n.eventBus;let c,A,p,l,_,I,h=[],d=[],N=!1,v=n.mediaSource,q=null;function k(O){return O.mimeType+';codecs="'+O.codecs+'"'}function D(O){return l=i.getTextSourceBuffer(O),Promise.resolve()}function $(){if(typeof l.addEventListener=="function")try{l.addEventListener("updateend",L,!1),l.addEventListener("error",H,!1),l.addEventListener("abort",H,!1)}catch{I=setInterval(L,50)}else I=setInterval(L,50)}function B(){try{typeof l.removeEventListener=="function"&&(l.removeEventListener("updateend",L,!1),l.removeEventListener("error",H,!1),l.removeEventListener("abort",H,!1)),clearInterval(I)}catch(O){p.error(O)}}function ee(O){return new Promise(x=>{l&&t.get().streaming.buffer.useAppendWindow?w(()=>{try{if(!l)return void x();let G=v.duration,W=0;O&&!isNaN(O.start)&&!isNaN(O.duration)&&isFinite(O.duration)&&(G=O.start+O.duration),O&&!isNaN(O.start)&&(W=O.start),l.appendWindowEnd===G&&l.appendWindowStart===W||(l.appendWindowStart=0,l.appendWindowEnd=G+.01,l.appendWindowStart=Math.max(W-.1,0),p.debug(`Updated append window for ${_.type}. Set start to ${l.appendWindowStart} and end to ${l.appendWindowEnd}`)),x()}catch{p.warn("Failed to set append window"),x()}}):x()})}function te(O){return new Promise(x=>{l?w(()=>{try{l.timestampOffset===O||isNaN(O)||(l.timestampOffset=O,p.debug(`Set MSE timestamp offset to ${O}`)),x()}catch{x()}}):x()})}function M(){if(!N&&d.length>0){N=!0;const O=d[0];d.splice(0,1);const x=function(){N=!1,d.length>0&&M.call(this),O&&O.data&&O.data.segmentType&&O.data.segmentType!==Ee.G.INIT_SEGMENT_TYPE&&delete O.data.bytes,O.promise.resolve({chunk:O.data})};try{if(q=O.request,O.data.bytes.byteLength===0)x.call(this);else{try{p.debug(`Appending ${O.data.segmentType} from period ${O.data.streamId} to buffer. Request URL: ${O.request.url}, Representation: ID: ${O.data.representation.id}, bitrate: ${O.data.representation.bitrateInKbit}`)}catch{}l instanceof Mo?l.appendBuffer(O.data.bytes,O.data.start,O.data.end):l.appendBuffer?l.appendBuffer(O.data.bytes):l.append(O.data.bytes,O.data),w(x.bind(this))}}catch(G){p.fatal('SourceBuffer append failed "'+G+'"'),d.length>0?M():N=!1,delete O.data.bytes,O.promise.reject({chunk:O.data,error:new Hn.A(G.code,G.message)})}}}function J(){h.length>0&&!l.updating&&(h.shift()(),J())}function L(){l&&!l.updating&&J()}function H(O){const x=O.target||{};(function(G,W){let ie=W||{};r.trigger(G,ie,{streamId:_.streamInfo.id,mediaType:A})})(F.A.SOURCE_BUFFER_ERROR,{error:x,lastRequestAppended:q})}function w(O){try{h.push(O),l&&!l.updating&&J()}catch(x){p.error(x)}}return c={abort:function(){return new Promise(O=>{try{d=[],v.readyState==="open"?w(()=>{try{l&&l.abort(),O()}catch{O()}}):(l&&l.setTextTrack&&v.readyState==="ended"&&l.abort(),O())}catch{O()}})},abortBeforeAppend:function(){return new Promise(O=>{try{if(v.readyState!=="open")return void O();w(()=>{try{if(l&&v.readyState==="open"){const x=l.appendWindowStart,G=l.appendWindowEnd;l.abort(),l.appendWindowStart=x,l.appendWindowEnd=G}O()}catch{O()}})}catch{O()}})},append:function(O,x=null){return new Promise((G,W)=>{O?(d.push({data:O,promise:{resolve:G,reject:W},request:x}),w(M.bind(this))):W({chunk:O,error:new Hn.A(f.A.APPEND_ERROR_CODE,f.A.APPEND_ERROR_MESSAGE)})})},changeType:function(O){const x=k(O);return new Promise((G,W)=>{w(()=>{if(l&&l.changeType)try{p.debug(`Changing SourceBuffer codec to ${x}`),l.changeType(x),G()}catch(ie){(function(oe){typeof oe?.name=="string"&&oe.name==="NotSupportedError"?(p.warn(oe),t.update({streaming:{buffer:{useChangeType:!1,resetSourceBuffersForTrackSwitch:!0}}})):p.error(oe)})(ie),W()}else G()})})},getAllBufferRanges:function(){try{return l?.buffered}catch(O){return p.error("getAllBufferRanges exception: "+O.message),null}},getBuffer:function(){return l},getType:function(){return A},initializeForFirstUse:function(O,x){_=O;const G=O.streamInfo;A=_.type;const W=x?k(x):O.codec;try{if(W.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return D(G);l=v.addSourceBuffer(W),$();const ie=[];return ie.push(ee(_.streamInfo)),x&&x.mseTimeOffset!==void 0&&ie.push(te(x.mseTimeOffset)),Promise.all(ie)}catch(ie){return _.type===U.A.TEXT&&!_.isFragmented||W.indexOf('codecs="stpp')!==-1||W.indexOf('codecs="vtt')!==-1||W.indexOf("text/vtt")!==-1?D(G):Promise.reject(ie)}},initializeForStreamSwitch:function(O,x,G){_=O,A=_.type,(function(W){l=W.getBuffer()})(G),$()},remove:function(O){return new Promise((x,G)=>{const W=O.start,ie=O.end;W>=0&&ie>W?w(function(){try{l.remove(W,ie),w(function(){x({from:W,to:ie,unintended:!1}),O.resolve&&O.resolve()})}catch(oe){G({from:W,to:ie,unintended:!1,error:new Hn.A(f.A.REMOVE_ERROR_CODE,f.A.REMOVE_ERROR_MESSAGE)}),O.reject&&O.reject(oe)}}):x()})},removeEventListeners:B,reset:function(){if(l){try{h=[],B(),N=!1,d=[],l.getClassName&&l.getClassName()==="TextSourceBuffer"||(p.debug("Removing sourcebuffer from media source"),v.removeSourceBuffer(l))}catch{}l=null}q=null},updateAppendWindow:ee,updateTimestampOffset:te},p=(0,j.A)(e).getInstance().getLogger(c),c}Oo.__dashjs_factory_name="SourceBufferSink";var Lo=o.A.getClassFactory(Oo);function Fo(n){const e=this.context;let t,i,r,c=[],A=[],p=n;return t={getAllBufferRanges:function(){let l=[];for(let I=0;I<A.length;I++){let h=A[I];l.length===0||h.start>l[l.length-1].end?l.push({start:h.start,end:h.end}):l[l.length-1].end=h.end}const _={start:function(I){return l[I].start},end:function(I){return l[I].end}};return Object.defineProperty(_,"length",{get:function(){return l.length}}),_},append:function(l){return l.segmentType!=="InitializationSegment"?(A.push(l),A.sort(function(_,I){return _.start-I.start}),r=null):(c.includes(l)||c.push(l),r=l),i.debug("PreBufferSink appended chunk s: "+l.start+"; e: "+l.end),p&&p({chunk:l}),Promise.resolve()},remove:function(l,_){return A=A.filter(I=>!((isNaN(_)||I.start<_)&&(isNaN(l)||I.end>l))),Promise.resolve()},abort:function(){return Promise.resolve()},discharge:function(){const l=A;let _=null;for(let I=0;I<l.length;I++)_&&l[I].representation.id==_.representation.id||(_=c.find(h=>h.representation.id===l[I].representation.id),_&&(l.splice(I,0,_),I++));return r&&(l.push(r),r=null),A=[],c=[],l},reset:function(){A=[],c=[],r=null,p=null},updateTimestampOffset:function(){return Promise.resolve()},waitForUpdateEnd:function(l){l()},getBuffer:function(){return this}},i=(0,j.A)(e).getInstance().getLogger(t),t}Fo.__dashjs_factory_name="PreBufferSink";var $a=o.A.getClassFactory(Fo);function Uo(n,e){if(!n||n.length===0)return NaN;let t=e,i=0;for(;t===e&&i<n.length;){const r=n.start(i),c=n.end(i);t>=r&&t<=c&&(t=c),i+=1}return t===e?NaN:t}const xo="BufferController";function Bo(n){const e=(n=n||{}).capabilities,t=this.context,i=(0,m.A)(t).getInstance(),r=n.fragmentModel,c=n.playbackController,A=n.representationController,p=n.settings,l=n.streamInfo,_=n.textController,I=n.type;let h,d,N,v,q,k,D,$,B,ee,te,M,J,L,H,w,O,x,G,W,ie;function oe(xe,Qe=null){return new Promise((at,St)=>{k=xe,B&&Qe&&typeof B.discharge=="function"?(ee=B,Ae(Qe).then(()=>{at()}).catch(ut=>{St(ut)})):at()})}function Ae(xe,Qe=new Map,at){return new Promise((St,ut)=>{x&&xe?k?(te=!1,(function(xt,en,an){return new Promise(In=>{B=Lo(t).create({mediaSource:k,textController:_,eventBus:i}),(function(On,Gn,$n){const nr=A.getCurrentRepresentation();let Jn=null;return I!==U.A.VIDEO&&I!==U.A.AUDIO||(Jn=Gn.get(I)),Jn?(function(jn,or,hr,bt){B.initializeForStreamSwitch(jn,or,hr);const tn=[];return tn.push(B.abortBeforeAppend()),tn.push(Fn()),tn.push(le(or,bt)),or&&or.mseTimeOffset!==void 0&&tn.push(bn(or)),Promise.allSettled(tn)})(On,nr,Jn,$n):(function(jn,or){return B.initializeForFirstUse(jn,or)})(On,nr)})(xt,en,an).then(()=>bn(A.getCurrentRepresentation())).then(()=>{In(B)}).catch(On=>{d.warn("Caught error on create SourceBuffer: "+On),In(B)})})})(xe,Qe,at).then(xt=>{St(xt)}).catch(xt=>{ut(xt)})):(te=!0,(function(){return new Promise((xt,en)=>{B=$a(t).create(Oe.bind(this)),bn(A.getCurrentRepresentation()).then(()=>{xt(B)}).catch(()=>{en()})})})().then(xt=>{St(xt)}).catch(xt=>{ut(xt)})):St(null)})}function ke(xe){p.get().streaming.cacheInitSegments&&(d.info("Init fragment finished loading saving to",I+"'s init cache"),x.save(xe.chunk)),d.debug(`Appending init fragment for type ${I}, representationId ${xe.chunk.representation.id} and bandwidth ${xe.chunk.representation.bandwidth}`),be(xe.chunk)}function Ie(xe){be(xe.chunk,xe.request)}function be(xe,Qe=null){B&&(B.append(xe,Qe).then(at=>{Oe(at)}).catch(at=>{Oe(at)}),xe.representation.mediaInfo.type===U.A.VIDEO&&Rn(F.A.VIDEO_CHUNK_RECEIVED,{chunk:xe}))}function me(xe){if(xe&&xe.length>0)for(let Qe=0,at=xe.length;Qe<at;Qe++)d.debug("Buffered range: "+xe.start(Qe)+" - "+xe.end(Qe)+", currentTime = ",c.getTime())}function Oe(xe){if(xe.error)return void(function(St){St.error.code===22&&(function(){if(O=!0,q=.8*Ht(),d.warn("Quota exceeded, Critical Buffer: "+q),q>0){const ut=Math.max(.2*q,1),xt=q-ut,en=Math.min(p.get().streaming.buffer.bufferTimeAtTopQuality,.9*xt),an=Math.min(p.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*xt),In={streaming:{buffer:{bufferToKeep:parseFloat(ut.toFixed(5)),bufferTimeAtTopQuality:parseFloat(en.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(an.toFixed(5))}}};p.update(In)}})(),St.error.code!==22&&rn()||(d.warn("Clearing playback buffer to overcome quota exceed situation"),Rn(F.A.QUOTA_EXCEEDED,{criticalBufferLevel:q,quotaExceededTime:St.chunk.start}),Qt(Wt()))})(xe);if(!B||(We(),O=!1,L=xe.chunk,!L||!L.endFragment))return;L&&!isNaN(L.index)&&(D=Math.max(L.index,D),rt());const Qe=B.getAllBufferRanges();L.segmentType===Ee.G.MEDIA_SEGMENT_TYPE&&(me(Qe),ze(),(function(){if(isNaN(ie)||te)return;if(I!==U.A.AUDIO&&I!==U.A.VIDEO)return void(ie=NaN);const St=c.getTime(),ut=Se(St,0),xt=Se(ie,0);if(ut&&xt&&ut.start===xt.start)return void(ie=NaN);const en=A.getCurrentRepresentation().segmentDuration,an=Se(ie,en);an&&(p.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(St-ie)>en?ie<=an.end&&c.seek(Math.max(ie,an.start),!1,!0):St<an.start&&c.seek(an.start,!1,!0))})());let at=!1;M&&(M.indexOf(L)>0&&(at=!0),M=null),L&&!at&&Rn(F.A.BYTES_APPENDED_END_FRAGMENT,{startTime:L.start,index:L.index,bufferedRanges:Qe,segmentType:L.segmentType,mediaType:I,representationId:L.representation.id})}function Ke(xe,Qe){const at=[];return at.push(bn(xe)),at.push(B?B.abort():Promise.resolve()),at.push(le(xe,Qe)),Promise.allSettled(at)}function le(xe,Qe){if(!xe||!Qe)return d.warn("BufferController._changeCodec() is missing the information about the Representations. Doing nothing"),Promise.resolve();if(xe&&Qe&&xe.mimeType===Qe.mimeType&&xe.codecFamily===Qe.codecFamily)return d.debug(`Switching to new codec ${xe.codecs} without changeType as previous codec ${Qe.codecs} is compatible.`),Promise.resolve();if(!p.get().streaming.buffer.useChangeType||!e.supportsChangeType())return d.debug("changeType() not available"),Promise.resolve();d.debug(`Using changeType() to switch from codec ${Qe.codecs} to ${xe.codecs}`);const at=xe.dependentRepresentation?xe.dependentRepresentation:xe;return B.changeType(at)}function fe(){return new Promise((xe,Qe)=>{let at=pe();if(!at||at.length===0)return ze(),void xe();Qt(at).then(()=>{xe()}).catch(St=>{Qe(St)})})}function pe(xe){if(!B)return[];const Qe=B.getAllBufferRanges();if(!Qe||Qe.length===0)return[];const at=p.get().streaming.buffer,St=l.manifestInfo.duration>=at.longFormContentDurationThreshold,ut=r.getRequests({state:Gt.FRAGMENT_MODEL_EXECUTED,time:xe,threshold:.01})[0];return(function(xt,en,an){const In=[];if(!xt||xt.length===0)return In;if(!(On=en)&&On!==0||isNaN(On))return In.push({start:xt.start(0),end:xt.end(xt.length-1)+.5}),In;var On;const Gn=an||{},$n=(function(Jn,jn,or,hr){const bt=Number(or);if(isNaN(bt))return null;const tn=Jn.start(0);if(jn-tn>bt){let _n=Math.max(0,jn-bt);if(hr&&(_n=Math.min(hr.startTime,_n)),_n>0)return{start:tn,end:_n}}return null})(xt,en,Gn.bufferToKeepBehind,Gn.currentTimeRequest),nr=(function(Jn,jn,or){const hr=Jn.end(Jn.length-1),bt=hr+.5,{bufferToKeepAhead:tn,currentTimeRequest:_n,avoidCurrentTimeRangePruning:vn,logger:wn}=or,Nn=Uo(Jn,jn);let xn;if(isNaN(Nn))xn=jn;else{const Vn=Number(tn);if(isNaN(Vn))return null;xn=Math.min(Nn,jn+Vn)}if(xn>=hr)return null;if(_n&&(xn=Math.max(_n.startTime+_n.duration,xn)),vn){for(let Vn=0;Vn<Jn.length;Vn++)if(Jn.start(Vn)<=jn&&jn<=Jn.end(Vn)&&Jn.start(Vn)<=xn&&xn<=Jn.end(Vn)){const rr=xn;xn=Vn+1<Jn.length?Jn.start(Vn+1):Jn.end(Vn)+1,wn&&wn.debug("Buffered range ["+Jn.start(Vn)+", "+Jn.end(Vn)+"] overlaps with targetTime "+jn+" and range to be pruned ["+rr+", "+bt+"], using ["+xn+", "+bt+"] instead"+(xn<bt?"":" (no actual pruning)"));break}}return xn<hr?{start:xn,end:bt}:null})(xt,en,Gn);return $n&&In.push($n),nr&&In.push(nr),In})(Qe,xe,{bufferToKeepBehind:at.bufferToKeep,bufferToKeepAhead:St?at.bufferTimeAtTopQualityLongForm:at.bufferTimeAtTopQuality,currentTimeRequest:ut,avoidCurrentTimeRangePruning:at.avoidCurrentTimeRangePruning,logger:d})}function ze(){W||I===U.A.TEXT&&!_.isTextEnabled()||We()}function $e(){gt()}function ot(){gt(),ie=NaN}function Se(xe,Qe){return B?(function(at,St,ut){let xt=null,en=null;const an=isNaN(ut)?.15:ut;if(at!=null)for(let In=0;In<at.length;In++){const On=at.start(In),Gn=at.end(In);if(xt===null){const $n=Math.abs(On-St);(St>=On&&St<Gn||$n<=an)&&(xt=On,en=Gn)}else{if(!(On-en<=an))break;en=Gn}}return xt===null?null:{start:xt,end:en}})(B.getAllBufferRanges(),xe,Qe):null}function We(){if(c){let xe=c.getTime()||0;te&&(xe=isNaN(ie)?0:ie);const Qe=p.get().streaming.gaps.jumpGaps&&!isNaN(p.get().streaming.gaps.smallGapLimit)?p.get().streaming.gaps.smallGapLimit:NaN;v=Math.max((function(at,St){p.get().streaming.gaps.jumpGaps&&(St=p.get().streaming.gaps.smallGapLimit);const ut=Se(at,St);return ut?ut.end-at:0})(xe,Qe),0),Rn(F.A.BUFFER_LEVEL_UPDATED,{mediaType:I,bufferLevel:v}),gt()}}function rt(){const xe=D>=$-1,Qe=c.getTimeToStreamEnd(l)-v<1e-5;!xe&&!Qe||N||(Rt(!0),d.debug(`checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ${l.id} and type ${I}`))}function gt(){if(I!==U.A.AUDIO&&I!==U.A.VIDEO)return;const xe=c.getLowLatencyModeEnabled()?p.get().streaming.buffer.lowLatencyStallThreshold:p.get().streaming.buffer.stallThreshold;v<=xe&&!N?Ot(mt.BUFFER_EMPTY):(N||v>xe)&&Ot(mt.BUFFER_LOADED)}function Ot(xe){J===xe||xe===mt.BUFFER_EMPTY&&c.getTime()===0||I===U.A.TEXT&&!_.isTextEnabled()||(J=xe,Rn(F.A.BUFFER_LEVEL_STATE_CHANGED,{state:xe}),Rn(xe===mt.BUFFER_LOADED?F.A.BUFFER_LOADED:F.A.BUFFER_EMPTY),d.debug(xe===mt.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function zt(){B&&I!==U.A.TEXT&&(N||Qt(Wt()))}function Wt(){const xe=[],Qe=B.getAllBufferRanges();if(!Qe||Qe.length===0)return xe;const at=c.getTime();let St=Math.max(0,at-p.get().streaming.buffer.bufferToKeep);const ut=r.getRequests({state:Gt.FRAGMENT_MODEL_EXECUTED,time:at,threshold:.01})[0];if(ut)St=Math.min(ut.startTime,St);else if(at===0&&c.getIsDynamic())return[];if(Qe.start(0)<=St){const xt={start:0,end:St};for(let en=0;en<Qe.length&&Qe.end(en)<=St;en++)xt.end=Qe.end(en);xt.start<xt.end&&xe.push(xt)}return xe}function Qt(xe){return new Promise((Qe,at)=>{if(!xe||!B||xe.length===0)return We(),void Qe();const St=[];xe.forEach(ut=>{St.push((function(xt){return new Promise((en,an)=>{xt.resolve=en,xt.reject=an,G.push(xt)})})(ut))}),w||fn(),Promise.all(St).then(()=>{Qe()}).catch(ut=>{at(ut)})})}function fn(){try{if(G.length===0||!B)return d.debug("Nothing to prune, halt pruning"),G=[],void(w=!1);const xe=B.getBuffer();if(!xe||!xe.buffered||xe.buffered.length===0)return d.debug("SourceBuffer is empty (or does not exist), halt pruning"),G=[],void(w=!1);const Qe=G.shift();d.debug(`${I}: Removing buffer from: ${Qe.start} to ${Qe.end}`),w=!0,c.getTime()<Qe.end&&Rt(!1),B.remove(Qe).then(at=>{En(at)}).catch(at=>{En(at)})}catch{w=!1}}function En(xe){d.debug("onRemoved buffer from:",xe.from,"to",xe.to),B&&(me(B.getAllBufferRanges()),G.length===0&&(w=!1,We()),xe.unintended&&(d.warn("Detected unintended removal from:",xe.from,"to",xe.to,"setting streamprocessor time to",xe.from),Rn(F.A.SEEK_TARGET,{time:xe.from})),w?fn():(W?W=!1:We(),Rn(F.A.BUFFER_CLEARED,{from:xe.from,to:xe.to,unintended:xe.unintended,hasEnoughSpaceToAppend:rn(),quotaExceeded:O})))}function bn(xe){return new Promise(Qe=>{xe&&xe.mseTimeOffset!==void 0&&B&&B.updateTimestampOffset?B.updateTimestampOffset(xe.mseTimeOffset).then(()=>{Qe()}).catch(()=>{Qe()}):Qe()})}function Fn(){return B&&!N?B.updateAppendWindow(l):Promise.resolve()}function et(){H++,H*(p.get().streaming.wallclockTimeUpdateInterval/1e3)>=p.get().streaming.buffer.bufferPruningInterval&&(H=0,zt())}function wt(){gt()}function Rt(xe){N=xe,N?Rn(F.A.BUFFERING_COMPLETED):$=Number.POSITIVE_INFINITY}function Ht(){try{const xe=B.getAllBufferRanges();let Qe,at,St=0;if(!xe)return St;for(at=0,Qe=xe.length;at<Qe;at++)St+=xe.end(at)-xe.start(at);return St}catch{return 0}}function rn(){const xe=Ht();return isNaN(xe)||xe<q}function Rn(xe,Qe){let at=Qe||{};i.trigger(xe,at,{streamId:l.id,mediaType:I})}function ht(xe,Qe){if(q=Number.POSITIVE_INFINITY,J=void 0,$=Number.POSITIVE_INFINITY,D=0,L=null,N=!1,w=!1,O=!1,v=0,H=0,G=[],ie=NaN,te=!1,B){let at=B;B=null,xe||(Qe?at.removeEventListeners():at.abort().then(()=>{at.reset(Qe),at=null}))}W=!1}return h={appendInitSegmentFromCache:function(xe){const Qe=x.extract(l.id,xe);return!!Qe&&(d.debug(`Appending init fragment for type ${I}, representationId ${Qe.representation.id} and bandwidth ${Qe.representation.bandwidth}`),be(Qe),!0)},clearBuffers:Qt,createBufferSink:Ae,dischargePreBuffer:function(){if(B&&ee&&typeof ee.discharge=="function"){const xe=ee.getAllBufferRanges();if(xe.length>0){let at="Beginning "+I+"PreBuffer discharge, adding buffer for:";for(let St=0;St<xe.length;St++)at+=" start: "+xe.start(St)+", end: "+xe.end(St)+";";d.debug(at)}else d.debug("PreBuffer discharge requested, but there were no media segments in the PreBuffer.");M=[];let Qe=ee.discharge();for(let at=0;at<Qe.length;at++){const St=Qe[at];M.push(St),B.append(St)}ee.reset(),ee=null}},getAllRangesWithSafetyFactor:pe,getBuffer:function(){return B},getBufferControllerType:function(){return xo},getBufferLevel:function(){return v},getContinuousBufferTimeForTargetTime:function(xe){try{return Uo(B.getAllBufferRanges(),xe)}catch{return NaN}},getIsBufferingCompleted:function(){return N},getIsPruningInProgress:function(){return w},getMediaSource:function(){return k},getRangeAt:Se,getStreamId:function(){return l.id},getType:function(){return I},hasBufferAtTime:function(xe){try{return(function(Qe,at){if(!Qe||Qe.length===0)return!1;for(let St=0;St<Qe.length;St++)if(at>=Qe.start(St)&&at<=Qe.end(St))return!0;return!1})(B.getAllBufferRanges(),xe)}catch(Qe){return d.error(Qe),!1}},initialize:function(xe){oe(xe),i.on(F.A.INIT_FRAGMENT_LOADED,ke,h),i.on(F.A.MEDIA_FRAGMENT_LOADED,Ie,h),i.on(F.A.WALLCLOCK_TIME_UPDATED,et,h),i.on(u.A.PLAYBACK_PLAYING,ot,h),i.on(u.A.PLAYBACK_PROGRESS,ze,h),i.on(u.A.PLAYBACK_TIME_UPDATED,ze,h),i.on(u.A.PLAYBACK_RATE_CHANGED,wt,h),i.on(u.A.PLAYBACK_STALLED,$e,h)},prepareForAbandonQualitySwitch:function(xe,Qe){return Ke(xe,Qe)},prepareForDefaultQualitySwitch:function(xe,Qe){return Ke(xe,Qe)},prepareForFastQualitySwitch:function(xe,Qe){return Ke(xe,Qe)},prepareForForceReplacementQualitySwitch:function(xe,Qe){return new Promise(at=>{const St=[];St.push(B.abort()),St.push(Fn()),St.push(fe()),St.push(bn(xe)),St.push(le(xe,Qe)),Promise.allSettled(St).then(()=>{Rt(!1),at()})})},prepareForNonReplacementTrackSwitch:function(xe,Qe){return new Promise(at=>{const St=[];St.push(Fn()),St.push(le(xe,Qe)),Promise.allSettled(St).then(()=>{at()})})},prepareForPlaybackSeek:function(){return N&&Rt(!1),B.abort()},prepareForReplacementTrackSwitch:function(xe,Qe){return new Promise(at=>{const St=[];St.push(B.abort()),St.push(Fn()),St.push(le(xe,Qe)),St.push(fe()),St.push(bn(xe)),Promise.allSettled(St).then(()=>{Rt(!1),at()})})},pruneAllSafely:fe,pruneBuffer:zt,reset:function(xe,Qe){i.off(F.A.INIT_FRAGMENT_LOADED,ke,this),i.off(F.A.MEDIA_FRAGMENT_LOADED,Ie,this),i.off(F.A.WALLCLOCK_TIME_UPDATED,et,this),i.off(u.A.PLAYBACK_PLAYING,ot,this),i.off(u.A.PLAYBACK_PROGRESS,ze,this),i.off(u.A.PLAYBACK_TIME_UPDATED,ze,this),i.off(u.A.PLAYBACK_RATE_CHANGED,wt,this),i.off(u.A.PLAYBACK_STALLED,$e,this),ht(xe,Qe)},segmentRequestingCompleted:function(xe){isNaN(xe)||($=xe,rt())},setIsBufferingCompleted:Rt,setMediaSource:oe,setSeekTarget:function(xe){ie=xe},updateAppendWindow:Fn,updateBufferTimestampOffset:bn},d=(0,j.A)(t).getInstance().getLogger(h),x=T(t).getInstance(),ht(),h}Bo.__dashjs_factory_name=xo;var Xa=o.A.getClassFactory(Bo);const ko="NotFragmentedTextBufferController";function Go(n){n=n||{};const e=this.context,t=(0,m.A)(e).getInstance(),i=n.textController,r=n.errHandler,c=n.streamInfo,A=n.type;let p,l,_,I,h,d;function N(k){I=k}function v(k){l!==k&&(l=k,l&&(function(D){let $={};t.trigger(D,$,{streamId:c.id,mediaType:A})})(F.A.BUFFERING_COMPLETED))}function q(k){k.chunk.bytes&&!l&&(d.save(k.chunk),h.append(k.chunk),v(!0))}return p={appendInitSegmentFromCache:function(k){return d.extract(c.id,k)!==null},clearBuffers:function(){return Promise.resolve()},createBufferSink:function(k){return new Promise((D,$)=>{try{h=Lo(e).create({mediaSource:I,textController:i,eventBus:t}),h.initializeForFirstUse(k),_||(h.getBuffer()&&typeof h.getBuffer().initialize=="function"&&h.getBuffer().initialize(),_=!0),D(h)}catch(B){r.error(new Hn.A(f.A.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,f.A.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+A)),$(B)}})},dischargePreBuffer:function(){},getAllRangesWithSafetyFactor:function(){return[]},getBuffer:function(){return h},getBufferControllerType:function(){return ko},getBufferLevel:function(){return 0},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},getIsBufferingCompleted:function(){return l},getIsPruningInProgress:function(){return!1},getMediaSource:function(){return I},getRangeAt:function(){return null},getStreamId:function(){return c.id},getType:function(){return A},hasBufferAtTime:function(){return!0},initialize:function(k){N(k)},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return l=!1,Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},pruneBuffer:function(){},reset:function(k){t.off(F.A.INIT_FRAGMENT_LOADED,q,p),!k&&h&&(h.abort(),h.reset(),h=null)},segmentRequestingCompleted:function(){},setIsBufferingCompleted:v,setMediaSource:N,setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()}},_=!1,I=null,l=!1,d=T(e).getInstance(),t.on(F.A.INIT_FRAGMENT_LOADED,q,p),p}Go.__dashjs_factory_name=ko;var Ja=o.A.getClassFactory(Go);function Yo(n){const e=(n=n||{}).abrController,t=n.bufferController,i=this.context,r=n.dashMetrics,c=(0,m.A)(i).getInstance(),A=n.fragmentModel,p=n.getBufferingTime||(()=>NaN),l=n.getBufferedEndForType||(()=>NaN),_=n.mediaPlayerModel,I=n.playbackController,h=n.representationController,d=n.settings,N=n.textController,v=n.type;let q,k,D,$,B,ee,te,M,J,L,H,w;function O(){ee=(0,j.A)(i).getInstance().getLogger(D),le(),J=n.streamInfo}function x(){te=!0}function G(){te=!1}function W(fe){if(t.getIsBufferingCompleted())return;ie();const pe=isNaN(fe)?0:fe;M=setTimeout(oe,pe)}function ie(){M&&(clearTimeout(M),M=null)}function oe(){const fe=_.getScheduleTimeout();try{if((function(){try{return v===U.A.TEXT&&!N.isTextEnabled()||I.isPaused()&&(!I.getStreamController().getInitialPlayback()||!I.getStreamController().getAutoPlay())&&!d.get().streaming.scheduling.scheduleWhilePaused}catch{return!1}})())return void ie();(function(){try{return!!te&&h.getCurrentRepresentation()&&(B==null||L||(function(){const pe=h.getCurrentRepresentation();if(!v||!pe)return!0;let ze=pe&&pe.segmentDuration&&!isNaN(pe.segmentDuration)?pe.segmentDuration:0;const $e=Math.max(r.getCurrentBufferLevel(v),(function(){if(v!==U.A.AUDIO&&v!==U.A.VIDEO)return 0;try{const Se=t.getBuffer(),We=Se?Se.getAllBufferRanges():null,rt=p();if(isNaN(rt))return 0;const gt=I.getTime();return gt===null||isNaN(gt)||!(function(Ot,zt){const Wt=I.getBufferedRanges();if(!Wt)return!1;for(let Qt=0;Qt<Wt.length;Qt++)if(Wt.start(Qt)>Ot&&Wt.start(Qt)<zt)return!0;return!1})(gt,rt)&&(function(Ot){const zt=v===U.A.VIDEO?U.A.AUDIO:v===U.A.AUDIO?U.A.VIDEO:null;if(!zt)return!1;const Wt=l(zt);return!isNaN(Wt)&&Wt>Ot})(rt)?0:(function(Ot,zt,Wt){let Qt=0;if(!Ot)return Qt;for(let fn=0;fn<Ot.length;fn++)Qt+=Math.max(0,Math.min(Ot.end(fn),Wt)-Math.max(Ot.start(fn),zt));return Qt})(We,gt,rt)}catch{return 0}})()),ot=Ae();return(ot<=ze||I.getLowLatencyModeEnabled()||v===U.A.AUDIO&&q)&&(ze=0),$e+ze<ot})())}catch{return!1}})()?(function(){if(e.handlePendingManualQualitySwitch(J.id,v))return;let pe=!1;w&&(pe=e.checkPlaybackQuality(v,J.id)),pe||(function(){const ze=h.getCurrentRepresentation();k||ze.id!==B||L?(function($e){L?(ee.debug("Switch track for "+v+", representation id = "+$e.id),L=!1):ee.debug("Quality has changed, get init request for representationid = "+$e.id),c.trigger(F.A.INIT_FRAGMENT_NEEDED,{representationId:$e.id,sender:D},{streamId:J.id,mediaType:v}),w=!1,k=!1})(ze):(ee.debug(`Media segment needed for ${v} and stream id ${J.id}`),c.trigger(F.A.MEDIA_FRAGMENT_NEEDED,{},{streamId:J.id,mediaType:v}),w=!0)})()})():W(fe)}catch{W(fe)}}function Ae(){let fe=NaN;const pe=h.getCurrentRepresentation();return v&&pe&&(fe=v===U.A.TEXT?(function(){try{if(N.isTextEnabled()){const ze=h.getCurrentRepresentation();if(isNaN(ze.fragmentDuration)){const $e=r.getCurrentSchedulingInfo(mt.SCHEDULING_INFO);return $e?$e.duration:0}return ze.fragmentDuration}return 0}catch{return 0}})():v===U.A.AUDIO&&q?(function(){try{const ze=Math.max(r.getCurrentBufferLevel(U.A.VIDEO),(function(){const ot=l(U.A.VIDEO);if(isNaN(ot))return 0;const Se=I.getTime();return Se===null||isNaN(Se)?0:Math.min(Math.max(ot-Se,0),ke())})()),$e=h.getCurrentRepresentation();return isNaN($e.fragmentDuration)?ze+1:Math.max(ze+1,$e.fragmentDuration)}catch{return 0}})():ke()),fe}function ke(){try{const fe=d.get().streaming.enhancement.enabled?h.getCurrentCompositeRepresentation():h.getCurrentRepresentation(),pe=fe.mediaInfo.streamInfo;return e.isPlayingAtTopQuality(fe)?pe.manifestInfo.duration>=d.get().streaming.buffer.longFormContentDurationThreshold?d.get().streaming.buffer.bufferTimeAtTopQualityLongForm:d.get().streaming.buffer.bufferTimeAtTopQuality:_.getBufferTimeDefaultUnadjusted()}catch{return _.getBufferTimeDefaultUnadjusted()}}function Ie(){be(!0)}function be(fe){if(I&&A){const pe=A.getRequests({state:Gt.FRAGMENT_MODEL_EXECUTED,time:I.getTime(),threshold:0})[0];pe&&I.getTime()>=pe.startTime&&((!$.representation||pe.representation.mediaInfo.type===$.representation.mediaInfo.type&&pe.representation.mediaInfo.index!==$.representation.mediaInfo.index)&&fe&&(function(ze){ee.debug(`Track change rendered for streamId ${J.id} and type ${v}`),c.trigger(F.A.TRACK_CHANGE_RENDERED,{mediaType:v,oldMediaInfo:$&&$.representation&&$.representation.mediaInfo?$.representation.mediaInfo:null,newMediaInfo:ze.representation.mediaInfo,streamId:J.id})})(pe),$.representation&&pe.representation.id===$.representation.id||!fe||(function(ze){ee.debug(`Quality change rendered for streamId ${J.id} and type ${v}`),c.trigger(F.A.QUALITY_CHANGE_RENDERED,{mediaType:v,oldRepresentation:$.representation?$.representation:null,newRepresentation:ze.representation,streamId:J.id})})(pe),$.representation=pe.representation)}}function me(){A.abortRequests(),ie()}function Oe(){d.get().streaming.scheduling.scheduleWhilePaused||W()}function Ke(fe){r.updatePlayListTraceMetrics({playbackspeed:fe.playbackRate.toString()})}function le(){w=!0,H=0,B=null,$={representation:null},L=!1,k=!1,te=!0}return D={clearScheduleTimer:ie,getBufferTarget:Ae,getPlaybackController:function(){return I},getStreamId:function(){return J.id},getSwitchTrack:function(){return L},getTimeToLoadDelay:function(){return H},getType:function(){return v},initialize:function(fe){q=fe,c.on(F.A.URL_RESOLUTION_FAILED,me,D),c.on(u.A.PLAYBACK_STARTED,Oe,D),c.on(u.A.PLAYBACK_RATE_CHANGED,Ke,D),c.on(u.A.PLAYBACK_TIME_UPDATED,Ie,D),c.on(u.A.MANAGED_MEDIA_SOURCE_START_STREAMING,x,D),c.on(u.A.MANAGED_MEDIA_SOURCE_END_STREAMING,G,D)},reset:function(){c.off(F.A.URL_RESOLUTION_FAILED,me,D),c.off(u.A.PLAYBACK_STARTED,Oe,D),c.off(u.A.PLAYBACK_RATE_CHANGED,Ke,D),c.off(u.A.PLAYBACK_TIME_UPDATED,Ie,D),c.off(u.A.MANAGED_MEDIA_SOURCE_START_STREAMING,x,D),c.off(u.A.MANAGED_MEDIA_SOURCE_END_STREAMING,G,D),ie(),be(!1),le(),J=null},setShouldCheckPlaybackQuality:function(fe){w=fe},setInitSegmentRequired:function(fe){k=fe},setLastInitializedRepresentationId:function(fe){B=fe},setup:O,setSwitchTrack:function(fe){L=fe},setTimeToLoadDelay:function(fe){H=fe},startScheduleTimer:W},O(),D}Yo.__dashjs_factory_name="ScheduleController";var Za=o.A.getClassFactory(Yo);const Qa=/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g;var el=class extends _o{constructor(){super(),this.isPartialSegment=!0,this.replacementSubNumber=NaN,this.totalNumberOfPartialSegments=NaN}};function qo(n){return n?n.totalNumberOfPartialSegments&&!isNaN(n.totalNumberOfPartialSegments)&&n.totalNumberOfPartialSegments>0&&!isNaN(n.subNumberOfPartialSegmentToRequest)?(function(e){const t=(function(i,r){const c=new el,A=i.segmentDurationInSeconds/i.totalNumberOfPartialSegments,{representation:p,timelineConverter:l,isDynamic:_,index:I,totalNumberOfPartialSegments:h}=i,d=Vo({representation:p,segmentDurationInSeconds:A,presentationStartTime:i.presentationStartTime+r*A,presentationEndTime:i.presentationStartTime+(r+1)*A,timelineConverter:l,isDynamic:_,mediaTimeInSeconds:i.mediaTimeInSeconds+r*A,index:I});return c.assignAttributes(d),c.replacementSubNumber=r,c.totalNumberOfPartialSegments=h,c})(e,e.subNumberOfPartialSegmentToRequest);return Ko(t,e),t})(n):(function(e){const t=new Gi,i=Vo(e);return t.assignAttributes(i),Ko(t,e),t})(n):null}function Vo(n){const{representation:e,segmentDurationInSeconds:t,presentationStartTime:i,presentationEndTime:r,mediaTimeInSeconds:c,timelineConverter:A,isDynamic:p,index:l}=n,_={availabilityEndTime:A.calcAvailabilityEndTimeFromPresentationTime(r+t,e,p),availabilityStartTime:A.calcAvailabilityStartTimeFromPresentationTime(r,e,p),duration:t,index:l,mediaStartTime:c,presentationStartTime:i,replacementNumber:e.startNumber+l,representation:e};return _.wallStartTime=A.calcWallTimeForSegment(_,p),_}function Ko(n,e){const{tManifest:t,mediaTime:i,mediaUrl:r,mediaRange:c}=e;n.replacementTime=t||i,n.media=gi(r,n.representation.id,n.replacementNumber,n.replacementSubNumber,n.representation.bandwidth,n.replacementTime),n.mediaRange=c,n.mediaUrl=r}function Ho(n,e,t,i){const r=e.adaptation.period;if(isFinite(r.duration)&&r.start+r.duration<=t.presentationStartTime)return!1;if(i){if(e.availabilityTimeOffset==="INF")return!0;const c=n.getClientReferenceTime();return t.availabilityStartTime.getTime()<=c&&(!isFinite(t.availabilityEndTime)||t.availabilityEndTime.getTime()>=c)}return!0}function gi(n,e,t,i,r,c){return n&&(function(A,p,l,_,I,h){return A.replace(Qa,(d,N,v,q)=>{let k,D;switch(N){case void 0:return"$";case"RepresentationID":k=p;break;case"Number":k=l;break;case"SubNumber":k=_;break;case"Bandwidth":k=I;break;case"Time":if(typeof h=="string")return h;k=h&&Math.round(h);break;default:k=null}if(k==null)return d;switch(q){case void 0:case"d":case"i":case"u":D=k.toString();break;case"o":D=k.toString(8);break;case"x":D=k.toString(16);break;case"X":D=k.toString(16).toUpperCase();break;default:D=k.toString()}const $=parseInt(v,10)||1;return D.padStart($,"0")})})(n,e,t,i,r,c)}function jo(n){const{index:e,isDynamic:t,mediaRange:i,mediaTime:r,mediaUrl:c,representation:A,subNumberOfPartialSegmentToRequest:p,timelineConverter:l,totalNumberOfPartialSegments:_}=n;let I,h,d;I=A.segmentDuration,isNaN(I)&&(I=A.adaptation.period.duration),h=parseFloat((A.adaptation.period.start+e*I).toFixed(5)),d=parseFloat((h+I).toFixed(5));const N=qo({index:e,isDynamic:t,mediaRange:i,mediaTime:r,mediaTimeInSeconds:l.calcMediaTimeFromPresentationTime(h,A),mediaUrl:c,presentationEndTime:d,presentationStartTime:h,representation:A,segmentDurationInSeconds:I,subNumberOfPartialSegmentToRequest:p,timelineConverter:l,totalNumberOfPartialSegments:_});return Ho(l,A,N,t)?N:null}function Yi(n){const{durationInTimescale:e,fTimescale:t,index:i,subNumberOfPartialSegmentToRequest:r,isDynamic:c,mediaRange:A,mediaTime:p,mediaUrl:l,totalNumberOfPartialSegments:_,representation:I,tManifest:h,timelineConverter:d}=n,N=p/t,v=e/t;let q=d.calcPresentationTimeFromMediaTime(N,I),k=qo({representation:I,segmentDurationInSeconds:v,presentationStartTime:q,presentationEndTime:q+v,mediaTimeInSeconds:N,timelineConverter:d,isDynamic:c,index:i,totalNumberOfPartialSegments:_,subNumberOfPartialSegmentToRequest:r,mediaUrl:l,mediaRange:A,tManifest:h,mediaTime:p});return Ho(d,I,k,c)?k:null}function qi(n){return n.k}function zo(n){n=n||{};const e=this.context,t=n.eventBus,i=n.events,r=n.abrController,c=n.dashMetrics,A=n.playbackController,p=n.timelineConverter,l=n.type,_=n.streamInfo,I=n.segmentsController,h=(0,E.A)(e).getInstance();let d,N,v,q,k,D,$,B=n.isDynamic;function ee(){return l}function te(){return v?.mediaInfo.type===l?v:(function(){let ie=v?.dependentRepresentation;if(ie){if(!ie.mediaInfo)throw new Error("dependentRepresentation has no mediaInfo!");if(ie.mediaInfo.type===l)return ie}return null})()}function M(){v=null,N=[],q=!1,D=new WeakMap,$=new WeakMap}function J(ie,oe){return new Promise((Ae,ke)=>{const Ie=ie.hasInitialization(),be=ie.hasSegments(),me=[];me.push(I.updateInitData(ie,Ie)),me.push(oe?I.updateSegmentData(ie,be):Promise.resolve()),Promise.all(me).then(Oe=>{var Ke;Oe[0]&&!Oe[0].error&&(ie=(function(le,fe){return fe&&!fe.error&&fe.representation?fe.representation:le})(ie,Oe[0])),Oe[1]&&!Oe[1].error&&(ie=(function(le,fe){if(!fe||fe.error)return;const pe=fe.segments,ze=[];let $e,ot,Se,We,rt=0;for($e=0,ot=pe?pe.length:0;$e<ot;$e++)Se=pe[$e],We=Yi({durationInTimescale:Se.duration,fTimescale:Se.timescale,index:rt,isDynamic:B,mediaRange:Se.mediaRange,mediaTime:Se.startTime,mediaUrl:Se.media,representation:le,timelineConverter:p}),We&&(ze.push(We),We=null,rt++);return ze.length>0&&(le.segments=ze),le})(ie,Oe[1])),ie.fragmentDuration=ie.segmentDuration?ie.segmentDuration:ie.segments&&ie.segments.length>0?ie.segments[0].duration:NaN,(Ke=ie).mediaFinishedInformation=I.getMediaFinishedInformation(Ke),(function(le){let fe,pe=c.getCurrentManifestUpdate(),ze=!1;if(pe){for(let $e=0;$e<pe.representationInfo.length;$e++)if(fe=pe.representationInfo[$e],fe.index===le.index&&fe.mediaType===ee()){ze=!0;break}ze||c.addManifestUpdateRepresentationInfo(le,ee())}})(ie),Ae()}).catch(Oe=>{ke(Oe)})})}function L(ie){if(!N||N.length===0)return null;const oe=N.filter(Ae=>Ae.id===ie);return oe.length>0?oe[0]:null}function H(ie){t.trigger(i.DATA_UPDATE_COMPLETED,{currentRepresentation:v,error:ie},{streamId:_.id,mediaType:l})}function w(ie){if(!x(ie))return null;const oe=L(ie.id),Ae=D.get(oe);return Ae&&Date.now()-Ae.failedAt<Ae.retryDelay?null:($.has(oe)||O(oe,J(oe,!0)),$.get(oe))}function O(ie,oe){const Ae=oe.catch(ke=>{k.warn(`Updating representation ${ie.id} for ${l} failed`,ke)}).then(()=>{var ke;if(!ie.segments&&N.includes(ie)){const Ie=(((ke=D.get(ie))==null?void 0:ke.failureCount)||0)+1,be=h.get().streaming.scheduling.segmentListRetryDelay*Math.min(2**(Ie-1),8);D.set(ie,{failureCount:Ie,failedAt:Date.now(),retryDelay:be}),$.delete(ie),r.excludeRepresentation(ie,be)}return ie});$.set(ie,Ae)}function x(ie){const oe=ie?L(ie.id):null;return q&&!!oe&&!oe.hasSegments()&&!oe.segments}function G(ie){v&&v.id===ie.id||(function(oe){(function(){if(!(r&&c&&A&&p))throw new Error(U.A.MISSING_CONFIG_ERROR)})();const Ae=new Date,ke=1e3*A.getTime();oe&&c.addRepresentationSwitch(oe.adaptation.type,Ae,ke,oe.id),t.trigger(u.A.REPRESENTATION_SWITCH,{mediaType:l,streamId:_.id,currentRepresentation:oe},{streamId:_.id,mediaType:l})})(ie),v=ie}function W(ie){if(ie.newDuration){const oe=te();oe&&oe.adaptation.period&&(oe.adaptation.period.duration=ie.newDuration)}}return d={getCurrentCompositeRepresentation:function(){return v},getCurrentRepresentation:te,getRepresentationById:L,getStreamId:function(){return _.id},getType:ee,isSegmentListMissing:x,loadSegmentList:w,prepareQualityChange:function(ie){const oe=L(ie.id);oe&&(G(oe),w(oe),w(oe.dependentRepresentation))},reset:function(){t.off(u.A.MANIFEST_VALIDITY_CHANGED,W,d),M()},setIsDynamic:function(ie){B=ie},updateData:function(ie,oe,Ae){return new Promise((ke,Ie)=>{var be;N=ie;const me=L(Ae);if(G(me),q=l===U.A.VIDEO||l===U.A.ENHANCEMENT||l===U.A.AUDIO||l===U.A.TEXT&&oe,!q)return H(),void ke();const Oe=(be=me?.dependentRepresentation)==null?void 0:be.id,Ke=[];for(let le=0,fe=N.length;le<fe;le++){const pe=N[le],ze=pe.id===Ae||pe.id===Oe,$e=J(pe,ze);ze&&!pe.hasSegments()&&O(pe,$e),Ke.push($e)}Promise.all(Ke).then(()=>{(function(){r.setPlaybackQuality(l,_,v);const le=c.getCurrentDVRInfo(l);le&&c.updateManifestUpdateInfo({latency:le.range.end-A.getTime()}),H()})(),ke()}).catch(le=>{Ie(le)})})}},k=(0,j.A)(e).getInstance().getLogger(d),M(),t.on(u.A.MANIFEST_VALIDITY_CHANGED,W,d),d}zo.__dashjs_factory_name="RepresentationController";var tl=o.A.getClassFactory(zo);function Wo(n){const e=(n=n||{}).eventBus,t=n.debug,i=n.urlUtils,r=n.type,c=n.streamInfo,A=n.segmentsController,p=n.timelineConverter,l=n.baseURLController;let _,I,h,d,N;function v(){return r}function q(){h=null}function k(M,J,L){const H=l.resolve(L.path);let w,O,x={};return H&&J!==H.url&&i.isRelative(J)?(w=H.url,O=H.serviceLocation,x=H.queryParams,J&&(w=i.resolve(J,w))):w=J,!i.isRelative(w)&&(M.url=w,M.serviceLocation=O,M.queryParams=x,!0)}function D(M,J,L){let H=null;if(!J||!J.segmentInfoType)return H;const w=A.getSegmentByTime(J,L);return w&&(h=w,I.debug("Index for time "+L+" is "+w.index),H=$(0,w)),H}function $(M,J){if(J==null)return null;const L=new dt.A,H=J.representation,w=H.bandwidth,O=gi(J.media,H.id,J.replacementNumber,J.replacementSubNumber,w,J.replacementTime);return L.adaptationIndex=H.adaptation.index,L.availabilityEndTime=J.availabilityEndTime,L.availabilityStartTime=J.availabilityStartTime,L.availabilityTimeComplete=H.availabilityTimeComplete,L.bandwidth=H.bandwidth,L.duration=J.duration,L.index=J.index,L.isPartialSegmentRequest=J.isPartialSegment,L.mediaStartTime=J.mediaStartTime,L.mediaType=v(),L.presentationStartTime=J.presentationStartTime,L.range=J.mediaRange,L.representation=H,L.startTime=J.presentationStartTime,L.timescale=H.timescale,L.type=Ee.G.MEDIA_SEGMENT_TYPE,L.wallStartTime=J.wallStartTime,k(L,O,H)?L:void 0}function B(M){if(!M)return{indexToRequest:0,subNumberOfPartialSegmentToRequest:NaN};const J=M.isPartialSegment,L=!isNaN(M.replacementSubNumber),H=!isNaN(M.totalNumberOfPartialSegments);if(J&&L&&H){const w=M.replacementSubNumber+1;return w<M.totalNumberOfPartialSegments?{indexToRequest:M.index,subNumberOfPartialSegmentToRequest:w}:{indexToRequest:M.index+1,subNumberOfPartialSegmentToRequest:0}}return{indexToRequest:M.index+1,subNumberOfPartialSegmentToRequest:NaN}}function ee(M,J,L,H){let w=null;const O=A.getSegmentByIndex(J,L,H,h);if(O)w=$(0,O),h=O;else{if(d&&!N)return I.debug(v()+" No segment found at index: "+L+". Wait for next loop"),null;N=!0}return w}function te(){I.debug("Dynamic stream complete"),N=!0}return _={getCurrentIndex:function(){return h?h.index:-1},getInitRequest:function(M,J){return J?(function(L,H,w){const O=new dt.A,x=H.adaptation.period,G=x.start;if(O.mediaType=w,O.type=Ee.G.INIT_SEGMENT_TYPE,O.range=H.range,O.availabilityStartTime=p.calcAvailabilityStartTimeFromPresentationTime(G,H,d),O.availabilityEndTime=p.calcAvailabilityEndTimeFromPresentationTime(G+x.duration,H,d),O.representation=H,k(O,H.initialization,H))return O.url=gi(O.url,H.id,void 0,void 0,H.bandwidth),O})(0,J,v()):null},getLastSegment:function(){return h},getNextSegmentRequest:function(M,J){if(!J||!J.segmentInfoType)return null;if((function(w){return w&&h&&w.endNumber&&h.replacementNumber&&h.replacementNumber>=w.endNumber})(J))return N=!0,null;let{indexToRequest:L,subNumberOfPartialSegmentToRequest:H}=B(h);return ee(0,J,L,H)},getNextSegmentRequestIdempotent:function(M,J){let L=null,{indexToRequest:H,subNumberOfPartialSegmentToRequest:w}=B(h);const O=A.getSegmentByIndex(J,H,w,h);return O?(L=$(0,O),L):null},getSegmentRequestForTime:D,getStreamId:function(){return c.id},getStreamInfo:function(){return c},getType:v,getValidTimeAheadOfTargetTime:function(M,J,L,H){try{if(isNaN(M)||!J||!L)return NaN;if(M<0&&(M=0),isNaN(H)&&(H=.5),D(0,L,M))return M;if(L.adaptation.period.start+L.adaptation.period.duration<M)return NaN;const w=isFinite(L.adaptation.period.duration)?L.adaptation.period.start+L.adaptation.period.duration:M+30;let O=Math.min(M+H,w),x=NaN,G=null;for(;O<=w;){let W=null;if(O<=w&&(W=D(0,L,O)),W){x=O,G=W;break}O+=H}if(G){const W=G.startTime+G.duration;return M>G.startTime&&W-M>H?M:!isNaN(G.startTime)&&M<G.startTime&&x>G.startTime?G.startTime+.001:Math.min(W-H,x)}return x}catch{return NaN}},initialize:function(M){d=M,N=!1,A.initialize(M)},isLastSegmentRequested:function(M,J){return!M||!h||!M.hasSegments()&&!M.segments?!1:N?!0:!isFinite(M.adaptation.period.duration)||h.presentationStartTime+h.duration>J?!1:M.mediaFinishedInformation&&!isNaN(M.mediaFinishedInformation.numberOfSegments)&&!isNaN(h.index)&&h.index>=M.mediaFinishedInformation.numberOfSegments-1&&(!d||M.segmentInfoType===Fe.A.SEGMENT_TEMPLATE||d&&M.segmentInfoType===Fe.A.SEGMENT_LIST&&M.adaptation.period.nextPeriodId)?!0:!!(d&&M.adaptation.period.nextPeriodId&&M.segmentInfoType===Fe.A.SEGMENT_TIMELINE&&M.mediaFinishedInformation&&!isNaN(M.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&h&&!isNaN(h.mediaStartTime)&&!isNaN(h.duration)&&h.mediaStartTime+h.duration>=M.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},repeatSegmentRequest:function(M,J){return J&&J.segmentInfoType?ee(0,J,h?h.index:0,h&&h.isPartialSegment&&!isNaN(h.replacementSubNumber)?h.replacementSubNumber:NaN):null},reset:function(){q(),e.off(u.A.DYNAMIC_TO_STATIC,te,_)}},I=t.getLogger(_),q(),e.on(u.A.DYNAMIC_TO_STATIC,te,_),_}Wo.__dashjs_factory_name="DashHandler";var $o=o.A.getClassFactory(Wo);function Xo(n,e){const t=(n=n||{}).timelineConverter,i=n.dashMetrics;let r;function c(p,l){if((function(){if(!t)throw new Error(U.A.MISSING_CONFIG_ERROR)})(),!p)return null;l===void 0&&(l=null);let _=null;const I=t.calcMediaTimeFromPresentationTime(l,p);return(function(h,d){const N=(function(w){return w.adaptation.period.mpd.manifest.Period[w.adaptation.period.index].AdaptationSet[w.adaptation.index].Representation[w.index].SegmentTemplate||w.adaptation.period.mpd.manifest.Period[w.adaptation.period.index].AdaptationSet[w.adaptation.index].Representation[w.index].SegmentList})(h),v=N.SegmentTimeline,q=N.SegmentURL;if(!v||!v.S)return;let k,D,$,B,ee,te,M=0,J=-1;te=h.timescale,k=v.S;let L=!1;const H=k.length;for($=0;$<H&&!L;$++)for(D=k[$],ee=0,D.hasOwnProperty("r")&&(ee=D.r),D.hasOwnProperty("t")&&(M=D.t),ee<0&&(ee=A(h,k[$+1],D,te,M/te)),B=0;B<=ee&&!L;B++)J++,L=d({mediaTime:M,segmentBase:N,segmentURL:q,currentSElement:D,sElementCounterIncludingRepeats:J,sElementCounter:$}),L&&(h.segmentDuration=D.d/te),M+=D.d})(p,function(h){const d=p.timescale;return(function(N,v){const{mediaTime:q,segmentBase:k,segmentURL:D,currentSElement:$,sElementCounterIncludingRepeats:B,sElementCounter:ee}=v,te=$.d,M=p.timescale;return N<q+te&&N>=q&&((function(J){const{segmentBase:L,segmentURL:H,sElementCounter:w,currentSElement:O,mediaTime:x,durationInTimescale:G,fTimescale:W,requiredMediaTimeInTimescaleUnits:ie,sElementCounterIncludingRepeats:oe}=J;let Ae=(function(me,Oe,Ke){let le=me.media;return Oe&&(le=Oe[Ke].media||""),le})(L,H,w),ke=(function(me,Oe,Ke){let le=me.mediaRange;return Oe&&(le=Oe[Ke].mediaRange),le})(O,H,w);const Ie=qi(O),be=(function(me){if(!me||me.totalNumberOfPartialSegments===void 0||isNaN(me.totalNumberOfPartialSegments)||me.totalNumberOfPartialSegments<1)return;const{durationInTimescale:Oe,requiredMediaTimeInTimescaleUnits:Ke,mediaTime:le,totalNumberOfPartialSegments:fe}=me,pe=Oe/fe;for(let ze=0;ze<fe;ze++){const $e=le+ze*pe;if(Ke>=$e&&Ke<$e+pe)return ze}return NaN})({durationInTimescale:G,requiredMediaTimeInTimescaleUnits:ie,mediaTime:x,totalNumberOfPartialSegments:Ie});_=Yi({timelineConverter:t,isDynamic:e,representation:p,mediaTime:x,durationInTimescale:G,fTimescale:W,mediaUrl:Ae,mediaRange:ke,index:oe,tManifest:O.tManifest,totalNumberOfPartialSegments:Ie,subNumberOfPartialSegmentToRequest:be})})({segmentBase:k,segmentURL:D,sElementCounter:ee,currentSElement:$,mediaTime:q,durationInTimescale:te,fTimescale:M,requiredMediaTimeInTimescaleUnits:N,sElementCounterIncludingRepeats:B}),!0)})(parseFloat((I*d).toPrecision(15)),h)}),_}function A(p,l,_,I,h){let d;if(l&&l.hasOwnProperty("t"))d=l.t/I;else try{let N=0;if(isNaN(p.adaptation.period.start)||isNaN(p.adaptation.period.duration)||!isFinite(p.adaptation.period.duration)){const v=i.getCurrentDVRInfo();N=isNaN(v.end)?0:v.end}else N=p.adaptation.period.start+p.adaptation.period.duration;d=t.calcMediaTimeFromPresentationTime(N,p),p.segmentDuration=_.d/I}catch{d=0}return Math.max(Math.ceil((d-h)/(_.d/I))-1,0)}return r={getMediaFinishedInformation:function(p){if(!p)return 0;const l=(p.adaptation.period.mpd.manifest.Period[p.adaptation.period.index].AdaptationSet[p.adaptation.index].Representation[p.index].SegmentTemplate||p.adaptation.period.mpd.manifest.Period[p.adaptation.period.index].AdaptationSet[p.adaptation.index].Representation[p.index].SegmentList).SegmentTimeline;if(!l||!l.S)return{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};let _,I,h,d,N,v,q=0,k=0,D=0;v=p.timescale,_=l.S;const $=_.length;for(h=0;h<$;h++)for(I=_[h],N=0,I.hasOwnProperty("r")&&(N=I.r),I.hasOwnProperty("t")&&(q=I.t,k=q/v),N<0&&(N=A(p,_[h+1],I,v,k)),d=0;d<=N;d++)D++,q+=I.d,k=q/v;return{numberOfSegments:D,mediaTimeOfLastSignaledSegment:k}},getSegmentByIndex:function(p,l){return p?c(p,l&&!isNaN(l.presentationStartTime)?l.presentationStartTime+l.duration+.01:0):null},getSegmentByTime:c},r}Xo.__dashjs_factory_name="TimelineSegmentsGetter";var nl=o.A.getClassFactory(Xo);function Jo(n,e){const t=(n=n||{}).timelineConverter;let i;function r(A,p,l){if(!A)return null;const _=c(A),I=qi(_);I!==void 0&&I>=0&&(l=l!==void 0&&l<I?l:0);const h=jo({index:p=Math.max(p,0),isDynamic:e,mediaTime:Math.round(p*A.segmentDuration*A.timescale,10),mediaUrl:_.media,representation:A,subNumberOfPartialSegmentToRequest:l,timelineConverter:t,totalNumberOfPartialSegments:I});return h&&A.endNumber&&h.replacementNumber>A.endNumber?null:h}function c(A){return A.adaptation.period.mpd.manifest.Period[A.adaptation.period.index].AdaptationSet[A.adaptation.index].Representation[A.index].SegmentTemplate}return i={getMediaFinishedInformation:function(A){const p={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!A)return p;const l=A.segmentDuration;return isNaN(l)?p.numberOfSegments=1:p.numberOfSegments=Math.ceil(A.adaptation.period.duration/l),p},getSegmentByIndex:r,getSegmentByTime:function(A,p){if(!A)return null;const l=A.segmentDuration;if(isNaN(l))return null;let _=t.calcPeriodRelativeTimeFromMpdRelativeTime(A,p);const I=c(A),h=Math.floor(_/l),d=(function(N){if(!N||N.totalNumberOfPartialSegments===void 0||isNaN(N.totalNumberOfPartialSegments)||N.totalNumberOfPartialSegments<1)return;const{totalNumberOfPartialSegments:v,representation:q,requestedTimeRelativeToPeriodStart:k,indexWithoutStartNumber:D}=N,$=D*q.segmentDuration,B=q.segmentDuration/v,ee=k-$;let te=Math.floor(ee/B);return te=Math.max(0,Math.min(te,v-1)),te})({totalNumberOfPartialSegments:qi(I),representation:A,requestedTimeRelativeToPeriodStart:_,indexWithoutStartNumber:h});return r(A,h,d)}},i}Jo.__dashjs_factory_name="TemplateSegmentsGetter";var rl=o.A.getClassFactory(Jo);function Zo(n,e){const t=(n=n||{}).timelineConverter;let i;function r(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(U.A.MISSING_CONFIG_ERROR)}function c(A,p){if(r(),!A)return null;const l=A.adaptation.period.mpd.manifest.Period[A.adaptation.period.index].AdaptationSet[A.adaptation.index].Representation[A.index].SegmentList,_=l.SegmentURL.length,I=A&&!isNaN(A.startNumber)?A.startNumber:1,h=Math.max(I-1,0),d=Math.max(p-h,0);let N=null;if(d<_){const v=l.SegmentURL[d];N=jo({index:p,isDynamic:e,mediaRange:v.mediaRange,mediaTime:(I+p-1)*A.segmentDuration,representation:A,timelineConverter:t}),N&&(N.media=v.media?v.media:"",N.indexRange=v.indexRange)}return N}return i={getSegmentByIndex:c,getSegmentByTime:function(A,p){if(r(),!A)return null;const l=A.segmentDuration;if(isNaN(l))return null;const _=t.calcPeriodRelativeTimeFromMpdRelativeTime(A,p);return c(A,Math.floor(_/l))},getMediaFinishedInformation:function(A){const p={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!A)return p;const l=A.adaptation.period.mpd.manifest.Period[A.adaptation.period.index].AdaptationSet[A.adaptation.index].Representation[A.index].SegmentList,_=A&&!isNaN(A.startNumber)?A.startNumber:1,I=Math.max(_-1,0);return p.numberOfSegments=I+l.SegmentURL.length,p}},i}Zo.__dashjs_factory_name="ListSegmentsGetter";var il=o.A.getClassFactory(Zo);function Qo(n){const e=(n=n||{}).timelineConverter;let t;function i(){if(!e||!e.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(U.A.MISSING_CONFIG_ERROR)}function r(c,A){if(i(),!c)return null;const p=c.segments?c.segments.length:-1;let l;if(A<p&&(l=c.segments[A],l&&l.index===A))return l;for(let _=0;_<p;_++)if(l=c.segments[_],l&&l.index===A)return l;return null}return t={getSegmentByIndex:r,getSegmentByTime:function(c,A){i();const p=(function(l,_){if(!l)return-1;const I=l.segments,h=I?I.length:null;let d,N,v,q,k,D=-1;if(I&&h>0){for(k=0;k<h;k++)if(N=I[k],v=N.presentationStartTime,q=N.duration,d=q/2,_+d>=v&&_-d<v+q){D=N.index;break}}return D})(c,A);return r(c,p)},getMediaFinishedInformation:function(c){const A={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};return c&&c.segments&&(A.numberOfSegments=c.segments.length),A}},t}Qo.__dashjs_factory_name="SegmentBaseGetter";var ol=o.A.getClassFactory(Qo);function es(n){n=n||{};const e=this.context,t=n.dashConstants,i=n.type,r=n.segmentBaseController;let c,A;function p(l){return l?l.segments?A[t.SEGMENT_BASE]:A[l.segmentInfoType]:null}return c={initialize:function(l){A[t.SEGMENT_TIMELINE]=nl(e).create(n,l),A[t.SEGMENT_TEMPLATE]=rl(e).create(n,l),A[t.SEGMENT_LIST]=il(e).create(n,l),A[t.SEGMENT_BASE]=ol(e).create(n,l)},updateInitData:function(l,_){return _?Promise.resolve():r.getSegmentBaseInitSegment({representation:l,mediaType:i})},updateSegmentData:function(l,_){return _||l.segments?Promise.resolve():r.getSegmentList({mimeType:l.mimeType,representation:l,mediaType:i})},getSegmentByIndex:function(l,_,I,h){const d=p(l);return d?l.segmentInfoType?l.segmentInfoType===t.SEGMENT_TIMELINE?d.getSegmentByIndex(l,h):l.segmentInfoType===t.SEGMENT_TEMPLATE?d.getSegmentByIndex(l,_,I):d.getSegmentByIndex(l,_):d.getSegmentByIndex(l,_):null},getSegmentByTime:function(l,_){const I=p(l);return I?I.getSegmentByTime(l,_):null},getMediaFinishedInformation:function(l){const _=p(l);return _?_.getMediaFinishedInformation(l):{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN}}},A={},c}es.__dashjs_factory_name="SegmentsController";var ts=o.A.getClassFactory(es);function ns(n){n=n||{};let e,t,i,r,c,A,p,l,_,I,h,d,N,v,q,k,D,$,B,ee,te,M=this.context,J=(0,m.A)(M).getInstance(),L=n.abrController,H=n.adapter,w=n.boxParser,O=n.capabilities,x=n.dashMetrics,G=n.errHandler,W=n.fragmentModel,ie=n.getBufferedEndForType,oe=n.manifestModel,Ae=n.mediaController,ke=n.mediaPlayerModel,Ie=n.mimeType,be=n.playbackController,me=n.segmentBlacklistController,Oe=n.settings,Ke=n.streamInfo,le=n.textController,fe=n.timelineConverter,pe=n.type;function ze(){return Ke.id}function $e(){return pe}function ot(){I=[],r=null,t=0,ee=!1,$=!1,d=!1,A=null,te=!1,k=null,B=!1,v=null,En()}function Se(bt){return!isNaN(bt)&&!isNaN(Ke.duration)&&isFinite(Ke.duration)&&bt>=Ke.start+Ke.duration}function We(bt,tn=!0){if(bt.sender){if(be.getIsManifestUpdateInProgress())Ot();else if((!r.isText||le.isTextEnabled())&&e&&bt.representationId&&!e.appendInitSegmentFromCache(bt.representationId)){const _n=N.getCurrentRepresentation();if(_n.range===0)return void rt();const vn=c?c.getInitRequest(r,_n):null;vn?W.executeRequest(vn):tn&&(q.setInitSegmentRequired(!0),Ot())}}}function rt(bt,tn=!0){if(be.getIsManifestUpdateInProgress()||e.getIsPruningInProgress())return void Ot();if((function(){const vn=N.getCurrentRepresentation();if(!N.isSegmentListMissing(vn))return!1;const wn=N.loadSegmentList(vn);return wn?(wn!==k&&(k=wn,wn.then(Nn=>{k===wn&&(k=null,Nn.segments&&v===Nn.id&&(v=null),d||te||(e.getIsPruningInProgress()?B=!0:q.startScheduleTimer(0)))})),!0):(v!==vn.id&&(v=vn.id,G.error(new Hn.A(f.A.SEGMENT_BASE_LOADER_ERROR_CODE,f.A.SEGMENT_BASE_LOADER_ERROR_MESSAGE))),Ot(),!0)})())return;let _n=(function(){let vn;if(isNaN(t)||$e()===U.A.TEXT&&!le.isTextEnabled())return null;if(c){const wn=an();vn=ee?c.getSegmentRequestForTime(r,wn,t):$?c.repeatSegmentRequest(r,wn):c.getNextSegmentRequest(r,wn)}return vn})();_n?(ee=!1,$=!1,(function(vn){isNaN(vn.startTime+vn.duration)||(t=vn.startTime+vn.duration),vn.delayLoadingTime=new Date().getTime()+q.getTimeToLoadDelay(),q.setTimeToLoadDelay(0),(function(wn){let Nn=wn.url;return wn.range&&(Nn=Nn.concat("_",wn.range)),me.contains(Nn)})(vn)?(_.warn(`Fragment request url ${vn.url} for stream id ${Ke.id} and media type ${pe} is on the ignore list and will be skipped`),Ot()):(_.debug(`Next fragment request url for stream id ${Ke.id} and media type ${pe} is ${vn.url} with request range ${vn.range}`),W.executeRequest(vn))})(_n)):(function(vn){const wn=N.getCurrentRepresentation();if(!gt()){try{if(Oe.get().streaming.gaps.enableSeekFix&&(ee||be.getTime()===0)){let Nn;if(l?l&&wn.segmentInfoType===Fe.A.SEGMENT_TIMELINE&&(Nn=(function(xn){return c.getValidTimeAheadOfTargetTime(t,r,xn,Oe.get().streaming.gaps.threshold)})(wn)):Nn=(function(xn){let Vn=c.getValidTimeAheadOfTargetTime(t,r,xn,Oe.get().streaming.gaps.threshold);if(isNaN(Vn)){const rr=xn.adaptation.period,ur=rr.start+rr.duration;Ke.isLast&&isFinite(ur)&&t<=ur&&t>=ur-xn.segmentDuration&&(Vn=Math.max(rr.start,t-.1))}return Vn})(wn),!isNaN(Nn)&&Nn!==t)return void(function(xn,Vn){be.isSeeking()||be.getTime()===0?(_.warn(`Adjusting playback time ${xn} because of gap in the manifest. Seeking by ${xn-t}`),be.seek(xn,!1,!1)):(_.warn(`Adjusting buffering time ${xn} because of gap in the manifest. Adjusting time by ${xn-t}`),jn(xn),Vn&&Ot())})(Nn,vn)}}catch(Nn){_.error(Nn)}vn&&Ot()}})(tn)}function gt(){const bt=N.getCurrentRepresentation(),tn=c.isLastSegmentRequested(bt,t);if(tn){const _n=c.getCurrentIndex();_.debug(`Segment requesting for stream ${Ke.id} has finished`),J.trigger(F.A.STREAM_REQUESTING_COMPLETED,{segmentIndex:_n},{streamId:Ke.id,mediaType:pe}),e.segmentRequestingCompleted(_n),en()}return tn}function Ot(){const bt=ke.getScheduleTimeout();q.startScheduleTimer(bt)}function zt(bt){x.addBufferState(pe,bt.state,q.getBufferTarget()),bt.state!==mt.BUFFER_EMPTY||be.isSeeking()||(_.info("Buffer is empty! Stalling!"),x.pushPlayListTraceMetrics(new Date,lr.REBUFFERING_REASON))}function Wt(bt){W.syncExecutedRequestsWithBufferedRange(e.getBuffer().getAllBufferRanges(),Ke.duration),bt.quotaExceeded&&bt.from>be.getTime()&&jn(bt.from);const tn=bt.quotaExceeded&&bt.hasEnoughSpaceToAppend,_n=B&&!bt.quotaExceeded;(tn||_n)&&(B=!1,q.startScheduleTimer())}function Qt(bt){if(!bt||!bt.lastRequestAppended||!bt.lastRequestAppended.url)return;let tn=bt.lastRequestAppended.url;bt.lastRequestAppended.range&&(tn=tn.concat("_",bt.lastRequestAppended.range)),_.warn(`Blacklisting segment with url ${tn}`),me.add(tn)}function fn(bt){if(_.debug(`Appended bytes for ${bt.mediaType} and stream id ${bt.streamId}`),bt.segmentType===Ee.G.INIT_SEGMENT_TYPE){const tn=bt.representationId;q.setLastInitializedRepresentationId(tn),_.info("["+pe+"] lastInitializedRepresentationId changed to "+tn)}h&&h.enabled?rn(h.newRepresentation,h.oldRepresentation):te||q.startScheduleTimer(0)}function En(){h={newRepresentation:null,oldRepresentation:null,enabled:!1}}function bn(bt){return new Promise(tn=>{if(!N)return Promise.resolve();let _n=null;var vn;_n=bt.newRepresentation?{selectedRepresentation:(vn=bt).newRepresentation,currentMediaInfo:vn.newMediaInfo}:r!==null&&H.areMediaInfosEqual(r,bt.newMediaInfo)?(function(Nn){return{currentMediaInfo:Nn.newMediaInfo,selectedRepresentation:N.getCurrentRepresentation()}})(bt):(function(Nn){let xn=NaN;return xn=!Oe.get().streaming.abr.autoSwitchBitrate[Nn.newMediaInfo.type]&&Nn.previouslySelectedRepresentation?Nn.previouslySelectedRepresentation.bitrateInKbit:L.getInitialBitrateFor(pe),{selectedRepresentation:L.getOptimalRepresentationForBitrate(Nn.newMediaInfo,xn,!1),currentMediaInfo:Nn.newMediaInfo}})(bt),Fn(_n.currentMediaInfo),J.trigger(),(function(Nn){A&&Nn.selectedRepresentation.dependentRepresentation&&(_.info("["+pe+"] selectMediaInfo : call selectMediaInfo on enhancementStreamProcessor for index = "+Nn.selectedRepresentation.absoluteIndex),A.selectMediaInfo(new Fr({newMediaInfo:Nn.selectedRepresentation.mediaInfo,newRepresentation:Nn.selectedRepresentation})))})(_n);const wn=L.getPossibleVoRepresentations(r,!1);return N.updateData(wn,r.isFragmented,_n.selectedRepresentation.id).then(()=>{(function(){if(!e||!N)return;const Nn=N.getCurrentCompositeRepresentation();e.getIsBufferingCompleted()||e.updateBufferTimestampOffset(Nn)})(),tn()}).catch(Nn=>{_.error(Nn),tn()})})}function Fn(bt){H.areMediaInfosEqual(r,bt)||J.trigger(u.A.NEW_TRACK_SELECTED,{value:bt}),r=bt,L.handleNewMediaInfo(r),J.trigger(F.A.MEDIAINFO_UPDATED,{mediaType:pe,streamId:Ke.id,currentMediaInfo:r})}function et(bt){const tn=bt.newRepresentation,_n=bt.oldRepresentation,vn=hr();tn&&_n||_.warn("_handleDifferentSwitchTypes() is missing the target representations"),bt.reason&&bt.reason.forceReplace?(function(wn,Nn){W.abortRequests(),J.trigger(F.A.BUFFER_REPLACEMENT_STARTED,{mediaType:pe,streamId:Ke.id},{mediaType:pe,streamId:Ke.id}),q.setShouldCheckPlaybackQuality(!1),e.prepareForForceReplacementQualitySwitch(wn,Nn).then(()=>{wt()}).catch(()=>{wt()})})(tn,_n):bt&&bt.reason&&bt.reason.forceAbandon?(function(wn,Nn){e.prepareForAbandonQualitySwitch(wn,Nn).then(()=>{Rt()}).catch(()=>{Rt()})})(tn,_n):!ke.getFastSwitchEnabled()||vn&&vn.isPartialSegment?rn(tn,_n):(function(wn,Nn){var xn,Vn;const rr=be.getTime(),ur=Ar=>isFinite(Ar)&&Ar>0,Nr=(xn=N.getRepresentationById(wn.id))==null?void 0:xn.fragmentDuration,yr=Nn?(Vn=N.getRepresentationById(Nn.id))==null?void 0:Vn.fragmentDuration:NaN;let _r=1.5*(ur(Nr)?Nr:ur(yr)?yr:1);const Er=W.getRequests({state:Gt.FRAGMENT_MODEL_EXECUTED,time:rr+_r,threshold:0})[0];if(Er&&!r.isText){const Ar=e.getBufferLevel(),pr=L.getAbandonmentStateFor(Ke.id,pe),sr=pe===U.A.VIDEO&&wn.dependentRepresentation?wn.dependentRepresentation.bandwidth:wn.bandwidth;Er.bandwidth<sr&&Ar>=_r&&pr===mt.ALLOW_LOAD?e.prepareForFastQualitySwitch(wn,Nn).then(()=>{Ht(rr,_r)}).catch(()=>{Ht(rr,_r)}):rn(wn,Nn)}else rn(wn,Nn)})(tn,_n),x.pushPlayListTraceMetrics(new Date,lr.REPRESENTATION_SWITCH_STOP_REASON),x.createPlaylistTraceMetrics(tn.id,1e3*be.getTime(),be.getPlaybackRate())}function wt(){$n(),En(),d=!1}function Rt(){W.abortRequests(),$=!0,q.setShouldCheckPlaybackQuality(!1),q.startScheduleTimer(),d=!1}function Ht(bt,tn){W.abortRequests(),jn(bt+tn),q.setShouldCheckPlaybackQuality(!1),q.startScheduleTimer(),d=!1}function rn(bt,tn){const _n=W.getRequests({state:Gt.FRAGMENT_MODEL_LOADING});if(_n&&_n.length>0)return _.debug("Preparing for default quality switch: Waiting for ongoing segment request to be finished before applying switch."),h.newRepresentation=bt,h.oldRepresentation=tn,void(h.enabled=!0);e.prepareForDefaultQualitySwitch(bt,tn).then(()=>{Rn()}).catch(()=>{Rn()})}function Rn(){q.setShouldCheckPlaybackQuality(!1),r.segmentAlignment||r.subSegmentAlignment?q.startScheduleTimer():nr(),En(),d=!1}function ht(bt){_.info("onFragmentLoadingAbandoned request: "+bt.request.url+" has been aborted"),be.isSeeking()||q.getSwitchTrack()||d||(_.info("onFragmentLoadingAbandoned request: "+bt.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),bt.request&&bt.request.isInitializationRequest()?q.setInitSegmentRequired(!0):jn(bt.request.startTime+bt.request.duration/2),q.startScheduleTimer(0))}function xe(bt){_.info("OnFragmentLoadingCompleted for stream id "+Ke.id+" and media type "+pe+" - Url:",bt.request?bt.request.url:"undefined",bt.request.range?", Range:"+bt.request.range:""),r.isText&&q.startScheduleTimer(0),bt.error&&bt.request.serviceLocation&&(function(tn){_.info("Fragment loading completed with an error"),tn&&tn.request&&tn.request.type&&(tn.request.type===Ee.G.INIT_SEGMENT_TYPE?We({representationId:tn.request.representation.id,sender:{}},!1):tn.request.type===Ee.G.MEDIA_SEGMENT_TYPE&&(jn(tn.request.startTime+tn.request.duration/2),rt(0,!1)))})(bt)}function Qe(){jn(be.getTime()),xt().startScheduleTimer()}function at(bt){const tn=bt.currentTrackInfo;if(!tn)return;const _n=I.find(vn=>vn.index===tn.index&&vn.lang===tn.lang);_n&&bn(new Fr({newMediaInfo:_n})).then(()=>{e.setIsBufferingCompleted(!1),jn(be.getTime()),q.setInitSegmentRequired(!0),q.startScheduleTimer()})}function St(bt){jn(bt.quotaExceededTime),en()}function ut(){return e?e.getBuffer():null}function xt(){return q}function en(){q&&q.clearScheduleTimer()}function an(bt=NaN){let tn;return isNaN(bt)?tn=N?N.getCurrentRepresentation():null:((0,Rr.zQ)(bt),tn=N?N.getRepresentationById(bt):null),tn}function In(){return!!e&&e.getIsBufferingCompleted()}function On(bt){if(!Oe.get().streaming.enableManifestTimescaleMismatchFix)return;const tn=bt.chunk,_n=tn.bytes,vn=an(tn.representation.id);vn&&(vn.timescale=w.getMediaTimescaleFromMoov(_n))}function Gn(bt){const tn=bt.chunk,_n=tn.bytes,vn=an(tn.representation.id);if(vn){let wn;if(Oe.get().streaming.parseInbandPrft&&bt.request.type===Ee.G.MEDIA_SEGMENT_TYPE){wn=wn||w.parse(_n);const Vn=(function(rr,ur){const Nr=rr.getBoxes("prft"),yr=[];return Nr.forEach(_r=>{yr.push((function(Er,Ar){let pr="unknown";switch(Er.flags){case 0:pr=Fe.A.PRODUCER_REFERENCE_TIME_TYPE.ENCODER;break;case 16:pr=Fe.A.PRODUCER_REFERENCE_TIME_TYPE.APPLICATION;break;case 24:pr=Fe.A.PRODUCER_REFERENCE_TIME_TYPE.CAPTURED}let sr=1e3*Er.ntp_timestamp_sec+Er.ntp_timestamp_frac/2**32*1e3;return sr=V(M).getInstance().ntpToUTC(sr),{type:pr,ntpTimestamp:sr,mediaTime:Er.media_time/Ar}})(_r,ur))}),yr})(wn,vn.timescale);Vn&&Vn.length&&J.trigger(u.A.INBAND_PRFT,{data:Vn},{streamId:Ke.id,mediaType:pe})}const Nn=H.getEventsFor(vn.mediaInfo,null,Ke),xn=H.getEventsFor(vn,vn,Ke);if(Nn&&Nn.length>0||xn&&xn.length>0){const Vn=bt.request;wn=wn||w.parse(_n);const rr=(function(ur,Nr,yr,_r){try{const Er={},Ar=[],pr=yr.concat(_r);for(let Sr=0,Kr=pr.length;Sr<Kr;Sr++)Er[pr[Sr].schemeIdUri+"/"+pr[Sr].value]=pr[Sr];const sr=ur.getBoxes("emsg");if(!sr||sr.length===0)return Ar;const wr=ur.getBox("sidx"),Di=!wr||isNaN(wr.earliest_presentation_time)||isNaN(wr.timescale)?Nr&&!isNaN(Nr.mediaStartTime)?Nr.mediaStartTime:0:wr.earliest_presentation_time/wr.timescale,Mi=Math.max(Di,0),ai=N.getCurrentRepresentation();for(let Sr=0,Kr=sr.length;Sr<Kr;Sr++){const Xe=H.getEvent(sr[Sr],Er,Mi,ai);Xe&&Ar.push(Xe)}return Ar}catch{return[]}})(wn,Vn,Nn,xn);J.trigger(F.A.INBAND_EVENTS,{events:rr},{streamId:Ke.id})}}}function $n(){const bt=be.getTime();Oe.get().streaming.buffer.flushBufferAtTrackSwitch&&be.seek(bt+.001,!1,!0),jn(bt),e.setSeekTarget(bt),q.startScheduleTimer()}function nr(){const bt=be.getTime(),tn=e.getContinuousBufferTimeForTargetTime(bt);jn(isNaN(tn)?bt:tn),q.startScheduleTimer()}function Jn(bt){bt&&!isNaN(bt.time)&&(jn(bt.time),e.setSeekTarget(bt.time))}function jn(bt){t=bt,ee=!0}function or(){return t}function hr(){return c.getLastSegment()}return p={checkAndHandleCompletedBuffering:gt,clearScheduleTimer:en,createBufferSinks:function(bt,tn){const _n=ut();return _n?Promise.resolve(_n):e?e.createBufferSink(r,bt,tn):Promise.resolve(null)},dischargePreBuffer:function(){e.dischargePreBuffer()},finalisePlayList:function(bt,tn){x.pushPlayListTraceMetrics(bt,tn)},getAllMediaInfos:function(){return I},getBuffer:ut,getBufferController:function(){return e},getBufferLevel:function(){return e?e.getBufferLevel():0},getBufferingTime:or,getFragmentModel:function(){return W},getLastSegment:hr,getMediaInfo:function(){return r},getMediaSource:function(){return e.getMediaSource()},getRepresentation:an,getRepresentationController:function(){return N},getScheduleController:xt,getStreamId:ze,getStreamInfo:function(){return Ke},getType:$e,initialize:function(bt,tn,_n){D=ts(M).create({events:F.A,eventBus:J,streamInfo:Ke,timelineConverter:fe,dashConstants:Fe.A,segmentBaseController:n.segmentBaseController,type:pe}),c=$o(M).create({baseURLController:n.baseURLController,boxParser:w,constants:U.A,dashConstants:Fe.A,dashMetrics:x,debug:(0,j.A)(M).getInstance(),errHandler:G,errors:f.A,eventBus:J,events:F.A,mediaPlayerModel:ke,segmentsController:D,settings:Oe,streamInfo:Ke,timelineConverter:fe,type:pe,urlUtils:(0,ln.A)(M).getInstance()}),l=Ke.manifestInfo.isDynamic,c.initialize(l),L.registerStreamType(pe,p),N=tl(M).create({abrController:L,adapter:H,dashConstants:Fe.A,dashMetrics:x,errors:f.A,eventBus:J,events:F.A,isDynamic:l,playbackController:be,segmentsController:D,streamInfo:Ke,timelineConverter:fe,type:pe}),e=(function(vn,wn){let Nn=null;return vn?(Nn=vn!==U.A.TEXT||wn?Xa(M).create({abrController:L,capabilities:O,errHandler:G,fragmentModel:W,manifestModel:oe,mediaController:Ae,mediaPlayerModel:ke,playbackController:be,representationController:N,settings:Oe,streamInfo:Ke,textController:le,type:vn}):Ja(M).create({errHandler:G,fragmentModel:W,mimeType:Ie,settings:Oe,streamInfo:Ke,textController:le,type:vn}),Nn):(G.error(new Hn.A(f.A.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,f.A.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null)})(pe,_n),e&&e.initialize(bt),q=Za(M).create({abrController:L,adapter:H,bufferController:e,dashMetrics:x,fragmentModel:W,getBufferingTime:or,getBufferedEndForType:ie,mediaController:Ae,mediaPlayerModel:ke,mimeType:Ie,playbackController:be,representationController:N,settings:Oe,streamInfo:Ke,textController:le,type:pe}),i=tn,q.initialize(tn),t=0,ee=!1,$=!1},isBufferingCompleted:In,prepareInnerPeriodPlaybackSeeking:function(bt){return new Promise(tn=>{if(e.hasBufferAtTime(bt.seekTime))return e.pruneBuffer(),Se(e.getContinuousBufferTimeForTargetTime(bt.seekTime))&&e.setIsBufferingCompleted(!0),void tn();en(),W.abortRequests(),e.prepareForPlaybackSeek().then(()=>{const _n=e.getAllRangesWithSafetyFactor(bt.seekTime);return e.clearBuffers(_n)}).then(()=>{const _n=e.getContinuousBufferTimeForTargetTime(bt.seekTime);if(Se(_n))e.setIsBufferingCompleted(!0),tn();else{const vn=isNaN(_n)?bt.seekTime:_n;jn(vn),e.setSeekTarget(vn);const wn=[];wn.push(e.updateAppendWindow());const Nn=an();wn.push(e.updateBufferTimestampOffset(Nn)),Promise.all(wn).then(()=>{q.setInitSegmentRequired(!0),q.setShouldCheckPlaybackQuality(!1),q.startScheduleTimer(),tn()})}}).catch(_n=>{_.error(_n)})})},prepareOuterPeriodPlaybackSeeking:function(){return new Promise((bt,tn)=>{try{en(),W.abortRequests(),e.prepareForPlaybackSeek().then(()=>e.pruneAllSafely()).then(()=>{bt()})}catch(_n){tn(_n)}})},prepareQualityChange:function(bt){bt.newRepresentation&&((function(tn){if(A)A.prepareQualityChange(tn);else if(pe===U.A.ENHANCEMENT){const _n=tn.oldRepresentation.mediaInfo.type,vn=tn.newRepresentation.mediaInfo.type;if(_n===U.A.ENHANCEMENT&&vn===U.A.VIDEO)return _.info("Stop "+pe+" stream processor"),q.reset(),!0;if(_n===U.A.VIDEO&&vn===U.A.ENHANCEMENT)return _.info("Start "+pe+" stream processor"),bn(new Fr({newMediaInfo:tn.newRepresentation.mediaInfo,newRepresentation:tn.newRepresentation})).then(()=>{q.setup(),q.initialize(i),q.startScheduleTimer()}),!0}return!1})(bt)||(h&&h.enabled&&_.warn(`Canceling queued representation switch to ${h.newRepresentation.id} for ${pe}`),bt.isAdaptationSetSwitch?(_.debug(`Preparing quality switch to different AdaptationSet for type ${pe} from representation id ${bt.oldRepresentation.id} to ${bt.newRepresentation.id}`),(function(tn){const _n=tn.newRepresentation;d=!0,en(),q.setSwitchTrack(!0);const vn=_n.mediaInfo;Fn(vn),bn(new Fr({newMediaInfo:vn,newRepresentation:_n})).then(()=>{et(tn)})})(bt)):(_.debug(`Preparing quality within the same AdaptationSet for type ${pe} from representation id ${bt.oldRepresentation.id} to ${bt.newRepresentation.id}`),(function(tn){const _n=tn.newRepresentation;d=!0,en(),N.prepareQualityChange(_n),et(tn)})(bt))))},prepareTrackSwitch:function(bt,tn=!1){return new Promise(_n=>{_.debug(`Preparing track switch for type ${pe}`);const vn=pe===U.A.TEXT||tn||Oe.get().streaming.trackSwitchMode[pe]===U.A.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&be.getTimeToStreamEnd(Ke)>Oe.get().streaming.buffer.stallThreshold;e.getIsBufferingCompleted()&&!vn?(function(wn){return new Promise(Nn=>{const xn=N.getCurrentRepresentation();e.prepareForNonReplacementTrackSwitch(xn,wn).then(()=>{J.trigger(F.A.BUFFERING_COMPLETED,{},{streamId:Ke.id,mediaType:pe}),Nn()}).catch(()=>{J.trigger(F.A.BUFFERING_COMPLETED,{},{streamId:Ke.id,mediaType:pe}),Nn()})})})(bt).then(()=>{_n()}):(q.setSwitchTrack(!0),vn?(function(wn){return new Promise(Nn=>{J.trigger(F.A.BUFFER_REPLACEMENT_STARTED,{mediaType:pe,streamId:Ke.id},{mediaType:pe,streamId:Ke.id}),W.abortRequests();const xn=an();e.prepareForReplacementTrackSwitch(xn,wn).then(()=>{$n(),Nn()}).catch(()=>{$n(),Nn()})})})(bt).then(()=>{_n()}):(function(wn){return new Promise(Nn=>{const xn=()=>{const Vn=W.getRequests({state:Gt.FRAGMENT_MODEL_LOADING});if(Vn&&Vn.length!==0)J.once(u.A.FRAGMENT_LOADING_COMPLETED,xn,p);else{const rr=an();e.prepareForNonReplacementTrackSwitch(rr,wn).then(()=>{nr(),Nn()}).catch(ur=>{_.error(ur),nr(),Nn()})}};xn()})})(bt).then(()=>{_n()}))})},probeNextRequest:function(){const bt=an();return c.getNextSegmentRequestIdempotent(r,bt)},reset:function(bt,tn){c&&c.reset(),e&&(e.reset(bt,tn),e=null),q&&(q.reset(),q=null),N&&(N.reset(),N=null),D&&(D=null),L&&L.unRegisterStreamType(ze(),pe),J.off(F.A.BUFFER_CLEARED,Wt,p),J.off(F.A.BUFFER_LEVEL_STATE_CHANGED,zt,p),J.off(F.A.BYTES_APPENDED_END_FRAGMENT,fn,p),J.off(F.A.FRAGMENT_LOADING_ABANDONED,ht,p),J.off(F.A.FRAGMENT_LOADING_COMPLETED,xe,p),J.off(F.A.INIT_FRAGMENT_LOADED,On,p),J.off(F.A.INIT_FRAGMENT_NEEDED,We,p),J.off(F.A.MEDIA_FRAGMENT_LOADED,Gn,p),J.off(F.A.MEDIA_FRAGMENT_NEEDED,rt,p),J.off(F.A.QUOTA_EXCEEDED,St,p),J.off(F.A.SEEK_TARGET,Jn,p),J.off(F.A.SET_FRAGMENTED_TEXT_AFTER_DISABLED,Qe,p),J.off(F.A.SET_NON_FRAGMENTED_TEXT,at,p),J.off(F.A.SOURCE_BUFFER_ERROR,Qt,p),ot(),pe=null,Ke=null},selectMediaInfo:bn,setEnhancementStreamProcessor:function(bt){A=bt,_.info("enhancementStreamProcessor = "+A)},setExplicitBufferingTime:jn,setMediaInfoArray:function(bt){I=bt},setMediaSource:function(bt){return e.setMediaSource(bt,r)},setTrackSwitchInProgress:function(bt){te=bt},updateStreamInfo:function(bt){return Ke=bt,Ke.manifestInfo.isDynamic!==l&&(l=Ke.manifestInfo.isDynamic,c.initialize(l),N.setIsDynamic(l)),In()?Promise.resolve():e.updateAppendWindow()}},_=(0,j.A)(M).getInstance().getLogger(p),ot(),J.on(F.A.BUFFER_CLEARED,Wt,p),J.on(F.A.BUFFER_LEVEL_STATE_CHANGED,zt,p),J.on(F.A.BYTES_APPENDED_END_FRAGMENT,fn,p),J.on(F.A.FRAGMENT_LOADING_ABANDONED,ht,p),J.on(F.A.FRAGMENT_LOADING_COMPLETED,xe,p),J.on(F.A.INIT_FRAGMENT_LOADED,On,p),J.on(F.A.INIT_FRAGMENT_NEEDED,We,p),J.on(F.A.MEDIA_FRAGMENT_LOADED,Gn,p),J.on(F.A.MEDIA_FRAGMENT_NEEDED,rt,p),J.on(F.A.QUOTA_EXCEEDED,St,p),J.on(F.A.SEEK_TARGET,Jn,p),J.on(F.A.SET_FRAGMENTED_TEXT_AFTER_DISABLED,Qe,p),J.on(F.A.SET_NON_FRAGMENTED_TEXT,at,p),J.on(F.A.SOURCE_BUFFER_ERROR,Qt,p),p}ns.__dashjs_factory_name="StreamProcessor";var sl=o.A.getClassFactory(ns),al=class{constructor(){this.url=null,this.width=null,this.height=null,this.x=null,this.y=null}},ll=class{constructor(){this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl="",this.id=""}},rs=C(9838),is=C(447),os=C(5099);function ss(n){const e=this.context,t=n.adapter,i=n.baseURLController,r=n.streamInfo,c=n.timelineConverter,A=n.debug,p=n.eventBus,l=n.events,_=n.dashConstants,I=(0,ln.A)(e).getInstance();let h,d,N,v,q,k,D,$,B;function ee(M,J){const L=new ll;L.id=M.id,L.bitrate=M.bandwidth,L.width=M.width,L.height=M.height,L.tilesHor=1,L.tilesVert=1,M.essentialProperties&&M.essentialProperties.forEach(H=>{if(U.A.THUMBNAILS_SCHEME_ID_URIS.indexOf(H.schemeIdUri)>=0&&H.value){const w=H.value.split("x");w.length!==2||isNaN(w[0])||isNaN(w[1])||(L.tilesHor=parseInt(w[0],10),L.tilesVert=parseInt(w[1],10))}}),J?D.updateSegmentData(M).then(H=>{(function(w,O,x){let G=[];const W=(function(ie,oe){const Ae=[];let ke,Ie,be,me,Oe=0;for(ke=0,Ie=ie.segments.length;ke<Ie;ke++)be=ie.segments[ke],me=Yi({durationInTimescale:be.duration,fTimescale:be.timescale,index:Oe,isDynamic:t.getIsDynamic(),mediaRange:be.mediaRange,mediaTime:be.startTime,mediaUrl:be.media,representation:oe,timelineConverter:c}),me&&(Ae.push(me),me=null,Oe++);return Ae})(x,O);O.segments=W,O.fragmentDuration=O.segmentDuration||(O.segments&&O.segments.length>0?O.segments[0].duration:NaN),w.segmentDuration=O.segments[0].duration,w.readThumbnail=function(ie,oe){let Ae=null;G.some(ke=>{if(ke.start<=ie&&ke.end>ie)return Ae=ke.url,!0}),Ae?oe(Ae):O.segments.some(ke=>{if(ke.mediaStartTime<=ie&&ke.mediaStartTime+ke.duration>ie){const Ie=i.resolve(O.path),be=new is.A({method:"get",url:Ie.url,responseType:"arraybuffer",customData:{request:{range:ke.mediaRange},onloadend:function(Oe){let Ke=B.getSamplesInfo(Oe.target.response),le=new Blob([Oe.target.response.slice(Ke.sampleList[0].offset,Ke.sampleList[0].offset+Ke.sampleList[0].size)],{type:"image/jpeg"}),fe=window.URL.createObjectURL(le);G.push({start:ke.mediaStartTime,end:ke.mediaStartTime+ke.duration,url:fe}),oe&&oe(fe)}}}),me=new os.A({request:be});return $.load(be,me),!0}})}})(L,M,H)}):(L.startNumber=M.startNumber,L.segmentDuration=M.segmentDuration,L.timescale=M.timescale,L.templateUrl=(function(H){const w=I.isRelative(H.media)?I.resolve(H.media,i.resolve(H.path).url):H.media;return w?gi(w,H.id):""})(M)),L.tilesHor>0&&L.tilesVert>0&&(L.widthPerTile=L.width/L.tilesHor,L.heightPerTile=L.height/L.tilesVert,d.push(L))}function te(){d=[],N=[],q=-1,k=null,v&&(v.reset(),v=null)}return h={addTracks:function(){if(!r||!t||(k=t.getMediaInfoForType(r,U.A.IMAGE),!k))return;const M=t.getVoRepresentations(k);M&&M.length>0&&M.forEach(J=>{(J.segmentInfoType===Fe.A.SEGMENT_TEMPLATE&&J.segmentDuration>0&&J.media||J.segmentInfoType===Fe.A.SEGMENT_TIMELINE)&&ee(J),J.segmentInfoType===Fe.A.SEGMENT_BASE&&ee(J,!0),N.push(J)}),d.length>0&&d.sort((J,L)=>J.bitrate-L.bitrate)},getCurrentTrack:function(){return q<0?null:d[q]},getCurrentTrackIndex:function(){return q},getRepresentations:function(){return N},getThumbnailRequestForTime:function(M){let J;const L=t.getVoRepresentations(k);for(let H=0;H<L.length;H++)if(d[q].id===L[H].id){J=L[H];break}return v.getSegmentRequestForTime(k,J,M)},getTracks:function(){return d},reset:te,setTrackById:function(M){if(!d||d.length===0)return;const J=d.findIndex(L=>L.id===M);J!==-1&&(q=J)},setTrackByIndex:function(M){d&&d.length!==0&&(M>=d.length&&(M=d.length-1),q=M)}},te(),$=(0,rs.A)(e).create({}),B=An(e).getInstance(),D=ts(e).create({events:l,eventBus:p,streamInfo:r,timelineConverter:c,dashConstants:_,dashMetrics:n.dashMetrics,segmentBaseController:n.segmentBaseController,type:U.A.IMAGE}),v=$o(e).create({streamInfo:r,type:U.A.IMAGE,timelineConverter:c,segmentsController:D,baseURLController:i,debug:A,eventBus:p,events:l,dashConstants:_,urlUtils:I}),v.initialize(!!t&&t.getIsDynamic()),h}ss.__dashjs_factory_name="ThumbnailTracks";var ul=o.A.getClassFactory(ss);function as(n){const e=this.context,t=n.streamInfo;let i,r;function c(p){r.setTrackByIndex(p)}function A(){r&&r.reset()}return i={getCurrentTrack:function(){return r.getCurrentTrack()},getCurrentTrackIndex:function(){return r.getCurrentTrackIndex()},getPossibleVoRepresentations:function(){return r.getRepresentations()},getStreamId:function(){return t.id},initialize:function(){r.addTracks();const p=r.getTracks();p&&p.length>0&&c(0)},provide:function(p,l){if(typeof l!="function")return;const _=r.getCurrentTrack();let I,h;if(!_||_.segmentDuration<=0||p==null)return void l(null);h=r.getThumbnailRequestForTime(p),h&&(_.segmentDuration=h.duration),I=p%_.segmentDuration;const d=Math.floor(I*_.tilesHor*_.tilesVert/_.segmentDuration),N=new al;if(N.width=Math.floor(_.widthPerTile),N.height=Math.floor(_.heightPerTile),N.x=Math.floor(d%_.tilesHor)*_.widthPerTile,N.y=Math.floor(d/_.tilesHor)*_.heightPerTile,"readThumbnail"in _)return _.readThumbnail(p,v=>{N.url=v,l(N)});if(h)N.url=h.url,_.segmentDuration=NaN;else{const v=Math.floor(p/_.segmentDuration);N.url=(function(q,k){const D=k+q.startNumber;return gi(q.templateUrl,void 0,D,void 0,q.bandwidth,(D-1)*q.segmentDuration*q.timescale)})(_,v)}l(N)},reset:A,setTrackByIndex:c,setTrackById:function(p){r.setTrackById(p)}},A(),r=ul(e).create({streamInfo:t,adapter:n.adapter,baseURLController:n.baseURLController,timelineConverter:n.timelineConverter,debug:n.debug,eventBus:n.eventBus,events:n.events,dashConstants:n.dashConstants,dashMetrics:n.dashMetrics,segmentBaseController:n.segmentBaseController}),i}as.__dashjs_factory_name="ThumbnailController";var cl=o.A.getClassFactory(as);const dl=[U.A.VIDEO,U.A.AUDIO,U.A.TEXT,U.A.MUXED,U.A.IMAGE];function ls(n){n=n||{};const e=this.context,t=(0,m.A)(e).getInstance(),i=(0,ln.A)(e).getInstance(),r=n.manifestModel,c=n.mediaPlayerModel,A=n.dashMetrics,p=n.manifestUpdater,l=n.adapter,_=n.timelineConverter,I=n.capabilities,h=n.errHandler,d=n.abrController,N=n.playbackController,v=n.throughputController,q=n.eventController,k=n.mediaController,D=n.protectionController,$=n.textController,B=n.videoModel;let ee=n.streamInfo;const te=n.settings;let M,J,L,H,w,O,x,G,W,ie,oe,Ae,ke,Ie,be,me;function Oe(ht,xe,Qe){return new Promise((at,St)=>{We(),gt();let ut=B.getElement();const xt=[];dl.forEach(en=>{if((en!==U.A.TEXT||ht)&&(en!==U.A.VIDEO||!ut||ut&&/^VIDEO$/i.test(ut.nodeName))){const an=Qe.find(In=>In.mediaInfo.type===en);xt.push(Ke(en,ht,an))}}),Promise.all(xt).then(()=>(function(en,an){return new Promise(In=>{const On={},Gn=Ie.map($n=>{const nr=$n.getRepresentation(),Jn=an.find(jn=>jn.mediaInfo.type===nr.mediaInfo.type);return $n.createBufferSinks(en,Jn)});Promise.all(Gn).then($n=>{$n.forEach(nr=>{nr&&(On[nr.getType()]=nr)}),In(On)}).catch(()=>{In(On)})})})(xe,Qe)).then(en=>{if(Ie.length===0){const an="No streams to play.";h.error(new Hn.A(f.A.MANIFEST_ERROR_ID_NOSTREAMS_CODE,an,r.getValue())),oe.fatal(an)}else Ht();ht&&$.createTracks(ee),at(en)}).catch(en=>{St(en)})})}function Ke(ht,xe,Qe){let at,St=l.getAllMediaInfoForType(ee,ht),ut=[],xt=null,en=-1;if(!St||St.length===0)return oe.info("No "+ht+" data."),Promise.resolve();ht===U.A.VIDEO&&(O=!0),ht===U.A.AUDIO&&(H=!0);for(let In=0,On=St.length;In<On;In++)xt=St[In],ht===U.A.TEXT&&xt.isEmbedded&&($.addEmbeddedTrack(ee,xt),ut.push(xt)),le(xt)&&k.addTrack(xt),xt.type===U.A.ENHANCEMENT&&(en=In);if(ut.length>0&&(k.setInitialMediaSettingsForType(ht,ee),$.addMediaInfosToBuffer(ee,ht,ut)),St=St.filter(In=>!In.isEmbedded),St.length===0)return Promise.resolve();if(ht===U.A.IMAGE)return be=cl(e).create({streamInfo:ee,adapter:l,baseURLController:n.baseURLController,timelineConverter:n.timelineConverter,debug:J,eventBus:t,events:F.A,dashConstants:Fe.A,dashMetrics:n.dashMetrics,segmentBaseController:n.segmentBaseController}),be.initialize(),Promise.resolve();t.trigger(F.A.STREAM_INITIALIZING,{streamInfo:ee,mediaInfo:xt}),k.setInitialMediaSettingsForType(ht,ee);let an=fe(St,xe,ht);if(en>=0){let In=new Va(t);In.open(),In.duration=ee.manifestInfo.duration;let On=fe(St,In,U.A.ENHANCEMENT);On.selectMediaInfo(new Fr({newMediaInfo:St[en]})),an.setEnhancementStreamProcessor(On)}if(at=k.getCurrentTrackFor(ht,ee.id),at){const In=ht===U.A.TEXT&&at.isEmbedded?St[0]:at,On=new Fr({newMediaInfo:In,previouslySelectedRepresentation:Qe});return an.selectMediaInfo(On)}return Promise.resolve()}function le(ht){const xe=ht?ht.type:null;let Qe;return xe===U.A.MUXED?(Qe="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",oe.fatal(Qe),h.error(new Hn.A(f.A.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,Qe,r.getValue())),!1):!(xe!==U.A.TEXT&&xe!==U.A.IMAGE&&ht.contentProtection&&ht.contentProtection.length>0&&!I.supportsEncryptedMedia()&&(h.error(new Hn.A(f.A.CAPABILITY_MEDIAKEYS_ERROR_CODE,f.A.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE)),1))}function fe(ht,xe,Qe){const at=ht&&ht.length>0?ht.filter(In=>In.type===Qe)[0]:null;let St=L.getModel(at?at.type:null);const ut=at?at.type:null,xt=at?at.mimeType:null,en=at?at.isFragmented:null;let an=sl(e).create({abrController:d,adapter:l,baseURLController:n.baseURLController,boxParser:M,capabilities:I,dashMetrics:n.dashMetrics,errHandler:h,fragmentModel:St,getBufferedEndForType:Fn,manifestModel:r,mediaController:k,mediaPlayerModel:c,mimeType:xt,playbackController:N,segmentBaseController:n.segmentBaseController,segmentBlacklistController:ke,settings:te,streamInfo:ee,textController:$,throughputController:v,timelineConverter:_,type:ut});return an.initialize(xe,O,en),Ie.push(an),an.setMediaInfoArray(ht),ut===U.A.TEXT&&$.addMediaInfosToBuffer(ee,ut,ht,St),an}function pe(ht){let xe=Ie?Ie.length:0;for(let Qe=0;Qe<xe;Qe++){let at=Ie[Qe].getFragmentModel();at.abortRequests(),at.resetInitialSettings(),Ie[Qe].reset(!1,ht)}$&&$.deactivateStream(ee),be&&(be.reset(),be=null),Ie=[],G=!1,w=!1,rn(!1),$e(!1),t.trigger(F.A.STREAM_DEACTIVATED,{streamInfo:ee})}function ze(ht){pe(ht),ie=!1,O=!1,H=!1,W=!1,me=[]}function $e(ht){W=ht}function ot(){return ee?ee.start:NaN}function Se(){return ee?ee.id:null}function We(){if(!B||!d)throw new Error(U.A.MISSING_CONFIG_ERROR)}function rt(ht){ht.error&&(h.error(ht.error),oe.fatal(ht.error.message))}function gt(){if(q){const ht=l.getEventsFor(ee);ht&&ht.length>0&&q.addInlineEvents(ht,ee.id)}}function Ot(ht){let xe=zt(ht);return xe?xe.getMediaInfo():null}function zt(ht){return ht?Ie.find(xe=>xe.getType()===ht):null}function Wt(){let ht=wt();const xe=ht.length;if(xe!==0){for(let Qe=0;Qe<xe;Qe++)if(!ht[Qe].isBufferingCompleted()&&(ht[Qe].getType()===U.A.AUDIO||ht[Qe].getType()===U.A.VIDEO))return void oe.debug("onBufferingCompleted - One streamProcessor has finished but",ht[Qe].getType(),"one is not buffering completed");oe.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),w=!0,t.trigger(F.A.STREAM_BUFFERING_COMPLETED,{streamInfo:ee},{streamInfo:ee})}else oe.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function Qt(ht){q&&q.addInbandEvents(ht.events,ee.id)}function fn(){Ht()}function En(){gt()}function bn(ht){return ht&&ht.type?et(ht.type):null}function Fn(ht){const xe=et(ht),Qe=xe?xe.getBuffer():null,at=Qe?Qe.getAllBufferRanges():null,St=xe?xe.getBufferingTime():NaN;return isNaN(St)?NaN:(function(ut,xt){let en=NaN;if(!ut)return en;for(let an=0;an<ut.length;an++)ut.start(an)<xt&&(en=Math.min(ut.end(an),xt));return en})(at,St)}function et(ht){return ht?wt().filter(function(xe){return xe.getType()===ht})[0]:null}function wt(){let ht,xe,Qe=[];for(let at=0;at<Ie.length;at++)xe=Ie[at],ht=xe.getType(),ht!==U.A.AUDIO&&ht!==U.A.VIDEO&&ht!==U.A.TEXT&&ht!==U.A.ENHANCEMENT||Qe.push(xe);return Qe}function Rt(){const ht=Ie.length;for(let xe=0;xe<ht&&Ie[xe];xe++)Ie[xe].getScheduleController().startScheduleTimer()}function Ht(){const ht=Ie.length;if(D){D.clearMediaInfoArray();for(let xe=0;xe<ht&&Ie[xe];xe++){const Qe=Ie[xe].getType(),at=Ie[xe].getMediaInfo();if(Qe===U.A.AUDIO||Qe===U.A.VIDEO||Qe===U.A.TEXT&&at&&at.isFragmented){let St=Ie[xe].getMediaInfo();St&&D.initializeForMedia(St)}}D.handleKeySystemFromManifest()}ie||(ie=!0,B.waitForReadyState(U.A.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,()=>{t.trigger(F.A.STREAM_INITIALIZED,{streamInfo:ee})}))}function rn(ht){Ae=ht}function Rn(){return Ae}return x={activate:function(ht,xe,Qe=[]){return new Promise((at,St)=>{if(!G)return Rn()?(G=!0,t.trigger(F.A.STREAM_ACTIVATED,{streamInfo:ee}),void at()):void(function(ut,xt,en=[]){return Oe(ut,xt,en)})(ht,xe,Qe).then(()=>{G=!0,Qe&&Qe.length>0&&Rt(),t.trigger(F.A.STREAM_ACTIVATED,{streamInfo:ee}),at()}).catch(ut=>{St(ut)});at()})},checkAndHandleCompletedBuffering:function(){w||Ie.forEach(ht=>{ht.checkAndHandleCompletedBuffering()})},deactivate:pe,getAdapter:function(){return l},getCurrentMediaInfoForType:function(ht){const xe=et(ht);return xe?xe.getMediaInfo():null},getCurrentRepresentationForType:function(ht){const xe=et(ht);return xe?xe.getRepresentation():null},getDuration:function(){return ee?ee.duration:NaN},getHasAudioTrack:function(){return H},getHasFinishedBuffering:function(){return w},getHasVideoTrack:function(){return O},getId:Se,getIsActive:function(){return G},getIsEndedEventSignaled:function(){return W},getPreloaded:Rn,getRepresentationForTypeById:function(ht,xe){let Qe;if(ht===U.A.IMAGE){if(!be)return null;Qe=be.getPossibleVoRepresentations()}else Qe=(function(St){let ut=zt(St);return ut?ut.getAllMediaInfos():[]})(ht).flatMap(St=>d.getPossibleVoRepresentationsFilteredBySettings(St,!0));if(!Qe||Qe.length===0)return null;const at=Qe.filter(St=>St.id===xe);return at&&at.length>0?at[0]:null},getRepresentationForTypeByIndex:function(ht,xe){let Qe;if(ht===U.A.IMAGE){if(!be)return null;Qe=be.getPossibleVoRepresentations()}else{const at=Ot(ht);Qe=d.getPossibleVoRepresentationsFilteredBySettings(at,!0)}return Qe[xe=Math.max(Math.min(xe,Qe.length-1),0)]},getRepresentationsByType:function(ht,xe=!0){if(We(),ht===U.A.IMAGE)return be?be.getPossibleVoRepresentations():[];const Qe=Ot(ht);return xe?d.getPossibleVoRepresentationsFilteredBySettings(Qe,!0):d.getPossibleVoRepresentations(Qe,!0)},getStartTime:ot,getStreamId:function(){return ee?ee.id:null},getStreamInfo:function(){return ee},getStreamProcessors:wt,getThumbnailController:function(){return be},initialize:function(){ke.initialize(),t.on(F.A.BUFFERING_COMPLETED,Wt,x),t.on(F.A.INBAND_EVENTS,Qt,x),t.on(F.A.DATA_UPDATE_COMPLETED,fn,x),t.on(u.A.PLAYBACK_SEEKED,En,x),D&&(t.on(F.A.KEY_ERROR,rt,x),t.on(F.A.SERVER_CERTIFICATE_UPDATED,rt,x),t.on(F.A.LICENSE_REQUEST_COMPLETE,rt,x),t.on(F.A.KEY_SYSTEM_SELECTED,rt,x),t.on(F.A.KEY_SESSION_CREATED,rt,x)),$.initializeForStream(ee),t.trigger(F.A.STREAM_UPDATED,{streamInfo:ee})},initializeForTextWithMediaSource:function(ht){return new Promise((xe,Qe)=>{Ke(U.A.TEXT,ht,null).then(()=>(function(){const at=et(U.A.TEXT);return at?at.createBufferSinks():Promise.resolve()})()).then(()=>{$.createTracks(ee),xe()}).catch(at=>{Qe(at)})})},prepareQualityChange:function(ht){const xe=et(ht.mediaType);xe&&xe.prepareQualityChange(ht)},prepareTrackChange:function(ht){if(!G||!ee)return;w=!1;let xe=ht.newMediaInfo,Qe=r.getValue(),at=bn(xe);if(!at)return;let St=N.getTime();if(oe.info("Stream - Process track changed at current time "+St),Qe.refreshManifestOnSwitchTrack)me.push(ht),p.getIsUpdating()||(oe.debug("Stream - Refreshing manifest for switch track"),p.refreshManifest());else{at.clearScheduleTimer(),at.setTrackSwitchInProgress(!0);const ut=at.getRepresentation();at.selectMediaInfo(new Fr({newMediaInfo:xe})).then(()=>{const xt=!!(ht&&ht.options&&ht.options.hasOwnProperty("replaceBuffer"))&&ht.options.replaceBuffer;return at.prepareTrackSwitch(ut,xt)}).then(()=>{at.setTrackSwitchInProgress(!1)})}},reset:function(ht){L&&(L.reset(),L=null),d&&ee&&d.clearDataForStream(ee.id),ke&&(ke.reset(),ke=null),$&&ee&&$.clearDataForStream(ee.id),k&&ee&&k.clearDataForStream(ee.id),ze(ht),ee=null,t.off(F.A.BUFFERING_COMPLETED,Wt,x),t.off(F.A.INBAND_EVENTS,Qt,x),t.off(F.A.DATA_UPDATE_COMPLETED,fn,x),t.off(u.A.PLAYBACK_SEEKED,En,x),D&&(t.off(F.A.KEY_ERROR,rt,x),t.off(F.A.SERVER_CERTIFICATE_UPDATED,rt,x),t.off(F.A.LICENSE_REQUEST_COMPLETE,rt,x),t.off(F.A.KEY_SYSTEM_SELECTED,rt,x),t.off(F.A.KEY_SESSION_CREATED,rt,x))},setIsEndedEventSignaled:$e,setMediaSource:function(ht){return new Promise((xe,Qe)=>{const at=[];for(let St=0;St<Ie.length;)le(Ie[St].getMediaInfo())?(at.push(Ie[St].setMediaSource(ht)),St++):(Ie[St].reset(),Ie.splice(St,1));Promise.all(at).then(()=>{for(let St=0;St<Ie.length;St++)Ie[St].dischargePreBuffer();if(Ie.length===0){const St="No streams to play.";h.error(new Hn.A(f.A.MANIFEST_ERROR_ID_NOSTREAMS_CODE,St+"nostreams",r.getValue())),oe.fatal(St)}xe()}).catch(St=>{oe.error(St),Qe(St)})})},startPreloading:function(ht,xe,Qe=[]){return new Promise((at,St)=>{Rn()?St():(oe.info(`[startPreloading] Preloading next stream with id ${Se()}`),rn(!0),Oe(ht,xe,Qe).then(()=>{for(let ut=0;ut<Ie.length&&Ie[ut];ut++)Ie[ut].setExplicitBufferingTime(ot()),Ie[ut].getScheduleController().startScheduleTimer();at()}).catch(()=>{rn(!1),St()}))})},startScheduleControllers:Rt,triggerProtectionError:function(ht){rt(ht)},updateData:function(ht){return new Promise(xe=>{ee=ht,q&&gt();let Qe,at=[];for(let St=0,ut=Ie.length;St<ut;St++){let xt=Ie[St];const en=xt.getMediaInfo();at.push(xt.updateStreamInfo(ee));let an=l.getAllMediaInfoForType(ee,xt.getType());if(an=an.filter(In=>!In.isEmbedded),xt.setMediaInfoArray(an),an)for(let In=0;In<an.length;In++)l.areMediaInfosEqual(en,an[In])&&at.push(xt.selectMediaInfo(new Fr({newMediaInfo:an[In]})))}Promise.all(at).then(()=>{let St=[];for(;me.length>0;){let ut=me.pop(),xt=ut.newMediaInfo;if(Qe=bn(ut.oldMediaInfo),!Qe)return;const en=Qe.getRepresentation();Qe.setTrackSwitchInProgress(!0),St.push(Qe.prepareTrackSwitch(en)),St.push(Qe.selectMediaInfo(new Fr({newMediaInfo:xt})))}return Promise.all(St)}).then(()=>{Ht(),Qe&&Qe.setTrackSwitchInProgress(!1),t.trigger(F.A.STREAM_UPDATED,{streamInfo:ee}),xe()}).catch(St=>{h.error(St)})})}},(function(){try{J=(0,j.A)(e).getInstance(),oe=J.getLogger(x),ze(),M=An(e).getInstance(),ke=ir(e).create({updateEventName:F.A.SEGMENT_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:F.A.SEGMENT_LOCATION_BLACKLIST_ADD,enableExpiry:!1}),L=Wa(e).create({streamInfo:ee,mediaPlayerModel:c,dashMetrics:A,errHandler:h,settings:te,boxParser:M,dashConstants:Fe.A,urlUtils:i})}catch(ht){throw ht}})(),x}ls.__dashjs_factory_name="Stream";var fl=o.A.getClassFactory(ls);function Vi(){const n=this.context,e=(0,m.A)(n).getInstance(),t=(0,ln.A)(n).getInstance();let i,r,c,A,p,l,_,I,h,d,N,v,q,k,D,$;function B(){I=[],h=[],d=null,N=null,q=null,v=NaN,c=!1,A=!1,k=p.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function ee(){p.get().streaming.utcSynchronization.enabled&&!c&&!A&&q&&q.value&&q.schemeIdUri&&!isNaN(v)&&!isNaN(p.get().streaming.utcSynchronization.backgroundAttempts)&&(N&&(Date.now()-N)/1e3<30||(I=[],A=!0,te(isNaN(p.get().streaming.utcSynchronization.backgroundAttempts)?2:p.get().streaming.utcSynchronization.backgroundAttempts)))}function te(Ie){try{if(Ie<=0)return void Ae();const be=Date.now();l[q.schemeIdUri](q.value,function(me){const Oe=Date.now(),Ke=J(be,Oe,me);I.push(Ke),te(Ie-1)},function(){Ae()})}catch{Ae()}}function M(Ie=null){let be=Ie||0;if(!h||h.length===0||be>=h.length)return void L();let me=h[be];if(me)if(l.hasOwnProperty(me.schemeIdUri)){const Oe=new Date().getTime();l[me.schemeIdUri](me.value,function(Ke){const le=new Date().getTime(),fe=J(Oe,le,Ke);q=me,L(fe)},function(){M(be+1)})}else M(be+1);else L()}function J(Ie,be,me){return me-(be-(be-Ie)/2)}function L(Ie=NaN){let be=isNaN(Ie);be&&p.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?(function(){let me=_.getLatestMPDRequestHeaderValueByID("Date"),Oe=me!==null?new Date(me).getTime():Number.NaN;isNaN(Oe)?oe(!0):oe(!1,Oe-Date.now())})():oe(be,Ie)}function H(Ie){let be=(function(me){let Oe,Ke,le=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2}):?([0-9]{2}))?/.exec(me);return le?(Oe=Date.UTC(parseInt(le[1],10),parseInt(le[2],10)-1,parseInt(le[3],10),parseInt(le[4],10),parseInt(le[5],10),le[6]&&parseInt(le[6],10)||0,le[7]&&1e3*parseFloat(le[7])||0),le[9]&&le[10]&&(Ke=60*parseInt(le[9],10)+parseInt(le[10],10),Oe+=(le[8]==="+"?-1:1)*Ke*60*1e3),new Date(Oe).getTime()):NaN})(Ie);return isNaN(be)&&(be=Date.parse(Ie)),be}function w(Ie){return H(Ie)}function O(Ie){return Date.parse(Ie)}function x(Ie,be,me){me()}function G(Ie,be,me){let Oe=H(Ie);isNaN(Oe)?me():be(Oe)}function W(Ie,be,me,Oe,Ke){let le,fe,pe=!1,ze=new XMLHttpRequest,$e=Ke?Ee.G.HEAD:Ee.G.GET,ot=be.match(/\S+/g);if(be=ot.shift(),le=function(){pe||(pe=!0,ot.length?W(Ie,ot.join(" "),me,Oe,Ke):Oe())},fe=function(){let Se,We;ze.status===200&&(Se=Ke?ze.getResponseHeader("Date"):ze.response,We=Ie(Se),isNaN(We)||(me(We),pe=!0))},t.isRelative(be)){const Se=$.resolve();Se&&(be=t.resolve(be,Se.url))}ze.open($e,be),ze.timeout=5e3,ze.onload=fe,ze.onloadend=le,ze.send()}function ie(Ie,be,me){W(O,Ie,be,me,!0)}function oe(Ie,be){if(isNaN(v)||isNaN(be)||Ie||(function(Oe){try{const Ke=ke(Oe),le=isNaN(k)?30:k,fe=isNaN(p.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:p.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,pe=isNaN(p.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:p.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,ze=isNaN(p.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:p.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;let $e;Ke?($e=Math.min(le*fe,pe),r.debug(`Increasing timeBetweenSyncAttempts to ${$e}`)):($e=Math.max(le/fe,ze),r.debug(`Decreasing timeBetweenSyncAttempts to ${$e}`)),k=$e}catch{}})(be),!Ie&&!isNaN(be)){d=Date.now(),c=!1;const Oe=isNaN(v);v=be,Oe&&ee(),r.debug(`Completed UTC sync. Setting client - server offset to ${be}`)}Ie&&(q=null,c=!1,D.error(new Hn.A(f.A.TIME_SYNC_FAILED_ERROR_CODE,f.A.TIME_SYNC_FAILED_ERROR_MESSAGE)));const me=p.get().streaming.utcSynchronization.artificialTimeOffsetToApply;e.trigger(F.A.UPDATE_TIME_SYNC_OFFSET,{offset:be+me}),e.trigger(F.A.TIME_SYNCHRONIZATION_COMPLETED)}function Ae(){if(!I||I.length===0)return;const Ie=I.reduce((be,me)=>be+me,0)/I.length;ke(Ie)?r.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(r.debug(`Completed background UTC sync. Setting client - server offset to ${Ie}`),v=Ie,e.trigger(F.A.UPDATE_TIME_SYNC_OFFSET,{offset:v})),A=!1,N=Date.now()}function ke(Ie){try{if(isNaN(v))return!0;const be=p.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(p.get().streaming.utcSynchronization.maximumAllowedDrift)?p.get().streaming.utcSynchronization.maximumAllowedDrift:100;return Ie>=v-be&&Ie<=v+be}catch{return!0}}return i={initialize:function(){B(),l={"urn:mpeg:dash:utc:http-head:2014":ie,"urn:mpeg:dash:utc:http-xsdate:2014":W.bind(null,H),"urn:mpeg:dash:utc:http-iso:2014":W.bind(null,w),"urn:mpeg:dash:utc:direct:2014":G,"urn:mpeg:dash:utc:http-head:2012":ie,"urn:mpeg:dash:utc:http-xsdate:2012":W.bind(null,H),"urn:mpeg:dash:utc:http-iso:2012":W.bind(null,w),"urn:mpeg:dash:utc:direct:2012":G,"urn:mpeg:dash:utc:http-ntp:2014":x,"urn:mpeg:dash:utc:ntp:2014":x,"urn:mpeg:dash:utc:sntp:2014":x}},attemptSync:function(Ie,be){h=Ie,c||((function(me){try{if(!me||!p.get().streaming.utcSynchronization.enabled)return!1;const Oe=isNaN(k)?30:k;return!(d&&Oe&&!isNaN(Oe))||(Date.now()-d)/1e3>=Oe}catch{return!0}})(be)?(c=!0,M()):e.trigger(F.A.TIME_SYNCHRONIZATION_COMPLETED))},setConfig:function(Ie){Ie&&(Ie.dashMetrics&&(_=Ie.dashMetrics),Ie.baseURLController&&($=Ie.baseURLController),Ie.errHandler&&(D=Ie.errHandler),Ie.settings&&(p=Ie.settings))},reset:function(){B(),e.off(F.A.ATTEMPT_BACKGROUND_SYNC,ee,i)}},r=(0,j.A)(n).getInstance().getLogger(i),e.on(F.A.ATTEMPT_BACKGROUND_SYNC,ee,i),i}Vi.__dashjs_factory_name="TimeSyncController";const Ki=o.A.getSingletonFactory(Vi);Ki.HTTP_TIMEOUT_MS=5e3,o.A.updateSingletonFactory(Vi.__dashjs_factory_name,Ki);var gl=Ki;function us(){let n,e,t,i,r;const c=this.context,A=(0,m.A)(c).getInstance();return n={attachMediaSource:function(p){let l=window.URL.createObjectURL(e);return p.setSource(l),i==="managedMediaSource"&&(p.setDisableRemotePlayback(!0),e.addEventListener("startstreaming",()=>{A.trigger(u.A.MANAGED_MEDIA_SOURCE_START_STREAMING)}),e.addEventListener("endstreaming",()=>{A.trigger(u.A.MANAGED_MEDIA_SOURCE_END_STREAMING)})),l},clearSeekableRange:function(){e&&typeof e.clearLiveSeekableRange=="function"&&e.readyState==="open"&&e.clearLiveSeekableRange()},createMediaSource:function(){let p="WebKitMediaSource"in window,l="MediaSource"in window;return"ManagedMediaSource"in window?(e=new ManagedMediaSource,i="managedMediaSource",r.info("Created ManagedMediaSource")):l?(e=new MediaSource,i="mediaSource",r.info("Created MediaSource")):p&&(e=new WebKitMediaSource,r.info("Created WebkitMediaSource")),e},detachMediaSource:function(p){p.setSource(null)},setConfig:function(p){p&&p.settings&&(t=p.settings)},setDuration:function p(l){if(e&&e.readyState==="open"&&l!==null&&!isNaN(l)&&e.duration!==l)if(l!==1/0||t.get().streaming.buffer.mediaSourceDurationInfinity||(l=Math.pow(2,32)),(function(_){let I=_.sourceBuffers;for(let h=0;h<I.length;h++)if(I[h].updating)return!0;return!1})(e))setTimeout(p.bind(null,l),50);else{const _=(function(I){let h=NaN;const d=I.sourceBuffers;for(let N=0;N<d.length;N++){const v=d[N].buffered;if(v&&v.length>0){const q=v.end(v.length-1);(isNaN(h)||q>h)&&(h=q)}}return h})(e);_>l&&(l=_),r.info("Set MediaSource duration:"+l),e.duration=l}},setSeekable:function(p,l){e&&typeof e.setLiveSeekableRange=="function"&&typeof e.clearLiveSeekableRange=="function"&&e.readyState==="open"&&p>=0&&p<l&&(e.clearLiveSeekableRange(),e.setLiveSeekableRange(p,l))},signalEndOfStream:function(p){if(!p||p.readyState!=="open")return void r.debug(`signalEndOfStream: not applicable, MediaSource readyState is ${p?p.readyState:"unavailable"}`);let l=p.sourceBuffers;for(let _=0;_<l.length;_++){if(l[_].updating)return void r.debug("signalEndOfStream: not applicable, a SourceBuffer is still updating");if(l[_].buffered.length===0)return void r.debug("signalEndOfStream: not applicable, a SourceBuffer holds no data")}r.info("call to mediaSource endOfStream"),p.endOfStream()}},r=(0,j.A)(c).getInstance().getLogger(n),n}us.__dashjs_factory_name="MediaSourceController";var hl=o.A.getSingletonFactory(us);function cs(){const n="urn:mpeg:dash:event:2012",e="updated",t="added";function i(x){for(const G in x)if(Object.prototype.hasOwnProperty.call(x,G))return!1;return!0}const r=this.context,c=(0,m.A)(r).getInstance();let A,p,l,_,I,h,d,N,v,q,k;function D(){if(!d||!N)throw new Error("setConfig function has to be called previously")}function $(){k=!1,l={},_={},I=null,q=!1,h=Date.now()/1e3}function B(){try{if(!q){q=!0;const x=N.getTime();let G=x-h;G=h>0?Math.max(0,G):0,ee(_,G,x),ee(l,G,x),te(_),te(l),h=x,q=!1}}catch(x){q=!1,p.error(x)}}function ee(x,G,W){try{H(x,function(ie){if(ie!==void 0){const oe=isNaN(ie.duration)?0:ie.duration;ie.calculatedPresentationTime<=W&&ie.calculatedPresentationTime+G+oe>=W?O(ie,u.A.EVENT_MODE_ON_START):(w(W,oe+G,ie.calculatedPresentationTime)||(function(Ae){try{const ke=Ae.eventStream.period.start+Ae.eventStream.period.duration;return Ae.calculatedPresentationTime>ke}catch(ke){return p.error(ke),!1}})(ie))&&(p.debug(`Removing event ${ie.id} from period ${ie.eventStream.period.id} as it is expired or invalid`),(function(Ae,ke){try{const Ie=ke.eventStream.schemeIdUri,be=ke.eventStream.period.id,me=ke.eventStream.value,Oe=ke.id;Ae[be][Ie]=Ae[be][Ie].filter(Ke=>me&&Ke.eventStream.value&&Ke.eventStream.value!==me||Ke.id!==Oe),Ae[be][Ie].length===0&&delete Ae[be][Ie]}catch(Ie){p.error(Ie)}})(x,ie))}})}catch(ie){p.error(ie)}}function te(x){try{for(const G in x)Object.prototype.hasOwnProperty.call(x,G)&&i(x[G])&&delete x[G]}catch(G){p.error(G)}}function M(x,G,W=!1){const ie=x.eventStream.schemeIdUri,oe=x.eventStream.value,Ae=x.id;let ke="discarded";G[ie]||(G[ie]=[]);const Ie=G[ie].findIndex(be=>(!oe||be.eventStream.value&&be.eventStream.value===oe)&&be.id===Ae);if(Ie===-1)G[ie].push(x),x.triggeredReceivedEvent=!1,x.triggeredStartEvent=!1,ke=t;else if(W){const be=G[ie][Ie];x.triggeredReceivedEvent=be.triggeredReceivedEvent,x.triggeredStartEvent=be.triggeredStartEvent,G[ie][Ie]=x,ke=e}return ke}function J(x){try{if(x.eventStream.value==1){const G=x.calculatedPresentationTime;let W;W=x.calculatedPresentationTime==4294967295?NaN:x.calculatedPresentationTime+x.duration,c.trigger(u.A.MANIFEST_VALIDITY_CHANGED,{id:x.id,validUntil:G,newDuration:W,newManifestValidAfter:NaN},{mode:u.A.EVENT_MODE_ON_START})}}catch(G){p.error(G)}}function L(x){try{const G=N.getTime();H(x,function(W){const ie=W.eventStream&&W.eventStream.period&&!isNaN(W.eventStream.period.duration)?W.eventStream.period.duration:NaN,oe=W.eventStream&&W.eventStream.period&&!isNaN(W.eventStream.period.start)?W.eventStream.period.start:NaN;if(isNaN(ie)||isNaN(oe))return;const Ae=W.calculatedPresentationTime;Math.abs(Ae-G)<300&&O(W,u.A.EVENT_MODE_ON_START)})}catch(G){p.error(G)}}function H(x,G){try{if(x)for(const W in x){const ie=x[W];for(const oe in ie){const Ae=ie[oe];for(let ke=0;ke<Ae.length;ke++){const Ie=Ae[ke];Ie!==void 0&&G(Ie)}}}}catch(W){p.error(W)}}function w(x,G,W){try{return x-G>W}catch(ie){return p.error(ie),!1}}function O(x,G){try{const W=N.getTime(),ie=x.id;if(G===u.A.EVENT_MODE_ON_RECEIVE&&!x.triggeredReceivedEvent)return p.debug(`Received event ${ie}`),x.triggeredReceivedEvent=!0,void c.trigger(x.eventStream.schemeIdUri,{event:x},{mode:G});x.triggeredStartEvent||(x.eventStream.schemeIdUri===n&&x.eventStream.value==1?x.duration===0&&x.presentationTimeDelta===0||(p.debug(`Starting manifest refresh event ${ie} at ${W}`),(function(){try{D(),d.refreshManifest()}catch(oe){p.error(oe)}})()):x.eventStream.schemeIdUri==="urn:mpeg:dash:event:callback:2015"&&x.eventStream.value==1?(p.debug(`Starting callback event ${ie} at ${W}`),(function(oe){try{let Ae=(0,rs.A)(r).create({});const ke=new is.A({method:"get",url:oe,responseType:"arraybuffer",customData:{}}),Ie=new os.A({request:ke});Ae.load(ke,Ie)}catch(Ae){p.error(Ae)}})(x.messageData instanceof Uint8Array?Xn.A.uint8ArrayToString(x.messageData):x.messageData)):(p.debug(`Starting event ${ie} from period ${x.eventStream.period.id} at ${W}`),c.trigger(x.eventStream.schemeIdUri,{event:x},{mode:G}),v.get().streaming.events.deleteEventMessageDataTimeout>-1&&setTimeout(()=>{delete x.messageData,delete x.parsedMessageData},v.get().streaming.events.deleteEventMessageDataTimeout)),x.triggeredStartEvent=!0)}catch(W){p.error(W)}}return A={addInlineEvents:function(x,G){try{if(D(),l[G]||(l[G]={}),x)for(let W=0;W<x.length;W++){let ie=x[W];if(!w(N.getTime(),isNaN(ie.duration)?0:ie.duration,ie.calculatedPresentationTime)){let oe=M(ie,l[G],!0);oe===t?(p.debug(`Added inline event with id ${ie.id} from period ${G}`),O(ie,u.A.EVENT_MODE_ON_RECEIVE)):oe===e&&p.debug(`Updated inline event with id ${ie.id} from period ${G}`)}}}catch(W){throw W}},addInbandEvents:function(x,G){try{D(),_[G]||(_[G]={});for(let W=0;W<x.length;W++){let ie=x[W];w(N.getTime(),isNaN(ie.duration)?0:ie.duration,ie.calculatedPresentationTime)||(M(ie,_[G],!1)===t?(ie.eventStream.schemeIdUri===n&&J(ie),p.debug(`Added inband event with id ${ie.id} from period ${G}`),O(ie,u.A.EVENT_MODE_ON_RECEIVE)):p.debug(`Inband event with scheme_id_uri ${ie.eventStream.schemeIdUri}, value ${ie.eventStream.value}, period id ${G} and event id ${ie.id} was ignored because it has been added before.`))}B()}catch(W){throw W}},getInbandEvents:function(){return _},getInlineEvents:function(){return l},start:function(){try{D(),p.debug("Start Event Controller");const x=v.get().streaming.events.eventControllerRefreshDelay;k||isNaN(x)||(k=!0,I=setInterval(B,x))}catch(x){throw x}},setConfig:function(x){try{if(!x)return;x.manifestUpdater&&(d=x.manifestUpdater),x.playbackController&&(N=x.playbackController),x.settings&&(v=x.settings)}catch(G){throw G}},reset:function(){(function(){try{I!==null&&k&&(clearInterval(I),I=null,k=!1,(function(){try{L(_),L(l)}catch(x){p.error(x)}})())}catch(x){throw x}})(),$()}},p=(0,j.A)(r).getInstance().getLogger(A),$(),A}cs.__dashjs_factory_name="EventController";var pl=o.A.getSingletonFactory(cs),si={LEVELS:{WARNING:"Warning",ERROR:"Error"},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:"NO_UTC_TIMING_ELEMENT",message:"No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/"},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:"NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE",message:'SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"'},INVALID_DVR_WINDOW:{key:"INVALID_DVR_WINDOW",message:"No valid segment found when applying a specification compliant DVR window calculation. Using SegmentTimeline entries as a fallback."}}},ml=C(5313),ds=C(445),fs=C(1923);function gs(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c,A,p,l,_,I,h,d,N,v,q,k,D,$,B,ee,te,M,J,L,H,w,O,x,G,W,ie,oe,Ae,ke,Ie,be,me,Oe,Ke,le,fe,pe,ze,$e,ot,Se,We,rt,gt,Ot;function zt(){if(!(p&&p.hasOwnProperty("load")&&J&&J.hasOwnProperty("initialize")&&J.hasOwnProperty("reset")&&J.hasOwnProperty("getClientTimeOffset")&&l&&M&&I&&be))throw new Error(U.A.MISSING_CONFIG_ERROR)}function Wt(){(function(){try{const Xe=_.getStreamsInfo();if(!H&&Xe.length===0)throw new Error("There are no periods in the MPD");H&&Xe.length>0&&I.updateManifestUpdateInfo({currentTime:be.getTime(),buffered:Ie.getBufferRange(),presentationStartTime:Xe[0].start,clientTimeOffset:J.getClientTimeOffset()}),L.length>0&&(function(nn){nn.length!==0?L=L.filter(Tn=>{const Bn=nn.filter(kn=>kn.id===Tn.getId()).length>0||Tn.getId()===H.getId();return Bn||(i.debug(`Removing stream ${Tn.getId()}`),Tn.reset(!0),Tn=null),Bn}):i.warn("No periods included in the current manifest. Skipping the filtering of outdated stream objects.")})(Xe);const Mt=[];for(let nn=0,Tn=Xe.length;nn<Tn;nn++){const Bn=Xe[nn];Mt.push(En(Bn)),I.addManifestUpdateStreamInfo(Bn)}Promise.all(Mt).then(()=>new Promise((nn,Tn)=>{H?nn():bn(Xe,nn,Tn)})).then(()=>{e.trigger(F.A.STREAMS_COMPOSED),Ot&&!_.getIsDynamic()&&ke&&(Ot=!1,_n(),en(),h.clearSeekableRange()),jn()}).catch(nn=>{throw nn})}catch(Xe){M.error(new Hn.A(f.A.MANIFEST_ERROR_ID_NOSTREAMS_CODE,Xe.message+" nostreamscomposed",l.getValue())),Ae=!0,ai()}})()}function Qt(){Se=!0}function fn(){ot.get().streaming.ignoreFinalStaticManifestOnDynamicToStaticTransition||(Ot=!0)}function En(Xe){let Mt=wr(Xe.id);return Mt?Mt.updateData(Xe):(Mt=fl(n).create({manifestModel:l,mediaPlayerModel:Oe,dashMetrics:I,manifestUpdater:A,adapter:_,timelineConverter:J,capabilities:r,capabilitiesFilter:c,errHandler:M,baseURLController:v,segmentBaseController:q,textController:O,abrController:D,playbackController:be,throughputController:$,eventController:ee,mediaController:B,protectionController:w,videoModel:Ie,streamInfo:Xe,settings:ot}),L.push(Mt),Mt.initialize(),Promise.resolve())}function bn(Xe,Mt,nn){try{en();const Tn=I.getCurrentDVRInfo().range;if(Tn.end<Tn.start)return void(function(kn,Zn,xr,hi){We&&clearTimeout(We);const li=Math.min(1e3*(-1*(kn.end-kn.start)+2),2147483647);i.debug(`Waiting for ${li} ms before playback can start`),e.trigger(F.A.AST_IN_FUTURE,{delay:li}),We=setTimeout(()=>{bn(Zn,xr,hi)},li)})(Tn,Xe,Mt,nn);ot.get().streaming.applyProducerReferenceTime&&me.calculateProducerReferenceTimeOffsets(Xe);const Bn=Xe[0].manifestInfo;if(ot.get().streaming.applyServiceDescription&&me.applyServiceDescription(Bn),_.getIsDynamic()){const kn=_.getFragmentDurationForLiveDelayCalculation(Xe[Xe.length-1]);be.computeAndSetLiveDelay(kn,Bn)}(ot.get().streaming.applyContentSteering&&N.shouldQueryBeforeStart()?N.loadSteeringData():Promise.resolve()).then(()=>{const kn=l.getValue();kn&&v.update(kn),Fn(),Mt()}).catch(kn=>{i.error(kn),Fn(),Mt()})}catch(Tn){nn(Tn)}}function Fn(){const Xe={seekTime:vn()};let Mt=xt(Xe.seekTime);Mt||(Mt=ht(Xe));const nn=Xe.seekTime,Tn=Mt!==null?Mt:L[0];e.trigger(F.A.INITIAL_STREAM_SWITCH,{startTime:nn}),et(Tn,null,nn),or()}function et(Xe,Mt,nn){try{if(ie||!Xe||Mt===Xe&&Xe.getIsActive())return;ie=!0,e.trigger(F.A.PERIOD_SWITCH_STARTED,{fromStreamInfo:Mt?Mt.getStreamInfo():null,toStreamInfo:Xe.getStreamInfo()});let Tn=!1,Bn=[],kn=new Map;H=Xe,Mt&&(Tn=St(Xe,Mt),Tn&&(kn=rn(Mt)),Bn=Ht(Mt),Mt.deactivate(Tn)),nn=isNaN(nn)?!Tn&&Mt?Xe.getStreamInfo().start:NaN:nn,i.info(`Switch to stream ${Xe.getId()}. Seektime is ${nn}, current playback time is ${be.getTime()}. Seamless period switch is set to ${Tn}`),$e=$e.filter(Zn=>Zn.getId()!==H.getId()),be.initialize(sr(),!!Mt),Ie.getElement()?wt({seekTime:nn,keepBuffers:Tn,sourceBufferSinksFromPreviousPeriod:kn,streamActivated:!1,representationsFromPreviousPeriod:Bn}):Rt({seekTime:nn,keepBuffers:Tn,sourceBufferSinksFromPreviousPeriod:kn})}catch{ie=!1}}function wt(Xe){let Mt;function nn(){if(!ke||ke.readyState!=="open")return;i.debug("MediaSource is open!"),window.URL.revokeObjectURL(Mt),ke.removeEventListener("sourceopen",nn),ke.removeEventListener("webkitsourceopen",nn),_n();const Bn=I.getCurrentDVRInfo();h.setSeekable(Bn.range.start,Bn.range.end),Xe.streamActivated?(isNaN(Xe.seekTime)||be.seek(Xe.seekTime,!0,!0),H.setMediaSource(ke).then(()=>{H.initializeForTextWithMediaSource(ke)})):Rt(Xe)}function Tn(){ke.addEventListener("sourceopen",nn,!1),ke.addEventListener("webkitsourceopen",nn,!1),Mt=h.attachMediaSource(Ie),i.debug("MediaSource attached to element. Waiting on open...")}ke?Xe.keepBuffers?Rt(Xe):(h.detachMediaSource(Ie),Tn()):(ke=h.createMediaSource(),Tn())}function Rt(Xe){const Mt=Xe.representationsFromPreviousPeriod||[];H.activate(ke,Xe.sourceBufferSinksFromPreviousPeriod,Mt).then(()=>{isNaN(Xe.seekTime)||(e.trigger(F.A.SEEK_TARGET,{time:Xe.seekTime},{streamId:H.getId()}),be.seek(Xe.seekTime,!1,!0),H.startScheduleControllers()),ie=!1,e.trigger(F.A.PERIOD_SWITCH_COMPLETED,{toStreamInfo:sr()})})}function Ht(Xe){return(Xe?Xe.getStreamProcessors():[]).map(Mt=>Mt.getRepresentation())}function rn(Xe){const Mt=new Map;return Xe&&(Xe?Xe.getStreamProcessors():[]).forEach(nn=>{const Tn=nn.getBuffer();Tn&&Mt.set(Tn.getType(),Tn)}),Mt}function Rn(Xe){let Mt=xt(Xe.seekTime);Mt||(Mt=ht(Xe)),Mt&&Mt!==H?Mt&&Mt!==H&&(xe(Mt),(function(nn,Tn){const Bn=nn&&!isNaN(nn.seekTime)?nn.seekTime:NaN,kn=H.getStreamProcessors().map(Zn=>Zn.prepareOuterPeriodPlaybackSeeking(nn));Promise.all(kn).then(()=>{et(Tn,H,Bn)}).catch(Zn=>{M.error(Zn)})})(Xe,Mt)):(xe(),(function(nn){H.getStreamProcessors().forEach(Tn=>Tn.prepareInnerPeriodPlaybackSeeking(nn)),yr(lr.USER_REQUEST_STOP_REASON)})(Xe)),or(),_r(Vr.SEEK_START_REASON)}function ht(Xe){if(isNaN(Xe.seekTime)||L.length===0||_.getIsDynamic())return null;const Mt=L[L.length-1],nn=parseFloat((Mt.getStartTime()+Mt.getDuration()).toFixed(5));if(Xe.seekTime<nn)return null;const Tn=isNaN(ot.get().streaming.seekDurationBackoff)?0:ot.get().streaming.seekDurationBackoff;return Xe.seekTime=Math.max(Mt.getStartTime(),nn-Tn),be.seek(Xe.seekTime,!1,!0),Mt}function xe(Xe=null){Qe()}function Qe(){$e&&$e.length>0&&($e.forEach(Xe=>{Xe.deactivate(!0)}),$e=[])}function at(Xe){if(Xe.newMediaInfo.streamInfo.id===H.getId()){if(Qe(),ot.get().streaming.buffer.resetSourceBuffersForTrackSwitch&&Xe.oldMediaInfo&&Xe.oldMediaInfo.codec!==Xe.newMediaInfo.codec){const Mt=be.getTime();return H.deactivate(!1),void wt({seekTime:Mt,keepBuffers:!1,streamActivated:!1})}H.prepareTrackChange(Xe)}}function St(Xe,Mt){try{return ot.get().streaming.buffer.reuseExistingSourceBuffers&&(r.isProtectionCompatible(Mt.getStreamInfo(),Xe.getStreamInfo())||Se)&&r.supportsChangeType()&&ot.get().streaming.buffer.useChangeType}catch{return!1}}function ut(Xe,Mt=null){if(!ke||Xe.getPreloaded()||!St(Xe,Mt))return;const nn=Ht(Mt),Tn=rn(Mt);Xe.startPreloading(ke,Tn,nn).then(()=>{$e.push(Xe)})}function xt(Xe){if(isNaN(Xe))return null;const Mt=L.length;for(let nn=0;nn<Mt;nn++){const Tn=L[nn];if(Xe<parseFloat((Tn.getStartTime()+Tn.getDuration()).toFixed(5)))return Tn}return null}function en(){try{const Xe=_.getIsDynamic(),Mt=_.getStreamsInfo()[0].manifestInfo,nn=be.getTime(),Tn=J.calcTimeShiftBufferWindow(L,Xe),Bn=bt();if(Tn.start===void 0||Tn.end===void 0)return;Bn&&Bn.length!==0?Bn.forEach(kn=>{I.addDVRInfo(kn.getType(),nn,Mt,Tn)}):I.addDVRInfo(U.A.VIDEO,nn,Mt,Tn)}catch{}}function an(Xe){if(fe&&W){const Mt=Oe.getInitialBufferLevel(),nn=[U.A.TEXT];(isNaN(Mt)||Mt<=be.getBufferLevel(nn)||_.getIsDynamic()&&Mt>be.getLiveDelay())&&(fe=!1,_r(Vr.INITIAL_PLAYOUT_START_REASON),be.play())}Xe&&Xe.mediaType&&I.addBufferLevel(Xe.mediaType,new Date,1e3*Xe.bufferLevel)}function In(Xe){Xe.streamInfo.id===H.getId()&&Qe(),wr(Xe.streamInfo.id).prepareQualityChange(Xe)}function On(){if(_.getIsDynamic()&&be.getOriginalLiveDelay()!==0&&H){const Xe=H.getStreamInfo();if(Xe){const Mt=_.getFragmentDurationForLiveDelayCalculation(Xe);be.computeAndSetLiveDelay(Mt,Xe.manifestInfo)}}}function Gn(){if(ur()){const Xe=Ie.getPlaybackQuality();Xe&&I.addDroppedFrames(Xe)}}function $n(){i.debug("[onPlaybackStarted]"),!fe&&le&&_r(Vr.RESUME_FROM_PAUSE_START_REASON),fe&&(fe=!1),pe&&(pe=!1,ot.get().streaming.applyContentSteering&&!N.shouldQueryBeforeStart()&&N.loadSteeringData()),le=!1}function nr(Xe){i.debug("[onPlaybackPaused]"),Xe.ended||(le=!0,yr(lr.USER_REQUEST_STOP_REASON))}function Jn(Xe){i.debug(`Stream with id ${Xe.streamInfo.id} finished buffering`);const Mt=Xe.streamInfo.isLast;ke&&Mt?(i.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),h.signalEndOfStream(ke)):jn()}function jn(){if(!H)return;if(!H.getHasFinishedBuffering())return void H.checkAndHandleCompletedBuffering();const Xe=(function(nn=null){try{const Tn=nn||H||null;if(Tn){const Bn=Tn.getStreamInfo();return L.filter(function(kn){const Zn=kn.getStreamInfo();return Zn.start>Bn.start&&Bn.id!==Zn.id})}}catch{return[]}})(H);let Mt=0;for(;Mt<Xe.length;){const nn=Xe[Mt],Tn=Mt===0?H:Xe[Mt-1];!nn.getPreloaded()&&Tn.getHasFinishedBuffering()&&ut(nn,Tn),Mt+=1}}function or(){ze||(ze=setInterval(function(){!ie&&be.getTimeToStreamEnd()<=0&&!be.isSeeking()&&e.trigger(F.A.PLAYBACK_ENDED,{isLast:sr().isLast})},200))}function hr(){ze&&(clearInterval(ze),ze=null)}function bt(){return H?H.getStreamProcessors():[]}function tn(Xe){if(H&&!H.getIsEndedEventSignaled()){H.setIsEndedEventSignaled(!0);const Mt=(function(nn=null){const Tn=nn||H||null;if(!Tn)return null;const Bn=Tn.getStreamInfo(),kn=Bn.start;let Zn=0,xr=-1,hi=NaN;for(;Zn<L.length;){const li=L[Zn].getStreamInfo(),Wi=li.start-kn;Wi>0&&(isNaN(hi)||Wi<hi)&&Bn.id!==li.id&&(hi=Wi,xr=Zn),Zn+=1}return xr>=0?L[xr]:null})();Mt?(i.debug(`StreamController onEnded, found next stream with id ${Mt.getStreamInfo().id}. Switching from ${H.getStreamInfo().id} to ${Mt.getStreamInfo().id}`),et(Mt,H,NaN)):(i.debug("StreamController no next stream found"),H.setIsEndedEventSignaled(!1)),yr(Mt?lr.END_OF_PERIOD_STOP_REASON:lr.END_OF_CONTENT_STOP_REASON)}Xe&&Xe.isLast&&(hr(),N.stopSteeringRequestTimer())}function _n(Xe){const Mt=Xe||sr().manifestInfo.duration;h.setDuration(Mt)}function vn(){let Xe;return Xe=_.getIsDynamic()?(function(){let Mt;const nn=I.getCurrentDVRInfo();Mt=(nn&&nn.range?nn.range.end:0)-be.getOriginalLiveDelay();const Tn=nn?nn.range:null;if(Tn){if(isNaN(rt)&&rt.toString().indexOf("posix:")===-1){const kn=wn(!0);isNaN(kn)||(i.info(`Start time from URI parameters: ${kn}`),Mt=Math.min(Mt,kn))}else{i.info(`Start time provided by the app: ${rt}`);const kn=Nn(!0,rt);isNaN(kn)||(Mt=Math.min(Mt,kn))}const Bn=ot.get().streaming.timeShiftBuffer.calcFromSegmentTimeline?.1:0;Mt=Math.max(Mt,Tn.start+Bn)}return Mt})():(function(){let Mt=Kr()[0].getStreamInfo().start;if(isNaN(rt)){const nn=wn(!1);isNaN(nn)||(i.info(`Start time from URI parameters: ${nn}`),Mt=Math.max(Mt,nn))}else{i.info(`Start time provided by the app: ${rt}`);const nn=Nn(!1,rt);isNaN(nn)||(Mt=Math.max(Mt,nn))}return Mt})(),Xe}function wn(Xe){const Mt=k.getURIFragmentData();if(!Mt||!Mt.t)return NaN;const nn=Kr()[0].getStreamInfo().start;return Mt.t=Mt.t.split(",")[0],xn(Xe,Mt.t,nn)}function Nn(Xe,Mt){let nn=0;return Xe||(nn=Kr()[0].getStreamInfo().start),xn(Xe,Mt,nn)}function xn(Xe,Mt,nn){const Tn=_.getRegularPeriods()[0],Bn=Mt.toString(),kn=Bn.indexOf("posix:")!==-1?Bn.substring(6)==="now"?Date.now()/1e3:parseFloat(Bn.substring(6)):NaN;return Xe&&!isNaN(kn)?J.calcPresentationTimeFromWallTime(new Date(1e3*kn),Tn):parseFloat(Bn)+nn}function Vn(){const Xe=l.getValue();v.initialize(Xe)}function rr(Xe){if(Xe.error)Ae=!0,ai();else{i.info("Manifest updated... updating data system wide.");const Mt=Xe.manifest;_.updatePeriods(Mt),c.filterUnsupportedFeatures(Mt).then(()=>{v.initialize(Mt);let nn=_.getUTCTimingSources();!_.getIsDynamic()||nn&&nn.length!==0||e.trigger(u.A.CONFORMANCE_VIOLATION,{level:si.LEVELS.WARNING,event:si.EVENTS.NO_UTC_TIMING_ELEMENT});let Tn=_.getIsDynamic()?nn.concat(Ke.getUTCTimingSources()):nn;d.attemptSync(Tn,_.getIsDynamic()),G.createFinalQueryStrings(Mt)})}}function ur(){return!!H&&H.getHasVideoTrack()}function Nr(){return!!H&&H.getHasAudioTrack()}function yr(Xe,Mt){Mt=Mt||new Date,bt().forEach(nn=>{nn.finalisePlayList(Mt,Xe)}),I.addPlayList()}function _r(Xe){I.createPlaylistMetrics(1e3*be.getTime(),Xe)}function Er(Xe){w.updateKeyStatusesMap(Xe),(function(){const Mt=bt();let nn=!1;Mt.forEach(Tn=>{const Bn=Tn.getMediaInfo();!Bn||r.areKeyIdsUsable(Bn)?Bn&&r.areKeyIdsExpired(Bn)&&(function(kn){const Zn=wr(kn.getStreamId());Zn&&Zn.triggerProtectionError({error:new Hn.A(fs.A.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,fs.A.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)})})(Tn):(nn=!0,(function(kn){const Zn=kn.getAllMediaInfos().filter(xr=>r.areKeyIdsUsable(xr));if(!Zn||Zn.length===0){const xr=kn.getType();return void M.error(new Hn.A(f.A.NO_SUPPORTED_KEY_IDS,`Type: ${xr}: ${f.A.NO_SUPPORTED_KEY_IDS_MESSAGE}`))}B.setTrack(Zn[0],{replaceBuffer:!0})})(Tn))}),nn&&(be.getTime()===0?e.once(u.A.FRAGMENT_LOADING_COMPLETED,()=>{Ar()},t):be.isProgressing(500).then(Tn=>{Tn||Ar()}))})()}function Ar(){const Xe=be.getTime();be.seek(Xe+.01,!1,!1)}function pr(Xe){if(!Xe.error)return;let Mt;switch(Xe.error.code){case 1:Mt="MEDIA_ERR_ABORTED";break;case 2:Mt="MEDIA_ERR_NETWORK";break;case 3:Mt="MEDIA_ERR_DECODE",gt.counts.mediaErrorDecode+=1;break;case 4:Mt="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:Mt="MEDIA_ERR_ENCRYPTED";break;default:Mt="UNKNOWN"}Mt==="MEDIA_ERR_DECODE"&&ot.get().errors.recoverAttempts.mediaErrorDecode>=gt.counts.mediaErrorDecode?(function(){i.error("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");const nn=be.getTime();H.deactivate(!1),i.info(`MediaSource has been resetted. Resuming playback from time ${nn}`),wt({seekTime:nn,keepBuffers:!1,streamActivated:!1})})():(oe=!0,Xe.error.message&&(Mt+=" ("+Xe.error.message+")"),Xe.error.msExtendedCode&&(Mt+=" (0x"+(Xe.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),i.fatal("Video Element Error: "+Mt),Xe.error&&i.fatal(Xe.error),M.error(new Hn.A(Xe.error.code,Mt)),ai())}function sr(){return H?H.getStreamInfo():null}function wr(Xe){for(let Mt=0,nn=L.length;Mt<nn;Mt++)if(L[Mt].getId()===Xe)return L[Mt];return null}function Di(Xe){isNaN(Xe.newDuration)||_n(Xe.newDuration)}function Mi(){L=[],rt=NaN,w=null,ie=!1,H=null,oe=!1,Ae=!1,fe=!0,pe=!0,le=!1,W=!0,ze=null,Ot=!1,Se=!1,$e=[],We=null,gt={counts:{mediaErrorDecode:0}}}function ai(){zt(),d.reset(),yr(oe||Ae?lr.FAILURE_STOP_REASON:lr.USER_REQUEST_STOP_REASON);for(let Xe=0,Mt=L?L.length:0;Xe<Mt;Xe++)L[Xe].reset(oe);e.off(u.A.PLAYBACK_TIME_UPDATED,Gn,t),e.off(u.A.PLAYBACK_SEEKING,Rn,t),e.off(u.A.PLAYBACK_ERROR,pr,t),e.off(u.A.PLAYBACK_STARTED,$n,t),e.off(u.A.PLAYBACK_PAUSED,nr,t),e.off(u.A.PLAYBACK_ENDED,tn,t),e.off(u.A.METRIC_ADDED,Sr,t),e.off(u.A.MANIFEST_VALIDITY_CHANGED,Di,t),e.off(u.A.BUFFER_LEVEL_UPDATED,an,t),e.off(u.A.QUALITY_CHANGE_REQUESTED,In,t),e.off(u.A.CONTENT_STEERING_REQUEST_COMPLETED,Vn,t),e.off(u.A.DYNAMIC_TO_STATIC,fn,t),F.A.KEY_SESSION_UPDATED&&e.off(F.A.KEY_SESSION_UPDATED,Qt,t),e.off(F.A.MANIFEST_UPDATED,rr,t),e.off(F.A.STREAM_BUFFERING_COMPLETED,Jn,t),e.off(F.A.TIME_SYNCHRONIZATION_COMPLETED,Wt,t),e.off(F.A.CURRENT_TRACK_CHANGED,at,t),e.off(F.A.SETTING_UPDATED_LIVE_DELAY,On,t),e.off(F.A.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,On,t),e.off(ds.A.INTERNAL_KEY_STATUSES_CHANGED,Er,t),v.reset(),A.reset(),ee.reset(),I.clearAllCurrentMetrics(),l.setValue(null),p.reset(),J.reset(),te.reset(),ke&&(h.detachMediaSource(Ie),ke=null),Ie=null,w&&(w=null,x=null,l.getValue()&&e.trigger(F.A.PROTECTION_DESTROYED,{data:l.getValue().url})),hr(),e.trigger(F.A.STREAM_TEARDOWN_COMPLETE),Mi()}function Sr(Xe){if(Xe.metric===mt.DVR_INFO){const Mt=Nr()?U.A.AUDIO:U.A.VIDEO;Xe.mediaType===Mt&&h.setSeekable(Xe.value.range.start,Xe.value.range.end)}}function Kr(){return L}return t={addDVRMetric:en,getActiveStream:function(){return H},getActiveStreamInfo:sr,getActiveStreamProcessors:bt,getAutoPlay:function(){return W},getHasMediaOrInitialisationError:function(){return oe||Ae},getInitialPlayback:function(){return fe},getIsStreamSwitchInProgress:function(){return ie},getProtectionData:function(){return w?w.getProtectionData():null},getStreamById:wr,getStreamForTime:xt,getStreams:Kr,getTimeRelativeToStreamId:function(Xe,Mt){let nn=null,Tn=0,Bn=0,kn=null;for(let Zn=0;Zn<L.length;Zn++){if(nn=L[Zn],Bn=nn.getStartTime(),kn=nn.getDuration(),Number.isFinite(Bn)&&(Tn=Bn),nn.getId()===Mt)return Xe-Tn;Number.isFinite(kn)&&(Tn+=kn)}return null},hasAudioTrack:Nr,hasVideoTrack:ur,initialize:function(Xe,Mt){zt(),W=Xe,x=Mt,J.initialize(),A=Eo(n).create(),A.setConfig({manifestModel:l,adapter:_,manifestLoader:p,errHandler:M,settings:ot,contentSteeringController:N}),A.initialize(),ee=pl(n).getInstance(),ee.setConfig({manifestUpdater:A,playbackController:be,settings:ot}),ee.start(),G=(0,ml.A)(n).getInstance(),d.setConfig({dashMetrics:I,baseURLController:v,errHandler:M,settings:ot}),d.initialize(),h.setConfig({settings:ot}),w&&(e.trigger(F.A.PROTECTION_CREATED,{controller:w}),w.setMediaElement(Ie.getElement()),x&&w.setProtectionData(x)),e.on(u.A.PLAYBACK_TIME_UPDATED,Gn,t),e.on(u.A.PLAYBACK_SEEKING,Rn,t),e.on(u.A.PLAYBACK_ERROR,pr,t),e.on(u.A.PLAYBACK_STARTED,$n,t),e.on(u.A.PLAYBACK_PAUSED,nr,t),e.on(u.A.PLAYBACK_ENDED,tn,t),e.on(u.A.METRIC_ADDED,Sr,t),e.on(u.A.MANIFEST_VALIDITY_CHANGED,Di,t),e.on(u.A.BUFFER_LEVEL_UPDATED,an,t),e.on(u.A.QUALITY_CHANGE_REQUESTED,In,t),e.on(u.A.CONTENT_STEERING_REQUEST_COMPLETED,Vn,t),e.on(u.A.DYNAMIC_TO_STATIC,fn,t),F.A.KEY_SESSION_UPDATED&&e.on(F.A.KEY_SESSION_UPDATED,Qt,t),e.on(F.A.MANIFEST_UPDATED,rr,t),e.on(F.A.STREAM_BUFFERING_COMPLETED,Jn,t),e.on(F.A.TIME_SYNCHRONIZATION_COMPLETED,Wt,t),e.on(F.A.CURRENT_TRACK_CHANGED,at,t),e.on(F.A.SETTING_UPDATED_LIVE_DELAY,On,t),e.on(F.A.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,On,t),e.on(ds.A.INTERNAL_KEY_STATUSES_CHANGED,Er,t)},load:function(Xe,Mt=NaN){zt(),rt=Mt,p.load(Xe)},loadWithManifest:function(Xe,Mt=NaN){(function(){if(!A||!A.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")})(),rt=Mt,A.setManifest(Xe)},refreshManifest:function(){A.getIsUpdating()||A.refreshManifest()},reset:ai,setConfig:function(Xe){Xe&&(Xe.capabilities&&(r=Xe.capabilities),Xe.capabilitiesFilter&&(c=Xe.capabilitiesFilter),Xe.manifestLoader&&(p=Xe.manifestLoader),Xe.manifestModel&&(l=Xe.manifestModel),Xe.mediaPlayerModel&&(Oe=Xe.mediaPlayerModel),Xe.customParametersModel&&(Ke=Xe.customParametersModel),Xe.protectionController&&(w=Xe.protectionController),Xe.adapter&&(_=Xe.adapter),Xe.dashMetrics&&(I=Xe.dashMetrics),Xe.errHandler&&(M=Xe.errHandler),Xe.timelineConverter&&(J=Xe.timelineConverter),Xe.videoModel&&(Ie=Xe.videoModel),Xe.playbackController&&(be=Xe.playbackController),Xe.throughputController&&($=Xe.throughputController),Xe.serviceDescriptionController&&(me=Xe.serviceDescriptionController),Xe.contentSteeringController&&(N=Xe.contentSteeringController),Xe.textController&&(O=Xe.textController),Xe.abrController&&(D=Xe.abrController),Xe.mediaController&&(B=Xe.mediaController),Xe.settings&&(ot=Xe.settings),Xe.baseURLController&&(v=Xe.baseURLController),Xe.uriFragmentModel&&(k=Xe.uriFragmentModel),Xe.segmentBaseController&&(q=Xe.segmentBaseController),Xe.manifestUpdater&&(A=Xe.manifestUpdater))},setProtectionData:function(Xe){x=Xe,w&&w.setProtectionData(x)},switchToVideoElement:function(Xe){H&&(be.initialize(sr()),wt({seekTime:Xe,keepBuffers:!1,streamActivated:!0}))}},i=(0,j.A)(n).getInstance().getLogger(t),d=gl(n).getInstance(),h=hl(n).getInstance(),te=T(n).getInstance(),Mi(),t}gs.__dashjs_factory_name="StreamController";var hs=o.A.getSingletonFactory(gs),El=class extends Jr{constructor(){super(),this.captionData=null,this.label=null,this.defaultTrack=!1,this.kind=null,this.isFragmented=!1,this.isEmbedded=!1,this.isTTML=null}},Al=C(7377);function ps(){let n,e=0;function t(l){let _="";for(let I=0;I<l.length;++I)_+=l[I].uchar;return _.length-_.replace(/^\s+/,"").length}function i(l){return"left: "+3.125*l.x+"%; top: "+6.66*l.y1+"%; width: "+(100-3.125*l.x)+"%; height: "+6.66*Math.max(l.y2-1-l.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function r(l){return l==="red"?"rgb(255, 0, 0)":l==="green"?"rgb(0, 255, 0)":l==="blue"?"rgb(0, 0, 255)":l==="cyan"?"rgb(0, 255, 255)":l==="magenta"?"rgb(255, 0, 255)":l==="yellow"?"rgb(255, 255, 0)":l==="white"?"rgb(255, 255, 255)":l==="black"?"rgb(0, 0, 0)":l}function c(l,_){const I=l.videoHeight/15;return _?"font-size: "+I+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(_.foreground?r(_.foreground):"rgb(255, 255, 255)")+"; font-style: "+(_.italics?"italic":"normal")+"; text-decoration: "+(_.underline?"underline":"none")+"; white-space: pre; background-color: "+(_.background?r(_.background):"transparent")+";":"font-size: "+I+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}function A(l){return l.replace(/^\s+/g,"")}function p(l){return l.replace(/\s+$/g,"")}return n={createHTMLCaptionsFromScreen:function(l,_,I,h){let d=null,N=null,v=!1,q=-1,k={start:_,end:I,spans:[]},D="style_cea608_white_black";const $={},B={},ee=[];let te,M;for(te=0;te<15;++te){const L=h.rows[te];let H="",w=null;if(L.isEmpty()===!1){const O=t(L.chars);d===null&&(d={x:O,y1:te,y2:te+1,p:[]}),O!==q&&v&&(d.p.push(k),k={start:_,end:I,spans:[]},d.y2=te,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,$.hasOwnProperty(d.name)===!1?(ee.push(d),$[d.name]=d):(N=$[d.name],N.p.contat(d.p)),d={x:O,y1:te,y2:te+1,p:[]});for(let x=0;x<L.chars.length;++x){const G=L.chars[x],W=G.penState;if(w===null||!W.equals(w)){H.trim().length>0&&(k.spans.push({name:D,line:H,row:te}),H="");let ie="style_cea608_"+W.foreground+"_"+W.background;W.underline&&(ie+="_underline"),W.italics&&(ie+="_italics"),B.hasOwnProperty(ie)||(B[ie]=JSON.parse(JSON.stringify(W))),w=W,D=ie}H+=G.uchar}H.trim().length>0&&k.spans.push({name:D,line:H,row:te}),v=!0,q=O}else v=!1,q=-1,d&&(d.p.push(k),k={start:_,end:I,spans:[]},d.y2=te,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,$.hasOwnProperty(d.name)===!1?(ee.push(d),$[d.name]=d):(N=$[d.name],N.p.contat(d.p)),d=null)}d&&(d.p.push(k),d.y2=te+1,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,$.hasOwnProperty(d.name)===!1?(ee.push(d),$[d.name]=d):(N=$[d.name],N.p.contat(d.p)),d=null);const J=[];for(te=0;te<ee.length;++te){const L=ee[te],H="sub_cea608_"+e++,w=document.createElement("div");w.id=H;const O=i(L);w.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+O;const x=document.createElement("div");x.className="paragraph bodyStyle",x.style.cssText=c(l);const G=document.createElement("div");G.className="cueUniWrapper",G.style.cssText="unicode-bidi: normal; direction: ltr;";for(let ie=0;ie<L.p.length;++ie){const oe=L.p[ie];let Ae=0;for(M=0;M<oe.spans.length;++M){let ke=oe.spans[M];if(ke.line.length>0){if(M!==0&&Ae!=ke.row){const Oe=document.createElement("br");Oe.className="lineBreak",G.appendChild(Oe)}let Ie=!1;Ae===ke.row&&(Ie=!0),Ae=ke.row;const be=B[ke.name],me=document.createElement("span");me.className="spanPadding "+ke.name+" customSpanColor",me.style.cssText=c(l,be),M!==0&&Ie?M===oe.spans.length-1?me.textContent=p(ke.line):me.textContent=ke.line:oe.spans.length>1&&M<oe.spans.length-1&&ke.row===oe.spans[M+1].row?me.textContent=A(ke.line):me.textContent=ke.line.trim(),G.appendChild(me)}}}x.appendChild(G),w.appendChild(x);const W={bodyStyle:["%",90]};for(const ie in B)B.hasOwnProperty(ie)&&(W[ie]=["%",90]);J.push({type:"html",start:_,end:I,cueHTMLElement:w,cueID:H,cellResolution:[32,15],isFromCEA608:!0,fontSize:W,lineHeight:{},linePadding:{}})}return J}},n}ps.__dashjs_factory_name="EmbeddedTextHtmlRender";var Tl=o.A.getSingletonFactory(ps),Ci=class{constructor(){this.time=null,this.verboseLevel=0}log(n,e){if(this.verboseLevel>=n){const t=typeof e=="function"?e():e;console.log(`${this.time} [${n}] ${t}`)}}},ms=class{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(n){for(const e of["foreground","underline","italics","background","flash"])Object.prototype.hasOwnProperty.call(n,e)&&(this[e]=n[e])}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(n){return this.foreground===n.foreground&&this.underline===n.underline&&this.italics===n.italics&&this.background===n.background&&this.flash===n.flash}copy(n){this.foreground=n.foreground,this.underline=n.underline,this.italics=n.italics,this.background=n.background,this.flash=n.flash}},yl=class{constructor(){this.uchar=" ",this.penState=new ms}reset(){this.uchar=" ",this.penState.reset()}setChar(n,e){this.uchar=n,this.penState.copy(e)}setPenState(n){this.penState.copy(n)}equals(n){return this.uchar===n.uchar&&this.penState.equals(n.penState)}copy(n){this.uchar=n.uchar,this.penState.copy(n.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}};const Ur=100,_l={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499};function Es(n){return String.fromCharCode(_l[n]||n)}var Sl=class{constructor(n=new Ci){this.chars=[],this.cueStartTime=null,this.pos=0,this.currPenState=new ms;for(let e=0;e<Ur;e++)this.chars.push(new yl);this.logger=n}equals(n){for(let e=0;e<Ur;e++)if(!this.chars[e].equals(n.chars[e]))return!1;return!0}copy(n){for(let e=0;e<Ur;e++)this.chars[e].copy(n.chars[e])}isEmpty(){let n=!0;for(let e=0;e<Ur;e++)if(!this.chars[e].isEmpty()){n=!1;break}return n}setCursor(n){this.pos!==n&&(this.pos=n),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>Ur&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Ur)}moveCursor(n){const e=this.pos+n;if(n>1)for(let t=this.pos+1;t<e+1;t++)this.chars[t].setPenState(this.currPenState);this.setCursor(e)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(n){n>=144&&this.backSpace();const e=Es(n);this.pos>=Ur?this.logger.log(0,()=>"Cannot insert "+n.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))}clearFromPos(n){let e;for(e=n;e<Ur;e++)this.chars[e].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const n=[];let e=!0;for(let t=0;t<Ur;t++){const i=this.chars[t].uchar;i!==" "&&(e=!1),n.push(i)}return e?"":n.join("")}setPenStyles(n){this.currPenState.setStyles(n),this.chars[this.pos].setPenState(this.currPenState)}};const $r=15;var Hi=class{constructor(n=new Ci){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null;for(let e=0;e<$r;e++)this.rows.push(new Sl(n));this.logger=n}reset(){for(let n=0;n<$r;n++)this.rows[n].clear();this.currRow=14}equals(n){let e=!0;for(let t=0;t<$r;t++)if(!this.rows[t].equals(n.rows[t])){e=!1;break}return e}copy(n){for(let e=0;e<$r;e++)this.rows[e].copy(n.rows[e])}isEmpty(){let n=!0;for(let e=0;e<$r;e++)if(!this.rows[e].isEmpty()){n=!1;break}return n}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(n){this.rows[this.currRow].insertChar(n)}setPen(n){this.rows[this.currRow].setPenStyles(n)}moveCursor(n){this.rows[this.currRow].moveCursor(n)}setCursor(n){this.logger.log(2,"setCursor: "+n),this.rows[this.currRow].setCursor(n)}setPAC(n){this.logger.log(2,()=>"pacData = "+JSON.stringify(n));let e=n.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(let A=0;A<$r;A++)this.rows[A].clear();const r=this.currRow+1-this.nrRollUpRows,c=this.lastOutputScreen;if(c){const A=c.rows[r].cueStartTime,p=this.logger.time;if(A!==null&&p!==null&&A<p)for(let l=0;l<this.nrRollUpRows;l++)this.rows[e-this.nrRollUpRows+l+1].copy(c.rows[r+l])}}this.currRow=e;const t=this.rows[this.currRow];if(n.indent!==null){const r=n.indent,c=Math.max(r-1,0);t.setCursor(n.indent),n.color=t.chars[c].penState.foreground}const i={foreground:n.color,underline:n.underline,italics:n.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(n){this.logger.log(2,()=>"bkgData = "+JSON.stringify(n)),this.backSpace(),this.setPen(n),this.insertChar(32)}setRollUpRows(n){this.nrRollUpRows=n}rollUp(){if(this.nrRollUpRows===null)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,()=>this.getDisplayText());const n=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(n,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(2,"Rolling up")}getDisplayText(n){n=n||!1;const e=[];let t="",i=-1;for(let r=0;r<$r;r++){const c=this.rows[r].getTextString();c&&(i=r+1,n?e.push("Row "+i+": '"+c+"'"):e.push(c.trim()))}return e.length>0&&(t=n?"["+e.join(" | ")+"]":e.join(`
20
+ `)),t}getTextAndFormat(){return this.rows}},As=class{constructor(n,e,t=new Ci){this.chNr=n,this.outputFilter=e,this.mode=null,this.displayedMemory=new Hi(t),this.nonDisplayedMemory=new Hi(t),this.lastOutputScreen=new Hi(t),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=t,this.logger.log(2,"new Cea608Channel("+this.chNr+")")}reset(){var n,e;this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),(e=(n=this.outputFilter)==null?void 0:n.reset)==null||e.call(n),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(n){this.outputFilter=n}setPAC(n){this.writeScreen.setPAC(n)}setBkgData(n){this.writeScreen.setBkgData(n)}setMode(n){n!==this.mode&&(this.mode=n,this.logger.log(2,()=>"MODE="+n),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.setRollUpRows(null),this.nonDisplayedMemory.setRollUpRows(null)),this.mode=n)}insertChars(n){for(const t of n)this.writeScreen.insertChar(t);const e=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>e+": "+this.writeScreen.getDisplayText(!0)),this.mode!=="MODE_PAINT-ON"&&this.mode!=="MODE_ROLL-UP"||(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(n){this.logger.log(2,"RU("+n+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(n)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const n=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=n,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(n){this.logger.log(2,"TO("+n+") - Tab Offset"),this.writeScreen.moveCursor(n)}ccMIDROW(n){const e={flash:!1};e.underline=n%2==1,e.italics=n>=46,e.italics?e.foreground="white":e.foreground=["white","green","blue","cyan","red","yellow","magenta"][Math.floor(n/2)-16],this.logger.log(2,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e),this.writeScreen.moveCursor(1)}outputDataUpdate(n=!1){const e=this.logger.time;e!==null&&this.outputFilter&&(this.cueStartTime!==null||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),n&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(n){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,n,this.displayedMemory),this.cueStartTime=n))}};const Il=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];function Rl(n,e,t){return t.a===n&&t.b===e}function Xr(n){const e=[];for(const t of n)e.push(t.toString(16));return e}const Nl={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Cl={25:2,26:4,29:6,30:8,31:10,27:13,28:15},bl={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},vl={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14};function bi(n,e,t){t.a=n,t.b=e}var Ts=class{constructor(n,e,t){this.currentChannel=0,this.cmdHistory={a:null,b:null},this.lastTime=null;const i=this.logger=new Ci;this.channels=[null,new As(n,e,i),new As(n+1,t,i)]}addData(n,e){this.lastTime=n,this.logger.time=n;for(let t=0;t<e.length;t+=2){const i=127&e[t],r=127&e[t+1];let c=!1,A=null;if(this.lastTime!==null&&(n=this.lastTime+.5*t*1001/3e4,this.logger.time=n),i===0&&r===0)continue;this.logger.log(3,()=>"["+Xr([e[t],e[t+1]])+"] -> ("+Xr([i,r])+")");const p=this.cmdHistory;if(i>=16&&i<=31){if(Rl(i,r,p)){bi(null,null,p),this.logger.log(3,()=>"Repeated command ("+Xr([i,r])+") is dropped");continue}bi(i,r,this.cmdHistory),c=this.parseCmd(i,r),c||(c=this.parseMidrow(i,r)),c||(c=this.parsePAC(i,r)),c||(c=this.parseBackgroundAttributes(i,r))}else bi(null,null,p);if(!c&&(A=this.parseChars(i,r),A.length)){const l=this.currentChannel;l&&l>0?this.channels[l].insertChars(A):this.logger.log(2,"No channel found yet. TEXT-MODE?")}c||A||this.logger.log(2,()=>"Couldn't parse cleaned data "+Xr([i,r])+" orig: "+Xr([e[t],e[t+1]]))}}parseCmd(n,e){if(!((n===20||n===28||n===21||n===29)&&e>=32&&e<=47||(n===23||n===31)&&e>=33&&e<=35))return!1;const t=n===20||n===21||n===23?1:2,i=this.channels[t];return n===20||n===21||n===28||n===29?e===32?i.ccRCL():e===33?i.ccBS():e===34?i.ccAOF():e===35?i.ccAON():e===36?i.ccDER():e===37?i.ccRU(2):e===38?i.ccRU(3):e===39?i.ccRU(4):e===40?i.ccFON():e===41?i.ccRDC():e===42?i.ccTR():e===43?i.ccRTD():e===44?i.ccEDM():e===45?i.ccCR():e===46?i.ccENM():e===47&&i.ccEOC():i.ccTO(e-32),this.currentChannel=t,!0}parseMidrow(n,e){let t=0;if((n===17||n===25)&&e>=32&&e<=47){if(t=n===17?1:2,t!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[t];return!!i&&(i.ccMIDROW(e),this.logger.log(3,()=>"MIDROW ("+Xr([n,e])+")"),!0)}return!1}parsePAC(n,e){let t;if(!((n>=17&&n<=23||n>=25&&n<=31)&&e>=64&&e<=127||(n===16||n===24)&&e>=64&&e<=95))return!1;const i=n<=23?1:2;t=e>=64&&e<=95?i===1?bl[n]:vl[n]:i===1?Nl[n]:Cl[n];const r=this.channels[i];return!!r&&(r.setPAC(this.interpretPAC(t,e)),this.currentChannel=i,!0)}interpretPAC(n,e){let t;const i={color:null,italics:!1,indent:null,underline:!1,row:n};return t=e>95?e-96:e-64,i.underline=!(1&~t),t<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(t/2)]:t<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((t-16)/2),i}parseChars(n,e){let t,i=[],r=null;if(n>=25?(t=2,r=n-8):(t=1,r=n),r>=17&&r<=19){let c;c=r===17?e+80:r===18?e+112:e+144,this.logger.log(2,()=>"Special char '"+Es(c)+"' in channel "+t),i=[c]}else n>=32&&n<=127&&(i=e===0?[n]:[n,e]);return i&&this.logger.log(3,()=>"Char codes = "+Xr(i).join(",")),i}parseBackgroundAttributes(n,e){if(!((n===16||n===24)&&e>=32&&e<=47||(n===23||n===31)&&e>=45&&e<=47))return!1;let t;const i={};n===16||n===24?(t=Math.floor((e-32)/2),i.background=Il[t],e%2==1&&(i.background=i.background+"_semi")):e===45?i.background="transparent":(i.foreground="black",e===47&&(i.underline=!0));const r=n<=23?1:2;return this.channels[r].setBkgData(i),!0}reset(){for(let n=0;n<Object.keys(this.channels).length;n++){const e=this.channels[n];e&&e.reset()}bi(null,null,this.cmdHistory)}cueSplitAtTime(n){for(const e of this.channels)e&&e.cueSplitAtTime(n)}};function Dl(n){return n===0||n===1}function Ml(n,e){return(127&n)>0||(127&e)>0}function wl(n,e,t,i){if(e+2>t)return;const r=31&n.getUint8(e);let c=e+2;const A=Math.min(c+3*r,t);for(;c+2<A;c+=3){const p=n.getUint8(c);if(!(4&p))continue;const l=3&p;if(!Dl(l))continue;const _=n.getUint8(c+1),I=n.getUint8(c+2);Ml(_,I)&&i[l].push(_,I)}}function Pl(n,e,t){const i=[];for(let r=e;r<t;r++)r+2<t&&n.getUint8(r)===0&&n.getUint8(r+1)===0&&n.getUint8(r+2)===3?(i.push(0),i.push(0),r+=2):i.push(n.getUint8(r));return new DataView(new Uint8Array(i).buffer)}function Ol(n,e,t,i){return!(n!==4||e<8)&&(function(r,c){return r.getUint8(c)===181&&r.getUint16(c+1)===49&&r.getUint32(c+3)===1195456820&&r.getUint8(c+7)===3})(t,i)}function Ll(n,e){const t=n.getUint8(e),i=31&t;if(i===6)return{nalType:i,headerSize:1};const r=t>>1&63;if(r===39||r===40)return{nalType:r,headerSize:2};if(e+1>=n.byteLength)return null;const c=n.getUint8(e+1)>>3&31;return c===23||c===24?{nalType:c,headerSize:2}:null}function Fl(n,e){let t=0;for(;t<n.byteLength-1;){let i,r=0,c=0;do r+=i=n.getUint8(t++);while(i===255);do c+=i=n.getUint8(t++);while(i===255);Ol(r,c,n,t)&&wl(n,t+8,t+c,e),t+=c}}function Ul(n,e,t){let i=0;const r=[[],[]];for(let c=e;c<e+t-6;c++){i=n.getUint32(c);const A=c+4+i;if(A>e+t)break;const p=Ll(n,c+4);if(p){const l=c+4+p.headerSize;A<=n.byteLength&&Fl(Pl(n,l,A),r)}c+=i+3}return r}function ys(n){const e=n.errHandler,t=n.manifestModel,i=n.mediaController,r=n.videoModel,c=n.textTracks,A=n.vttParser,p=n.vttCustomRenderingParser,l=n.ttmlParser,_=n.streamInfo,I=n.settings,h=n.timelineConverter,d=this.context,N=(0,m.A)(d).getInstance();let v,q,k,D,$,B,ee,te,M,J,L,H,w,O,x,G,W=!1;function ie(){B=null,te=NaN,M=[],ee=!1,$=[],D=null}function oe(fe){const pe={};pe[Fe.A.SUBTITLE]="subtitles",pe[Fe.A.CAPTION]="captions",pe[Fe.A.FORCED_SUBTITLE]="subtitles";const ze=new El;for(let $e in fe)ze[$e]=fe[$e];ze.defaultTrack=(function($e){let ot=!1;return L.length>1&&$e.isEmbedded?ot=$e.id&&$e.id===U.A.CC1:L.length===1?$e.id&&typeof $e.id=="string"&&$e.id.substring(0,2)==="CC"&&(ot=!0):L.length===0&&(ot=$e.index===$[0].index),ot})(fe),ze.isTTML=(function($e){return $e.codec&&$e.codec.search(U.A.STPP)>=0||$e.mimeType&&$e.mimeType.search(U.A.TTML)>=0})(fe),ze.kind=(function($e,ot){let Se=$e.roles&&$e.roles.length>0?ot[$e.roles[0].value]:ot.caption;return Se=Object.values(ot).includes(Se)?Se:ot.caption,Se})(fe,pe),c.addTextTrackInfo(ze)}function Ae(fe){const pe=fe.chunk;pe.representation.mediaInfo.embeddedCaptions&&Ie(pe.bytes,pe)}function ke(fe){J=fe}function Ie(fe,pe){const ze=pe.representation.mediaInfo,$e=ze.type,ot=ze.mimeType,Se=ze.codec||ot;Se?ze.codec.indexOf("application/mp4")!==-1?(function(We,rt,gt){let Ot,zt;if(rt.segmentType==="InitializationSegment")ee=!0,te=k.getMediaTimescaleFromMoov(We);else{if(!ee)return;zt=k.getSamplesInfo(We),Ot=zt.sampleList,gt.search(U.A.STPP)>=0?(function(Wt,Qt,fn){let En,bn;for(D=D!==null?D:Oe(fn),En=0;En<Qt.length;En++){const Fn=Qt[En],et=Fn.cts,wt=me(),Rt=wt+et/te,Ht=Rt+Fn.duration/te;v.buffered.add(Rt,Ht);const rn=new DataView(Wt,Fn.offset,Fn.subSizes[0]);let Rn=Gr.Utils.dataViewToString(rn,U.A.UTF8);const ht=[];let xe=Fn.offset+Fn.subSizes[0];for(bn=1;bn<Fn.subSizes.length;bn++){const Qe=new Uint8Array(Wt,xe,Fn.subSizes[bn]),at=String.fromCharCode.apply(null,Qe);ht.push(at),xe+=Fn.subSizes[bn]}try{const Qe=t.getValue().ttmlTimeIsRelative?et/te:0,at=D.parse(Rn,Qe,et/te,(et+Fn.duration)/te,ht);c.addCaptions(J,wt,at)}catch(Qe){B.removeExecutedRequestsBeforeTime(),Ke(),q.error("TTML parser error: "+Qe)}}})(We,Ot,gt):(function(Wt,Qt){let fn,En,bn;const Fn=[],et=me();for(fn=0;fn<Qt.length;fn++){const wt=Qt[fn],Rt=et+wt.cts/te,Ht=Rt+wt.duration/te;v.buffered.add(Rt,Ht);const rn=Wt.slice(wt.offset,wt.offset+wt.size),Rn=Gr.parseBuffer(rn);for(En=0;En<Rn.boxes.length;En++){const ht=Rn.boxes[En];if(q.debug("VTT box1: "+ht.type),ht.type!=="vtte"&&ht.type==="vttc"){q.debug("VTT vttc boxes.length = "+ht.boxes.length);let xe={styles:{}};for(bn=0;bn<ht.boxes.length;bn++){const Qe=ht.boxes[bn];if(q.debug("VTT box2: "+Qe.type),Qe.type==="payl")xe.start=wt.cts/te,xe.end=(wt.cts+wt.duration)/te,xe.data=Qe.cue_text;else if(Qe.type==="sttg"&&Qe.settings&&Qe.settings!=="")try{const at=Qe.settings.split(" ");xe.styles=A.getCaptionStyles(at)}catch{}}xe&&xe.data&&(Fn.push(xe),q.debug(`VTT ${xe.start} - ${xe.end} : ${xe.data}`))}}}Fn.length>0&&c.addCaptions(J,et,Fn)})(We,Ot)}})(fe,pe,Se):$e===U.A.VIDEO?(function(We,rt){let gt,Ot;if(rt.segmentType===Ee.G.INIT_SEGMENT_TYPE)H===0&&(H=k.getMediaTimescaleFromMoov(We));else if(rt.segmentType===Ee.G.MEDIA_SEGMENT_TYPE){if(H===0)return void q.warn("CEA-608: No timescale for embeddedTextTrack yet");Ot=k.getSamplesInfo(We);const zt=Ot.lastSequenceNumber,Wt=Math.trunc(rt.start),Qt=Math.trunc(rt.end);if(x[0]||x[1]||(function(){let fn;for(let En=0;En<L.length;En++){if(fn=c.getTrackIdxForId(L[En].id),fn===-1)return void q.warn("CEA-608: data before track is ready.");const bn=be(fn);x[En]=new Ts(En+1,{newCue:bn},null)}})(),H){if((function(En,bn,Fn,et,wt){return En!==null&&bn!==null&&et!==null&&wt!==null&&(bn===En?et!==wt:bn!==En+Fn)})(w,zt,Ot.numSequences,O,Wt))for(gt=0;gt<x.length;gt++)x[gt]&&x[gt].reset();const fn=(function(En,bn){if(bn.length===0)return null;const Fn={splits:[],fields:[[],[]]},et=new DataView(En);for(let wt=0;wt<bn.length;wt++){const Rt=bn[wt],Ht=Ul(et,Rt.offset,Rt.size);let rn=null,Rn=0;for(let ht=0;ht<2;ht++)if(Ht[ht].length>0){Rt.cts!==rn?Rn=0:Rn+=1;const xe=me();Fn.fields[ht].push([Rt.cts+xe*H,Ht[ht],Rn]),rn=Rt.cts}}return Fn.fields.forEach(function(wt){wt.sort(function(Rt,Ht){return Rt[0]===Ht[0]?Rt[2]-Ht[2]:Rt[0]-Ht[0]})}),Fn})(We,Ot.sampleList);if(!fn)return;for(let En=0;En<x.length;En++){const bn=fn.fields[En],Fn=x[En];if(Fn)for(gt=0;gt<bn.length;gt++){const et=h.calcPresentationTimeFromMediaTime(bn[gt][0]/H,rt.representation);Fn.addData(et,bn[gt][1])}}w=zt,O=Qt}}})(fe,pe):(function(We,rt,gt){let Ot,zt;const Wt=new DataView(We,0,We.byteLength);zt=Gr.Utils.dataViewToString(Wt,U.A.UTF8);try{Ot=Oe(gt).parse(zt,0),c.addCaptions(c.getCurrentTrackIdx(),0,Ot),v.buffered&&v.buffered.add(rt.start,rt.end)}catch(Qt){e.error(new Hn.A(f.A.TIMED_TEXT_ERROR_ID_PARSE_CODE,f.A.TIMED_TEXT_ERROR_MESSAGE_PARSE+Qt.message,zt))}})(fe,pe,Se):q.error("No text type defined")}function be(fe){return function(pe,ze,$e){let ot;ot=r.getTTMLRenderingDiv()?G.createHTMLCaptionsFromScreen(r.getElement(),pe,ze,$e):[{start:pe,end:ze,data:$e.getDisplayText(),styles:{}}],ot&&c.addCaptions(fe,0,ot)}}function me(){return isNaN(v.timestampOffset)?0:v.timestampOffset}function Oe(fe){let pe;return fe.search(U.A.VTT)>=0?pe=I.get().streaming.text.webvtt.customRenderingEnabled&&p?p:A:(fe.search(U.A.TTML)>=0||fe.search(U.A.STPP)>=0)&&(pe=l),pe}function Ke(fe,pe){fe===void 0&&fe===pe&&(fe=v.buffered.start(0),pe=v.buffered.end(v.buffered.length-1)),v.buffered.remove(fe,pe),c.deleteCuesFromTrackIdx(J,fe,pe)}function le(fe){L.forEach(function(pe){const ze=c.getTrackIdxForId(pe.id);ze>=0&&c.deleteCuesFromTrackIdx(ze,fe.from,fe.to)})}return v={abort:function(){},addEmbeddedTrack:function(fe){if(W&&fe)if(fe.id===U.A.CC1||fe.id===U.A.CC3){for(let pe=0;pe<L.length;pe++)if(L[pe].id===fe.id)return;L.push(fe)}else q.warn("Embedded track "+fe.id+" not supported!")},addMediaInfos:function(fe,pe,ze){if($=$.concat(pe),fe===U.A.TEXT&&pe[0].isFragmented&&!pe[0].isEmbedded){B=ze,v.buffered=(0,Al.A)(d).create(),M=i.getTracksFor(U.A.TEXT,_.id).filter(ot=>ot.isFragmented);const $e=i.getCurrentTrackFor(U.A.TEXT,_.id);for(let ot=0;ot<M.length;ot++)if(M[ot]===$e){ke(ot);break}}for(let $e=0;$e<pe.length;$e++)oe(pe[$e])},append:Ie,getConfig:function(){return{fragmentModel:B,fragmentedTracks:M,videoModel:r}},getStreamId:function(){return _.id},initialize:function(){W||(L=[],J=null,H=0,x=[],w=null,O=null,W=!0,G=Tl(d).getInstance(),N.on(F.A.VIDEO_CHUNK_RECEIVED,Ae,v),N.on(F.A.BUFFER_CLEARED,le,v))},remove:Ke,reset:function(){ie(),$=[],k=null},resetEmbedded:function(){N.off(F.A.VIDEO_CHUNK_RECEIVED,Ae,v),N.off(F.A.BUFFER_CLEARED,le,v),c&&c.deleteAllTextTracks(),W=!1,L=[],x=[null,null],w=null,O=null},resetMediaInfos:function(){$=[]},setCurrentFragmentedTrackIdx:ke},q=(0,j.A)(d).getInstance().getLogger(v),k=An(d).getInstance(),ie(),v}ys.__dashjs_factory_name="TextSourceBuffer";var xl=o.A.getClassFactory(ys);class Bl{constructor(){this.root=null,this.size=0}addCue(e){const t={start:e.startTime,end:e.endTime,cue:e,maxEnd:e.endTime,left:null,right:null,height:1},[i,r]=this._insert(t,this.root);this.root=i,r&&this.size++}removeCue(e){const[t,i]=this._remove(e,this.root);return this.root=t,i&&this.size--,i}findCuesInRange(e,t){const i=[];return this._searchRange(this.root,e,t,i),i}findCuesAtTime(e){return this.findCuesInRange(e,e)}getAllCues(){const e=[];return this._inorderTraversal(this.root,e),e}getSize(){return this.size}clear(){this.root=null,this.size=0}_compareCues(e,t){if(e.startTime!==t.startTime)return e.startTime-t.startTime;if(e.endTime!==t.endTime)return e.endTime-t.endTime;const i=(e.text||"").localeCompare(t.text||"");if(i!==0)return i;if(e.isd||t.isd){const A=JSON.stringify(e.isd||null).localeCompare(JSON.stringify(t.isd||null));if(A!==0)return A}const r=e.cueHTMLElement?e.cueHTMLElement.style.cssText+"|"+e.cueHTMLElement.textContent:"",c=t.cueHTMLElement?t.cueHTMLElement.style.cssText+"|"+t.cueHTMLElement.textContent:"";return r.localeCompare(c)}_compareIntervals(e,t){return this._compareCues(e.cue,t.cue)}_insert(e,t){if(!t)return[e,!0];const i=this._compareIntervals(e,t);if(i<0){const[c]=this._insert(e,t.left);t.left=c}else{if(!(i>0))return[t,!1];{const[c]=this._insert(e,t.right);t.right=c}}t.height=1+Math.max(this._getHeight(t.left),this._getHeight(t.right)),t.maxEnd=Math.max(t.maxEnd,e.maxEnd);const r=this._getBalance(t);return r>1?(this._compareIntervals(e,t.left)<0||(t.left=this._leftRotate(t.left)),[this._rightRotate(t),!0]):r<-1?(this._compareIntervals(e,t.right)>0||(t.right=this._rightRotate(t.right)),[this._leftRotate(t),!0]):[t,!0]}_searchRange(e,t,i,r){e&&(this._overlaps(e,t,i)&&r.push(e.cue),e.left&&e.left.maxEnd>=t&&this._searchRange(e.left,t,i,r),e.right&&e.start<=i&&this._searchRange(e.right,t,i,r))}_inorderTraversal(e,t){e&&(this._inorderTraversal(e.left,t),t.push(e.cue),this._inorderTraversal(e.right,t))}_overlaps(e,t,i){if(i===t){const r=t;return e.start<=r&&r<e.end}return e.start<i&&t<e.end}_getHeight(e){return e?e.height:0}_getBalance(e){return e?this._getHeight(e.left)-this._getHeight(e.right):0}_leftRotate(e){const t=e.right,i=t.left;return t.left=e,e.right=i,e.height=1+Math.max(this._getHeight(e.left),this._getHeight(e.right)),t.height=1+Math.max(this._getHeight(t.left),this._getHeight(t.right)),e.maxEnd=Math.max(e.end,e.left?e.left.maxEnd:0,e.right?e.right.maxEnd:0),t.maxEnd=Math.max(t.end,t.left?t.left.maxEnd:0,t.right?t.right.maxEnd:0),t}_rightRotate(e){const t=e.left,i=t.right;return t.right=e,e.left=i,e.height=1+Math.max(this._getHeight(e.left),this._getHeight(e.right)),t.height=1+Math.max(this._getHeight(t.left),this._getHeight(t.right)),e.maxEnd=Math.max(e.end,e.left?e.left.maxEnd:0,e.right?e.right.maxEnd:0),t.maxEnd=Math.max(t.end,t.left?t.left.maxEnd:0,t.right?t.right.maxEnd:0),t}_remove(e,t){if(!t)return[null,!1];const i=this._compareCues(e,t.cue);if(i<0){const[r,c]=this._remove(e,t.left);return t.left=r,c&&this._updateNode(t),[t,c]}if(i>0){const[r,c]=this._remove(e,t.right);return t.right=r,c&&this._updateNode(t),[t,c]}if(t.left||t.right){if(t.left){if(t.right){const r=this._findMin(t.right);t.cue=r.cue,t.start=r.start,t.end=r.end;const[c]=this._remove(r.cue,t.right);return t.right=c,this._updateNode(t),[t,!0]}return[t.left,!0]}return[t.right,!0]}return[null,!0]}_findMin(e){for(;e.left;)e=e.left;return e}_updateNode(e){e.height=1+Math.max(this._getHeight(e.left),this._getHeight(e.right)),e.maxEnd=Math.max(e.end,e.left?e.left.maxEnd:0,e.right?e.right.maxEnd:0)}}var ji=C(7640);const _s=["text","align","fontSize","id","isd","line","lineAlign","lineHeight","linePadding","position","positionAlign","region","size","snapToLines","vertical"];function Ss(n){const e=this.context,t=(0,m.A)(e).getInstance(),i=n.videoModel,r=n.streamInfo,c=n.settings;let A,p,l,_,I,h,d,N,v,q,k,D,$,B,ee,te,M,J,L,H;const w=new Map;function O(et){const wt=et.kind,Rt=et.id!==void 0?et.id:et.lang,Ht=et.lang,rn=et.isTTML,Rn=et.isEmbedded;return i.addTextTrack(wt,Rt,Ht,rn,Rn)}function x(et,wt,Rt,Ht,rn,Rn){let ht=0,xe=0;et/wt>Rt/Ht?(xe=wt,ht=xe/Ht*Rt):(ht=et,xe=ht/Rt*Ht);let Qe=0,at=0,St=0,ut=0;return ht/xe>rn?(ut=xe,St=xe*rn):(St=ht,ut=ht/rn),Qe=(et-St)/2,at=(wt-ut)/2,Rn?{x:Qe+.1*St,y:at+.1*ut,w:.8*St,h:.8*ut}:{x:Qe,y:at,w:St,h:ut}}function G(et,wt){const Rt=i.getClientWidth(),Ht=i.getClientHeight(),rn=i.getVideoWidth(),Rn=i.getVideoHeight(),ht=i.getVideoRelativeOffsetTop(),xe=i.getVideoRelativeOffsetLeft();if(rn!==0&&Rn!==0){let Qe=rn/Rn,at=!1;et.isFromCEA608&&(Qe=3.5/3,at=!0);const St=x.call(this,Rt,Ht,rn,Rn,Qe,at),ut=St.w,xt=St.h,en=St.x,an=St.y;if(ut!=v||xt!=q||en!=d||an!=N||wt){if(d=en+xe,N=an+ht,v=ut,q=xt,k){const On=k.style;On&&(On.left=d+"px",On.top=N+"px",On.width=v+"px",On.height=q+"px",On.zIndex=B&&document[B]||ee?M:null,t.trigger(u.A.CAPTION_CONTAINER_RESIZE))}const In=et.activeCues;if(In){const On=In.length;for(let Gn=0;Gn<On;++Gn){const $n=In[Gn];$n.scaleCue($n)}}}}}function W(et){const wt=v,Rt=q;let Ht,rn,Rn,ht,xe;if(et.cellResolution){const Qe=[wt/et.cellResolution[0],Rt/et.cellResolution[1]];if(et.linePadding){for(Ht in et.linePadding)if(et.linePadding.hasOwnProperty(Ht)){rn=(et.linePadding[Ht]*Qe[0]).toString();const at=document.getElementsByClassName("spanPadding");for(let St=0;St<at.length;St++)at[St].style.cssText=at[St].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+rn),at[St].style.cssText=at[St].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+rn)}}if(et.fontSize){for(Ht in et.fontSize)if(et.fontSize.hasOwnProperty(Ht)){et.fontSize[Ht][0]==="%"?Rn=et.fontSize[Ht][1]/100:et.fontSize[Ht][0]==="c"&&(Rn=et.fontSize[Ht][1]),rn=(Rn*Qe[1]).toString(),xe=Ht!=="defaultFontSize"?document.getElementsByClassName(Ht):document.getElementsByClassName("paragraph");for(let at=0;at<xe.length;at++)xe[at].style.cssText=xe[at].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+rn)}if(et.lineHeight){for(Ht in et.lineHeight)if(et.lineHeight.hasOwnProperty(Ht)){et.lineHeight[Ht][0]==="%"?ht=et.lineHeight[Ht][1]/100:et.fontSize[Ht][0]==="c"&&(ht=et.lineHeight[Ht][1]),rn=(ht*Qe[1]).toString(),xe=document.getElementsByClassName(Ht);for(let at=0;at<xe.length;at++)xe[at].style.cssText=xe[at].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+rn)}}}if(et.isFromCEA608&&et.cueHTMLElement){const at=et.cueHTMLElement.getElementsByClassName("cueUniWrapper");for(let St=0;St<at.length;St++){const ut=at[St];let xt=0,en=0;for(let In=0;In<ut.childNodes.length;In++){const On=ut.childNodes[In];On.nodeName==="BR"?(xt=Math.max(xt,en),en=0):en+=On.textContent.length}xt=Math.max(xt,en);const an=ut.offsetWidth;if(xt>0&&an>0){const In=xt*Qe[0];ut.style.transformOrigin="left",ut.style.transform="scaleX("+In/an+")"}}}}if(et.isd){let Qe=document.getElementById(et.cueID);Qe&&k.removeChild(Qe),oe(et)}}function ie(et,wt){const Rt=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,Ht=/^#(.*)$/;if(Rt.test(wt)){const rn=Rt.exec(wt),Rn=parseInt(rn[4],10)-1;return"data:image/png;base64,"+btoa(et.images[Rn])}if(Ht.test(wt)){const rn=Ht.exec(wt)[1];return"data:image/png;base64,"+et.embeddedImages[rn]}return wt}function oe(et){if(k){bn.call(this);const wt=document.createElement("div");k.appendChild(wt),te=(0,ji.renderHTML)(et.isd,wt,function(Rt){return ie(et,Rt)},k.clientHeight,k.clientWidth,c.get().streaming.text.imsc.displayForcedOnlyMode,function(Rt){p.info("renderCaption :",Rt)},te,c.get().streaming.text.imsc.enableRollUp),wt.id=et.cueID,t.trigger(u.A.CAPTION_RENDERED,{captionDiv:wt,currentTrackIdx:h})}}function Ae(et,wt){const Rt=wt.findCuesInRange(et.startTime-.1,et.endTime+.1);for(const Ht of Rt)if(ke(et,Ht)&&be(et,Ht,_s)||ke(Ht,et)&&be(et,Ht,_s))return Ht;return null}function ke(et,wt){return!!wt&&wt.endTime>=et.startTime}function Ie(et,wt){return et.startTime=Math.min(et.startTime,wt.startTime),et.endTime=Math.max(et.endTime,wt.endTime),et}function be(et,wt,Rt){for(let Ht=0;Ht<Rt.length;Ht++){const rn=Rt[Ht];if(JSON.stringify(et[rn])!==JSON.stringify(wt[rn]))return!1}return!0}function me(et,wt){wt&&wt.forEach(Rt=>{Rt.kind&&Rt.kind==="image"&&(Rt.src=ie(et,Rt.src)),me(et,Rt.contents)})}function Oe(et,wt,Rt){const Ht=rt(et),rn=w.get(Ht),Rn=c.get().streaming.text.dispatchForManualRendering,ht=c.get().streaming.text.extendSegmentedCues;if(Ht&&rn&&Array.isArray(Rt)&&Rt.length!==0){for(let xe=0;xe<Rt.length;xe++){let Qe=null;const at=Rt[xe];if(Ht.cellResolution=at.cellResolution,Ht.isFromCEA608!==at.isFromCEA608&&(Ht.isFromCEA608=at.isFromCEA608,et===h&&G.call(this,Ht,!0)),isNaN(at.start)||isNaN(at.end)||(Rn?Qe=Ke(at,wt):$e(at)&&k?Qe=pe(at,wt,Ht):at.data&&(Qe=ze(at,wt,Ht))),Qe){if(ht&&!at.isFromCEA608){const St=Ae(Qe,rn.allCues);St&&(rn.allCues.removeCue(St),Qe=Ie(St,Qe))}rn.allCues.addCue(Qe)}else p.error("Impossible to display subtitles. You might have missed setting a TTML rendering div via player.attachTTMLRenderingDiv(TTMLRenderingDiv)")}Qt()}}function Ke(et,wt){let Rt=ot(et,wt);return Rt.onenter=function(){$e(et)&&H&&H.cueID!==Rt.cueID&&fe(H),delete Rt.type,H=Rt,le(Rt)},Rt.onexit=function(){fe(Rt),H=null},Rt}function le(et){t.trigger(u.A.CUE_ENTER,et)}function fe(et){t.trigger(u.A.CUE_EXIT,{cueID:et.cueID})}function pe(et,wt,Rt){const Ht=this;let rn=ot(et,wt);return k.style.left=d+"px",k.style.top=N+"px",k.style.width=v+"px",k.style.height=q+"px",rn.onenter=function(){Rt.mode===U.A.TEXT_SHOWING&&(this.isd?(L?requestAnimationFrame(()=>oe(this)):oe(this),p.debug("Cue enter id:"+this.cueID)):(k.appendChild(this.cueHTMLElement),W.call(Ht,this),t.trigger(u.A.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:h})))},rn.onexit=function(){if(k){const Rn=k.childNodes;for(let ht=0;ht<Rn.length;++ht)Rn[ht].id===this.cueID&&(p.debug("Cue exit id:"+Rn[ht].id),k.removeChild(Rn[ht]),--ht)}},rn}function ze(et,wt,Rt){let Ht=ot(et,wt);if(et.styles)try{et.styles.align!==void 0&&"align"in Ht&&(Ht.align=et.styles.align),et.styles.line!==void 0&&"line"in Ht&&(Ht.line=et.styles.line),et.styles.lineAlign!==void 0&&(Ht.lineAlign=et.styles.lineAlign),et.styles.snapToLines!==void 0&&"snapToLines"in Ht&&(Ht.snapToLines=et.styles.snapToLines),et.styles.position!==void 0&&"position"in Ht&&(Ht.position=et.styles.position),et.styles.positionAlign!==void 0&&(Ht.positionAlign=et.styles.positionAlign),et.styles.size!==void 0&&"size"in Ht&&(Ht.size=et.styles.size)}catch(rn){p.error(rn)}return Ht.onenter=function(){Rt.mode===U.A.TEXT_SHOWING&&t.trigger(u.A.CAPTION_RENDERED,{currentTrackIdx:h})},Ht}function $e(et){return et.type==="html"}function ot(et,wt){return $e(et)?(function(Rt,Ht){let rn=new l(Rt.start+Ht,Rt.end+Ht,"");return rn.cueHTMLElement=Rt.cueHTMLElement,rn.isd=Rt.isd,rn.images=Rt.images,rn.embeddedImages=Rt.embeddedImages,rn.cueID=Rt.cueID,rn.scaleCue=W.bind(self),rn.isFromCEA608=Rt.isFromCEA608,rn.cellResolution=Rt.cellResolution,rn.lineHeight=Rt.lineHeight,rn.linePadding=Rt.linePadding,rn.fontSize=Rt.fontSize,rn.isd&&me(rn,rn.isd.contents),rn})(et,wt):(function(Rt,Ht){let rn=new l(Rt.start+Ht,Rt.end+Ht,Rt.data);return rn.cueID=Xn.A.generateUuid(),rn})(et,wt)}function Se(et){if(D){const wt=D.childNodes;for(let Rt=0;Rt<wt.length;++Rt)wt[Rt].id===et.cueID&&(D.removeChild(wt[Rt]),--Rt)}}function We(){const et=i.getTextTracks(),wt=[];for(const Rt of et)Rt.manualMode===U.A.TEXT_SHOWING&&wt.push(Rt);return wt}function rt(et){return et>=0&&_[et]?i.getTextTrack(_[et].kind,_[et].id,_[et].lang,_[et].isTTML,_[et].isEmbedded):null}function gt(et){if(et===h)return;h=et;const wt=rt(h);Ot.call(this,wt),$&&(clearInterval($),$=null),wt&&wt.renderingType==="html"&&(G.call(this,wt,!0),window.ResizeObserver?(J=new window.ResizeObserver(()=>{G.call(this,wt,!0)}),J.observe(i.getElement())):$=setInterval(G.bind(this,wt),500))}function Ot(et){bn.call(this),et&&et.renderingType==="html"?fn.call(this):En.call(this)}function zt(et,wt,Rt,Ht=!0){return!!et&&(isNaN(wt)||(Ht?et.startTime:et.endTime)>=wt)&&(isNaN(Rt)||(Ht?et.endTime:et.startTime)<=Rt)}function Wt(et,wt,Rt,Ht=!0){if(!et)return;if(et.cues&&et.cues.length>0)for(let Rn=et.cues.length-1;Rn>=0;Rn--)zt(et.cues[Rn],wt,Rt,Ht)&&(et.cues[Rn].onexit&&et.cues[Rn].onexit(),et.removeCue(et.cues[Rn]));const rn=w.get(et);if(rn){const Rn=rn.activeCues,ht=Rn.filter(xe=>xe.startTime>=wt&&xe.endTime<=Rt);ht.forEach(xe=>{c.get().streaming.text.dispatchForManualRendering?fe(xe):Se(xe)}),rn.activeCues=Rn.filter(xe=>!ht.includes(xe))}}function Qt(){for(const et of w.values())et.lastCueWindowUpdate=-1/0}function fn(){let et=document.getElementById("native-cue-style");if(et)return;et=document.createElement("style"),et.id="native-cue-style",document.head.appendChild(et);const wt=et.sheet,Rt=i.getElement();try{Rt&&(Rt.id?wt.insertRule("#"+Rt.id+"::cue {background: transparent}",0):Rt.classList.length!==0?wt.insertRule("."+Rt.className+"::cue {background: transparent}",0):wt.insertRule("video::cue {background: transparent}",0))}catch(Ht){p.info(""+Ht.message)}}function En(){const et=document.getElementById("native-cue-style");et&&document.head.removeChild(et)}function bn(){if(k)for(;k.firstChild;)k.removeChild(k.firstChild)}function Fn(){return _}return A={addCaptions:Oe,addTextTrackInfo:function(et){_.push(et)},createTracks:function(){_.sort(function(wt,Rt){return wt.index-Rt.index}),k=i.getTTMLRenderingDiv(),D=i.getVttRenderingDiv();let et=-1;for(let wt=0;wt<_.length;wt++){const Rt=O(_[wt]);I.push(Rt),_[wt].defaultTrack&&(Rt.default=!0,et=wt);const Ht=rt(wt);Ht&&(Ht.mode=U.A.TEXT_SHOWING,k&&(_[wt].isTTML||_[wt].isEmbedded)?Ht.renderingType="html":Ht.renderingType="default",w.set(Ht,{allCues:new Bl,lastCueWindowUpdate:-1/0,activeCues:[]})),Oe(wt,0,_[wt].captionData),t.trigger(u.A.TEXT_TRACK_ADDED)}if(gt.call(this,et),et>=0){let wt=function(){const Rt=rt(et);Rt&&Rt.renderingType==="html"&&G.call(this,Rt,!0),t.off(u.A.PLAYBACK_METADATA_LOADED,wt,this)};t.on(u.A.PLAYBACK_METADATA_LOADED,wt,this);for(let Rt=0;Rt<_.length;Rt++){const Ht=rt(Rt);if(Ht){const rn=c.get().streaming.text.dispatchForManualRendering;Ht.mode=Rt!==et||rn?U.A.TEXT_HIDDEN:U.A.TEXT_SHOWING,Ht.manualMode=Rt===et?U.A.TEXT_SHOWING:U.A.TEXT_HIDDEN}}}t.trigger(F.A.TEXT_TRACKS_QUEUE_INITIALIZED,{index:h,tracks:_,streamId:r.id})},deleteAllTextTracks:function(){const et=I?I.length:0;for(let wt=0;wt<et;wt++){const Rt=rt(wt);Rt&&Wt.call(this,Rt,r.start,r.start+r.duration,!1)}I=[],_=[],$&&(clearInterval($),$=null),J&&i&&(J.unobserve(i.getElement()),J=null),h=-1,bn.call(this),w.clear()},deleteCuesFromTrackIdx:function(et,wt,Rt){const Ht=rt(et);Ht&&Wt(Ht,wt,Rt)},disableManualTracks:function(){const et=We();if(et&&et.length>0){const wt=et[0],Rt=w.get(wt);if(!Rt)return;Rt.activeCues.forEach(Ht=>{c.get().streaming.text.dispatchForManualRendering?fe(Ht):Se(Ht)}),Rt.activeCues=[]}},getCurrentTrackIdx:function(){return h},getCurrentTextTrackInfo:function(){return _[h]},getStreamId:function(){return r.id},getTextTrackInfos:Fn,getTrackIdxForId:function(et){let wt=-1;for(let Rt=0;Rt<_.length;Rt++)if(_[Rt].id===et){wt=Rt;break}return wt},initialize:function(){typeof window<"u"&&typeof navigator<"u"&&(l=window.VTTCue||window.TextTrackCue,_=[],I=[],h=-1,d=0,N=0,v=0,q=0,k=null,D=null,$=null,ee=!1,M=2147483647,te=null,L="requestAnimationFrame"in window,w.clear(),document.fullscreenElement!==void 0?B="fullscreenElement":document.webkitIsFullScreen!==void 0?B="webkitIsFullScreen":document.msFullscreenElement?B="msFullscreenElement":document.mozFullScreen&&(B="mozFullScreen"))},manualCueProcessing:function(et){const wt=We();if(wt&&wt.length>0){const Rt=wt[0],Ht=w.get(Rt);if(!Ht)return;const rn=Ht.activeCues,Rn=Ht.allCues.findCuesAtTime(et),ht=rn.filter(Qe=>!Rn.includes(Qe)),xe=Rn.filter(Qe=>!rn.includes(Qe));ht.forEach(Qe=>{c.get().streaming.text.dispatchForManualRendering?fe(Qe):Se(Qe)}),xe.forEach(Qe=>{c.get().streaming.text.dispatchForManualRendering?le(Qe):WebVTT.processCues(window,[Qe],D,Qe.cueID)}),Ht.activeCues=Rn}},setCurrentTrackIdx:gt,setModeForTrackIdx:function(et,wt){const Rt=rt(et);Rt&&Rt.mode!==wt&&(Rt.mode=wt),Rt&&Rt.manualMode!==wt&&(Rt.manualMode=wt)},updateTextTrackWindow:function(et,wt=!1){const Rt=Fn(),Ht=c.get().streaming.text.webvtt.customRenderingEnabled;for(let rn=0;rn<Rt.length;rn++){const Rn=Rt[rn],ht=rt(rn),xe=w.get(ht);if(!ht||!xe||!Rn.isEmbedded&&Ht)continue;const{bufferToKeep:Qe,bufferPruningInterval:at}=c.get().streaming.buffer,St=Date.now();if((St-xe.lastCueWindowUpdate)/1e3<at&&!wt)continue;const ut=i.getPlaybackRate()||1,xt=Math.max(0,et-Qe/ut),en=et+2*at/ut;if(ht.cues)for(;ht.cues.length>0;)ht.removeCue(ht.cues[0]);ht.mode!==U.A.TEXT_DISABLED&&xe.allCues.findCuesInRange(xt,en).forEach(an=>{ht.addCue(an)}),xe.lastCueWindowUpdate=St}},invalidateCueWindow:Qt},p=(0,j.A)(e).getInstance().getLogger(A),A}Ss.__dashjs_factory_name="TextTracks";var kl=o.A.getClassFactory(Ss);function Is(){const n=this.context;let e,t,i,r,c,A;function p(h){const d=h.split(":"),N=d.length-1;return h=60*parseInt(d[N-1],10)+parseFloat(d[N]),N===2&&(h+=3600*parseInt(d[0],10)),h}function l(h){const d=h.split(r),N=d[1].split(A);return N.shift(),d[1]=N[0],N.shift(),{cuePoints:d,styles:_(N)}}function _(h){const d={};return h.forEach(function(N){const v=N.split(":");if(v.length>1){const[q,k]=v;switch(q){case"align":case"A":d.align=k;break;case"line":case"L":const[D,$]=k.split(","),B=D.endsWith("%");d.line=D==="auto"?D:parseInt(D,10),B&&(d.snapToLines=!1),$&&(d.lineAlign=$);break;case"position":case"P":const[ee,te]=k.split(",");d.position=parseInt(ee,10),te&&(d.positionAlign=te);break;case"size":case"S":d.size=parseInt(k,10)}}}),d}function I(h,d){let N,v=d,q="",k="";for(;h[v]!==""&&v<h.length;)v++;if(N=v-d,N>1)for(let D=0;D<N;D++){if(k=h[d+D],k.match(r)){q="";break}q+=k,D!==N-1&&(q+=`
21
+ `)}else k=h[d],k.match(r)||(q=k);return q}return e={parse:function(h){const d=[];let N,v;if(!h)return d;N=(h=h.split(i)).length,v=-1;for(let q=0;q<N;q++){let k=h[q];if(k.length>0&&k!=="WEBVTT"&&k.match(r)){const D=l(k),$=D.cuePoints,B=D.styles,ee=I(h,q+1),te=p($[0].replace(c,"")),M=p($[1].replace(c,""));!isNaN(te)&&!isNaN(M)&&te>=v&&M>te?ee!==""?(v=te,d.push({start:te,end:M,data:ee,styles:B})):t.error("Skipping cue due to empty/malformed cue text"):t.error("Skipping cue due to incorrect cue timing")}}return d},getCaptionStyles:_},t=(0,j.A)(n).getInstance().getLogger(e),i=/(?:\r\n|\r|\n)/gm,r=/-->/,c=/(^[\s]+|[\s]+$)/g,A=/\s\b/g,e}Is.__dashjs_factory_name="VTTParser";var Gl=o.A.getSingletonFactory(Is);function Rs(){let n,e;return n={parse:function(t){let i=[];return e.oncue=function(r){r.start=r.startTime,r.end=r.endTime,r.data=r.text,r.styles={align:r.align,line:r.line,position:r.position,size:r.size},i.push(r)},e.parse(t),i}},(function(){try{window&&window.WebVTT&&window.WebVTT.Parser&&(e=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder()))}catch{}})(),n}Rs.__dashjs_factory_name="VttCustomRenderingParser";var Yl=o.A.getSingletonFactory(Rs);function Ns(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r=0;function c(){const A="cue_TTML_"+r;return r++,A}return t={parse:function(A,p,l,_,I){let h="";const d=[];let N,v,q;const k={},D={};let $="",B="",ee={onOpenTag:function(J,L,H){if(H[" imagetype"]&&!H[" imageType"]&&(e.trigger(u.A.CONFORMANCE_VIOLATION,{level:si.LEVELS.ERROR,event:si.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),H[" imageType"]=H[" imagetype"]),L==="image"&&(J==="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"||J==="http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt")){if(!H[" imageType"]||H[" imageType"].value!=="PNG")return void i.warn("smpte-tt imageType != PNG. Discarded");$=H["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){$&&(D[$]=B.trim()),B="",$=""},onText:function(J){$&&(B+=J)}};if(!A)throw h="no ttml data to parse",new Error(h);k.data=A,e.trigger(F.A.TTML_TO_PARSE,k);let te=(0,ji.fromXML)(k.data,function(J){h=J},ee);e.trigger(F.A.TTML_PARSED,{ttmlString:k.data,ttmlDoc:te});const M=te.getMediaTimeEvents();for(q=0;q<M.length;q++){let J=(0,ji.generateISD)(te,M[q],function(L){h=L});J.contents.some(L=>L.contents.length)&&(N=M[q]+p,v=q+1<M.length?M[q+1]+p:_,N<v&&d.push({start:N,end:v,type:"html",cueID:c(),isd:J,images:I,embeddedImages:D}))}if(h!=="")throw i.error(h),new Error(h);return d}},i=(0,j.A)(n).getInstance().getLogger(t),t}Ns.__dashjs_factory_name="TTMLParser";var ql=o.A.getSingletonFactory(Ns);function Cs(n){let e=this.context;const t=(0,m.A)(e).getInstance(),i=(0,ln.A)(e).getInstance(),r=n.adapter,c=n.baseURLController;let A,p,l;function _(d,N){let v,q,k=!1;if(c.resolve()){const B=r.getVoRepresentations(d);B&&B.length>0&&(v=c.resolve(B[0].path).url)}const D=d.essentialProperties.filter(B=>B.schemeIdUri&&B.schemeIdUri===U.A.FONT_DOWNLOAD_DVB_SCHEME),$=d.supplementalProperties.filter(B=>B.schemeIdUri&&B.schemeIdUri===U.A.FONT_DOWNLOAD_DVB_SCHEME);D.length>0?(k=!0,q=D):q=$,q.forEach(B=>{if((function(M){return!(!(M.value&&parseInt(M.value)===1&&M.dvbUrl&&M.dvbUrl.length>0&&M.dvbFontFamily&&M.dvbFontFamily.length>0&&M.dvbMimeType)||M.dvbMimeType!==U.A.OFF_MIMETYPE&&M.dvbMimeType!==U.A.WOFF_MIMETYPE)})(B)){let M=(ee=B.dvbUrl,te=v,i.isPathAbsolute(ee)?ee:i.isRelative(ee)?te?i.resolve(ee,te):i.resolve(ee):ee);l.push({fontFamily:B.dvbFontFamily,url:M,mimeType:B.dvbMimeType,trackId:d.id,streamId:N,isEssential:k,status:"unloaded",fontFace:new FontFace(B.dvbFontFamily,`url(${M})`,{display:"swap"})})}var ee,te})}function I(d,N){const v=l[d];l[d]={...v,status:N}}function h(){l=[]}return A={addFontsFromTracks:function(d,N){if(d&&Array.isArray(d)&&N)for(let v=0;v<d.length;v++)_(d[v],N)},downloadFonts:function(){for(let d=0;d<l.length;d++){let N=l[d];document.fonts.add(N.fontFace),t.trigger(u.A.DVB_FONT_DOWNLOAD_ADDED,N),N.fontFace.load().then(()=>{I(d,"loaded"),t.trigger(u.A.DVB_FONT_DOWNLOAD_COMPLETE,N)},v=>{I(d,"error"),p.debug("Font download error: ",v),t.trigger(u.A.DVB_FONT_DOWNLOAD_FAILED,N)})}},getFonts:function(){return l},getFontsForTrackId:function(d){return l.filter(N=>N.trackId&&N.trackId===d)},reset:function(){(function(){for(const d of l){let N=document.fonts.delete(d.fontFace);p.debug(`Removal of fontFamily: ${d.fontFamily} was ${N?"successful":"unsuccessful"}`)}})(),h()}},p=(0,j.A)(e).getInstance().getLogger(A),h(),A}Cs.__dashjs_factory_name="DVBFonts";var Vl=o.A.getClassFactory(Cs);function bs(n){let e=this.context;const t=n.adapter,i=n.errHandler,r=n.manifestModel,c=n.mediaController,A=n.baseURLController,p=n.videoModel,l=n.settings,_=n.timelineConverter;let I,h,d,N,v,q,k,D,$,B,ee,te,M,J;function L(me){if(J.error(`Could not download ${me.isEssential?"an essential":"a"} font - fontFamily: ${me.fontFamily}, url: ${me.url}`),me.isEssential){let Oe=N[me.streamId].getTrackIdxForId(me.trackId);N[me.streamId].setModeForTrackIdx(Oe,U.A.TEXT_DISABLED)}}function H(me){if(J.debug(`Successfully downloaded ${me.isEssential?"an essential":"a"} font - fontFamily: ${me.fontFamily}, url: ${me.url}`),me.isEssential){let Oe=N[me.streamId].getTrackIdxForId(me.trackId);Oe===N[me.streamId].getCurrentTrackIdx()?N[me.streamId].setModeForTrackIdx(Oe,U.A.TEXT_SHOWING):N[me.streamId].setModeForTrackIdx(Oe,U.A.TEXT_HIDDEN)}}function w(me){let Oe=me.tracks,Ke=me.index;const le=me.streamId;if(l.get().streaming.text.defaultEnabled===!1&&!ie()||te)oe(le,-1);else{const fe=c.getCurrentTrackFor(U.A.TEXT,le);if(fe){const pe={lang:fe.lang,role:fe.roles[0],index:fe.index,codec:fe.codec,accessibility:fe.accessibility[0]};pe.lang=c.getAvailablePreferredLanguages(Oe,pe),Oe.some((ze,$e)=>{if(c.matchSettings(pe,ze))return oe(le,$e),Ke=$e,!0})}$=!1}h[le].lastEnabledIndex=Ke,D.trigger(u.A.TEXT_TRACKS_ADDED,{enabled:ie(),index:Ke,tracks:Oe,streamId:le}),ee=!0,M.addFontsFromTracks(Oe,le),M.getFonts().forEach(fe=>{if(fe.isEssential){let pe=N[fe.streamId].getTrackIdxForId(fe.trackId);N[fe.streamId].setModeForTrackIdx(pe,U.A.TEXT_DISABLED)}}),M.downloadFonts()}function O(me){try{const Oe=me.streamId,Ke=N[Oe];if(!Ke||isNaN(me.time))return;Ke.updateTextTrackWindow(me.time),l.get().streaming.text.webvtt.customRenderingEnabled&&Ke.manualCueProcessing(me.time)}catch{}}function x(me){try{const Oe=me.streamId;if(!N[Oe])return;N[Oe].disableManualTracks()}catch{}}function G(me){try{const Oe=N[me.streamId];if(!Oe)return;const Ke=p.getTime()||0;Oe.updateTextTrackWindow(Ke,!0)}catch(Oe){J.error(Oe)}}function W(me){try{if(!me||!me.mediaType||me.mediaType!==U.A.AUDIO||!me.currentMediaInfo)return;const Oe=N[me.streamId].getCurrentTextTrackInfo();let Ke=NaN;$?Ke=Ae(me.streamId):ke(Oe)&&me.currentMediaInfo.lang&&me.currentMediaInfo.lang!==Oe.lang&&(Ke=Ae(me.streamId),isNaN(Ke)&&(Ke=-1)),isNaN(Ke)||oe(me.streamId,Ke)}catch(Oe){J.error(Oe)}}function ie(){let me=!0;return $&&!B&&(me=!1),me}function oe(me,Oe){$=Oe===-1,$&&D.trigger(F.A.BUFFER_LEVEL_UPDATED,{mediaType:U.A.TEXT,bufferLevel:-1},{streamId:me,mediaType:U.A.TEXT}),$&&c&&c.saveTextSettingsDisabled();let Ke=Ie(me);if(Ke===Oe||!N[me])return;N[me].disableManualTracks(),N[me].invalidateCueWindow();let le=N[me].getCurrentTextTrackInfo(),fe=le?p.getTextTrack(le.kind,le.id,le.lang,le.isTTML,le.isEmbedded):null;fe&&fe.mode!==U.A.TEXT_DISABLED&&N[me].setModeForTrackIdx(Ke,U.A.TEXT_HIDDEN),N[me].setCurrentTrackIdx(Oe),le=N[me].getCurrentTextTrackInfo();const pe=l.get().streaming.text.dispatchForManualRendering;if(le&&!pe&&le.mode!==U.A.TEXT_DISABLED&&N[me].setModeForTrackIdx(Oe,U.A.TEXT_SHOWING),le&&le.isFragmented&&!le.isEmbedded)(function(ze,$e,ot){if(!d[ze])return;let Se=d[ze].getConfig().fragmentedTracks;for(let We=0;We<Se.length;We++){let rt=Se[We];if($e.lang===rt.lang&&(rt.id?$e.id===rt.id:$e.index===rt.index)){let gt=c.getCurrentTrackFor(U.A.TEXT,ze);(rt.id?gt.id!==rt.id:gt.index!==rt.index)?(N[ze].deleteCuesFromTrackIdx(ot),d[ze].setCurrentFragmentedTrackIdx(We)):ot===-1&&D.trigger(F.A.SET_FRAGMENTED_TEXT_AFTER_DISABLED,{},{streamId:ze,mediaType:U.A.TEXT})}}})(me,le,Ke);else if(le&&!le.isFragmented)(function(ze,$e){D.trigger(F.A.SET_NON_FRAGMENTED_TEXT,{currentTrackInfo:$e},{streamId:ze,mediaType:U.A.TEXT})})(me,le);else if(!le&&$){const ze=Ae(me);return void(isNaN(ze)||oe(me,ze))}c.setTrack(le)}function Ae(me){const Oe=(function(fe){return N[fe].getTextTrackInfos().filter((pe,ze)=>(pe._indexToSelect=ze,!!(pe&&pe.roles&&pe.roles.length>0)&&ke(pe)))})(me);if(!Oe||Oe.length<=0)return NaN;const Ke=c.getCurrentTrackFor(U.A.AUDIO,me);if(!Ke)return NaN;const le=Oe.find(fe=>Ke.lang===fe.lang);return le?le._indexToSelect:NaN}function ke(me){return!(!me||!me.roles||me.roles.length===0)&&me.roles.some(Oe=>Oe.schemeIdUri===U.A.DASH_ROLE_SCHEME_ID&&Oe.value===Fe.A.FORCED_SUBTITLE)}function Ie(me){return N[me].getCurrentTrackIdx()}function be(){d={},N={},h={},$=!0,ee=!1,te=!1}return I={addEmbeddedTrack:function(me,Oe){const Ke=me.id;d[Ke]&&d[Ke].addEmbeddedTrack(Oe)},addMediaInfosToBuffer:function(me,Oe,Ke,le=null){const fe=me.id;d[fe]&&d[fe].addMediaInfos(Oe,Ke,le)},createTracks:function(me){const Oe=me.id;N[Oe]&&N[Oe].createTracks()},deactivateStream:function(me){if(!me)return;const Oe=me.id;d[Oe]&&d[Oe].resetMediaInfos(),N[Oe]&&N[Oe].deleteAllTextTracks()},enableForcedTextStreaming:function(me){return(0,Rr.sq)(me,"boolean"),B=me,!0},enableText:function(me,Oe){return(0,Rr.sq)(Oe,"boolean"),ie()!==Oe&&(Oe&&oe(me,h[me].lastEnabledIndex),Oe||(h[me].lastEnabledIndex=Ie(me),ee?oe(me,-1):te=!0)),!0},getAllTracksAreDisabled:function(){return $},getCurrentTrackIdx:Ie,getTextSourceBuffer:function(me){const Oe=me.id;if(d&&d[Oe])return d[Oe]},initialize:function(){M=Vl(e).create({adapter:t,baseURLController:A}),D.on(F.A.TEXT_TRACKS_QUEUE_INITIALIZED,w,I),D.on(F.A.DVB_FONT_DOWNLOAD_FAILED,L,I),D.on(F.A.DVB_FONT_DOWNLOAD_COMPLETE,H,I),D.on(F.A.MEDIAINFO_UPDATED,W,I),D.on(F.A.PLAYBACK_TIME_UPDATED,O,I),l.get().streaming.text.webvtt.customRenderingEnabled&&D.on(F.A.PLAYBACK_SEEKING,x,I),D.on(F.A.PLAYBACK_SEEKED,G,I)},initializeForStream:function(me){const Oe=me.id,Ke=kl(e).create({videoModel:p,settings:l,streamInfo:me});Ke.initialize(),N[Oe]=Ke;const le=xl(e).create({errHandler:i,adapter:t,dvbFonts:M,manifestModel:r,mediaController:c,videoModel:p,textTracks:Ke,vttParser:v,vttCustomRenderingParser:q,ttmlParser:k,streamInfo:me,settings:l,timelineConverter:_});le.initialize(),d[Oe]=le,h[Oe]={},h[Oe].lastEnabledIndex=-1},isTextEnabled:ie,reset:function(){Object.keys(d).forEach(me=>{d[me].resetEmbedded(),d[me].reset()}),M.reset(),be(),D.off(F.A.TEXT_TRACKS_QUEUE_INITIALIZED,w,I),D.off(F.A.DVB_FONT_DOWNLOAD_FAILED,L,I),D.off(F.A.DVB_FONT_DOWNLOAD_COMPLETE,H,I),D.off(F.A.MEDIAINFO_UPDATED,W,I),D.off(F.A.PLAYBACK_TIME_UPDATED,O,I),l.get().streaming.text.webvtt.customRenderingEnabled&&D.off(F.A.PLAYBACK_SEEKING,x,I),D.off(F.A.PLAYBACK_SEEKED,G,I)},setTextTrack:oe,clearDataForStream:function(me){d[me]&&(d[me].resetEmbedded(),d[me].reset(),delete d[me]),N[me]&&(N[me].deleteAllTextTracks(),delete N[me]),h[me]&&delete h[me]}},B=!1,ee=!1,te=!1,v=Gl(e).getInstance(),q=Yl(e).getInstance(),k=ql(e).getInstance(),D=(0,m.A)(e).getInstance(),J=(0,j.A)(e).getInstance().getLogger(I),be(),I}bs.__dashjs_factory_name="TextController";var Kl=o.A.getClassFactory(bs);function vs(n){n=n||{};const e=this.context,t=(0,j.A)(e).getInstance(),i=n.settings,r=(0,m.A)(e).getInstance();let c,A,p,l,_,I;function h(){return navigator&&navigator.connection&&!isNaN(navigator.connection.downlink)&&navigator.connection.downlink>0?1e3*navigator.connection.downlink:NaN}function d(q,k,D,$){const B=Math.pow(.5,D/$.fast);q.fastEstimate=(1-B)*k+B*q.fastEstimate;const ee=Math.pow(.5,D/$.slow);q.slowEstimate=(1-ee)*k+ee*q.slowEstimate,q.totalWeight+=D}function N(){c={},A={},p={},l={}}const v={addEntry:function(q,k){try{if(!(q&&k&&k.trace&&k.trace.length))return;(function(B){c[B]=c[B]||[],A[B]=A[B]||[],p[B]=p[B]||{fastEstimate:0,slowEstimate:0,totalWeight:0},l[B]=l[B]||{fastEstimate:0,slowEstimate:0,totalWeight:0}})(q);const D=k.tresponse.getTime()-k.trequest.getTime()||1;let $=(function(B,ee){return B._fileLoaderType&&B._fileLoaderType===U.A.FILE_LOADER_TYPES.FETCH?(function(te){const M=te.trace.reduce((H,w)=>H+w.b[0],0),J=te.trace.reduce((H,w)=>H+w.d,0);let L=NaN;return i.get().streaming.abr.throughput.useNetworkInformationApi.fetch&&(L=h()),isNaN(L)&&(L=Math.round(8*M/J)),{downloadedBytes:M,value:L,downloadTimeInMs:J}})(B):(function(te,M){let J=NaN,L=NaN,H=!1;if(i.get().streaming.abr.throughput.useResourceTimingApi&&te._resourceTimingValues)J=te._resourceTimingValues.transferSize,L=te._resourceTimingValues.responseEnd-te._resourceTimingValues.responseStart,H=!0;else{if(te.trace.length<=1)return{throughput:NaN,downloadTimeInMs:NaN};J=te.trace.reduce((O,x)=>O+x.b[0],0)-te.trace[0].b[0],L=Math.max(te.trace.reduce((O,x)=>O+x.d,0)-te.trace[0].d,1)}let w=NaN;if(!H&&i.get().streaming.abr.throughput.useNetworkInformationApi.xhr&&(w=h()),isNaN(w)){const O=i.get().streaming.abr.throughput.useDeadTimeLatency?L:L+M;w=Math.round(8*J/O)}return{downloadedBytes:J,value:w,downloadTimeInMs:L}})(B,ee)})(k,D);if($.latencyInMs=D,isNaN($.value)||!isFinite($.value))return;if(k._cmsd){const B=k._cmsd.dynamic&&k._cmsd.dynamic.etp?k._cmsd.dynamic.etp:null;if(B){const ee=i.get().streaming.cmsd.abr.etpWeightRatio;ee>0&&ee<=1&&($.value=$.value*(1-ee)+B*ee)}}if((function(B,ee,te){return i.get().streaming.abr.throughput.useResourceTimingApi&&te._resourceTimingValues?te._resourceTimingValues.transferSize===0&&te._resourceTimingValues.decodedBodySize>0:!isNaN(ee)&&(B===U.A.VIDEO?ee<i.get().streaming.cacheLoadThresholds[U.A.VIDEO]:B===U.A.AUDIO?ee<i.get().streaming.cacheLoadThresholds[U.A.AUDIO]:void 0)})(q,k._tfinish.getTime()-k.trequest.getTime(),k))return void I.debug(`${q} Assuming segment ${k.url} came from cache, ignoring it for throughput calculation`);I.debug(`Added throughput entry for ${q}: ${$.value} kbit/s`),$.serviceLocation=k._serviceLocation,c[q].push($),A[q].push({value:D}),(function(B){c[B].length>i.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&c[B].shift(),A[B].length>i.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&A[B].shift()})(q),r.trigger(u.A.THROUGHPUT_MEASUREMENT_STORED,{throughputValues:$}),k.type!==Ee.G.MPD_TYPE&&(d(p[q],$.value,i.get().streaming.abr.throughput.ewma.weightDownloadTimeMultiplicationFactor*$.downloadTimeInMs,_.bandwidthHalfLife),d(l[q],D,1,_.latencyHalfLife))}catch(D){I.error(D)}},getThroughputDict:function(q){return q?c[q]:c},getEwmaThroughputDict:function(q){return q?p[q]:p},getEwmaLatencyDict:function(q){return q?l[q]:l},getEwmaHalfLife:function(){return _},getLatencyDict:function(q){return q?A[q]:A},reset:N};return I=t.getLogger(v),_={bandwidthHalfLife:{fast:i.get().streaming.abr.throughput.ewma.throughputFastHalfLifeSeconds,slow:i.get().streaming.abr.throughput.ewma.throughputSlowHalfLifeSeconds},latencyHalfLife:{fast:i.get().streaming.abr.throughput.ewma.latencyFastHalfLifeCount,slow:i.get().streaming.abr.throughput.ewma.latencySlowHalfLifeCount}},N(),v}vs.__dashjs_factory_name="ThroughputModel";var Hl=o.A.getClassFactory(vs);function Ds(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r;function c(){performance.clearResourceTimings()}function A(B){B.metric!==mt.HTTP_REQUEST||!B.value||B.value.type!==Ee.G.MPD_TYPE&&(B.value.type!==Ee.G.MEDIA_SEGMENT_TYPE||B.mediaType!==U.A.AUDIO&&B.mediaType!==U.A.VIDEO)||t.addEntry(B.mediaType,B.value)}function p(B,ee,te=null,M=NaN){let J,L=null,H=t.getEwmaHalfLife(),w=null,O=!0;switch(te||(te=r.get().streaming.abr.throughput.averageCalculationMode),B){case U.A.THROUGHPUT_TYPES.BANDWIDTH:L=te===U.A.THROUGHPUT_CALCULATION_MODES.EWMA?t.getEwmaThroughputDict(ee):t.getThroughputDict(ee),w=H.bandwidthHalfLife,O=!0,M=isNaN(M)?i.getIsDynamic()?r.get().streaming.abr.throughput.sampleSettings.live:r.get().streaming.abr.throughput.sampleSettings.vod:M;break;case U.A.THROUGHPUT_TYPES.LATENCY:L=te===U.A.THROUGHPUT_CALCULATION_MODES.EWMA?t.getEwmaLatencyDict(ee):t.getLatencyDict(ee),w=H.latencyHalfLife,O=!1,M=isNaN(M)?r.get().streaming.abr.throughput.sampleSettings.averageLatencySampleAmount:M}if(!L||L.length===0)return NaN;switch(te){case U.A.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN:return J=l(L,M,B),_(L,J);case U.A.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:return J=l(L,M,B),I(L,J);case U.A.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_ARITHMETIC_MEAN:return J=l(L,M,B),h(L,J);case U.A.THROUGHPUT_CALCULATION_MODES.HARMONIC_MEAN:return J=l(L,M,B),d(L,J);case U.A.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:return J=l(L,M,B),N(L,J);case U.A.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_HARMONIC_MEAN:return J=l(L,M,B),v(L,J);case U.A.THROUGHPUT_CALCULATION_MODES.EWMA:return q(L,w,O);case U.A.THROUGHPUT_CALCULATION_MODES.ZLEMA:return J=l(L,M,B),k(L,J)}}function l(B,ee,te){if(B){if(ee>=B.length)ee=B.length;else if(te===U.A.THROUGHPUT_TYPES.BANDWIDTH&&r.get().streaming.abr.throughput.sampleSettings.enableSampleSizeAdjustment)for(let M=1;M<ee;++M){const J=B[B.length-M].value/B[B.length-M-1].value;if((J>=r.get().streaming.abr.throughput.sampleSettings.increaseScale||J<=r.get().streaming.abr.throughput.sampleSettings.decreaseScale)&&(ee+=1)===B.length)break}}else ee=0;return ee}function _(B,ee){let te=B;return ee!==0&&te&&te.length!==0?(te=te.slice(-ee),te.reduce((M,J)=>M+J.value,0)/te.length):NaN}function I(B,ee){let te=B;if(ee===0||!te||te.length===0)return NaN;te=te.slice(-ee);let M=0;return te.reduce((J,L)=>{let H=Math.sqrt(L.downloadedBytes);return M+=H,J+L.value*H},0)/M}function h(B,ee){let te=B;if(ee===0||!te||te.length===0)return NaN;te=te.slice(-ee);let M=0;return te.reduce((J,L,H)=>{let w=H+1;return M+=w,J+L.value*w},0)/M}function d(B,ee){let te=B;if(ee===0||!te||te.length===0)return NaN;te=te.slice(-ee);const M=te.reduce((J,L)=>J+1/L.value,0);return te.length/M}function N(B,ee){let te=B;if(ee===0||!te||te.length===0)return NaN;te=te.slice(-ee);let M=0;const J=te.reduce((L,H)=>{let w=Math.sqrt(H.downloadedBytes);return M+=w,L+1/H.value*w},0);return M/J}function v(B,ee){let te=B;if(ee===0||!te||te.length===0)return NaN;te=te.slice(-ee);let M=0;const J=te.reduce((L,H,w)=>{let O=w+1;return M+=O,L+1/H.value*O},0);return M/J}function q(B,ee,te=!0){if(!B||B.totalWeight<=0)return NaN;const M=B.fastEstimate/(1-Math.pow(.5,B.totalWeight/ee.fast)),J=B.slowEstimate/(1-Math.pow(.5,B.totalWeight/ee.slow));return te?Math.min(M,J):Math.max(M,J)}function k(B,ee){if(ee===0||!B||B.length===0)return NaN;let te=B.slice(-ee).map(H=>H.value),M=2/(te.length+1),J=te[te.length-1],L=te[te.length-1];for(let H=0;H<te.length;H++)J=M*te[H]+(1-M)*J,L=M*J+(1-M)*L;return L}function D(B,ee=null,te=NaN){const M=p(U.A.THROUGHPUT_TYPES.BANDWIDTH,B,ee,te);return Math.round(M)}const $={getArithmeticMean:_,getAverageLatency:function(B,ee=null,te=NaN){const M=p(U.A.THROUGHPUT_TYPES.LATENCY,B,ee,te);return Math.round(M)},getAverageThroughput:D,getByteSizeWeightedArithmeticMean:I,getByteSizeWeightedHarmonicMean:N,getDateWeightedArithmeticMean:h,getDateWeightedHarmonicMean:v,getEwma:q,getHarmonicMean:d,getRawThroughputData:function(B){return B?t.getThroughputDict(B):[]},getSafeAverageThroughput:function(B,ee=null,te=NaN){let M=D(B,ee,te);return isNaN(M)||(M*=r.get().streaming.abr.throughput.bandwidthSafetyFactor),M},getZlema:k,initialize:function(){var B,ee;t=Hl(n).create({settings:r}),e.on(u.A.METRIC_ADDED,A,$),(ee=(B=window.performance)==null?void 0:B.addEventListener)==null||ee.call(B,"resourcetimingbufferfull",c)},reset:function(){var B,ee;t.reset(),e.off(u.A.METRIC_ADDED,A,$),(ee=(B=window.performance)==null?void 0:B.removeEventListener)==null||ee.call(B,"resourcetimingbufferfull",c)},setConfig:function(B){B.settings&&(r=B.settings),B.playbackController&&(i=B.playbackController)}};return $}Ds.__dashjs_factory_name="ThroughputController";var jl=o.A.getSingletonFactory(Ds);function Ms(){const n=this.context,e=(0,m.A)(n).getInstance(),t=(0,E.A)(n).getInstance();let i,r,c,A;function p(D){A=D}function l(D,$,B,ee){let te,M=$.adaptation.period.mpd;const J=M.availabilityStartTime;if(ee)te=B&&M.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(J.getTime()+1e3*(D+M.timeShiftBufferDepth)):M.availabilityEndTime;else if(B){const L=$.availabilityTimeOffset;te=new Date(J.getTime()+1e3*(D-L))}else te=J;return te}function _(D,$){return(D.getTime()-$.mpd.availabilityStartTime.getTime()+1e3*A)/1e3}function I(D,$){return D+($.adaptation.period.start-$.presentationTimeOffset)}function h(D){const $={start:NaN,end:NaN},B=D[0].getAdapter().getRegularPeriods()[0],ee=_(new Date,B);if(!D||D.length===0)return{range:$,now:ee};D.forEach(M=>{let J=M.getCurrentRepresentationForType(U.A.VIDEO);if(J||(J=M.getCurrentRepresentationForType(U.A.AUDIO)),!J){const H=M.getAdapter(),w=H.getMediaInfoForType(M.getStreamInfo(),U.A.VIDEO)||H.getMediaInfoForType(M.getStreamInfo(),U.A.AUDIO);J=H.getVoRepresentations(w)[0]}let L={start:NaN,end:NaN};if(J)if(J.segmentInfoType===Fe.A.SEGMENT_TIMELINE)L=(function(H){const w=H.adaptation.period.mpd.manifest.Period[H.adaptation.period.index].AdaptationSet[H.adaptation.index],O=r.getRepresentationFor(H.index,w),x=O.SegmentTemplate||O.SegmentList,G=x.SegmentTimeline,W=x.timescale,ie=G.S,oe={start:0,end:0},Ae=ie[0].t,ke=!isNaN(Ae),Ie=ke?Ae:0;let be,me,Oe,Ke,le=0;for(ke&&(oe.start=I(Ie/W,H)),Oe=0,Ke=ie.length;Oe<Ke;Oe++)be=ie[Oe],me=0,be.hasOwnProperty("r")&&(me=be.r),le+=be.d*(1+me);return oe.end=I((Ie+le)/W,H),oe})(J);else{const H=J.adaptation.period;L.start=H.start,L.end=Math.max(ee,H.start+H.duration)}!isNaN(L.start)&&(isNaN($.start)||$.start>L.start)&&($.start=L.start),!isNaN(L.end)&&(isNaN($.end)||$.end<L.end)&&($.end=L.end)}),$.end=Math.min(ee,$.end);const te=N(D,$.end,!0);return $.end=isNaN(te)?$.end:te,$.start=B&&B.mpd&&B.mpd.timeShiftBufferDepth&&!isNaN(B.mpd.timeShiftBufferDepth)&&!isNaN($.end)?Math.max($.end-B.mpd.timeShiftBufferDepth,$.start):$.start,$.start=N(D,$.start),{range:$,now:ee}}function d(D,$){c=D-$.end}function N(D,$,B=!1){try{let ee=0,te=!1,M=NaN;for(;!te&&ee<D.length;){const J=D[ee].getStreamInfo();J.start<=$&&(!isFinite(J.duration)||J.start+J.duration>=$)?(M=$,te=!0):!B&&J.start>$&&(isNaN(M)||J.start<M)?M=J.start:B&&J.start+J.duration<$&&(isNaN(M)||J.start+J.duration>M)&&(M=J.start+J.duration),ee+=1}return M}catch{return $}}function v(D){D.offset===void 0||isNaN(D.offset)||p(D.offset/1e3)}function q(){A=0,c=0}function k(){e.off(F.A.UPDATE_TIME_SYNC_OFFSET,v,this),q()}return i={calcAvailabilityEndTimeFromPresentationTime:function(D,$,B){return l(D,$,B,!0)},calcAvailabilityStartTimeFromPresentationTime:function(D,$,B){return l(D,$,B)},calcMediaTimeFromPresentationTime:function(D,$){return D-$.adaptation.period.start+$.presentationTimeOffset},calcPeriodRelativeTimeFromMpdRelativeTime:function(D,$){return $-D.adaptation.period.start},calcPresentationTimeFromMediaTime:I,calcPresentationTimeFromWallTime:_,calcTimeShiftBufferWindow:function(D,$){if(!$)return(function(B){const ee={start:NaN,end:NaN};let te=NaN,M=NaN;return B.forEach(J=>{const L=J.getStreamInfo();(isNaN(te)||L.start<te)&&(te=L.start);const H=L.start+L.duration;(isNaN(M)||H>M)&&(M=H)}),ee.start=te,ee.end=M,ee})(D);if(t.get().streaming.timeShiftBuffer.calcFromSegmentTimeline){const B=h(D);return d(B.now,B.range),B.range}return(function(B){const ee={start:NaN,end:NaN};if(!B||B.length===0)return ee;const te=B[0].getAdapter().getRegularPeriods()[0],M=_(new Date,te),J=te.mpd.timeShiftBufferDepth,L=isNaN(J)?0:M-J;if(ee.start=N(B,L),ee.end=!isNaN(ee.start)&&M<ee.start?M:N(B,M,!0),!isNaN(J)&&ee.end<M-J&&(ee.end=NaN),t.get().streaming.timeShiftBuffer.fallbackToSegmentTimeline){const H=h(B);if(H.range.end<ee.start)return e.trigger(u.A.CONFORMANCE_VIOLATION,{level:si.LEVELS.WARNING,event:si.EVENTS.INVALID_DVR_WINDOW}),d(H.now,H.range),H.range}return ee})(D)},calcWallTimeForSegment:function(D,$){let B,ee,te;return $&&(B=D.representation.adaptation.period.mpd.suggestedPresentationDelay,ee=D.presentationStartTime+B,te=new Date(D.availabilityStartTime.getTime()+1e3*ee)),te},getClientReferenceTime:function(){return Date.now()-1e3*c+1e3*A},getClientTimeOffset:function(){return A},initialize:function(){q(),e.on(F.A.UPDATE_TIME_SYNC_OFFSET,v,this)},reset:k,setClientTimeOffset:p,setConfig:function(D){D&&D.dashManifestModel&&(r=D.dashManifestModel)}},r=(0,Wn.A)(n).getInstance(),k(),i}Ms.__dashjs_factory_name="TimelineConverter";var zl=o.A.getSingletonFactory(Ms),Wl=class{constructor(){this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}};function ws(){let n,e;return n={initialize:function(t){if(e=new Wl,!t)return null;const i=t.indexOf("#");if(i!==-1){const r=t.substr(i+1).split("&");for(let c=0,A=r.length;c<A;++c){const p=r[c],l=p.indexOf("=");if(l!==-1){const _=p.substring(0,l);e.hasOwnProperty(_)&&(e[_]=p.substr(l+1))}}}},getURIFragmentData:function(){return e}},n}ws.__dashjs_factory_name="URIFragmentModel";var $l=o.A.getSingletonFactory(ws);const Xl=new Map([[U.A.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[U.A.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[U.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[U.A.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function Ps(){let n,e,t,i,r,c,A,p,l,_,I,h;const d=this.context,N=(0,m.A)(d).getInstance(),v=[];function q(){clearTimeout(I),N.off(F.A.PLAYBACK_PLAYING,B,this),v.length=0,(function(){try{A&&t&&A.unobserve(t),A&&(A.disconnect(),A=null)}catch{}})()}function k(x,G=!1){t&&(G?t.playbackRate=x:O(U.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,()=>{t.playbackRate=x}))}function D(){return v.length>0}function $(x){let G=v.indexOf(x);if(x!==null&&(G!==-1&&v.splice(G,1),_.get().streaming.buffer.syntheticStallEvents.enabled&&t&&!D())){const W=()=>{if(k(c||1,_.get().streaming.buffer.syntheticStallEvents.ignoreReadyState),!t.paused){const ie=document.createEvent("Event");ie.initEvent("playing",!0,!1),t.dispatchEvent(ie)}};_.get().streaming.buffer.syntheticStallEvents.ignoreReadyState?W():(p&&p.func&&p.event&&te(p.event,p.func),p=O(U.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,W))}}function B(){if(t&&D()&&t.playbackRate===0){const x=document.createEvent("Event");x.initEvent("waiting",!0,!1),t.dispatchEvent(x)}}function ee(x,G){t&&t.addEventListener(x,G)}function te(x,G){t&&t.removeEventListener(x,G)}function M(){return t?t.readyState:NaN}function J(){return t?t.buffered:null}function L(){return t?t.clientWidth:NaN}function H(){return t?t.clientHeight:NaN}function w(x,G,W,ie,oe){if(t){for(let Ae=0;Ae<t.textTracks.length;Ae++)if(t.textTracks[Ae].kind===x&&(!G||t.textTracks[Ae].label==G)&&t.textTracks[Ae].language===W&&t.textTracks[Ae].isTTML===ie&&t.textTracks[Ae].isEmbedded===oe)return t.textTracks[Ae]}return null}function O(x,G){return x===U.A.VIDEO_ELEMENT_READY_STATES.HAVE_NOTHING||M()>=x?(G(),null):(function(W,ie){const oe=()=>{te(W,oe),ie(W)};return ee(W,oe),{func:oe,event:W}})(Xl.get(x),G)}return i={addEventListener:ee,addTextTrack:function(x,G,W,ie,oe){if(!t)return null;let Ae=w(x,G,W,ie,oe);return Ae||(Ae=t.addTextTrack(x,G,W),Ae.isEmbedded=oe,Ae.isTTML=ie),Ae},appendChild:function(x){t&&(t.appendChild(x),x.isTTML!==void 0&&(t.textTracks[t.textTracks.length-1].isTTML=x.isTTML,t.textTracks[t.textTracks.length-1].isEmbedded=x.isEmbedded))},destroy:function(){q(),t=null,n=null,h=null},getBufferRange:J,getClientHeight:H,getClientWidth:L,getElement:function(){return t},getEnded:function(){return t?t.ended:null},getPlaybackQuality:function(){if(!t)return null;let x="webkitDroppedFrameCount"in t&&"webkitDecodedFrameCount"in t,G=null;return"getVideoPlaybackQuality"in t?G=t.getVideoPlaybackQuality():x&&(G={droppedVideoFrames:t.webkitDroppedFrameCount,totalVideoFrames:t.webkitDroppedFrameCount+t.webkitDecodedFrameCount,creationTime:new Date}),G},getPlaybackRate:function(){return t?t.playbackRate:null},getPlayedRanges:function(){return t?t.played:null},getReadyState:M,getSource:function(){return t?t.src:null},getTTMLRenderingDiv:function(){return n},getTextTrack:w,getTextTracks:function(){return t?t.textTracks:[]},getTime:function(){return t?isNaN(e)?t.currentTime:e:null},getVideoElementSize:function(){const x=_.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;return{elementWidth:L()*x,elementHeight:H()*x}},getVideoHeight:function(){return t?t.videoHeight:NaN},getVideoRelativeOffsetLeft:function(){if(t){const x=t.parentNode.host||t.parentNode;return x?t.getBoundingClientRect().left-x.getBoundingClientRect().left:NaN}return NaN},getVideoRelativeOffsetTop:function(){if(t){const x=t.parentNode.host||t.parentNode;return x?t.getBoundingClientRect().top-x.getBoundingClientRect().top:NaN}return NaN},getVideoWidth:function(){return t?t.videoWidth:NaN},getVttRenderingDiv:function(){return h},initialize:function(){N.on(F.A.PLAYBACK_PLAYING,B,this)},isPaused:function(){return t?t.paused:null},isSeeking:function(){return t?t.seeking||!isNaN(e):null},isStalled:D,pause:function(){t&&(t.pause(),t.autoplay=!1)},play:function(){if(t){t.autoplay=!0;const x=t.play();x&&x.catch&&typeof Promise<"u"&&x.catch(G=>{G.name==="NotAllowedError"&&N.trigger(F.A.PLAYBACK_NOT_ALLOWED),r.warn(`Caught pending play exception - continuing (${G})`)})}},removeChild:function(x){t&&t.removeChild(x)},removeEventListener:te,reset:q,setConfig:function(x){x&&x.settings&&(_=x.settings)},setCurrentTime:function(x,G){t&&(l&&l.func&&l.event&&te(l.event,l.func),e=x,l=O(U.A.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,()=>{if(t)if(t.currentTime!==e)try{e=G?(function(W){const ie=J();let oe=W,Ae=9999999999;if(ie)for(let ke=0;ke<ie.length;ke++){const Ie=ie.start(ke),be=ie.end(ke),me=Math.abs(Ie-W),Oe=Math.abs(be-W);if(W>=Ie&&W<=be)return W;me<Ae&&(Ae=me,oe=Ie),Oe<Ae&&(Ae=Oe,oe=be)}return oe})(e):e,isNaN(e)||(t.currentTime=e),e=NaN}catch(W){t.readyState===0&&W.code===W.INVALID_STATE_ERR&&(I=setTimeout(function(){t.currentTime=e,e=NaN},400))}else e=NaN}))},setDisableRemotePlayback:function(x){t&&(t.disableRemotePlayback=x)},setElement:function(x){if((!t||t!==x)&&((function(G){try{if(!A||!G)return;A.unobserve(G)}catch{}})(t),t=x,x!=null)){if(!x||!/^(VIDEO|AUDIO)$/i.test(x.nodeName))throw"element is not video or audio DOM type!";(function(G){try{if(!A||!G)return;A.observe(G)}catch{}})(t)}},setPlaybackRate:k,setSource:function(x){t&&(x?t.src=x:(t.removeAttribute("src"),t.load()))},setStallState:function(x,G){(function(W,ie){ie?(function(oe){if(oe!==null&&t&&!t.seeking&&v.indexOf(oe)===-1&&(v.push(oe),_.get().streaming.buffer.syntheticStallEvents.enabled&&t&&v.length===1&&(_.get().streaming.buffer.syntheticStallEvents.ignoreReadyState||M()>=U.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA))){c=t.playbackRate,k(0,!0);const Ae=document.createEvent("Event");Ae.initEvent("waiting",!0,!1),t.dispatchEvent(Ae)}})(W):$(W)})(x,G)},setTTMLRenderingDiv:function(x){n=x,n.style.position="absolute",n.style.display="flex",n.style.overflow="hidden",n.style.pointerEvents="none",n.style.top=0,n.style.left=0},setVttRenderingDiv:function(x){h=x},waitForReadyState:O},r=(0,j.A)(d).getInstance().getLogger(i),_=(0,E.A)(d).getInstance(),e=NaN,(function(){try{A=new ResizeObserver(()=>{N.trigger(F.A.VIDEO_ELEMENT_RESIZED)})}catch{}})(),i}Ps.__dashjs_factory_name="VideoModel";var Jl=o.A.getSingletonFactory(Ps);function Os(){const n=this.context,e=(0,m.A)(n).getInstance(),t=["streamController","textController","throughputController","playbackController","contentSteeringController","customParametersModel","abrController","mediaController","settings","dashMetrics"];let i,r,c,A,p,l,_,I,h,d,N,v,q,k,D,$,B,ee,te;function M(){return Ma(n).create({debug:c,errHandler:h,dashMetrics:r.dashMetrics,mediaPlayerModel:I,mssHandler:_,settings:r.settings})}function J(){if(r.protectionController)return r.protectionController;if(typeof dashjs>"u")return null;let L=dashjs.Protection;if(typeof L=="function"){let H=L(n).create();return F.A.extend(L.events),u.A.extend(L.events,{publicOnly:!0}),f.A.extend(L.errors),r.protectionController=H.createProtectionSystem({debug:c,errHandler:h,videoModel:r.videoModel,customParametersModel:r.customParametersModel,capabilities:d,eventBus:e,events:F.A,BASE64:dn,constants:U.A,cmcdController:D,settings:r.settings}),d||(d=(0,Un.A)(n).getInstance()),d.setProtectionController(r.protectionController),r.protectionController}return null}return i={createCoreControllers:function(){p=zl(n).getInstance(),r.throughputController||(r.throughputController=jl(n).getInstance()),r.abrController||(r.abrController=Dt(n).getInstance()),A||(A=(0,Ua.A)(n).getInstance()),r.playbackController||(r.playbackController=Fa(n).getInstance()),r.mediaController||(r.mediaController=Oa(n).getInstance()),r.streamController||(r.streamController=hs(n).getInstance()),v||(v=ga(n).getInstance()),k||(k=Qn(n).getInstance()),q||(q=Ya(n).getInstance()),r.contentSteeringController||(r.contentSteeringController=tr(n).getInstance()),N||(N=Yn(n).getInstance()),r.adapter=Js(n).getInstance(),r.manifestModel=wa(n).getInstance(),D=(0,Tr.A)(n).getInstance(),$=(0,zr.A)(n).getInstance(),te=br(n).getInstance(),r.dashMetrics=da(n).getInstance({settings:r.settings}),B=Pi(n).getInstance({settings:r.settings}),r.adapter.setConfig({constants:U.A,cea608parser:new Ts,errHandler:h,BASE64:dn}),r.baseURLController||(r.baseURLController=mi(n).create()),r.baseURLController.setConfig({adapter:r.adapter,contentSteeringController:r.contentSteeringController}),q.setConfig({adapter:r.adapter}),ee||(ee=ka(n).getInstance({dashMetrics:r.dashMetrics,mediaPlayerModel:I,errHandler:h,baseURLController:r.baseURLController,events:F.A,eventBus:e,debug:c,boxParser:An(n).getInstance(),errors:f.A})),r.mediaController.setConfig({domStorage:B,settings:r.settings,mediaPlayerModel:I,customParametersModel:r.customParametersModel,videoModel:r.videoModel}),I.setConfig({playbackController:r.playbackController,serviceDescriptionController:q}),r.contentSteeringController.setConfig({adapter:r.adapter,errHandler:h,dashMetrics:r.dashMetrics,mediaPlayerModel:I,manifestModel:r.manifestModel,serviceDescriptionController:q,throughputController:r.throughputController,eventBus:e})},createManifestLoader:M,createPlaybackControllers:function(){const L=M();r.streamController||(r.streamController=hs(n).getInstance()),r.textController||(r.textController=Kl(n).create({adapter:r.adapter,baseURLController:r.baseURLController,errHandler:h,manifestModel:r.manifestModel,mediaController:r.mediaController,settings:r.settings,videoModel:r.videoModel,timelineConverter:p})),N.setConfig({adapter:r.adapter,capabilities:d,customParametersModel:r.customParametersModel,errHandler:h,manifestModel:r.manifestModel,protectionController:r.protectionController,settings:r.settings}),r.streamController.setConfig({abrController:r.abrController,adapter:r.adapter,baseURLController:r.baseURLController,capabilities:d,capabilitiesFilter:N,contentSteeringController:r.contentSteeringController,customParametersModel:r.customParametersModel,dashMetrics:r.dashMetrics,errHandler:h,manifestLoader:L,manifestModel:r.manifestModel,mediaController:r.mediaController,mediaPlayerModel:I,playbackController:r.playbackController,protectionController:r.protectionController,segmentBaseController:ee,serviceDescriptionController:q,settings:r.settings,textController:r.textController,throughputController:r.throughputController,timelineConverter:p,uriFragmentModel:r.uriFragmentModel,videoModel:r.videoModel}),v.setConfig({adapter:r.adapter,playbackController:r.playbackController,settings:r.settings,streamController:r.streamController,timelineConverter:p,videoModel:r.videoModel}),r.playbackController.setConfig({adapter:r.adapter,dashMetrics:r.dashMetrics,serviceDescriptionController:q,settings:r.settings,streamController:r.streamController,timelineConverter:p,videoModel:r.videoModel}),k.setConfig({mediaPlayerModel:I,playbackController:r.playbackController,settings:r.settings,streamController:r.streamController,videoModel:r.videoModel}),r.throughputController.setConfig({settings:r.settings,playbackController:r.playbackController}),r.abrController.setConfig({adapter:r.adapter,capabilities:d,cmsdModel:$,customParametersModel:r.customParametersModel,dashMetrics:r.dashMetrics,domStorage:B,mediaPlayerModel:I,settings:r.settings,streamController:r.streamController,throughputController:r.throughputController,videoModel:r.videoModel}),D.setConfig({abrController:r.abrController,dashMetrics:r.dashMetrics,errHandler:h,mediaPlayerModel:I,playbackController:r.playbackController,serviceDescriptionController:q,throughputController:r.throughputController}),te.setConfig({serviceDescriptionController:q}),$.setConfig({}),r.mediaController.initialize(),r.throughputController.initialize(),r.abrController.initialize(),r.streamController.initialize(r.autoPlay,r.protectionData),r.textController.initialize(),v.initialize(),k.initialize(),D.initialize(r.autoPlay),$.initialize(),r.contentSteeringController.initialize(),ee.initialize()},detectMetricsReporting:function(){if(l||typeof dashjs>"u")return;let L=dashjs.MetricsReporting;typeof L=="function"&&(l=L(n).create().createMetricsReporting({debug:c,eventBus:e,mediaElement:r.videoModel.getElement(),adapter:r.adapter,dashMetrics:r.dashMetrics,mediaPlayerModel:I,events:F.A,constants:U.A,metricsConstants:mt}))},detectMss:function(){if(_||typeof dashjs>"u")return;let L=dashjs.MssHandler;typeof L=="function"&&(f.A.extend(L.errors),_=L(n).create({eventBus:e,mediaPlayerModel:I,dashMetrics:r.dashMetrics,manifestModel:r.manifestModel,playbackController:r.playbackController,streamController:r.streamController,protectionController:r.protectionController,baseURLController:r.baseURLController,errHandler:h,events:F.A,constants:U.A,debug:c,initSegmentType:Ee.G.INIT_SEGMENT_TYPE,BASE64:dn,ISOBoxer:Gr,settings:r.settings}))},detectOffline:function(){if(!r.mediaPlayerInitialized)throw z;if(r.offlineController)return r.offlineController;if(typeof dashjs>"u")return null;let L=dashjs.OfflineController;if(typeof L=="function"){F.A.extend(L.events),u.A.extend(L.events,{publicOnly:!0}),f.A.extend(L.errors);const H=M(),w=Eo(n).create();return w.setConfig({manifestModel:r.manifestModel,adapter:r.adapter,manifestLoader:H,errHandler:h,contentSteeringController:r.contentSteeringController}),r.offlineController=L(n).create({debug:c,manifestUpdater:w,baseURLController:r.baseURLController,manifestLoader:H,manifestModel:r.manifestModel,mediaPlayerModel:I,abrController:r.abrController,playbackController:r.playbackController,adapter:r.adapter,errHandler:h,dashMetrics:r.dashMetrics,timelineConverter:p,segmentBaseController:ee,schemeLoaderFactory:A,eventBus:e,events:F.A,errors:f.A,constants:U.A,settings:r.settings,dashConstants:Fe.A,urlUtils:(0,ln.A)(n).getInstance()}),r.offlineController}return null},detectProtection:J,reset:function(){l&&(l.reset(),l=null),r.offlineController&&(r.offlineController.reset(),r.offlineController=null)},resetPlaybackControllers:function(){r.playbackInitialized=!1,r.streamingInitialized=!1,r.adapter.reset(),r.streamController.reset(),v.reset(),k.reset(),r.playbackController.reset(),q.reset(),r.contentSteeringController.reset(),r.abrController.reset(),r.throughputController.reset(),r.mediaController.reset(),ee.reset(),r.protectionController&&(r.settings.get().streaming.protection.keepProtectionMediaKeys?r.protectionController.stop():(r.protectionController.reset(),r.protectionController=null,J())),r.textController.reset(),D.reset(),$.reset()},setConfig:function(L){L&&(L.state&&(r=L.state),L.debug&&(c=L.debug),t.forEach(H=>{L[H]&&(r[H]=L[H])}),L.capabilities&&(d=L.capabilities),L.capabilitiesFilter&&(N=L.capabilitiesFilter),L.gapController&&(v=L.gapController),L.serviceDescriptionController&&(q=L.serviceDescriptionController),L.clientDataReportingController&&(te=L.clientDataReportingController),L.catchupController&&(k=L.catchupController),L.mediaPlayerModel&&(I=L.mediaPlayerModel),L.schemeLoaderFactory&&(A=L.schemeLoaderFactory))},setup:function(){r.mediaPlayerInitialized=!1,r.playbackInitialized=!1,r.streamingInitialized=!1,r.autoPlay=!0,r.providedStartTime=NaN,r.protectionController=null,r.protectionData=null,r.adapter=null,F.A.extend(u.A),r.customParametersModel=(0,vr.A)(n).getInstance(),r.videoModel=Jl(n).getInstance(),r.uriFragmentModel=$l(n).getInstance(),r.offlineController=null,ee=null,I=La(n).getInstance()},supportsMediaSource:function(){return d||(d=(0,Un.A)(n).getInstance(),d.setConfig({settings:r.settings,protectionController:r.protectionController})),h||(h=fa(n).getInstance()),!!d.supportsMediaSource()||(h.error(new Hn.A(f.A.CAPABILITY_MEDIASOURCE_ERROR_CODE,f.A.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE)),!1)}},i}Os.__dashjs_factory_name="MediaPlayerWiring";var Zl=o.A.getSingletonFactory(Os);function Ls(){let n,e,t;function i(){if(!e.playbackInitialized)throw je;return e.playbackController.isPaused()}function r(){if(!e.playbackInitialized)throw je;return e.playbackController.getIsDynamic()}function c(l){const _=e.streamController&&e.streamController.hasVideoTrack()?U.A.VIDEO:U.A.AUDIO;let I=e.dashMetrics.getCurrentDVRInfo(_);return I?A(I.range.start+l,I):0}function A(l,_){let I=e.playbackController.getOriginalLiveDelay();return l>_.range.end-I&&(l=_.range.end-I),l}function p(l=""){if(!e.playbackInitialized)throw je;let _=t.getVideoElement().currentTime;return l!==""&&(_=e.streamController.getTimeRelativeToStreamId(_,l)),_}return n={duration:function(){if(!e.playbackInitialized)throw je;let l=t.getVideoElement().duration;if(e.playbackController.getIsDynamic()){const _=e.streamController&&e.streamController.hasVideoTrack()?U.A.VIDEO:U.A.AUDIO;let I=e.dashMetrics.getCurrentDVRInfo(_);l=I?I.range.end-I.range.start:0}return l},getAutoPlay:function(){return e.autoPlay},getBufferLength:function(l){const _=[U.A.VIDEO,U.A.AUDIO,U.A.TEXT];if(l)return _.indexOf(l)!==-1?e.dashMetrics.getCurrentBufferLevel(l)||NaN:(e.logger.warn("getBufferLength requested for invalid type"),NaN);{const I=_.map(h=>t.getTracksFor(h).length>0?e.dashMetrics.getCurrentBufferLevel(h):Number.MAX_VALUE).reduce((h,d)=>Math.min(h,d));return I===Number.MAX_VALUE?NaN:I}},getCurrentLiveLatency:function(){if(!e.mediaPlayerInitialized)throw z;return e.playbackInitialized?e.playbackController.getCurrentLiveLatency():NaN},getDvrSeekOffset:c,getDvrWindow:function(){if(!e.playbackInitialized)throw je;const l=e.streamController&&e.streamController.hasVideoTrack()?U.A.VIDEO:U.A.AUDIO;let _=e.dashMetrics.getCurrentDVRInfo(l);if(!_)return{};let I=0;const h=e.playbackController.getIsDynamic();return h&&(I=_.manifestInfo.availableFrom.getTime()/1e3),{start:_.range.start,end:_.range.end,startAsUtc:h?I+_.range.start:NaN,endAsUtc:h?I+_.range.end:NaN,size:_.range.end-_.range.start}},getLowLatencyModeEnabled:function(){if(!e.playbackInitialized)throw je;return e.playbackController.getLowLatencyModeEnabled()},getPlaybackRate:function(){return t.getVideoElement().playbackRate},getTargetLiveDelay:function(){if(!e.playbackInitialized)throw je;return e.playbackController.getOriginalLiveDelay()},getVolume:function(){return t.getVideoElement().volume},isDynamic:r,isMuted:function(){return t.getVideoElement().muted},isPaused:i,isSeeking:function(){if(!e.playbackInitialized)throw je;return e.playbackController.isSeeking()},pause:function(){if(!e.playbackInitialized)throw je;e.playbackController.pause()},play:function(){if(!e.playbackInitialized)throw je;(!e.autoPlay||i()&&e.playbackInitialized)&&e.playbackController.play(!0)},seek:function(l){if(!e.playbackInitialized)throw je;if((0,Rr.sq)(l,"number"),isNaN(l))throw U.A.BAD_ARGUMENT_ERROR;l<0&&(l=0);let _=e.playbackController.getIsDynamic()?c(l):l;const I=t.getVideoElement();!e.playbackController.getIsDynamic()&&I.duration&&(_=Math.min(I.duration,_)),e.playbackController.seek(_,!1,!1,!0)},seekToOriginalLive:function(){e.playbackInitialized&&r()&&e.playbackController.seekToOriginalLive()},seekToPresentationTime:function(l){if(!e.playbackInitialized)throw je;if((0,Rr.sq)(l,"number"),isNaN(l))throw U.A.BAD_ARGUMENT_ERROR;l<0&&(l=0);const _=t.getVideoElement();if(!e.playbackController.getIsDynamic()&&_.duration&&(l=Math.min(_.duration,l)),e.playbackController.getIsDynamic()){const I=e.streamController&&e.streamController.hasVideoTrack()?U.A.VIDEO:U.A.AUDIO;let h=e.dashMetrics.getCurrentDVRInfo(I);if(!h)return;(l=A(l,h))<h.range.start&&(l=h.range.start)}e.playbackController.seek(l,!1,!1,!0)},setAutoPlay:function(l){(0,Rr.sq)(l,"boolean"),e.autoPlay=l},setConfig:function(l){l&&(l.state&&(e=l.state),l.mediaPlayer&&(t=l.mediaPlayer))},setMute:function(l){(0,Rr.sq)(l,"boolean"),t.getVideoElement().muted=l},setPlaybackRate:function(l){t.getVideoElement().playbackRate=l},setVolume:function(l){if(typeof l!="number"||isNaN(l)||l<0||l>1)throw U.A.BAD_ARGUMENT_ERROR;t.getVideoElement().volume=l},time:p,timeAsUTC:function(){if(!e.playbackInitialized)throw je;if(!e.playbackController.getIsDynamic()||p()<0)return NaN;const l=e.streamController&&e.streamController.hasVideoTrack()?U.A.VIDEO:U.A.AUDIO;let _,I,h=e.dashMetrics.getCurrentDVRInfo(l);return h?(_=h.manifestInfo.availableFrom.getTime()/1e3,I=_+p(),I):0},timeInDvrWindow:function(){if(!e.playbackInitialized)throw je;if(!e.playbackController.getIsDynamic())return p();let l=t.getVideoElement().currentTime;const _=e.streamController&&e.streamController.hasVideoTrack()?U.A.VIDEO:U.A.AUDIO;let I=e.dashMetrics.getCurrentDVRInfo(_);return l=I===null||l===0?0:Math.max(0,l-I.range.start),l}},n}Ls.__dashjs_factory_name="PlaybackApi";var Ql=o.A.getClassFactory(Ls);function Fs(){let n,e;function t(){const i=e.streamController.getActiveStreamInfo();return i&&e.textController?i:null}return n={attachTTMLRenderingDiv:function(i){if(!e.videoModel.getElement())throw tt;e.videoModel.setTTMLRenderingDiv(i)},attachVttRenderingDiv:function(i){if(!e.videoModel.getElement())throw tt;e.videoModel.setVttRenderingDiv(i)},enableForcedTextStreaming:function(i){return!!t()&&e.textController.enableForcedTextStreaming(i)},enableText:function(i){const r=t();return!!r&&e.textController.enableText(r.id,i)},getCurrentTextTrackIndex:function(){const i=t();if(i)return e.textController.getCurrentTrackIdx(i.id)},getTTMLRenderingDiv:function(){return e.videoModel?e.videoModel.getTTMLRenderingDiv():null},isTextEnabled:function(){const i=t();return!!i&&e.textController.isTextEnabled(i)},setConfig:function(i){i&&i.state&&(e=i.state)},setTextTrack:function(i){if(!e.playbackInitialized)throw je;const r=t();r&&e.textController.setTextTrack(r.id,i)}},n}Fs.__dashjs_factory_name="TextApi";var eu=o.A.getClassFactory(Fs);function Us(){let n,e,t;function i(r,c,A=!0){if(!e.streamingInitialized)throw ve;let p=c?e.streamController.getStreamById(c):t.getActiveStream();return p?p.getRepresentationsByType(r,A):[]}return n={getAverageLatency:function(r=U.A.VIDEO,c=null,A=NaN){return e.throughputController?e.throughputController.getAverageLatency(r,c,A):0},getAverageThroughput:function(r=U.A.VIDEO,c=null,A=NaN){return e.throughputController?e.throughputController.getAverageThroughput(r,c,A):0},getCurrentRepresentationForType:function(r){if(!e.streamingInitialized)throw ve;if(r!==U.A.IMAGE&&r!==U.A.VIDEO&&r!==U.A.AUDIO)return null;const c=t.getActiveStream();if(!c)return null;if(r===U.A.IMAGE){const A=c.getThumbnailController();return A?A.getCurrentTrack():-1}return c.getCurrentRepresentationForType(r)},getCurrentTrackFor:function(r){if(!e.streamingInitialized)throw ve;let c=e.streamController.getActiveStreamInfo();return c?e.mediaController.getCurrentTrackFor(r,c.id):null},getInitialMediaSettingsFor:function(r){if(!e.mediaPlayerInitialized)throw z;return e.mediaController.getInitialSettings(r)},getRawThroughputData:function(r=U.A.VIDEO){return e.throughputController?e.throughputController.getRawThroughputData(r):[]},getRepresentationsByType:function(r,c=null){return i(r,c,!0)},getRepresentationsByTypeUnfiltered:function(r,c=null){return i(r,c,!1)},getSafeAverageThroughput:function(r=U.A.VIDEO,c=null,A=NaN){return e.throughputController?e.throughputController.getSafeAverageThroughput(r,c,A):0},getTracksFor:function(r){if(!e.streamingInitialized)throw ve;let c=e.streamController.getActiveStreamInfo();return c?e.mediaController.getTracksFor(r,c.id).filter(A=>!e.protectionController||e.protectionController.areKeyIdsUsable(A.normalizedKeyIds)):[]},provideThumbnail:function(r,c){if(typeof c!="function")return;if(r<0)return void c(null);const A=e.playbackController.getIsDynamic()?t.getDvrSeekOffset(r):r,p=e.streamController.getStreamForTime(A);if(p===null)return void c(null);const l=p.getThumbnailController();if(l)return l.provide(A,c);c(null)},setConfig:function(r){r&&(r.state&&(e=r.state),r.mediaPlayer&&(t=r.mediaPlayer))},setCurrentTrack:function(r,c=!1){if(!e.streamingInitialized)throw ve;!e.protectionController||e.protectionController.areKeyIdsUsable(r.normalizedKeyIds)?e.mediaController.setTrack(r,{noSettingsSave:c}):e.logger.error(`Can not switch to track with index ${r.index} because key is not usable`)},setInitialMediaSettingsFor:function(r,c){if(!e.mediaPlayerInitialized)throw z;let A=(function(p){const l=e.settings.get().streaming.defaultSchemeIdUri;let _={};function I(h,d,N){let v={};if(d){if(d instanceof Array)throw"Array type not supported for settings!";return d instanceof Object?(v.schemeIdUri=d.schemeIdUri?d.schemeIdUri:"",v.value=d.value?d.value:""):(v.schemeIdUri=N,v.value=d,e.logger.warn("No schemeIdUri provided for "+h+', using default "'+N+'"')),v}return null}return p.id!==void 0&&(_.id=p.id),p.lang!==void 0&&(_.lang=p.lang),isNaN(p.index)||(_.index=p.index),p.viewpoint!==void 0&&(_.viewpoint=I("viewpoint",p.viewpoint,l.viewpoint)),p.audioChannelConfiguration!==void 0&&(_.audioChannelConfiguration=I("audioChannelConfiguration",p.audioChannelConfiguration,l.audioChannelConfiguration)),p.role!==void 0&&p.role!==null&&(_.role=I("role",p.role,l.role),_.role.schemeIdUri===U.A.DASH_ROLE_SCHEME_ID&&_.role.value==="Main"&&(_.role.value=Fe.A.MAIN)),p.accessibility!==void 0&&(_.accessibility=I("accessibility",p.accessibility,l.accessibility)),p.codec!==void 0&&(_.codec=p.codec),_})(c);e.mediaController.setInitialSettings(r,A)},setRepresentationForTypeById:function(r,c,A=!1){if(r!==U.A.IMAGE&&r!==U.A.VIDEO&&r!==U.A.AUDIO)return;if(!e.streamingInitialized)throw ve;const p=t.getActiveStream();if(p)if(r===U.A.IMAGE){const l=p.getThumbnailController();l&&l.setTrackById(c)}else{const l=p.getRepresentationForTypeById(r,c);l&&e.abrController.manuallySetPlaybackQuality(r,e.streamController.getActiveStreamInfo(),l,{forceReplace:A})}},setRepresentationForTypeByIndex:function(r,c,A=!1){if(r!==U.A.IMAGE&&r!==U.A.VIDEO&&r!==U.A.AUDIO)return;if(!e.streamingInitialized)throw ve;const p=t.getActiveStream();if(p)if(r===U.A.IMAGE){const l=p.getThumbnailController();l&&l.setTrackByIndex(c)}else{const l=p.getRepresentationForTypeByIndex(r,c);l&&e.abrController.manuallySetPlaybackQuality(r,e.streamController.getActiveStreamInfo(),l,{forceReplace:A})}}},n}Us.__dashjs_factory_name="TrackApi";var tu=o.A.getClassFactory(Us);function zi(){const n=[ce,we,Ql,tu,eu,pt,ue],e=this.context;let t;const i={abrController:null,adapter:null,autoPlay:!0,baseURLController:null,contentSteeringController:null,customParametersModel:null,dashMetrics:null,logger:null,manifestModel:null,mediaController:null,mediaPlayerInitialized:!1,offlineController:null,playbackController:null,playbackInitialized:!1,protectionController:null,protectionData:null,providedStartTime:NaN,retrieveManifestRequest:null,settings:(0,E.A)(e).getInstance(),source:null,streamController:null,streamingInitialized:!1,textController:null,throughputController:null,uriFragmentModel:null,videoModel:null},r=(0,j.A)(e).getInstance({settings:i.settings}),c=Zl(e).getInstance();function A(){n.forEach(p=>{const l=p(e).create();typeof l.setConfig=="function"&&l.setConfig({state:i,mediaPlayer:t,wiring:c,debug:r});const{setConfig:_,getClassName:I,...h}=l;Object.assign(t,h)})}return c.setConfig({state:i,debug:r}),t={extend:function(p,l,_){o.A.extend(p,l,_,e),A()},setConfig:function(p){c.setConfig(p)}},A(),i.logger=r.getLogger(t),c.setup(),t}zi.__dashjs_factory_name="MediaPlayer";const vi=o.A.getClassFactory(zi);vi.events=u.A,vi.errors=f.A,o.A.updateClassFactory(zi.__dashjs_factory_name,vi);var nu=vi},1191:function(Nt,Re,C){var j=C(7252);class f extends j.A{constructor(){super(),this.AST_IN_FUTURE="astInFuture",this.BASE_URLS_UPDATED="baseUrlsUpdated",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_LOADED="bufferLoaded",this.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",this.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",this.DVB_FONT_DOWNLOAD_ADDED="dvbFontDownloadAdded",this.DVB_FONT_DOWNLOAD_COMPLETE="dvbFontDownloadComplete",this.DVB_FONT_DOWNLOAD_FAILED="dvbFontDownloadFailed",this.DYNAMIC_TO_STATIC="dynamicToStatic",this.ERROR="error",this.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",this.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",this.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",this.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",this.LOG="log",this.MANIFEST_LOADING_STARTED="manifestLoadingStarted",this.MANIFEST_LOADING_FINISHED="manifestLoadingFinished",this.MANIFEST_LOADED="manifestLoaded",this.METRICS_CHANGED="metricsChanged",this.METRIC_CHANGED="metricChanged",this.METRIC_ADDED="metricAdded",this.METRIC_UPDATED="metricUpdated",this.PERIOD_SWITCH_STARTED="periodSwitchStarted",this.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",this.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",this.QUALITY_CHANGE_RENDERED="qualityChangeRendered",this.NEW_TRACK_SELECTED="newTrackSelected",this.TRACK_CHANGE_RENDERED="trackChangeRendered",this.STREAM_INITIALIZING="streamInitializing",this.STREAM_UPDATED="streamUpdated",this.STREAM_ACTIVATED="streamActivated",this.STREAM_DEACTIVATED="streamDeactivated",this.STREAM_INITIALIZED="streamInitialized",this.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",this.TEXT_TRACKS_ADDED="allTextTracksAdded",this.TEXT_TRACK_ADDED="textTrackAdded",this.CUE_ENTER="cueEnter",this.CUE_EXIT="cueExit",this.THROUGHPUT_MEASUREMENT_STORED="throughputMeasurementStored",this.TTML_PARSED="ttmlParsed",this.TTML_TO_PARSE="ttmlToParse",this.CAPTION_RENDERED="captionRendered",this.CAPTION_CONTAINER_RESIZE="captionContainerResize",this.CAN_PLAY="canPlay",this.CAN_PLAY_THROUGH="canPlayThrough",this.PLAYBACK_ENDED="playbackEnded",this.PLAYBACK_ERROR="playbackError",this.PLAYBACK_INITIALIZED="playbackInitialized",this.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",this.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",this.PLAYBACK_LOADED_DATA="playbackLoadedData",this.PLAYBACK_PAUSED="playbackPaused",this.PLAYBACK_PLAYING="playbackPlaying",this.PLAYBACK_PROGRESS="playbackProgress",this.PLAYBACK_RATE_CHANGED="playbackRateChanged",this.PLAYBACK_SEEKED="playbackSeeked",this.PLAYBACK_SEEKING="playbackSeeking",this.PLAYBACK_STALLED="playbackStalled",this.PLAYBACK_STARTED="playbackStarted",this.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",this.PLAYBACK_VOLUME_CHANGED="playbackVolumeChanged",this.PLAYBACK_WAITING="playbackWaiting",this.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",this.EVENT_MODE_ON_START="eventModeOnStart",this.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",this.CONFORMANCE_VIOLATION="conformanceViolation",this.REPRESENTATION_SWITCH="representationSwitch",this.ADAPTATION_SET_REMOVED_NO_CAPABILITIES="adaptationSetRemovedNoCapabilities",this.CONTENT_STEERING_REQUEST_COMPLETED="contentSteeringRequestCompleted",this.INBAND_PRFT="inbandPrft",this.MANAGED_MEDIA_SOURCE_START_STREAMING="managedMediaSourceStartStreaming",this.MANAGED_MEDIA_SOURCE_END_STREAMING="managedMediaSourceEndStreaming"}}let o=new f;Re.A=o},6882:function(Nt,Re,C){var j=C(138),f=C(3346),o=C(8261),u=C(5212);function E(){let m,b,T,Q;const V=this.context;function se(){const ue=(function(){if(typeof Q!="function")return null;try{return Q()}catch{return null}})();return ue&&Object.keys(ue).length>0?ue:T}function Y(){const ue=se();if(ue&&ue.version)return parseInt(ue.version,10);const F=b.get().streaming.cmcd;return F&&F.version?parseInt(F.version,10):u.A.CMCD_DEFAULT_VERSION}function ce(ue,F,ve={}){if(!ue||!F)return;let je=F;for(const[z,he]of Object.entries(ve))je=je.replace(`{${z}}`,he);const tt=je.split(".");let re=ue;for(let z=0;z<tt.length;z++){const he=tt[z];if(re==null)return;const we=he.match(/^([^\[]+)\[(\d+)\]$/);if(we){const[,Be,pt]=we;if(re=re[Be],!Array.isArray(re))return;re=re[parseInt(pt,10)]}else re=re[he]}return re}function ge(ue,F={}){var ve,je,tt;const re=f.A[ue];if(!re)return F.defaultValue!==void 0?F.defaultValue:void 0;const z=Y(),he={settings:b.get(),manifestParams:se()||{}};if(re.version&&!re.version.includes(z))return F.defaultValue!==void 0?F.defaultValue:void 0;const we={};F.targetIndex!==void 0&&(we.targetIndex=F.targetIndex);const Be=ue==="applyParametersFromMpd"||(((tt=(je=(ve=he.settings)==null?void 0:ve.streaming)==null?void 0:je.cmcd)==null?void 0:tt.applyParametersFromMpd)??!0),pt=[...re.sources].sort((ye,mt)=>ye.priority-mt.priority);for(const ye of pt){if(!Be&&ye.path.startsWith("manifestParams"))continue;const mt=ce(he,ye.path,we);if(mt!=null)return typeof ye.transform=="function"?ye.transform(mt):mt}for(const ye of pt)if((Be||!ye.path.startsWith("manifestParams"))&&ye.default!==void 0)return ye.default;return F.defaultValue!==void 0?F.defaultValue:void 0}function Te(){if(Y()!==2)return[];const ue=ge("eventTargets");return Array.isArray(ue)?ue:[]}return m={get:ge,getEventTarget:function(ue){const F=Te();return ue<0||ue>=F.length?null:{get:ve=>ge(ve,{targetIndex:ue}),has:ve=>ge(ve,{targetIndex:ue})!=null,index:ue,raw:F[ue]}},getEventTargets:Te,getVersion:function(){return Y()},has:function(ue){return ge(ue)!=null},hasManifestParams:function(){const ue=se();return!(!ue||!ue.version)},isEnabled:function(){const ue=b.get().streaming.cmcd;if(ue?.applyParametersFromMpd??!0){const F=se();if(F&&F.version)return!0}return(!ue||ue.enabled!==!1)&&ge("enabled")===!0},reset:function(){T=null,Q=null},setManifestParams:function(ue){T=ue},setManifestParamsProviderFunction:function(ue){Q=ue}},b=(0,o.A)(V).getInstance(),T=null,Q=null,m}E.__dashjs_factory_name="CmcdConfigAccessor",Re.A=j.A.getSingletonFactory(E)},3346:function(Nt,Re,C){var j=C(5212);const f={version:{version:[1,2],sources:[{path:"manifestParams.version",priority:1,type:"number"},{path:"settings.streaming.cmcd.version",priority:2,type:"number",default:j.A.CMCD_DEFAULT_VERSION}]},enabled:{version:[1,2],sources:[{path:"settings.streaming.cmcd.enabled",priority:1,type:"boolean",default:!1}]},sessionID:{version:[1,2],sources:[{path:"manifestParams.sessionID",priority:1,type:"string"},{path:"settings.streaming.cmcd.sid",priority:2,type:"string",default:null}]},contentID:{version:[1,2],sources:[{path:"manifestParams.contentID",priority:1,type:"string"},{path:"settings.streaming.cmcd.cid",priority:2,type:"string",default:null}]},mode:{version:[1,2],sources:[{path:"manifestParams.mode",priority:1,type:"string"},{path:"settings.streaming.cmcd.mode",priority:2,type:"string",default:j.A.CMCD_MODE_QUERY}]},rtp:{version:[1,2],sources:[{path:"settings.streaming.cmcd.rtp",priority:1,type:"number",default:null}]},rtpSafetyFactor:{version:[1,2],sources:[{path:"settings.streaming.cmcd.rtpSafetyFactor",priority:1,type:"number",default:5}]},maxBufferedErrorCodes:{version:[1,2],sources:[{path:"settings.streaming.cmcd.maxBufferedErrorCodes",priority:1,type:"number",default:10}]},keys:{version:[1,2],sources:[{path:"manifestParams.keys",priority:1,type:"array",transform:o=>typeof o=="string"?o.split(" "):o},{path:"settings.streaming.cmcd.enabledKeys",priority:2,type:"array",default:j.A.CMCD_KEYS}]},customKeys:{version:[1,2],sources:[{path:"settings.streaming.cmcd.customKeys",priority:1,type:"array",default:[]}]},includeInRequests:{version:[1,2],sources:[{path:"manifestParams.includeInRequests",priority:1,type:"array",transform:o=>typeof o=="string"?o.split(" "):o},{path:"settings.streaming.cmcd.includeInRequests",priority:2,type:"array",default:["segment","mpd","license"]}]},applyParametersFromMpd:{version:[1,2],sources:[{path:"settings.streaming.cmcd.applyParametersFromMpd",priority:1,type:"boolean",default:!0}]},eventTargets:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets",priority:1,type:"array",default:[]}]},targetEnabled:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].enabled",priority:1,type:"boolean",default:!0}]},targetUrl:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].url",priority:1,type:"string",default:null}]},targetKeys:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].enabledKeys",priority:1,type:"array",default:[]}]},targetEvents:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].events",priority:1,type:"array",default:[]}]},targetInterval:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].interval",priority:1,type:"number",default:j.A.CMCD_DEFAULT_TIME_INTERVAL}]},targetBatchSize:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].batchSize",priority:1,type:"number",default:0}]},targetResponseReceivedTypes:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].responseReceivedTypes",priority:1,type:"array"}]}};Re.A=f},5212:function(Nt,Re,C){var j=C(8735);Re.A={STREAM:"stream",VIDEO:"video",ENHANCEMENT:"enhancement",AUDIO:"audio",TEXT:"text",MUXED:"muxed",IMAGE:"image",STPP:"stpp",TTML:"ttml",VTT:"vtt",WVTT:"wvtt",CONTENT_STEERING:"contentSteering",LIVE_CATCHUP_MODE_DEFAULT:"liveCatchupModeDefault",LIVE_CATCHUP_MODE_LOLP:"liveCatchupModeLoLP",LIVE_CATCHUP_MODE_STEP:"liveCatchupModeStep",MOVING_AVERAGE_SLIDING_WINDOW:"slidingWindow",MOVING_AVERAGE_EWMA:"ewma",BAD_ARGUMENT_ERROR:"Invalid Arguments",MISSING_CONFIG_ERROR:"Missing config parameter(s)",TRACK_SWITCH_MODE_ALWAYS_REPLACE:"alwaysReplace",TRACK_SWITCH_MODE_NEVER_REPLACE:"neverReplace",TRACK_SELECTION_MODE_FIRST_TRACK:"firstTrack",TRACK_SELECTION_MODE_HIGHEST_BITRATE:"highestBitrate",TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:"highestEfficiency",TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY:"lowestStartupDelay",TRACK_SELECTION_MODE_WIDEST_RANGE:"widestRange",CMCD_QUERY_KEY:"CMCD",CMCD_MODE_QUERY:j.x_.QUERY,CMCD_MODE_HEADERS:j.x_.HEADERS,CMCD_MODE_BODY:"body",CMCD_AVAILABLE_REQUESTS:["segment","mpd","xlink","steering","other","license"],CMCD_DEFAULT_TIME_INTERVAL:30,CMCD_REPORTING_MODE:j.LA,CMCD_KEYS:j.pv,CMCD_REPORTING_EVENTS:j.WJ,CMCD_PLAYER_STATES:j.I$,CMCD_DEFAULT_VERSION:1,CMCD_DEFAULT_INCLUDE_IN_REQUESTS:"segment",CMCD_CONTENT_TYPE_HEADER:{"Content-Type":"text/cmcd"},INITIALIZE:"initialize",TEXT_SHOWING:"showing",TEXT_HIDDEN:"hidden",TEXT_DISABLED:"disabled",ACCESSIBILITY_CEA608_SCHEME:"urn:scte:dash:cc:cea-608:2015",CC1:"CC1",CC3:"CC3",UTF8:"utf-8",SCHEME_ID_URI:"schemeIdUri",START_TIME:"starttime",SERVICE_DESCRIPTION_DVB_LL_SCHEME:"urn:dvb:dash:lowlatency:scope:2019",SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME:"urn:dvb:dash:lowlatency:critical:2019",CTA_5004_2023_SCHEME:"urn:mpeg:dash:cta-5004:2023",CTA_5004_2025_SCHEME:"urn:dashif:cta-5004:2025",THUMBNAILS_SCHEME_ID_URIS:["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"],FONT_DOWNLOAD_DVB_SCHEME:"urn:dvb:dash:fontdownload:2014",COLOUR_PRIMARIES_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:ColourPrimaries",URL_QUERY_INFO_SCHEME:"urn:mpeg:dash:urlparam:2014",EXT_URL_QUERY_INFO_SCHEME:"urn:mpeg:dash:urlparam:2016",ADV_URL_QUERY_INFO_SCHEME:"urn:mpeg:dash:urlparam:2025",URL_QUERY_STATE_PREFIX:/urn:mpeg:dash:state:/,MATRIX_COEFFICIENTS_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:MatrixCoefficients",TRANSFER_CHARACTERISTICS_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:TransferCharacteristics",SEGMENT_SEQUENCE_REPRESENTATION_SCHEME_ID_URI:"urn:mpeg:dash:ssr:2023",HDR_METADATA_FORMAT_SCHEME_ID_URI:"urn:dvb:dash:hdr-dmi",HDR_METADATA_FORMAT_VALUES:{ST2094_10:"ST2094-10",SL_HDR2:"SL-HDR2",ST2094_40:"ST2094-40"},MEDIA_CAPABILITIES_API:{COLORGAMUT:{SRGB:"srgb",P3:"p3",REC2020:"rec2020"},TRANSFERFUNCTION:{SRGB:"srgb",PQ:"pq",HLG:"hlg"},HDR_METADATATYPE:{SMPTE_ST_2094_10:"smpteSt2094-10",SLHDR2:"slhdr2",SMPTE_ST_2094_40:"smpteSt2094-40"}},XML:"XML",ARRAY_BUFFER:"ArrayBuffer",DVB_REPORTING_URL:"dvb:reportingUrl",DVB_PROBABILITY:"dvb:probability",OFF_MIMETYPE:"application/font-sfnt",WOFF_MIMETYPE:"application/font-woff",VIDEO_ELEMENT_READY_STATES:{HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4},FILE_LOADER_TYPES:{FETCH:"fetch_loader",XHR:"xhr_loader"},THROUGHPUT_TYPES:{LATENCY:"throughput_type_latency",BANDWIDTH:"throughput_type_bandwidth"},THROUGHPUT_CALCULATION_MODES:{EWMA:"throughputCalculationModeEwma",ZLEMA:"throughputCalculationModeZlema",ARITHMETIC_MEAN:"throughputCalculationModeArithmeticMean",BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:"throughputCalculationModeByteSizeWeightedArithmeticMean",DATE_WEIGHTED_ARITHMETIC_MEAN:"throughputCalculationModeDateWeightedArithmeticMean",HARMONIC_MEAN:"throughputCalculationModeHarmonicMean",BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:"throughputCalculationModeByteSizeWeightedHarmonicMean",DATE_WEIGHTED_HARMONIC_MEAN:"throughputCalculationModeDateWeightedHarmonicMean"},LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE:{MOOF_PARSING:"lowLatencyDownloadTimeCalculationModeMoofParsing",DOWNLOADED_DATA:"lowLatencyDownloadTimeCalculationModeDownloadedData",AAST:"lowLatencyDownloadTimeCalculationModeAast"},RULES_TYPES:{QUALITY_SWITCH_RULES:"qualitySwitchRules",ABANDON_FRAGMENT_RULES:"abandonFragmentRules"},QUALITY_SWITCH_RULES:{BOLA_RULE:"BolaRule",THROUGHPUT_RULE:"ThroughputRule",INSUFFICIENT_BUFFER_RULE:"InsufficientBufferRule",SWITCH_HISTORY_RULE:"SwitchHistoryRule",DROPPED_FRAMES_RULE:"DroppedFramesRule",LEARN_TO_ADAPT_RULE:"L2ARule",LOL_PLUS_RULE:"LoLPRule"},ABANDON_FRAGMENT_RULES:{ABANDON_REQUEST_RULE:"AbandonRequestsRule"},ID3_SCHEME_ID_URI:"https://aomedia.org/emsg/ID3",COMMON_ACCESS_TOKEN_HEADER:"common-access-token",DASH_ROLE_SCHEME_ID:"urn:mpeg:dash:role:2011",CODEC_FAMILIES:{MP3:"mp3",AAC:"aac",AC3:"ac3",EC3:"ec3",DTSX:"dtsx",DTSC:"dtsc",AVC:"avc",HEVC:"hevc"}}},2861:function(Nt,Re){const C={CLEARKEY_KEYSTEM_STRING:"org.w3.clearkey",CLEARKEY_UUID:"e2719d58-a985-b3c9-781a-b030af78d30e",ENCRYPTION_SCHEME_CBCS:"cbcs",ENCRYPTION_SCHEME_CENC:"cenc",FAIRPLAY_KEYSTEM_STRING:"com.apple.fps",FAIRPLAY_UUID:"94ce86fb-07ff-4f43-adb8-93d2fa968ca2",INITIALIZATION_DATA_TYPE_CENC:"cenc",INITIALIZATION_DATA_TYPE_KEYIDS:"keyids",INITIALIZATION_DATA_TYPE_SINF:"sinf",INITIALIZATION_DATA_TYPE_WEBM:"webm",MEDIA_KEY_MESSAGE_TYPES:{LICENSE_REQUEST:"license-request",LICENSE_RENEWAL:"license-renewal",LICENSE_RELEASE:"license-release",INDIVIDUALIZATION_REQUEST:"individualization-request"},MEDIA_KEY_STATUSES:{USABLE:"usable",EXPIRED:"expired",RELEASED:"released",OUTPUT_RESTRICTED:"output-restricted",OUTPUT_DOWNSCALED:"output-downscaled",STATUS_PENDING:"status-pending",INTERNAL_ERROR:"internal-error"},PLAYREADY_KEYSTEM_STRING:"com.microsoft.playready",PLAYREADY_RECOMMENDATION_KEYSTEM_STRING:"com.microsoft.playready.recommendation",PLAYREADY_RECOMMENDATION_3000_KEYSTEM_STRING:"com.microsoft.playready.recommendation.3000",PLAYREADY_UUID:"9a04f079-9840-4286-ab92-e65be0885f95",ROBUSTNESS_STRINGS:{WIDEVINE:{SW_SECURE_CRYPTO:"SW_SECURE_CRYPTO",SW_SECURE_DECODE:"SW_SECURE_DECODE",HW_SECURE_CRYPTO:"HW_SECURE_CRYPTO",HW_SECURE_DECODE:"HW_SECURE_DECODE",HW_SECURE_ALL:"HW_SECURE_ALL"}},W3C_CLEARKEY_UUID:"1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",WIDEVINE_KEYSTEM_STRING:"com.widevine.alpha",WIDEVINE_UUID:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};C.DEFAULT_SYSTEM_STRING_PRIORITY=Object.freeze({[C.PLAYREADY_KEYSTEM_STRING]:Object.freeze([C.PLAYREADY_KEYSTEM_STRING,C.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING])}),Re.A=C},1234:function(Nt,Re,C){var j=C(8850),f=C(913),o=C(138),u=C(1191),E=C(5212),m=C(7568),b=C(8735),T=C(649),Q=C(1613),V=C(3773),se=C(8898),Y=C(893),ce=C(6882);function ge(){let Te,ue,F,ve,je,tt,re,z,he,we,Be,pt,ye,mt=this.context,Ze=(0,j.A)(mt).getInstance(),He=(0,T.A)(mt).getInstance();const U={[u.A.PLAYBACK_INITIALIZED]:E.A.CMCD_PLAYER_STATES.STARTING,[u.A.PLAYBACK_PAUSED]:E.A.CMCD_PLAYER_STATES.PAUSED,[u.A.PLAYBACK_ERROR]:E.A.CMCD_PLAYER_STATES.FATAL_ERROR,[u.A.PLAYBACK_ENDED]:E.A.CMCD_PLAYER_STATES.ENDED};let Bt={};function Ut(Z){K(E.A.CMCD_REPORTING_EVENTS.PLAY_STATE,{sta:Z})}function kt(Z=Kt()){we=JSON.stringify(Z);const{customKeys:de,...qe}=Z;tt=[];const yt=Z.eventTargets.map(({responseReceivedTypes:Ft,...X})=>{const De=[];return tt.push(De),{...X,transform:(it,dt)=>{var It,lt;return dt&&Ft&&!ue.isIncludedInRequestFilter((lt=(It=dt.customData)==null?void 0:It.request)==null?void 0:lt.type,Ft)?null:on(De,it)}}}),Lt=new b.tt({...qe,transform:Ft=>on(pt,Ft),eventTargets:yt},hn);return Object.keys(de).length>0&&Lt.update(de),Lt}function Kt(){const Z=(function(){const Lt=Te.get("customKeys")??[];return Array.isArray(Lt)?Lt.reduce((Ft,X)=>(X&&typeof X.key=="string"&&(0,b.Qn)(X.key)&&X.value!==void 0?Ft[X.key]=X.value:z.warn(`Ignoring CMCD custom key entry "${X&&X.key}": entries require a value and a key with a hyphenated prefix, e.g. "com.example-mykey"`),Ft),{}):(z.warn("Ignoring CMCD customKeys setting: expected an array of { key, value } entries"),{})})(),de={version:Te.getVersion(),transmissionMode:Te.get("mode")===E.A.CMCD_MODE_HEADERS?b.dp:"query",enabledKeys:[...Te.get("keys"),...Object.keys(Z)],eventTargets:Te.getEventTargets().reduce((Lt,Ft,X)=>{if(!ae(X))return Lt;const De=Te.getEventTarget(X);return Lt.push({url:De.get("targetUrl"),events:De.get("targetEvents"),interval:De.get("targetInterval")??E.A.CMCD_DEFAULT_TIME_INTERVAL,batchSize:De.get("targetBatchSize")||1,enabledKeys:De.get("targetKeys"),responseReceivedTypes:De.get("targetResponseReceivedTypes")}),Lt},[]),customKeys:Z},qe=Te.get("sessionID");qe&&(de.sid=qe);const yt=Te.get("contentID");return yt&&(de.cid=yt),de}function on(Z,de){return delete de.ec,Z.length>0&&(de.ec=Z.splice(0)),de}function un(Z,de){Z.push(de),Z.length>Te.get("maxBufferedErrorCodes")&&Z.shift()}function hn(Z){return new Promise(de=>{const qe=new Q.A;qe.url=Z.url,qe.method=Z.method,qe.headers=Z.headers,qe.body=Z.body,qe.type=m.G.CMCD_EVENT,ye.load({request:qe,success:()=>de({status:200}),error:yt=>de({status:yt?.status||500})})})}function Le(){ue.onPeriodSwitchComplete()}function Ee(){ue.onPlaybackStarted()}function Tt(){ue.onPlaybackPlaying(),Ut(E.A.CMCD_PLAYER_STATES.PLAYING)}function Ct(Z){var de,qe,yt,Lt,Ft,X;if(((yt=(qe=(de=Z.error)==null?void 0:de.data)==null?void 0:qe.request)==null?void 0:yt.type)===m.G.CMCD_EVENT||!F)return;Ye();const De=((Lt=Z.error)==null?void 0:Lt.code)||((X=(Ft=Z.error)==null?void 0:Ft.data)==null?void 0:X.code);if(De){const it=String(De);ae()&&un(pt,it),tt.forEach(dt=>un(dt,it))}K(E.A.CMCD_REPORTING_EVENTS.ERROR)}function Ye(){if(!Be||!F||!(Te.get("applyParametersFromMpd")??!0)||!Te.hasManifestParams())return;Be=!1;const Z=Kt();JSON.stringify(Z)!==we&&(F.stop(!0),F=kt(Z),F.start())}function K(Z,de={}){if(!F)return;Ye();const qe={...ue.getEventModeData(),...de},yt=ue.calculateMsd();yt.msd!==void 0&&F.update(yt),F.recordEvent(Z,qe)}function S(Z){var de;if(!F||!ae()||!ue.isIncludedInRequestFilter(Z.type))return!1;Ye();let qe=!1;try{const yt=ue.deriveCmcdDataForRequest(Z),Lt=ue.calculateMsd();Lt.msd!==void 0&&F.update(Lt);const Ft=F.createRequestReport(Z,yt);Z.url=Ft.url,Z.headers=Ft.headers,Z.cmcd=((de=Ft.customData)==null?void 0:de.cmcd)||{},qe=!0,(function(X){const De=Te.get("mode"),it={url:X.url,mediaType:X.mediaType,requestType:X.type,cmcdData:X.cmcd,mode:De};if(De===E.A.CMCD_MODE_HEADERS)it.headers=X.headers;else try{const dt=new URL(X.url);it.cmcdString=dt.searchParams.get("CMCD")||""}catch{it.cmcdString=""}Ze.trigger(f.A.CMCD_DATA_GENERATED,it)})(Z)}catch(yt){z.warn(yt)}return qe}function ae(Z=null){return Z!==null?(function(de){if(Te.getVersion()!==2)return z.warn("CMCD version 2 is required for target configuration"),!1;const qe=Te.getEventTarget(de),yt=qe.get("targetEnabled"),Lt=qe.get("targetUrl");return Lt?yt&&Lt:(z.warn("Target URL is not configured"),!1)})(Z):(function(){const de=Te.getVersion();return de!==1&&de!==2?(z.error(`version parameter must be 1 or 2, got ${de}.`),!1):Te.isEnabled()})()&&(function(){if(Te.getVersion()===2)return!0;const de=Te.get("includeInRequests"),qe=E.A.CMCD_AVAILABLE_REQUESTS,yt=de.filter(Lt=>!qe.includes(Lt));return yt.length===de.length?(z.error("None of the request types are supported."),!1):(yt.forEach(Lt=>{z.warn(`request type ${Lt} is not supported.`)}),!0)})()}function P(Z){const de=ue.onPlaybackRateChanged(Z);F&&de&&F.update(de)}function _e(Z){if(ue.updateCmcdManifestParamsInCmcdConfigAccessor(),Be=!0,F){const de=ue.onManifestLoaded(Z);F.update(de)}}function Ue(Z){ue.onBufferLevelStateChanged(Z)}function Pe(){ue.onPlaybackSeeking(),Ut(E.A.CMCD_PLAYER_STATES.SEEKING)}function Je(){ue.onPlaybackSeeked()}function g(){if(ue.wasPlaying()){const Z=ue.getLastMediaTypeRequest();ue.onRebufferingStarted(Z),Ut(E.A.CMCD_PLAYER_STATES.REBUFFERING)}else Ut(E.A.CMCD_PLAYER_STATES.WAITING)}function y(Z){const de=Z.customData.request;return S(de)?Z={...Z,url:de.url,headers:de.headers,cmcd:de.cmcd,customData:{...Z.customData,cmcd:de.cmcd}}:(Z.cmcd=de.cmcd,Z)}function R(Z){var de,qe,yt;return((yt=(qe=(de=Z.request)==null?void 0:de.customData)==null?void 0:qe.request)==null?void 0:yt.type)===m.G.CMCD_EVENT||(function(Lt){if(!F)return;Ye();const Ft=ue.getEventModeData(),X=ue.calculateMsd();X.msd!==void 0&&F.update(X);const De={};if(Lt.headers)try{const it=Lt.headers["cmsd-static"];it&&(De.cmsds=btoa(it));const dt=Lt.headers["cmsd-dynamic"];dt&&(De.cmsdd=btoa(dt))}catch(it){z.warn("Failed to base64 encode CMSD headers, ignoring.",it)}try{F.recordResponseReceived(Lt,{...Ft,...De})}catch(it){z.warn("Failed to record response received in CMCD reporter.",it)}})(Z),Z}function ne(){Ze.off(u.A.PLAYBACK_RATE_CHANGED,P,re),Ze.off(u.A.MANIFEST_LOADED,_e,re),Ze.off(u.A.BUFFER_LEVEL_STATE_CHANGED,Ue,re),Ze.off(u.A.PLAYBACK_SEEKED,Je,re),Ze.off(u.A.PERIOD_SWITCH_COMPLETED,Le,re),Ze.off(u.A.PLAYBACK_STARTED,Ee,re),Ze.off(u.A.MANIFEST_LOADING_STARTED,Ee,re),Ze.off(u.A.ERROR,Ct,re),Ze.off(u.A.PLAYBACK_PLAYING,Tt,re),Ze.off(u.A.PLAYBACK_SEEKING,Pe,re),Ze.off(u.A.PLAYBACK_WAITING,g,re),Object.keys(U).forEach(Z=>{Ze.off(Z,Bt[Z],re)}),F&&(F.stop(!0),F=null),ue.resetInitialSettings()}return ue=(0,se.A)(mt).getInstance(),Te=(0,ce.A)(mt).getInstance(),re={applyCmcdToRequest:S,getCmcdRequestInterceptors:function(){return[y]},getCmcdResponseReceivedInterceptors:function(){return[R]},getCmcdParametersFromManifest:function(){return ue.getCmcdParametersFromManifest()},initialize:function(Z){Be=!1,pt=[],tt=[],(function(de){Ze.on(u.A.PLAYBACK_RATE_CHANGED,P,re),Ze.on(u.A.MANIFEST_LOADED,_e,re),Ze.on(u.A.BUFFER_LEVEL_STATE_CHANGED,Ue,re),Ze.on(u.A.PLAYBACK_SEEKED,Je,re),Ze.on(u.A.PERIOD_SWITCH_COMPLETED,Le,re),de?Ze.on(u.A.MANIFEST_LOADING_STARTED,Ee,re):Ze.on(u.A.PLAYBACK_STARTED,Ee,re),Ze.on(u.A.ERROR,Ct,re)})(Z),ye||(ye=(0,V.A)(mt).create({errHandler:je,mediaPlayerModel:he,errors:Y.A,dashMetrics:ve})),F=kt(),F.start(),Ze.on(u.A.PLAYBACK_PLAYING,Tt,re),Ze.on(u.A.PLAYBACK_SEEKING,Pe,re),Ze.on(u.A.PLAYBACK_WAITING,g,re),Object.entries(U).forEach(([de,qe])=>{Bt[de]||(Bt[de]=()=>Ut(qe)),Ze.on(de,Bt[de],re)})},isCmcdEnabled:ae,reset:ne,setConfig:function(Z){Z&&(Z.dashMetrics&&(ve=Z.dashMetrics),Z.mediaPlayerModel&&(he=Z.mediaPlayerModel),Z.errHandler&&(je=Z.errHandler),Z.urlLoader&&(ye=Z.urlLoader),Z.serviceDescriptionController&&Te.setManifestParamsProviderFunction(()=>{var de;const qe=Z.serviceDescriptionController.getServiceDescriptionSettings();return((de=qe?.clientDataReporting)==null?void 0:de.cmcdParameters)||null}),ue.setConfig(Z))}},z=He.getLogger(re),ne(),re}ge.__dashjs_factory_name="CmcdController",Re.A=o.A.getSingletonFactory(ge)},2473:function(Nt,Re,C){var j=C(138),f=C(5212),o=C(7263);function u(){let E,m;function b(){m={}}return E={reset:function(){b()},processResponseHeaders:function(T){if(!(T&&T.headers&&T.request&&T.request.url))return;const Q=T.headers[f.A.COMMON_ACCESS_TOKEN_HEADER];if(Q){const V=o.A.getHostFromUrl(T.request.url);V&&(m[V]=Q)}},getCommonAccessTokenForUrl:function(T){if(!T)return null;const Q=o.A.getHostFromUrl(T);return Q?m[Q]?m[Q]:null:void 0}},b(),E}u.__dashjs_factory_name="CommonAccessTokenController",Re.A=j.A.getSingletonFactory(u)},5313:function(Nt,Re,C){var j=C(138),f=C(7263),o=C(8854),u=C(5212),E=C(7568),m=C(649);function b(){let T,Q,V;const se=this.context;function Y(ce,ge,Te,ue,F){var ve;const je=(function(tt,re){let z=[];return z=re===o.A.PERIOD?tt[o.A.SUPPLEMENTAL_PROPERTY]||[]:[...tt[o.A.ESSENTIAL_PROPERTY]||[],...tt[o.A.SUPPLEMENTAL_PROPERTY]||[]],z.find(he=>he.schemeIdUri===u.A.URL_QUERY_INFO_SCHEME&&he.UrlQueryInfo||he.schemeIdUri===u.A.EXT_URL_QUERY_INFO_SCHEME&&he.ExtUrlQueryInfo)})(ge,F);(function(tt,re,z,he){z.initialQueryString="";let we="";const Be=tt?.ExtUrlQueryInfo||tt?.UrlQueryInfo;we=Be&&Be.queryString?re&&re.length>0?re+"&"+Be.queryString:Be.queryString:re,Be?.useMPDUrlQuery==="true"&&he&&(we=we?we+"&"+he:he),z.initialQueryString=we})(je,ue.initialQueryString,ce,Te),(function(tt,re,z){var he,we;if(!tt)return void(re.finalQueryString=z);const Be=((he=tt?.ExtUrlQueryInfo)==null?void 0:he.queryTemplate)||((we=tt?.UrlQueryInfo)==null?void 0:we.queryTemplate)||"";re.finalQueryString=Be===o.A.QUERY_PART?re?.initialQueryString:""})(je,ce,ue.finalQueryString),ce.sameOriginOnly=(ve=je?.ExtUrlQueryInfo)==null?void 0:ve.sameOriginOnly,ce.queryParams=f.A.parseQueryParams(ce?.finalQueryString),ce.includeInRequests=(function(tt,re){var z;return tt?(z=tt.ExtUrlQueryInfo)!=null&&z.includeInRequests?tt.ExtUrlQueryInfo.includeInRequests.split(" "):[o.A.SEGMENT_TYPE]:re})(je,ue.includeInRequests)}return Q=(0,m.A)(se).getInstance().getLogger(T),T={getFinalQueryString:function(ce){try{if(!V)return null;if(ce.type===E.G.MEDIA_SEGMENT_TYPE||ce.type===E.G.INIT_SEGMENT_TYPE){const ge=ce.representation;if(!ge)return null;const Te=ge.adaptation,ue=Te.period,F=V.period[ue.index].adaptation[Te.index].representation[ge.index],ve=new URL(ce.url),je=!F.sameOriginOnly||V.origin===ve.origin;if(F.includeInRequests.includes(o.A.SEGMENT_TYPE)&&je)return F.queryParams}else if(ce.type===E.G.MPD_TYPE){if([o.A.MPD_TYPE,o.A.MPD_PATCH_TYPE].some(ge=>V.includeInRequests.includes(ge)))return V.queryParams}else if(ce.type===E.G.CONTENT_STEERING_TYPE&&V.includeInRequests.includes(o.A.STEERING_TYPE))return V.queryParams}catch(ge){return Q.error(ge),null}},createFinalQueryStrings:function(ce){V={origin:new URL(ce.url).origin,period:[]};const ge=ce.url.split("?")[1];Y(V,ce,ge,{initialQueryString:"",includeInRequests:[]},o.A.MPD),ce.Period.forEach(Te=>{const ue={adaptation:[]};Y(ue,Te,ge,V,o.A.PERIOD),Te.AdaptationSet.forEach(F=>{const ve={representation:[]};Y(ve,F,ge,ue,o.A.ADAPTATION_SET),F.Representation.forEach(je=>{const tt={};Y(tt,je,ge,ve,o.A.REPRESENTATION),ve.representation.push(tt)}),ue.adaptation.push(ve)}),V.period.push(ue)})}},T}b.__dashjs_factory_name="ExtUrlQueryInfoController",Re.A=j.A.getSingletonFactory(b)},4469:function(Nt,Re,C){C.d(Re,{A:function(){return ae}});class j{constructor(){this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null}}j.SSL_CONNECTION_FAILED_PREFIX="SSL",j.DNS_RESOLUTION_FAILED="C00",j.HOST_UNREACHABLE="C01",j.CONNECTION_REFUSED="C02",j.CONNECTION_ERROR="C03",j.CORRUPT_MEDIA_ISOBMFF="M00",j.CORRUPT_MEDIA_OTHER="M01",j.BASE_URL_CHANGED="F00",j.BECAME_REPORTER="S00";var f=j,o=C(913),u=C(138);function E(P){let _e,Ue;const Pe=(P=P||{}).eventBus,Je=P.dashMetrics,g=P.metricsConstants,y=P.events;function R(Lt){let Ft=new f;if(Ue){for(const X in Lt)Lt.hasOwnProperty(X)&&(Ft[X]=Lt[X]);Ft.mpdurl||(Ft.mpdurl=Ue.originalUrl||Ue.url),Ft.terror||(Ft.terror=new Date),Je.addDVBErrors(Ft)}}function ne(Lt){Lt.error||(Ue=Lt.manifest)}function Z(Lt){R({errorcode:f.BASE_URL_CHANGED,servicelocation:Lt.entry})}function de(){R({errorcode:f.BECAME_REPORTER})}function qe(Lt){var Ft;Lt.metric===g.HTTP_REQUEST&&((Ft=Lt.value).responsecode===0||Ft.responsecode==null||Ft.responsecode>=400||Ft.responsecode<100||Ft.responsecode>=600)&&R({errorcode:Ft.responsecode||f.CONNECTION_ERROR,url:Ft.url,terror:Ft.tresponse,servicelocation:Ft._serviceLocation})}function yt(Lt){let Ft;switch(Lt.error?Lt.error.code:0){case MediaError.MEDIA_ERR_NETWORK:Ft=f.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:Ft=f.CORRUPT_MEDIA_OTHER;break;default:return}R({errorcode:Ft})}return _e={initialize:function(){Pe.on(y.MANIFEST_UPDATED,ne,_e),Pe.on(y.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,Z,_e),Pe.on(y.METRIC_ADDED,qe,_e),Pe.on(y.METRIC_UPDATED,qe,_e),Pe.on(y.PLAYBACK_ERROR,yt,_e),Pe.on(o.A.BECAME_REPORTING_PLAYER,de,_e)},reset:function(){Pe.off(y.MANIFEST_UPDATED,ne,_e),Pe.off(y.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,Z,_e),Pe.off(y.METRIC_ADDED,qe,_e),Pe.off(y.METRIC_UPDATED,qe,_e),Pe.off(y.PLAYBACK_ERROR,yt,_e),Pe.off(o.A.BECAME_REPORTING_PLAYER,de,_e)}},_e}E.__dashjs_factory_name="DVBErrorsTranslator";var m=u.A.getSingletonFactory(E),b=C(7377);function T(P){P=P||{};let _e,Ue,Pe=!1,Je=this.context,g=P.mediaElement;return _e={initialize:function(y){y&&y.length&&(y.forEach(R=>{let ne=R.starttime,Z=ne+R.duration;Ue.add(ne,Z)}),Pe=!!y[0]._useWallClockTime)},reset:function(){Ue.clear()},isEnabled:function(){let y,R=Ue.length;if(!R)return!0;y=Pe?new Date().getTime()/1e3:g.currentTime;for(let ne=0;ne<R;ne+=1){let Z=Ue.start(ne),de=Ue.end(ne);if(Z<=y&&y<de)return!0}return!1}},Ue=(0,b.A)(Je).create(),_e}T.__dashjs_factory_name="RangeController";var Q=u.A.getClassFactory(T);function V(){return{serialise:function P(_e){let Ue,Pe,Je=[],g=[];for(Ue in _e)if(_e.hasOwnProperty(Ue)&&Ue.indexOf("_")!==0){if(Pe=_e[Ue],Pe==null&&(Pe=""),Array.isArray(Pe)){if(!Pe.length)continue;g=[],Pe.forEach(function(y){let R=Object.prototype.toString.call(y).slice(8,-1)!=="Object";g.push(R?y:P(y))}),Pe=g.map(encodeURIComponent).join(",")}else typeof Pe=="string"?Pe=encodeURIComponent(Pe):Pe instanceof Date?Pe=Pe.toISOString():typeof Pe=="number"&&(Pe=Math.round(Pe));Je.push(Ue+"="+Pe)}return Je.join("&")}}}V.__dashjs_factory_name="MetricSerialiser";var se=u.A.getSingletonFactory(V);function Y(){let P,_e,Ue,Pe=window.crypto||window.msCrypto,Je=Uint32Array,g=Math.pow(2,8*Je.BYTES_PER_ELEMENT)-1;function y(){Pe&&(P||(P=new Je(10)),Pe.getRandomValues(P),_e=0)}return Ue={random:function(R,ne){let Z;return R||(R=0),ne||(ne=1),Pe?(_e===P.length&&y(),Z=P[_e]/g,_e+=1):Z=Math.random(),Z*(ne-R)+R}},y(),Ue}Y.__dashjs_factory_name="RNG";var ce=u.A.getSingletonFactory(Y),ge=C(1926),Te=C(8261);function ue(P){let _e;P=P||{};let Ue,Pe,Je,g,y,R,ne,Z=this.context,de=(0,Te.A)(Z).getInstance(),qe=[];const yt=P.metricsConstants;function Lt(){g=!1,y=!1,R=null,ne=null}return _e={report:function(Ft,X){Array.isArray(X)||(X=[X]),y&&ne.isEnabled()&&X.forEach(function(De){let it=Ue.serialise(De);Ft!==yt.DVB_ERRORS&&(it=`metricname=${Ft}&${it}`),it=`${R}?${it}`,(function(dt,It,lt){let Yt=new XMLHttpRequest;Yt.withCredentials=Pe.getXHRWithCredentialsForType(yt.HTTP_REQUEST_DVB_REPORTING_TYPE);const Xt=function(){let Zt=qe.indexOf(Yt);Zt!==-1&&(qe.splice(Zt,1),!(Yt.status>=200&&Yt.status<300)&&lt&&lt())};qe.push(Yt);try{Yt.open("GET",dt),Yt.onloadend=Xt,Yt.onerror=Xt,Yt.send()}catch{Yt.onerror()}})(it,0,function(){y=!1})})},initialize:function(Ft,X){let De;if(ne=X,R=de.get().streaming.dvbReporting.reportingUrl||Ft.dvbReportingUrl,!R)throw new Error('MPD parameter missing "dvb:reportingUrl" or URL not provided in player settings');g||(De=Ft.dvbProbability,De&&(De===1e3||De/1e3>=Je.random())&&(y=!0),g=!0)},reset:function(){Lt()}},Ue=se(Z).getInstance(),Je=ce(Z).getInstance(),Pe=(0,ge.A)(Z).getInstance(),Lt(),_e}ue.__dashjs_factory_name="DVBReporting";var F=u.A.getClassFactory(ue);function ve(P){P=P||{};const _e={"urn:dvb:dash:reporting:2014":F},Ue=this.context;let Pe;const Je=P.debug?P.debug.getLogger(Pe):{},g=P.metricsConstants,y=P.mediaPlayerModel||{};return Pe={create:function(R,ne){let Z;try{Z=_e[R.schemeIdUri](Ue).create({metricsConstants:g,mediaPlayerModel:y}),Z.initialize(R,ne)}catch(de){Z=null,Je.error(`ReportingFactory: could not create Reporting with schemeIdUri ${R.schemeIdUri} (${de.message})`)}return Z},register:function(R,ne){_e[R]=ne},unregister:function(R){delete _e[R]}},Pe}ve.__dashjs_factory_name="ReportingFactory";var je=u.A.getSingletonFactory(ve);function tt(P){let _e,Ue=[];const Pe=je(this.context).getInstance(P);return _e={initialize:function(Je,g){Je.some(y=>{let R=Pe.create(y,g);if(R)return Ue.push(R),!0})},reset:function(){Ue.forEach(Je=>Je.reset()),Ue=[]},report:function(Je,g){Ue.forEach(y=>y.report(Je,g))}},_e}tt.__dashjs_factory_name="ReportingController";var re=u.A.getClassFactory(tt);function z(){return{reconstructFullMetricName:function(P,_e,Ue){let Pe=P;return _e&&(Pe+="("+_e,Ue&&Ue.length&&(Pe+=","+Ue),Pe+=")"),Pe},validateN:function(P){if(!P)throw new Error("missing n");if(isNaN(P))throw new Error("n is NaN");if(P<0)throw new Error("n must be positive");return P}}}z.__dashjs_factory_name="HandlerHelpers";var he=u.A.getSingletonFactory(z);function we(P){let _e,Ue,Pe,Je,g,y;P=P||{};let R=this.context,ne=he(R).getInstance(),Z=[];const de=P.metricsConstants;function qe(){let yt=(function(){try{return Object.keys(Z).map(Lt=>Z[Lt]).reduce((Lt,Ft)=>Lt.level<Ft.level?Lt:Ft)}catch{return}})();yt&&y!==yt.t&&(y=yt.t,Ue.report(Je,yt))}return _e={initialize:function(yt,Lt,Ft){Lt&&(Pe=ne.validateN(Ft),Ue=Lt,Je=ne.reconstructFullMetricName(yt,Ft),g=setInterval(qe,Pe))},reset:function(){clearInterval(g),g=null,Pe=0,Ue=null,y=null},handleNewMetric:function(yt,Lt,Ft){yt===de.BUFFER_LEVEL&&(Lt.level<0?delete Z[Ft]:Z[Ft]=Lt)}},_e}we.__dashjs_factory_name="BufferLevelHandler";var Be=u.A.getClassFactory(we),pt=u.A.getClassFactory(function(P){let _e,Ue,Pe=(P=P||{}).eventBus;const Je=P.metricsConstants;function g(){Pe.off(o.A.METRICS_INITIALISATION_COMPLETE,g,this),Pe.trigger(o.A.BECAME_REPORTING_PLAYER)}return _e={initialize:function(y,R){R&&(Ue=R,Pe.on(o.A.METRICS_INITIALISATION_COMPLETE,g,this))},reset:function(){Ue=null},handleNewMetric:function(y,R){y===Je.DVB_ERRORS&&Ue&&Ue.report(y,R)}},_e});function ye(P){let _e,Ue,Pe,Je,g,y;P=P||{};let R=[],ne=he(this.context).getInstance();const Z=P.metricsConstants;function de(){var qe=R;qe.length&&Ue&&Ue.report(g,qe),R=[]}return _e={initialize:function(qe,yt,Lt,Ft){yt&&(Pe=ne.validateN(Lt),Ue=yt,Ft&&Ft.length&&(Je=Ft),g=ne.reconstructFullMetricName(qe,Lt,Ft),y=setInterval(de,Pe))},reset:function(){clearInterval(y),y=null,Pe=null,Je=null,R=[],Ue=null},handleNewMetric:function(qe,yt){qe===Z.HTTP_REQUEST&&(Je&&Je!==yt.type||R.push(yt))}},_e}ye.__dashjs_factory_name="HttpListHandler";var mt=u.A.getClassFactory(ye);function Ze(){let P,_e,Ue;return P={initialize:function(Pe,Je){_e=Pe,Ue=Je},reset:function(){Ue=null,_e=void 0},handleNewMetric:function(Pe,Je){Pe===_e&&Ue&&Ue.report(_e,Je)}},P}Ze.__dashjs_factory_name="GenericMetricHandler";var He=u.A.getClassFactory(Ze);function U(P){let _e;const Ue=(P=P||{}).debug?P.debug.getLogger(_e):{};let Pe=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/;const Je=this.context;let g={BufferLevel:Be,DVBErrors:pt,HttpList:mt,PlayList:He,RepSwitchList:He,TcpList:He};return _e={create:function(y,R){var ne,Z=y.match(Pe);if(Z){try{(ne=g[Z[1]](Je).create({eventBus:P.eventBus,metricsConstants:P.metricsConstants})).initialize(Z[1],R,Z[3],Z[5])}catch(de){ne=null,Ue.error(`MetricsHandlerFactory: Could not create handler for type ${Z[1]} with args ${Z[3]}, ${Z[5]} (${de.message})`)}return ne}},register:function(y,R){g[y]=R},unregister:function(y){delete g[y]}},_e}U.__dashjs_factory_name="MetricsHandlerFactory";var Bt=u.A.getSingletonFactory(U);function Ut(P){P=P||{};let _e,Ue=[];const Pe=this.context,Je=P.eventBus,g=P.events;let y=Bt(Pe).getInstance({debug:P.debug,eventBus:P.eventBus,metricsConstants:P.metricsConstants});function R(ne){Ue.forEach(Z=>{Z.handleNewMetric(ne.metric,ne.value,ne.mediaType)})}return _e={initialize:function(ne,Z){ne.split(",").forEach((de,qe,yt)=>{let Lt;if(de.indexOf("(")!==-1&&de.indexOf(")")===-1){let Ft=yt[qe+1];Ft&&Ft.indexOf("(")===-1&&Ft.indexOf(")")!==-1&&(de+=","+Ft,delete yt[qe+1])}Lt=y.create(de,Z),Lt&&Ue.push(Lt)}),Je.on(g.METRIC_ADDED,R,_e),Je.on(g.METRIC_UPDATED,R,_e)},reset:function(){Je.off(g.METRIC_ADDED,R,_e),Je.off(g.METRIC_UPDATED,R,_e),Ue.forEach(ne=>ne.reset()),Ue=[]}},_e}Ut.__dashjs_factory_name="MetricsHandlersController";var kt=u.A.getClassFactory(Ut);function Kt(P){let _e,Ue,Pe,Je;P=P||{};let g=this.context;function y(){_e&&_e.reset(),Ue&&Ue.reset(),Pe&&Pe.reset()}return Je={initialize:function(R){try{Pe=Q(g).create({mediaElement:P.mediaElement}),Pe.initialize(R.Range),Ue=re(g).create({debug:P.debug,metricsConstants:P.metricsConstants,mediaPlayerModel:P.mediaPlayerModel}),Ue.initialize(R.Reporting,Pe),_e=kt(g).create({debug:P.debug,eventBus:P.eventBus,metricsConstants:P.metricsConstants,events:P.events}),_e.initialize(R.metrics,Ue)}catch(ne){throw y(),ne}},reset:y},Je}Kt.__dashjs_factory_name="MetricsController";var on=u.A.getClassFactory(Kt),un=class{constructor(){this.metrics="",this.Range=[],this.Reporting=[]}},hn=class{constructor(){this.starttime=0,this.duration=1/0,this._useWallClockTime=!1}},Le=class{constructor(){this.schemeIdUri="",this.value="",this.dvbReportingUrl="",this.dvbProbability=1e3}};function Ee(P){let _e,Ue=(P=P||{}).adapter;const Pe=P.constants;return _e={getMetrics:function(Je){let g=[];return Je&&Je.Metrics&&Je.Metrics.forEach(y=>{var R=new un,ne=Ue.getIsDynamic(Je);y.hasOwnProperty("metrics")&&(R.metrics=y.metrics,y.Range&&y.Range.forEach(Z=>{var de=new hn;de.starttime=(function(qe,yt,Lt){let Ft,X,De=0;return yt?De=Ue.getAvailabilityStartTime(qe)/1e3:(Ft=Ue.getRegularPeriods(qe),Ft.length&&(De=Ft[0].start)),X=De,Lt&&Lt.hasOwnProperty(Pe.START_TIME)&&(X+=Lt.starttime),X})(Je,ne,Z),Z.hasOwnProperty("duration")?de.duration=Z.duration:de.duration=Ue.getDuration(Je),de._useWallClockTime=ne,R.Range.push(de)}),y.Reporting&&(y.Reporting.forEach(Z=>{var de=new Le;Z.hasOwnProperty(Pe.SCHEME_ID_URI)&&(de.schemeIdUri=Z.schemeIdUri,Z.hasOwnProperty("value")&&(de.value=Z.value),Z.hasOwnProperty(Pe.DVB_REPORTING_URL)&&(de.dvbReportingUrl=Z[Pe.DVB_REPORTING_URL]),Z.hasOwnProperty(Pe.DVB_PROBABILITY)&&(de.dvbProbability=Z[Pe.DVB_PROBABILITY]),R.Reporting.push(de))}),g.push(R)))}),g}},_e}Ee.__dashjs_factory_name="ManifestParsing";var Tt=u.A.getSingletonFactory(Ee);function Ct(P){let _e;P=P||{};let Ue={},Pe=this.context,Je=P.eventBus;const g=P.events;function y(ne){if(ne.error)return;let Z=Object.keys(Ue);Tt(Pe).getInstance({adapter:P.adapter,constants:P.constants}).getMetrics(ne.manifest).forEach(de=>{const qe=JSON.stringify(de);if(Ue.hasOwnProperty(qe))Z.splice(qe,1);else try{let yt=on(Pe).create(P);yt.initialize(de),Ue[qe]=yt}catch{}}),Z.forEach(de=>{Ue[de].reset(),delete Ue[de]}),Je.trigger(o.A.METRICS_INITIALISATION_COMPLETE)}function R(){Object.keys(Ue).forEach(ne=>{Ue[ne].reset()}),Ue={}}return _e={reset:function(){Je.off(g.MANIFEST_UPDATED,y,_e),Je.off(g.STREAM_TEARDOWN_COMPLETE,R,_e)}},Je.on(g.MANIFEST_UPDATED,y,_e),Je.on(g.STREAM_TEARDOWN_COMPLETE,R,_e),_e}Ct.__dashjs_factory_name="MetricsCollectionController";var Ye=u.A.getClassFactory(Ct);function K(){let P,_e,Ue=this.context;return P={createMetricsReporting:function(Pe){return _e=m(Ue).getInstance({eventBus:Pe.eventBus,dashMetrics:Pe.dashMetrics,metricsConstants:Pe.metricsConstants,events:Pe.events}),_e.initialize(),Ye(Ue).create(Pe)},getReportingFactory:function(){return je(Ue).getInstance()},getMetricsHandlerFactory:function(){return Bt(Ue).getInstance()}},P}K.__dashjs_factory_name="MetricsReporting";const S=u.A.getClassFactory(K);S.events=o.A,u.A.updateClassFactory(K.__dashjs_factory_name,S);var ae=S},913:function(Nt,Re,C){var j=C(7252);class f extends j.A{constructor(){super(),this.METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",this.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",this.CMCD_DATA_GENERATED="cmcdDataGenerated"}}let o=new f;Re.A=o},8898:function(Nt,Re,C){var j=C(8735),f=C(7568),o=C(1191),u=C(7263),E=C(5212),m=C(138),b=C(9302),T=C(6882);const Q={[f.G.INIT_SEGMENT_TYPE]:"segment",[f.G.MEDIA_SEGMENT_TYPE]:"segment",[f.G.XLINK_EXPANSION_TYPE]:"xlink",[f.G.MPD_TYPE]:"mpd",[f.G.CONTENT_STEERING_TYPE]:"steering",[f.G.OTHER_TYPE]:"other",[f.G.LICENSE]:"license"};function V(){let se,Y,ce,ge,Te,ue,F,ve,je,tt,re,z,he,we,Be,pt,ye,mt,Ze={},He={},U=this.context;function Bt(){F=(0,T.A)(U).getInstance(),Pe()}function Ut(R){return R!=null&&!isNaN(R)&&isFinite(R)}function kt(R,ne){const Z=[];return Ut(R)&&Z.push((0,j.gz)(R,{v:!0})),Ut(ne)&&Z.push((0,j.gz)(ne,{a:!0})),Z.length>0?Z:null}function Kt(R,ne){var Z;on(ne);const de=Ue(ne),qe=(function(Xt){try{return parseInt(Xt.bandwidth/1e3)}catch{return null}})(R),yt=(function(Xt){try{return isNaN(Xt.duration)?NaN:Math.round(1e3*Xt.duration)}catch{return null}})(R),Lt=K(ne),Ft=(function(Xt){try{const Zt=ge?ge.getPlaybackRate():1,Gt=Y.getCurrentBufferLevel(Xt);return isNaN(Zt)||isNaN(Gt)?null:100*parseInt(Gt/Zt*10)}catch{return null}})(ne),X=ae(ne),De=hn((Z=R.representation)==null?void 0:Z.mediaInfo),it=Ye(ne),dt=Le(ne),It=(function(Xt){if(Be&&Be.length!==0){for(let Zt of Be)if(Zt.getType()===Xt)return Zt.probeNextRequest()}})(ne);let lt;ne===E.A.VIDEO&&(lt=j.hU.VIDEO),ne===E.A.AUDIO&&(lt=j.hU.AUDIO),R.mediaType===E.A.ENHANCEMENT&&(lt=j.hU.OTHER),ne===E.A.TEXT&&(lt=R.representation.mediaInfo.mimeType==="application/mp4"?j.hU.TIMED_TEXT:j.hU.CAPTION);const Yt=F.has("rtp")?F.get("rtp"):(function(Xt){try{let Zt=ge.getPlaybackRate();Zt||(Zt=1);let{bandwidth:Gt,mediaType:mn,representation:sn,duration:Me}=Xt;if(!sn.mediaInfo)return NaN;let Ce=ae(mn);Ce===0&&(Ce=500);let Ve=Gt*Me/1e3/(Ce/Zt/1e3);const Ne=F.get("rtpSafetyFactor",{defaultValue:5});return 100*(parseInt(Ve*Ne/100)+1)}catch{return NaN}})(R);if(isNaN(Yt)||(de.rtp=Yt),It&&R.url!==It.url){const Xt=u.A.getRelativeUrl(R.url,It.url),Zt=It.range?{r:It.range}:void 0;de.nor=[(0,j.gz)(Xt,Zt)]}if(qe){const Xt=ne===E.A.VIDEO?qe:null,Zt=ne===E.A.AUDIO?qe:null;de.br=kt(Xt,Zt)||[(0,j.gz)(qe,{})]}if(lt&&(de.ot=lt),isNaN(yt)||(de.d=yt),!isNaN(Lt)){const Xt=ne===E.A.VIDEO?Lt:null,Zt=ne===E.A.AUDIO?Lt:null;de.mtp=kt(Xt,Zt)||[(0,j.gz)(Lt,{})]}if(isNaN(Ft)||(de.dl=Ft),!isNaN(X)){const Xt=ne===E.A.VIDEO?X:null,Zt=ne===E.A.AUDIO?X:null;de.bl=kt(Xt,Zt)||[(0,j.gz)(X,{})]}if(!isNaN(De)&&isFinite(De)){const Xt=ne===E.A.VIDEO?De:null,Zt=ne===E.A.AUDIO?De:null;de.tb=kt(Xt,Zt)||[(0,j.gz)(De,{})]}if(it!==null&&!isNaN(it)){const Xt=ne===E.A.VIDEO?it:null,Zt=ne===E.A.AUDIO?it:null;de.tpb=kt(Xt,Zt)||[(0,j.gz)(it,{})]}if(dt!==null&&!isNaN(dt)){const Xt=ne===E.A.VIDEO?dt:null,Zt=ne===E.A.AUDIO?dt:null;de.pb=kt(Xt,Zt)||[(0,j.gz)(dt,{})]}if(tt[ne]&&(de.bs=!0,tt[ne]=!1),He[ne]){const Xt=ne===E.A.VIDEO?He[ne]:null,Zt=ne===E.A.AUDIO?He[ne]:null;de.bsd=kt(Xt,Zt)||[(0,j.gz)(He[ne],{})],delete He[ne]}return!je[ne]&&re[ne]||(de.su=!0,je[ne]=!1,re[ne]=!0),Object.assign(de,y()),de}function on(R){re.hasOwnProperty(R)||(re[R]=!1),je.hasOwnProperty(R)||(je[R]=!1),tt.hasOwnProperty(R)||(tt[R]=!1)}function un(){var R;const ne={},Z=(R=ge.getStreamController())==null?void 0:R.getActiveStream();if(!Z)return ne;const de=Z.getCurrentRepresentationForType(E.A.VIDEO),qe=Z.getCurrentRepresentationForType(E.A.AUDIO),yt=kt(de?Math.round(de.bitrateInKbit):null,qe?Math.round(qe.bitrateInKbit):null);return yt&&(ne.br=yt),ne}function hn(R){try{if(mt&&mt.has(R))return mt.get(R);const ne=Te.getPossibleVoRepresentationsFilteredBySettings(R).map(de=>de.bitrateInKbit),Z=Math.max(...ne);return mt&&mt.set(R,Z),Z}catch{return null}}function Le(R){var ne,Z;try{if(!Be||Be.length===0)return null;const de=Be.find(yt=>yt.getType()===R),qe=(Z=(ne=de?.getRepresentationController())==null?void 0:ne.getCurrentRepresentation())==null?void 0:Z.bitrateInKbit;return qe===void 0||isNaN(qe)?null:Math.round(qe)}catch{return null}}function Ee(){const R={},ne=kt(Le(E.A.VIDEO),Le(E.A.AUDIO));return ne&&(R.pb=ne),R}function Tt(R){if(!Be||Be.length===0)return null;const ne=Be.find(de=>de.getType()===R);if(!ne)return null;const Z=hn(ne.getMediaInfo());return isFinite(Z)&&Z>0?Z:null}function Ct(){const R={},ne=kt(Tt(E.A.VIDEO),Tt(E.A.AUDIO));ne&&(R.tb=ne);const Z=kt(Ye(E.A.VIDEO),Ye(E.A.AUDIO));return Z&&(R.tpb=Z),R}function Ye(R){try{if(!Be||Be.length===0)return null;const ne=Be.find(Z=>Z.getType()===R);if(ne){const Z=hn(ne.getMediaInfo());return isFinite(Z)&&Z>0?Z:null}return null}catch{return null}}function K(R){try{return 100*parseInt(ue.getSafeAverageThroughput(R)/100)}catch{return null}}function S(){const R={},ne=kt(K(E.A.VIDEO),K(E.A.AUDIO));return ne&&(R.mtp=ne),R}function ae(R){try{const ne=Y.getCurrentBufferLevel(R);return isNaN(ne)?null:100*parseInt(10*ne)}catch{return null}}function P(){const R={},ne=kt(ae(E.A.VIDEO),ae(E.A.AUDIO));return ne&&(R.bl=ne),R}function _e(R){Ze[R]!=null&&(He[R]=Date.now()-Ze[R],delete Ze[R])}function Ue(R){var ne;const Z={};let de=1e3*ge.getCurrentLiveLatency();if(isNaN(de)||(Z.ltc=de),typeof document<"u"&&document.hidden&&(Z.bg=!0),R&&(function(qe){return qe===E.A.VIDEO||qe===E.A.AUDIO||qe===E.A.OTHER})(R)){const qe=(ne=Y.getCurrentDroppedFrames())==null?void 0:ne.droppedFrames;qe>0&&(Z.df=qe)}return Z}function Pe(){tt={},je={},re={},we=!1,ve=void 0,z=void 0,he=void 0,Ze={},He={},pt=void 0,ye=void 0,Je()}function Je(){if(!ge)return;const R=ge.getStreamController();if(!R||typeof R.getActiveStream!="function")return;const ne=R.getActiveStream();ne&&(Be=ne.getStreamProcessors())}function g(){let R={};if(ce){const ne=ce.getServiceDescriptionSettings();ne.clientDataReporting&&ne.clientDataReporting.cmcdParameters&&(R=ne.clientDataReporting.cmcdParameters)}return R}function y(){var R;const ne={},Z=(R=ge.getStreamController())==null?void 0:R.getActiveStream();if(!Z)return ne;const de=Z.getCurrentRepresentationForType(E.A.VIDEO),qe=Z.getCurrentRepresentationForType(E.A.AUDIO),yt=de?de.bitrateInKbit:0,Lt=qe?qe.bitrateInKbit:0,Ft=kt(yt>0?Math.round(yt):null,Lt>0?Math.round(Lt):null);Ft&&(ne.ab=Ft);const X=Z.getRepresentationsByType(E.A.VIDEO)||[],De=Z.getRepresentationsByType(E.A.AUDIO)||[],it=X.reduce((Zt,Gt)=>Math.max(Zt,Gt.bitrateInKbit),0),dt=De.reduce((Zt,Gt)=>Math.max(Zt,Gt.bitrateInKbit),0),It=kt(it>0?Math.round(it):null,dt>0?Math.round(dt):null);It&&(ne.tab=It);const lt=X.length>0?Math.min(...X.map(Zt=>Zt.bitrateInKbit)):0,Yt=De.length>0?Math.min(...De.map(Zt=>Zt.bitrateInKbit)):0,Xt=kt(lt>0?Math.round(lt):null,Yt>0?Math.round(Yt):null);return Xt&&(ne.lab=Xt),ne}return se={calculateMsd:function(){const R={},ne=he!==void 0?he:null;return ne===null||isNaN(ne)||(R.msd=ne),R},deriveCmcdDataForRequest:function(R){mt=new Map;try{return R.type,(ne=R.mediaType)!==E.A.VIDEO&&ne!==E.A.AUDIO||ve&&ve!==E.A.AUDIO||(ve=ne),R.type===f.G.MPD_TYPE?(function(){const Z=Ue();return Z.ot=j.hU.MANIFEST,Z})():R.type===f.G.MEDIA_SEGMENT_TYPE?(on(R.mediaType),Kt(R,R.mediaType)):R.type===f.G.INIT_SEGMENT_TYPE?(function(){const Z=Ue();return Z.ot=j.hU.INIT,Z.su=!0,Z})():R.type===f.G.OTHER_TYPE||R.type===f.G.XLINK_EXPANSION_TYPE?(function(){const Z=Ue();return Z.ot=j.hU.OTHER,Z})():R.type===f.G.LICENSE?(function(){const Z=Ue();return Z.ot=j.hU.KEY,Z})():R.type===f.G.CONTENT_STEERING_TYPE?(function(Z){const de=ve?Kt(Z,ve):Ue();return de.ot=j.hU.OTHER,de})(R):{}}catch{return null}finally{mt=null}var ne},getCmcdParametersFromManifest:g,getEventModeData:function(){return{...Ue(),...y(),...un(),...P(),...S(),...Ee(),...Ct()}},getLastMediaTypeRequest:function(){return ve},isIncludedInRequestFilter:function(R,ne){const Z=ne??F.get("includeInRequests"),de=Q[R];return de!==void 0&&Z.includes(de)},onBufferLevelStateChanged:function(R){try{R.state&&R.mediaType&&R.state===o.A.BUFFER_EMPTY&&(tt[R.mediaType]||(tt[R.mediaType]=!0),je[R.mediaType]||(je[R.mediaType]=!0))}catch{}},onManifestLoaded:function(R){try{return pt=(0,b.A)(U).getInstance().getIsDynamic(R.data)?`${j.YM.LIVE}`:`${j.YM.VOD}`,ye=R.protocol&&R.protocol==="MSS"?`${j.xq.SMOOTH}`:`${j.xq.DASH}`,{st:pt,sf:ye}}catch{return{}}},onPeriodSwitchComplete:function(){Je()},onPlaybackPlaying:function(){he===void 0&&z!==void 0&&(he=Date.now()-z);for(const R in Ze)Ze.hasOwnProperty(R)&&_e(R)},onPlaybackRateChanged:function(R){return R.playbackRate!==void 0?{pr:R.playbackRate}:null},onPlaybackSeeked:function(){we=!1;for(let R in tt)tt.hasOwnProperty(R)&&(tt[R]=!0);for(let R in je)je.hasOwnProperty(R)&&(je[R]=!0)},onPlaybackSeeking:function(){we=!0},onPlaybackStarted:function(){z===void 0&&(z=Date.now())},onRebufferingCompleted:_e,onRebufferingStarted:function(R){R&&!Ze[R]&&(Ze[R]=Date.now())},reset:function(){Pe()},resetInitialSettings:Pe,setConfig:function(R){R&&(R.abrController&&(Te=R.abrController),R.dashMetrics&&(Y=R.dashMetrics),R.playbackController&&(ge=R.playbackController),R.throughputController&&(ue=R.throughputController),R.serviceDescriptionController&&(ce=R.serviceDescriptionController))},setup:Bt,updateCmcdManifestParamsInCmcdConfigAccessor:function(){const R=g();F&&Object.keys(R).length>0?F.setManifestParams(R):F&&F.setManifestParams(null)},wasPlaying:function(){return!we&&z}},Bt(),se}V.__dashjs_factory_name="CmcdModel",Re.A=m.A.getSingletonFactory(V)},6066:function(Nt,Re,C){var j=C(138),f=C(8850),o=C(3621),u=C(649),E=C(1103);const m=E.Pb.toLowerCase(),b=E.uu.toLowerCase(),T=["mb","st","sf","v"],Q="stream",V={video:E.Nw.VIDEO,audio:E.Nw.AUDIO,text:E.Nw.TIMED_TEXT,stream:Q};function se(){const Y=this.context,ce=(0,f.A)(Y).getInstance();let ge,Te,ue,F;function ve(){ue={},F={}}function je(we){we&&Object.keys(we).forEach(Be=>{T.includes(Be)||delete we[Be]})}function tt(we){try{return(0,E.aD)(we)}catch(Be){Te.error("Failed to parse CMSD-Static response header value:",Be)}}function re(we){try{const Be=(0,E.nt)(we),pt=Be[Be.length-1];return pt?.params||{}}catch(Be){return Te.error("Failed to parse CMSD-Dynamic response header value:",Be),{}}}function z(we){return V[we]||E.Nw.OTHER}function he(we,Be,pt){const ye=we===E.Pb?ue:F,mt=ye[Be]||{},Ze=ye[Q]||{};return mt[pt]||Ze[pt]}return ge={setConfig:function(){},initialize:function(){},reset:function(){ve()},parseResponseHeaders:function(we,Be){let pt=null,ye=null;for(const Ze in we){const He=we[Ze];switch(Ze){case m:pt=tt(He),ce.trigger(o.A.CMSD_STATIC_HEADER,pt);break;case b:ye||(ye=re(He))}}let mt=Q;return pt&&pt.ot?mt=pt.ot:Be&&(mt=z(Be)),je(ue[mt]),je(F[mt]),pt&&(ue[mt]=Object.assign(ue[mt]||{},pt)),ye&&(F[mt]=Object.assign(F[mt]||{},ye)),{static:pt,dynamic:ye}},getMaxBitrate:function(we){let Be=z(we);return he(E.uu,Be,"mb")||-1},getEstimatedThroughput:function(we){let Be=z(we);return he(E.uu,Be,"etp")||null},getResponseDelay:function(we){let Be=z(we);return he(E.uu,Be,"rd")||null},getRoundTripTime:function(we){let Be=z(we);return he(E.uu,Be,"rtt")||null}},Te=(0,u.A)(Y).getInstance().getLogger(ge),ve(),ge}se.__dashjs_factory_name="CmsdModel",Re.A=j.A.getSingletonFactory(se)},1926:function(Nt,Re,C){var j=C(5717),f=C(138),o=C(8261),u=C(656),E=C(5212),m=C(1234),b=C(5560);function T(V=[]){return{add(se){V.push(se)},getAll(){return V},remove(se){const Y=V.indexOf(se);Y!==-1&&V.splice(Y,1)}}}function Q(){let V,se,Y,ce,ge,Te,ue,F,ve,je,tt,re,z,he;const we=this.context,Be=(0,o.A)(we).getInstance();function pt(){Te=T(),ve=T(),ue=T(),F=T(),je=T(),z=[],tt=null,se=[],ce=T(he.getCmcdRequestInterceptors()),ge=T(he.getCmcdResponseReceivedInterceptors()),re=new Set}function ye(U){let Bt;for(Bt=0;Bt<z.length;Bt++)if(z[Bt].rulename===U)return Bt;return-1}function mt(U,Bt){let Ut=!1;return re.forEach(kt=>{kt[U]===Bt&&(Ut=!0)}),Ut}function Ze(U,Bt){He(U,Bt);let Ut=new j.A;Ut.schemeIdUri=U,Ut.value=Bt,se.push(Ut)}function He(U,Bt){(0,u.sq)(U,"string"),(0,u.sq)(Bt,"string"),se.forEach(function(Ut,kt){Ut.schemeIdUri===U&&Ut.value===Bt&&se.splice(kt,1)})}return V={addAbrCustomRule:function(U,Bt,Ut){if(typeof U!="string"||U!==E.A.RULES_TYPES.ABANDON_FRAGMENT_RULES&&U!==E.A.RULES_TYPES.QUALITY_SWITCH_RULES||typeof Bt!="string")throw E.A.BAD_ARGUMENT_ERROR;let kt=ye(Bt);kt===-1?z.push({type:U,rulename:Bt,rule:Ut}):(z[kt].type=U,z[kt].rule=Ut)},addExternalSubtitle:function(U){if(!(U&&U.id!==void 0&&U.url&&U.language&&U.mimeType&&U.bandwidth!==void 0))return;const Bt=new b.A(U);mt("url",Bt.url)||mt("id",Bt.id)||re.add(Bt)},addRequestInterceptor:function(U){ce.add(U)},addResponseInterceptor:function(U){ge.add(U)},addUTCTimingSource:Ze,clearDefaultUTCTimingSources:function(){se=[]},getAbrCustomRules:function(){return z},getCertificateRequestFilters:function(){return ue.getAll()},getCertificateResponseFilters:function(){return F.getAll()},getCustomCapabilitiesFilters:function(){return je.getAll()},getCustomInitialTrackSelectionFunction:function(){return tt},getExternalSubtitles:function(){return re},getLicenseRequestFilters:function(){return Te.getAll()},getLicenseResponseFilters:function(){return ve.getAll()},getRequestInterceptors:function(){return ce.getAll()},getResponseInterceptors:function(){return ge.getAll()},getUTCTimingSources:function(){return se},getXHRWithCredentialsForType:function(U){const Bt=Y[U];return Bt===void 0?Y.default:Bt},registerCertificateRequestFilter:function(U){ue.add(U)},registerCertificateResponseFilter:function(U){F.add(U)},registerCustomCapabilitiesFilter:function(U){je.add(U)},registerLicenseRequestFilter:function(U){Te.add(U)},registerLicenseResponseFilter:function(U){ve.add(U)},removeAbrCustomRule:function(U){if(U){let Bt=ye(U);Bt!==-1&&z.splice(Bt,1)}else z=[]},removeAllAbrCustomRule:function(){z=[]},removeExternalSubtitleById:function(U){re.forEach(Bt=>{Bt.id===U&&re.delete(Bt)})},removeExternalSubtitleByUrl:function(U){re.forEach(Bt=>{Bt.url===U&&re.delete(Bt)})},removeRequestInterceptor:function(U){ce.remove(U)},removeResponseInterceptor:function(U){ge.remove(U)},removeUTCTimingSource:He,reset:function(){pt()},resetCustomInitialTrackSelectionFunction:function(){tt=null},resetPlaybackSessionSpecificSettings:function(){re=new Set},restoreDefaultUTCTimingSources:function(){let U=Be.get().streaming.utcSynchronization.defaultTimingSource;Ze(U.scheme,U.value)},setConfig:function(){},setCustomInitialTrackSelectionFunction:function(U){tt=U},setXHRWithCredentialsForType:function U(Bt,Ut){Bt?Y[Bt]=!!Ut:Object.keys(Y).forEach(kt=>{U(kt,Ut)})},unregisterCertificateRequestFilter:function(U){ue.remove(U)},unregisterCertificateResponseFilter:function(U){F.remove(U)},unregisterCustomCapabilitiesFilter:function(U){je.remove(U)},unregisterLicenseRequestFilter:function(U){Te.remove(U)},unregisterLicenseResponseFilter:function(U){ve.remove(U)}},Y={default:!1},he=(0,m.A)(we).getInstance(),pt(),V}Q.__dashjs_factory_name="CustomParametersModel",Re.A=f.A.getSingletonFactory(Q)},1244:function(Nt,Re,C){var j=C(138),f=C(8261),o=C(5212),u=C(649);function E(){const b=this.context,T=(0,f.A)(b).getInstance();let Q,V,se;function Y(ve,je,tt){ve.customData.reader.read().then(tt).catch(function(){ce(ve)})}function ce(ve){ve.customData.onloadend&&ve.customData.onloadend()}function ge(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Te(){if(this.customData.abortController)this.customData.abortController.abort();else if(this.customData.reader)try{this.customData.reader.cancel(),this.onabort()}catch{}}function ue(ve,je){try{if((ve=ve.filter(tt=>tt.bytes>je/4/ve.length)).length>1){let tt=0;const re=(ve[ve.length-1].timestamp-ve[0].timestamp)/ve.length;return ve.forEach((z,he)=>{const we=ve[he+1];if(we){const Be=we.timestamp-z.timestamp;tt+=Be<re?Be:0}}),tt}return null}catch{return null}}function F(ve,je){return 8*ve/je}return se=(0,u.A)(b).getInstance().getLogger(Q),Q={abort:Te,calculateDownloadedTime:ue,load:function(ve,je){const tt=(function(he){const we=new Headers;if(he.headers)for(let Be in he.headers){let pt=he.headers[Be];pt&&we.append(Be,pt)}return we})(ve),re=(function(he){let we;return typeof window.AbortController=="function"&&(we=new AbortController,he.customData.abortController=we,we.signal.onabort=he.customData.onabort),he.customData.abort=Te.bind(he),we})(ve),z=(function(he,we,Be){return new Request(he.url,{method:he.method,headers:we,credentials:he.credentials,signal:Be?Be.signal:void 0})})(ve,tt,re);fetch(z).then(he=>{(function(we,Be,pt){(function(un,hn){un.status=hn.status,un.statusText=hn.statusText,un.url=hn.url;const Le={};for(const Ee of hn.headers.keys())Le[Ee]=hn.headers.get(Ee);un.headers=Le})(pt,we);let ye=0,mt=!1,Ze=new Uint8Array,He=0;Be.customData.reader=we.body.getReader();let U=[],Bt=[],Ut=[],kt=!0;const Kt=T.get().streaming.abr.throughput.lowLatencyDownloadTimeCalculationMode,on=({value:un,done:hn})=>{hn?(function(){if(Ze){const Le=(function(){let Ee=null;return Kt===o.A.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING?Ee=(function(){const Tt=(function(Ct,Ye){try{let K,S;if(K=Ct.slice(0,-1),S=Ye.slice(0,-1),K.length!==S.length&&se.warn(`[FetchLoader] Moof and Mdat data arrays have different lengths. Moof: ${K.length}, Mdat: ${S.length}`),K.length<=1)return null;let ae=[],P=0,_e=0;for(let Ue=0;Ue<K.length;Ue++)if(K[Ue]&&S[Ue]){let Pe=S[Ue].timestamp-K[Ue].timestamp;if(Pe>1){const Je=F(S[Ue].bytes,Pe);ae.push(Je),_e=0}else{_e===0&&(_e=K[Ue].timestamp,P=0);let Je=S[Ue].timestamp-_e;if(Je>1){P+=S[Ue].bytes;const g=F(P,Je);ae.push(g),_e=0}else P+=S[Ue].bytes}}return ae.length>0?ae.reduce((Ue,Pe)=>Ue+Pe,0)/ae.length:null}catch{return null}})(Bt,Ut);return Tt?8*ye/Tt:null})():Kt===o.A.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.DOWNLOADED_DATA&&(Ee=ue(U,ye)),Ee})();Be.customData.onprogress({loaded:ye,total:ye,lengthComputable:!0,time:Le}),pt.data=Ze.buffer}Be.customData.onloadend()})():(un&&un.length>0&&(function(Le){Ze=(function(Tt,Ct){if(Tt.length===0)return Ct;const Ye=new Uint8Array(Tt.length+Ct.length);return Ye.set(Tt),Ye.set(Ct,Tt.length),Ye})(Ze,Le),ye+=Le.length,U.push({timestamp:ge(),bytes:Le.length}),Kt===o.A.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING&&kt&&V.findLastTopIsoBoxCompleted(["moof"],Ze,He).found&&(kt=!1,Bt.push({timestamp:ge()}));const Ee=V.findLastTopIsoBoxCompleted(["moov","mdat"],Ze,He);Ee.found?(function(Tt){const Ct=(function(Ye){let K;return Ye===Ze.length?(K=Ze,Ze=new Uint8Array):(K=new Uint8Array(Ze.subarray(0,Ye)),Ze=Ze.subarray(Ye)),K})(Tt.startOffsetOfLastFoundTargetBox+Tt.sizeOfLastFoundTargetBox);Kt!==o.A.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING||kt||(kt=!0,Ut.push({timestamp:ge(),bytes:Ct.length})),Be.customData.onprogress({data:Ct.buffer,lengthComputable:!1,noTrace:!0}),He=0})(Ee):(function(Tt){He=Tt.startOffsetOfLastCompletedBox+Tt.sizeOfLastCompletedBox,mt||(Be.customData.onprogress({lengthComputable:!1,noTrace:!0}),mt=!0)})(Ee)})(un),Y(Be,0,on))};Y(Be,0,on)})(he,ve,je)}).catch(()=>{ce(ve)})},reset:function(){},setConfig:function(ve){V=ve.boxParser}},Q}E.__dashjs_factory_name="FetchLoader";const m=j.A.getClassFactory(E);Re.A=m},868:function(Nt,Re,C){var j=C(9838),f=C(1244),o=C(7568),u=C(138),E=C(1944),m=C(6066),b=C(7263),T=C(649),Q=C(8850),V=C(3621),se=C(8261),Y=C(5212),ce=C(1926),ge=C(2473),Te=C(5313),ue=C(447),F=C(5099);function ve(tt){tt=tt||{};const re=this.context,z=tt.errHandler,he=tt.dashMetrics,we=tt.mediaPlayerModel,Be=tt.boxParser,pt=tt.errors,ye=(0,Q.A)(re).getInstance(),mt=(0,se.A)(re).getInstance();let Ze,He,U,Bt,Ut,kt,Kt,on,un,hn,Le,Ee;function Tt(Ct,Ye){const K=function(){_e()},S=function(lt){const Yt=new Date;ne&&(ne=!1,(!lt.lengthComputable||lt.lengthComputable&&lt.total!==lt.loaded)&&(y.firstByteDate=Yt,Ft.resourceTiming.responseStart=performance.now())),lt.lengthComputable&&(y.bytesLoaded=Ft.length=lt.loaded,y.bytesTotal=Ft.resourceTiming.encodedBodySize=lt.total,Ft.length=lt.total,Ft.resourceTiming.encodedBodySize=lt.loaded),lt.noTrace||(R.push({s:de,d:lt.time?lt.time:Yt.getTime()-de.getTime(),b:[lt.loaded?lt.loaded-qe:0],t:lt.throughput}),y.traces=R,de=Yt,qe=lt.loaded),yt&&(clearTimeout(yt),yt=null),mt.get().streaming.fragmentRequestProgressTimeout>0&&(yt=setTimeout(function(){Ee.warn("Abort request "+Lt.url+" due to progress timeout"),De.abort(Lt),K()},mt.get().streaming.fragmentRequestProgressTimeout)),Ct.progress&&lt&&Ct.progress(lt)},ae=function(){_e(!0)},P=function(lt){let Yt;if(lt.lengthComputable){let Xt=lt.loaded/lt.total*100;Yt="Request timeout: loaded: "+lt.loaded+", out of: "+lt.total+" : "+Xt.toFixed(3)+"% Completed"}else Yt="Request timeout: non-computable download size";Ee.warn(Yt)},_e=function(lt=!1){He.indexOf(Lt)!==-1&&He.splice(He.indexOf(Lt),1),yt&&(clearTimeout(yt),yt=null),hn.processResponseHeaders(Ft),Ue(),Pe(),(function(Yt){const Xt=un.getResponseInterceptors();return Xt?Xt.reduce((Zt,Gt)=>Zt.then(mn=>Gt(mn)),Promise.resolve(Yt)):Promise.resolve(Yt)})(Ft).then(Yt=>{if(Ft=Yt,(function(Zt,Gt,mn){const sn=Zt.customData.request,Me=mt.get().streaming.cmsd&&mt.get().streaming.cmsd.enabled?kt.parseResponseHeaders(Gt.headers,sn.mediaType):null;he.addHttpRequest(sn,Gt.url,Gt.status,Gt.headers,mn,Me)})(Lt,Ft,R),lt)return void(Ct.abort&&Ct.abort(y));y.type===o.G.MPD_TYPE&&(he.addManifestUpdate(y),ye.trigger(V.A.MANIFEST_LOADING_FINISHED,{requestObject:y}));const Xt=!!Ft.data||y.method===o.G.POST;if(Ft.status>=200&&Ft.status<=299&&Xt)Ct.success&&Ct.success(Ft.data,Ft.statusText,Ft.url),Ct.complete&&Ct.complete(y,Ft.statusText);else{try{Ft.status===404&&mt.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&y.type===o.G.MEDIA_SEGMENT_TYPE&&we.getRetryAttemptsForType(o.G.MEDIA_SEGMENT_TYPE)===Ye&&ye.trigger(V.A.ATTEMPT_BACKGROUND_SYNC)}catch{}g()}})},Ue=function(){y.startDate=Z,y.endDate=new Date,y.firstByteDate=y.firstByteDate||Z},Pe=function(){Ft.resourceTiming.responseEnd=performance.now(),Ft.resourceTiming.duration=Ft.resourceTiming.responseEnd-Ft.resourceTiming.startTime,(function(lt,Yt){var Xt;if(!mt.get().streaming.abr.throughput.useResourceTimingApi||typeof performance>"u"||lt.range)return;const Zt=(Xt=performance.getEntriesByType)==null?void 0:Xt.call(performance,"resource");if(Zt===void 0||Zt.length<=0)return;let Gt=0,mn=null;for(;Gt<Zt.length;){if(Zt[Gt].name===lt.url){mn=Zt[Gt];break}Gt+=1}(function(sn){return sn&&!isNaN(sn.responseStart)&&sn.responseStart>0&&!isNaN(sn.responseEnd)&&sn.responseEnd>0&&!isNaN(sn.transferSize)&&sn.transferSize>0})(mn)&&(lt.customData.request.resourceTimingValues=mn,Yt.resourceTiming.startTime=mn.startTime,Yt.resourceTiming.encodedBodySize=mn.encodedBodySize,Yt.resourceTiming.responseStart=mn.responseStart,Yt.resourceTiming.responseEnd=mn.responseEnd,Yt.resourceTiming.duration=mn.duration)})(Lt,Ft)},Je=function(lt,Yt,Xt){return new Promise(Zt=>{(function(Gt){const mn=un.getRequestInterceptors();return mn?mn.reduce((sn,Me)=>sn.then(Ce=>Me(Ce)),Promise.resolve(Gt)):Promise.resolve(Gt)})(Yt).then(Gt=>{Yt=Gt,Xt.request=Yt,Yt.customData.onloadend=K,Yt.customData.onprogress=S,Yt.customData.onabort=ae,Yt.customData.ontimeout=P,Xt.resourceTiming.startTime=performance.now(),lt.load(Yt,Xt),Zt()})})},g=function(){if(Ye>0){Ye--,Ct&&Ct.request&&(Ct.request.retryAttempts+=1);let lt={config:Ct};Bt.push(lt),lt.timeout=setTimeout(function(){Bt.indexOf(lt)!==-1&&(Bt.splice(Bt.indexOf(lt),1),Tt(Ct,Ye))},we.getRetryIntervalsForType(y.type))}else{if(y.type===o.G.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;z.error(new E.A(Ut[y.type],y.url+" is not available",{request:y,response:Ft})),Ct.error&&Ct.error(y,"error",Ft.statusText,Ft),Ct.complete&&Ct.complete(y,Ft.statusText)}},y=Ct.request,R=[];let ne,Z,de,qe,yt,Lt,Ft;if(y.bytesLoaded=NaN,y.bytesTotal=NaN,y.firstByteDate=null,y.traces=[],ne=!0,Z=new Date,de=Z,qe=0,yt=null,!he||!z)throw new Error("config object is not correct or missing");const X=(function(lt){let Yt,Xt;return!lt.isPartialSegmentRequest&&lt.hasOwnProperty("availabilityTimeComplete")&&lt.availabilityTimeComplete===!1&&window.fetch&&lt.responseType==="arraybuffer"&&lt.type===o.G.MEDIA_SEGMENT_TYPE?(on||(on=(0,f.A)(re).create(),on.setConfig({dashMetrics:he,boxParser:Be})),Yt=on,Xt=Y.A.FILE_LOADER_TYPES.FETCH):(Kt||(Kt=(0,j.A)(re).create()),Yt=Kt,Xt=Y.A.FILE_LOADER_TYPES.XHR),{loader:Yt,fileLoaderType:Xt}})(y),De=X.loader;var it;y.fileLoaderType=X.fileLoaderType,y.headers=y.headers||{},(it=y).retryAttempts===0&&(function(lt){let Yt=Le.getFinalQueryString(lt);Yt&&(lt.url=b.A.addAdditionalQueryParameterToUrl(lt.url,Yt))})(it),(function(lt){if(lt.queryParams){const Yt=[];for(const Xt in lt.queryParams)Yt.push({key:Xt,value:lt.queryParams[Xt]});lt.url=b.A.addAdditionalQueryParameterToUrl(lt.url,Yt)}})(it),(function(lt){const Yt=hn.getCommonAccessTokenForUrl(lt.url);Yt&&(lt.headers[Y.A.COMMON_ACCESS_TOKEN_HEADER]=Yt)})(it),y.range&&(y.headers.Range="bytes="+y.range);const dt=un.getXHRWithCredentialsForType(y.type);Lt=new ue.A({url:y.url,method:y.method||o.G.GET,responseType:y.responseType,headers:y.headers,credentials:dt?"include":"omit",timeout:(function(lt){return lt.type===o.G.MPD_TYPE?mt.get().streaming.manifestRequestTimeout||0:((Yt=lt)&&Yt.type===o.G.INIT_SEGMENT_TYPE||Yt.type===o.G.INDEX_SEGMENT_TYPE||Yt.type===o.G.MEDIA_SEGMENT_TYPE||Yt.type===o.G.BITSTREAM_SWITCHING_SEGMENT_TYPE||Yt.type===o.G.MSS_FRAGMENT_INFO_SEGMENT_TYPE)&&mt.get().streaming.fragmentRequestTimeout||0;var Yt})(y),body:y.body,customData:{request:y}}),Ft=new F.A({request:Lt,resourceTiming:{startTime:performance.now(),encodedBodySize:0},status:0});let It=new Date().getTime();if(isNaN(y.delayLoadingTime)||It>=y.delayLoadingTime)return He.push(Lt),Je(De,Lt,Ft);{let lt={httpRequest:Lt,httpResponse:Ft};return U.push(lt),lt.delayTimeout=setTimeout(function(){if(U.indexOf(lt)!==-1){U.splice(U.indexOf(lt),1);try{Z=new Date,de=Z,He.push(lt.httpRequest),Je(De,lt.httpRequest,lt.httpResponse)}catch{lt.httpRequest.onloadend()}}},y.delayLoadingTime-It),Promise.resolve()}}return Ze={abort:function(){Bt.forEach(Ct=>{clearTimeout(Ct.timeout),Ct.config.request&&Ct.config.abort&&Ct.config.abort(Ct.config.request)}),Bt=[],U.forEach(Ct=>clearTimeout(Ct.delayTimeout)),U=[],He.forEach(Ct=>{const Ye=Ct.customData;Ye&&(Ye.request&&Ye.request.type===o.G.MSS_FRAGMENT_INFO_SEGMENT_TYPE||(Ye.onloadend=Ye.onprogress=void 0,Ye.abort&&Ye.abort()))}),He=[]},load:function(Ct){return Ct.request?Tt(Ct,we.getRetryAttemptsForType(Ct.request.type)):(Ct.error&&Ct.error(Ct.request,"error"),Promise.resolve())},reset:function(){He=[],U=[],Bt=[],Kt&&Kt.reset(),on&&on.reset(),Kt=null,on=null},resetInitialSettings:function(){Kt&&Kt.resetInitialSettings()},setConfig:function(Ct){Ct&&(Ct.commonAccessTokenController&&(hn=Ct.commonAccessTokenController),Ct.extUrlQueryInfoController&&(Le=Ct.extUrlQueryInfoController))}},Ee=(0,T.A)(re).getInstance().getLogger(Ze),He=[],U=[],Bt=[],kt=(0,m.A)(re).getInstance(),un=(0,ce.A)(re).getInstance(),hn=(0,ge.A)(re).getInstance(),Le=(0,Te.A)(re).getInstance(),Ut={[o.G.MPD_TYPE]:pt.DOWNLOAD_ERROR_ID_MANIFEST_CODE,[o.G.XLINK_EXPANSION_TYPE]:pt.DOWNLOAD_ERROR_ID_XLINK_CODE,[o.G.INIT_SEGMENT_TYPE]:pt.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE,[o.G.MEDIA_SEGMENT_TYPE]:pt.DOWNLOAD_ERROR_ID_CONTENT_CODE,[o.G.INDEX_SEGMENT_TYPE]:pt.DOWNLOAD_ERROR_ID_CONTENT_CODE,[o.G.BITSTREAM_SWITCHING_SEGMENT_TYPE]:pt.DOWNLOAD_ERROR_ID_CONTENT_CODE,[o.G.OTHER_TYPE]:pt.DOWNLOAD_ERROR_ID_CONTENT_CODE},Ze}ve.__dashjs_factory_name="HTTPLoader";const je=u.A.getClassFactory(ve);Re.A=je},1721:function(Nt,Re,C){var j=C(138),f=C(868);function o(){let E,m;function b(){m={}}function T(){b()}return T(),E={getLoader:function(Q){for(var V in m)if(m.hasOwnProperty(V)&&Q.startsWith(V))return m[V];return f.A},registerLoader:function(Q,V){m[Q]=V},unregisterLoader:function(Q){m[Q]&&delete m[Q]},unregisterAllLoader:b,reset:T},E}o.__dashjs_factory_name="SchemeLoaderFactory";const u=j.A.getSingletonFactory(o);Re.A=u},3773:function(Nt,Re,C){var j=C(138),f=C(1721);function o(E){E=E||{};const m=this.context;let b,T,Q;return T=(0,f.A)(m).getInstance(),b={abort:function(){Q&&Q.abort()},load:function(V){Q||(Q=T.getLoader(V&&V.request?V.request.url:null)(m).create({errHandler:E.errHandler,mediaPlayerModel:E.mediaPlayerModel,dashMetrics:E.dashMetrics,boxParser:E.boxParser?E.boxParser:null,constants:E.constants?E.constants:null,dashConstants:E.dashConstants?E.dashConstants:null,urlUtils:E.urlUtils?E.urlUtils:null,errors:E.errors})),Q.load(V)},reset:function(){T&&(T.reset(),T=null),Q&&typeof Q.reset=="function"&&Q.reset(),Q=null},resetInitialSettings:function(){Q&&typeof Q.resetInitialSettings=="function"&&Q.resetInitialSettings()}},b}o.__dashjs_factory_name="URLLoader";const u=j.A.getClassFactory(o);Re.A=u},9838:function(Nt,Re,C){var j=C(138),f=C(7263);function o(){let E,m;function b(){m&&(m.onloadend=m.onerror=m.onprogress=m.onload=null,m.abort(),m.onabort=m.ontimeout=null,m=null)}return E={load:function(T,Q){if(m=null,m=new XMLHttpRequest,m.open(T.method,T.url,!0),T.responseType&&(m.responseType=T.responseType),T.headers)for(let se in T.headers){let Y=T.headers[se];Y&&m.setRequestHeader(se,Y)}m.withCredentials=T.credentials==="include",m.timeout=T.timeout,m.onload=function(){Q.url=this.responseURL,Q.status=this.status,Q.statusText=this.statusText,Q.headers=f.A.parseHttpHeaders(this.getAllResponseHeaders()),Q.data=this.response},T.customData&&(m.onloadend=T.customData.onloadend,m.onprogress=T.customData.onprogress,m.onabort=T.customData.onabort,m.ontimeout=T.customData.ontimeout);let V=T.body||null;return m.send(V),T.customData.abort=b.bind(this),!0},abort:b,getXhr:function(){return m},reset:function(){b(),E=null},resetInitialSettings:function(){b()}},E}o.__dashjs_factory_name="XHRLoader";const u=j.A.getClassFactory(o);Re.A=u},6334:function(Nt,Re,C){C.d(Re,{A:function(){return Me}});var j=C(8854),f=C(2861);const o={prefixes:["clearkey","dashif","ck"]};class u{static findMp4ProtectionElement(Ve){let Ne=null;for(let Ge=0;Ge<Ve.length;++Ge){let st=Ve[Ge];st.schemeIdUri&&st.schemeIdUri.toLowerCase()===j.A.MP4_PROTECTION_SCHEME&&st.value&&(st.value.toLowerCase()===f.A.ENCRYPTION_SCHEME_CENC||st.value.toLowerCase()===f.A.ENCRYPTION_SCHEME_CBCS)&&(Ne=st)}return Ne}static getPSSHData(Ve){let Ne=8,Ge=new DataView(Ve),st=Ge.getUint8(Ne);return Ne+=20,st>0&&(Ne+=4+16*Ge.getUint32(Ne)),Ne+=4,Ve.slice(Ne)}static getPSSHForKeySystem(Ve,Ne){let Ge=u.parsePSSHList(Ne);return Ve&&Ge.hasOwnProperty(Ve.uuid.toLowerCase())?Ge[Ve.uuid.toLowerCase()]:null}static parseInitDataFromContentProtection(Ve,Ne){return"pssh"in Ve&&Ve.pssh?(Ve.pssh.__text=Ve.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),Ne.decodeArray(Ve.pssh.__text).buffer):null}static parsePSSHList(Ve){if(Ve==null)return[];let Ne=new DataView(Ve.buffer||Ve),Ge={},st=0;for(;;){let nt,ft,Pt,_t,Et,Dt,pn=st;if(st>=Ne.buffer.byteLength)break;if(nt=Ne.getUint32(st),ft=st+nt,st+=4,Ne.getUint32(st)===1886614376)if(st+=4,Pt=Ne.getUint8(st),Pt===0||Pt===1){for(st++,st+=3,_t="",Et=0;Et<4;Et++)Dt=Ne.getUint8(st+Et).toString(16),_t+=Dt.length===1?"0"+Dt:Dt;for(st+=4,_t+="-",Et=0;Et<2;Et++)Dt=Ne.getUint8(st+Et).toString(16),_t+=Dt.length===1?"0"+Dt:Dt;for(st+=2,_t+="-",Et=0;Et<2;Et++)Dt=Ne.getUint8(st+Et).toString(16),_t+=Dt.length===1?"0"+Dt:Dt;for(st+=2,_t+="-",Et=0;Et<2;Et++)Dt=Ne.getUint8(st+Et).toString(16),_t+=Dt.length===1?"0"+Dt:Dt;for(st+=2,_t+="-",Et=0;Et<6;Et++)Dt=Ne.getUint8(st+Et).toString(16),_t+=Dt.length===1?"0"+Dt:Dt;st+=6,_t=_t.toLowerCase(),st+=4,Ge[_t]=Ne.buffer.slice(pn,ft),st=ft}else st=ft;else st=ft}return Ge}static getLicenseServerUrlFromMediaInfo(Ve,Ne){try{if(!Ve||Ve.length===0)return null;let Ge=0,st=null;for(;Ge<Ve.length&&!st;){const nt=Ve[Ge];if(nt&&nt.contentProtection&&nt.contentProtection.length>0){const ft=nt.contentProtection.filter(Pt=>Pt.schemeIdUri&&Pt.schemeIdUri===Ne);if(ft&&ft.length>0){let Pt=0;for(;Pt<ft.length&&!st;){const _t=ft[Pt];_t.laUrl&&_t.laUrl.__prefix&&o.prefixes.includes(_t.laUrl.__prefix)&&_t.laUrl.__text&&(st=_t.laUrl.__text),Pt+=1}}}Ge+=1}return st}catch{return null}}static hexKidToBufferSource(Ve){const Ne=Ve.replace(/-/g,"");return new Uint8Array(Ne.match(/[\da-f]{2}/gi).map(function(Ge){return parseInt(Ge,16)})).buffer}}var E=u,m=class{constructor(Ce,Ve,Ne=null){this.contentType=Ce,this.robustness=Ve,this.encryptionScheme=Ne}},b=class{constructor(Ce,Ve,Ne,Ge,st,nt){this.initDataTypes=nt&&nt.length>0?nt:[f.A.INITIALIZATION_DATA_TYPE_CENC],Ce&&Ce.length&&(this.audioCapabilities=Ce),Ve&&Ve.length&&(this.videoCapabilities=Ve),this.distinctiveIdentifier=Ne,this.persistentState=Ge,this.sessionTypes=st}},T=C(1923),Q=C(1944),V=class{constructor(Ce,Ve,Ne,Ge,st,nt,ft,Pt){this.url=Ce,this.method=Ve,this.responseType=Ne,this.headers=Ge,this.withCredentials=st,this.messageType=nt,this.sessionId=ft,this.data=Pt}},se=class{constructor(Ce,Ve,Ne){this.url=Ce,this.headers=Ve,this.data=Ne}},Y=C(7568),ce=C(1349),ge=C(7263),Te=C(138),ue=class{constructor(Ce,Ve,Ne){this.url=Ce,this.method="GET",this.responseType="arraybuffer",this.headers=Ve,this.body=null,this.withCredentials=Ne}},F=class{constructor(Ce,Ve,Ne){this.url=Ce,this.headers=Ve,this.data=Ne}};function ve(Ce){const Ve=(Ce=Ce||{}).BASE64,Ne=Ce.cmcdController,Ge=Ce.constants,st=Ce.customParametersModel,nt=Ce.debug,ft=Ce.eventBus,Pt=Ce.events,_t=Ce.protectionKeyController,Et=Ce.settings;let Dt,pn,cn,qt,dn,Mn,yn,gn,$t,At,ct,Vt,jt,Fe,ln=Ce.protectionModel,Pn=[];function zn(){if(!(ft&&ft.hasOwnProperty("on")&&_t&&_t.hasOwnProperty("getSupportedKeySystemMetadataFromContentProtection")))throw new Error("Missing config parameter(s)")}function Xn(vt,Jt){jt||dn?jt&&(At?At.then(()=>{ir()}):ir()):(function(An,Un){if(dn)return;var Dn;dn=!0;const Ln=(function(Cn){const Sn=[];for(let Yn=0;Yn<Cn.length;Yn++){const Kn=Or(Cn[Yn]);Sn.push({ks:Cn[Yn].ks,configs:[Kn],protData:Cn[Yn].protData})}return Sn})(An=(Dn=An).sort((Cn,Sn)=>(Dt&&Dt[Cn.ks.systemString]&&Dt[Cn.ks.systemString].priority>=0?Dt[Cn.ks.systemString].priority:Dn.length)-(Dt&&Dt[Sn.ks.systemString]&&Dt[Sn.ks.systemString].priority>=0?Dt[Sn.ks.systemString].priority:Dn.length)));let qn;ln.requestKeySystemAccess(Ln).then(Cn=>(qn=Cn.data,(function(Sn){let Yn=Sn&&Sn.selectedSystemString?Sn.selectedSystemString:Sn.keySystem.systemString;return gn.info("DRM: KeySystem Access Granted for system string ("+Yn+")! Selecting key system..."),ln.selectKeySystem(Sn)})(qn))).then(Cn=>{(function(Sn,Yn){try{jt=Sn,dn=!1,ft.trigger(Pt.KEY_SYSTEM_SELECTED,{data:Yn});const Kn=Hn(jt);Kn&&Kn.serverCertificate&&Kn.serverCertificate.length>0&&ln.setServerCertificate(Ve.decodeArray(Kn.serverCertificate).buffer),jt.systemString===f.A.FAIRPLAY_KEYSTEM_STRING?At=ar().then(()=>{At=null,ir()}).catch(Qn=>{gn.warn("DRM: Certificate acquisition failed for FairPlay: "+(Qn&&Qn.message?Qn.message:Qn)+". Proceeding anyway."),At=null,ir()}):(ar().catch(Qn=>{gn.error(Qn)}),ir())}catch(Kn){gn.error(Kn)}})(Cn,qn)}).catch(Cn=>{(function(Sn,Yn){jt=null,dn=!1,Yn||ft.trigger(Pt.KEY_SYSTEM_SELECTED,{data:null,error:new Q.A(T.A.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,T.A.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+Sn.error)})})(Cn,Un)})})(vt,Jt)}function ar(){if(!jt)return Promise.resolve();const vt=jt.systemString,Jt=pn.get(vt);if(Jt&&(Jt.applied||Jt.inProgress))return Promise.resolve();const An=(function(){const Ln=[],qn=Hn(jt);return qn&&Array.isArray(qn.certUrls)&&qn.certUrls.length&&qn.certUrls.forEach(Cn=>{Ln.push(Cn)}),$t.forEach(Cn=>{Cn&&Cn.contentProtection&&Cn.contentProtection.forEach(Sn=>{Sn&&Array.isArray(Sn.certUrls)&&Sn.certUrls.length&&Sn.schemeIdUri.toLowerCase()===jt.schemeIdURI&&Sn.certUrls.forEach(Yn=>{Ln.push(Yn)})})}),ce.A.dedupeCertUrls(Ln)})();if(!An.length)return gn.debug("DRM: No Certificate Server URLs found for "+vt+". Skipping certificate acquisition."),Promise.resolve();gn.debug("DRM: Found "+An.length+" certificate candidate(s) for "+vt+". Starting acquisition.");const Un=Hn(jt)||{},Dn=Jt||{applied:!1,inProgress:!0,attempts:0};return Dn.inProgress=!0,pn.set(vt,Dn),tr(An,0,Un,vt,Dn)}function tr(vt,Jt,An,Un,Dn){if(Jt>=vt.length)return(function(Cn,Sn){return Cn.inProgress=!1,Cn.error=Cn.error||"All certificate candidates failed",gn.warn("DRM: All certificate candidates failed for "+Sn+"."),Promise.reject(new Error(Cn.error))})(Dn,Un);const Ln=vt[Jt],qn=isNaN(Et.get().streaming.retryAttempts[Y.G.LICENSE_CERTIFICATE])?3:Et.get().streaming.retryAttempts[Y.G.LICENSE_CERTIFICATE];return gn.debug("DRM: Attempting certificate download ("+(Jt+1)+"/"+vt.length+") url="+Ln.url),(function(Cn,Sn){const Yn=st.getCertificateRequestFilters();let Kn=!1;Sn&&typeof Sn.withCredentials=="boolean"&&(Kn=Sn.withCredentials);const Qn={};Sn&&Hr(Qn,Sn.httpRequestHeaders);const er=new ue(Cn.url,Qn,Kn);return jr(Yn,er).then(()=>er)})(Ln,An).then(Cn=>Ir(Cn,An,qn)).then(Cn=>(function(Sn,Yn,Kn,Qn){if(!Sn||!Sn.byteLength)throw new Error("Empty certificate response");return Qn.urlUsed=Yn.url,Qn.buffer=Sn,(function(er,br,Tr){return new Promise((zr,vr)=>{try{const dr=ln.setServerCertificate(er);dr&&typeof dr.then=="function"?dr.then(gr=>{zr(typeof gr!="boolean"||gr)}).catch(gr=>{Tr.error=gr&&gr.message?gr.message:gr,vr(gr)}):zr(!0)}catch(dr){Tr.error=dr&&dr.message?dr.message:dr,gn.warn("DRM: setServerCertificate threw for "+br+": "+Tr.error),vr(dr)}})})(Sn,Kn,Qn).then(er=>{if(!er)throw new Error("CDM rejected certificate");Qn.applied=!0,Qn.inProgress=!1})})(Cn,Ln,Un,Dn)).then(()=>{(function(Cn,Sn,Yn){const Kn=Cn.certType?" certType="+Cn.certType:"";gn.info("DRM: Server certificate applied successfully from "+Yn.urlUsed+Kn+" for "+Sn+".")})(Ln,Un,Dn)}).catch(Cn=>(Dn.attempts++,Dn.lastError=Cn&&Cn.message?Cn.message:Cn,gn.warn("DRM: Certificate attempt failed ("+Ln.url+"): "+Dn.lastError),tr(vt,Jt+1,An,Un,Dn)))}function Ir(vt,Jt,An){return new Promise((Un,Dn)=>{const Ln=new XMLHttpRequest;Ln.open(vt.method,vt.url,!0),Ln.responseType=vt.responseType;const qn=Jt&&!isNaN(Jt.httpTimeout)?Jt.httpTimeout:8e3;qn>0&&(Ln.timeout=qn),Ln.withCredentials=vt.withCredentials;for(const Sn of Object.keys(vt.headers))Ln.setRequestHeader(Sn,vt.headers[Sn]);const Cn=Sn=>{if(An>0){const Yn=An-1,Kn=isNaN(Et.get().streaming.retryIntervals[Y.G.LICENSE_CERTIFICATE])?500:Et.get().streaming.retryIntervals[Y.G.LICENSE_CERTIFICATE];gn.debug("DRM: Certificate request failed ("+Sn+"). Retrying... remaining="+Yn),setTimeout(()=>{Ir(vt,Jt,Yn).then(Un).catch(Dn)},Kn)}else Dn(new Error(Sn))};Ln.onload=function(){if(this.status>=200&&this.status<=299){const Sn=ge.A.parseHttpHeaders(Ln.getAllResponseHeaders?Ln.getAllResponseHeaders():null);jr(st.getCertificateResponseFilters(),new F(Ln.responseURL,Sn,this.response)).then(()=>{Un(this.response)}).catch(()=>{Un(this.response)})}else Cn("HTTP "+this.status)},Ln.onerror=function(){Cn("network error")},Ln.ontimeout=function(){Cn("timeout")},Ln.onabort=function(){Cn("aborted")};try{Ln.send(vt.body)}catch(Sn){Dn(Sn)}})}function ir(){let vt;for(let Jt=0;Jt<ct.length;Jt++)for(vt=0;vt<ct[Jt].length;vt++)if(jt===ct[Jt][vt].ks){cr(ct[Jt][vt]);break}ct=[]}function Or(vt){const Jt=vt.protData,An=[],Un=[];let Dn=f.A.INITIALIZATION_DATA_TYPE_CENC;vt.ks&&vt.ks.systemString===f.A.FAIRPLAY_KEYSTEM_STRING&&(Dn=f.A.INITIALIZATION_DATA_TYPE_SINF);const Ln=Jt&&Jt.initDataTypes&&Jt.initDataTypes.length>0?Jt.initDataTypes:[Dn],qn=Jt&&Jt.audioRobustness&&Jt.audioRobustness.length>0?Jt.audioRobustness:Vt,Cn=Jt&&Jt.videoRobustness&&Jt.videoRobustness.length>0?Jt.videoRobustness:Vt,Sn=vt.sessionType,Yn=Jt&&Jt.distinctiveIdentifier?Jt.distinctiveIdentifier:"optional",Kn=Jt&&Jt.persistentState?Jt.persistentState:Sn==="temporary"?"optional":"required",Qn=vt.ks&&vt.ks.systemString===f.A.FAIRPLAY_KEYSTEM_STRING?f.A.ENCRYPTION_SCHEME_CBCS:void 0;return $t.forEach(er=>{er.type===Ge.AUDIO?An.push(new m(er.codec,qn,Qn)):er.type===Ge.VIDEO&&Un.push(new m(er.codec,Cn,Qn))}),new b(An,Un,Yn,Kn,[Sn],Ln)}function cr(vt){_t.isClearKey(jt)&&(function(Jt){if(Jt.protData&&Jt.protData.hasOwnProperty("clearkeys")&&Object.keys(Jt.protData.clearkeys).length!==0){const An={kids:Object.keys(Jt.protData.clearkeys)};Jt.initData=new TextEncoder().encode(JSON.stringify(An))}})(vt),vt.sessionId?kr(vt):vt.initData!==null&&Lr(vt)}function kr(vt){zn(),ln.loadKeySession(vt)}function Lr(vt){if(vt&&(function(An){if(!An)return!1;try{const Un=ln.getSessionTokens();for(let Dn=0;Dn<Un.length;Dn++)if(Un[Dn].getKeyId()===An)return!0;return!1}catch{return!1}})(vt.keyId))return;(function(){if(!Et)return;const An=Et.get().streaming.protection.keepProtectionMediaKeys,Un=Et.get().streaming.protection.keepProtectionMediaKeysMaximumOpenSessions;if(typeof Un!="number"||Un<=0)return;if(!An)return void gn.warn("DRM: keepProtectionMediaKeysMaximumOpenSessions is set to "+Un+", but keepProtectionMediaKeys is not enabled. Therefore, keepProtectionMediaKeysMaximumOpenSessions will be ignored.");if(!ln||typeof ln.getSessionTokens!="function")return;const Dn=ln.getSessionTokens()||[];if(Dn.length<Un)return;const Ln=Dn[0];Ln&&(gn.info("DRM: Maximum number of open MediaKeySessions reached ("+Un+"), closing oldest session."),ui(Ln))})();const Jt=E.getPSSHForKeySystem(jt,vt?vt.initData:null);if(Jt){if(Rr(Jt))return;try{vt.initData=Jt,ln.createKeySession(vt)}catch(An){ft.trigger(Pt.KEY_SESSION_CREATED,{data:null,error:new Q.A(T.A.KEY_SESSION_CREATED_ERROR_CODE,T.A.KEY_SESSION_CREATED_ERROR_MESSAGE+An.message)})}}else vt&&vt.initData?ln.createKeySession(vt):ft.trigger(Pt.KEY_SESSION_CREATED,{data:null,error:new Q.A(T.A.KEY_SESSION_CREATED_ERROR_CODE,T.A.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(jt?jt.systemString:null)+". needkey/encrypted event contains no initData corresponding to that key system!")})}function Hn(vt){if(vt){const Jt=vt.systemString;if(Dt)return Jt in Dt?Dt[Jt]:null}return null}function Rr(vt){if(!vt)return!1;try{const Jt=ln.getAllInitData();for(let An=0;An<Jt.length;An++)if(_t.initDataEquals(vt,Jt[An]))return gn.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch{return!1}}function ui(vt){zn(),ln.closeKeySession(vt)}function pi(vt){zn(),vt?(ln.setMediaElement(vt),ft.on(Pt.NEED_KEY,fi,cn)):vt===null&&(ln.setMediaElement(vt),ft.off(Pt.NEED_KEY,fi,cn))}function ci(vt){gn.debug("DRM: onKeyMessage");const Jt=vt.data;ft.trigger(Pt.KEY_MESSAGE,{data:Jt});const An=Jt.messageType?Jt.messageType:f.A.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST,Un=Jt.message,Dn=Jt.sessionToken,Ln=Hn(jt),qn=_t.getLicenseServerModelInstance(jt,Ln,An),Cn={sessionToken:Dn,messageType:An};if(Un&&Un.byteLength!==0){if(!qn)return gn.debug("DRM: License server request not required for this message (type = "+vt.data.messageType+"). Session ID = "+Dn.getSessionId()),void Cr(Cn);if(_t.isClearKey(jt)){const Sn=_t.processClearKeyLicenseRequest(jt,Ln,Un);if(Sn&&Sn.keyPairs&&Sn.keyPairs.length>0)return gn.debug("DRM: ClearKey license request handled by application!"),Cr(Cn),void ln.updateKeySession(Dn,Sn)}(function(Sn,Yn,Kn){const Qn=Sn.sessionToken,er=Sn.messageType?Sn.messageType:f.A.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST,br={sessionToken:Qn,messageType:er},Tr=jt?jt.systemString:null;let zr=(function(Wn,Wr,Zr,qr,Li){let mr=null;const Fi=qr.message;if(Wn&&Wn.serverURL){const Dr=Wn.serverURL;typeof Dr=="string"&&Dr!==""?mr=Dr:typeof Dr=="object"&&Dr.hasOwnProperty(Wr)&&(mr=Dr[Wr])}else if(Wn&&Wn.laURL&&Wn.laURL!=="")mr=Wn.laURL;else if(mr=E.getLicenseServerUrlFromMediaInfo($t,jt.schemeIdURI),!mr&&!_t.isClearKey(jt)){const Dr=E.getPSSHData(Zr.initData);mr=jt.getLicenseServerURLFromInitData(Dr),mr||(mr=qr.laURL)}return mr=Li.getServerURLFromMessage(mr,Fi,Wr),mr})(Kn,er,Qn,Sn,Yn);if(!zr)return void Cr(br,new Q.A(T.A.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,T.A.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE));const vr={};let dr=!1;Kn&&Hr(vr,Kn.httpRequestHeaders);const gr=Sn.message;Hr(vr,jt.getRequestHeadersFromMessage(gr)),Object.keys(vr).forEach(Wn=>{Wn.toLowerCase()==="authorization"&&(dr=!0)}),Kn&&typeof Kn.withCredentials=="boolean"&&(dr=Kn.withCredentials);const Ai=function(Wn){if(ln)if(Wn.status>=200&&Wn.status<=299){const Wr=ge.A.parseHttpHeaders(Wn.getAllResponseHeaders?Wn.getAllResponseHeaders():null);let Zr=new se(Wn.responseURL,Wr,Wn.response);jr(st.getLicenseResponseFilters(),Zr).then(()=>{const qr=Yn.getLicenseMessage(Zr.data,Tr,er);qr!==null?(Cr(br),ln.updateKeySession(Qn,qr)):Ei(Wn,br,Tr,er,Yn)})}else Ei(Wn,br,Tr,er,Yn)},Yr=function(Wn){Cr(br,new Q.A(T.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,T.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+Tr+' update, XHR aborted. status is "'+Wn.statusText+'" ('+Wn.status+"), readyState is "+Wn.readyState))},Ti=function(Wn){Cr(br,new Q.A(T.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,T.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+Tr+' update, XHR error. status is "'+Wn.statusText+'" ('+Wn.status+"), readyState is "+Wn.readyState))},yi=jt.getLicenseRequestFromMessage(gr),_i=Yn.getHTTPMethod(er),Pi=Yn.getResponseType(Tr,er),Jr=Kn&&!isNaN(Kn.httpTimeout)?Kn.httpTimeout:8e3,Si=Qn.getSessionId()||null;let Ii=new V(zr,_i,Pi,vr,dr,er,Si,yi);const Oi=isNaN(Et.get().streaming.retryAttempts[Y.G.LICENSE])?3:Et.get().streaming.retryAttempts[Y.G.LICENSE];jr(st.getLicenseRequestFilters(),Ii).then(()=>{di(Ii,Oi,Jr,Ai,Yr,Ti)})})(Jt,qn,Ln)}else Cr(Cn,new Q.A(T.A.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,T.A.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function Cr(vt,Jt=null){ft.trigger(Pt.LICENSE_REQUEST_COMPLETE,{data:vt,error:Jt})}function di(vt,Jt,An,Un,Dn,Ln){const qn=new XMLHttpRequest,Cn={url:vt.url,type:Y.G.LICENSE,method:vt.method,headers:vt.headers||{}};Ne.applyCmcdToRequest(Cn),vt.url=Cn.url,vt.headers=Cn.headers,qn.open(vt.method,vt.url,!0),qn.responseType=vt.responseType,qn.withCredentials=vt.withCredentials,An>0&&(qn.timeout=An);for(const Yn in vt.headers)qn.setRequestHeader(Yn,vt.headers[Yn]);const Sn=function(){Jt--;const Yn=isNaN(Et.get().streaming.retryIntervals[Y.G.LICENSE])?1e3:Et.get().streaming.retryIntervals[Y.G.LICENSE];Mn=setTimeout(function(){di(vt,Jt,An,Un,Dn,Ln)},Yn)};qn.onload=function(){yn=null,this.status>=200&&this.status<=299||Jt<=0?Un(this):(gn.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+Jt),Sn())},qn.ontimeout=qn.onerror=function(){yn=null,Jt<=0?Ln(this):(gn.warn("License request network request failed . Retrying it... Pending retries: "+Jt),Sn())},qn.onabort=function(){Dn(this)},ft.trigger(Pt.LICENSE_REQUEST_SENDING,{url:vt.url,headers:vt.headers,payload:vt.data,sessionId:vt.sessionId}),yn=qn,qn.send(vt.data)}function mi(){yn&&(yn.onloadend=yn.onerror=yn.onprogress=void 0,yn.abort(),yn=null),Mn&&(clearTimeout(Mn),Mn=null)}function Hr(vt,Jt){if(Jt)for(const An in Jt)vt[An]=Jt[An]}function Ei(vt,Jt,An,Un,Dn){let Ln="NONE",qn=null;vt.response&&(Ln=Dn.getErrorResponse(vt.response,An,Un),qn={serverResponse:vt.response||null,responseCode:vt.status||null,responseText:vt.statusText||null}),Cr(Jt,new Q.A(T.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,T.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+An+' update, XHR complete. status is "'+vt.statusText+'" ('+vt.status+"), readyState is "+vt.readyState+". Response is "+Ln,qn))}function jr(vt,Jt){return vt?vt.reduce((An,Un)=>An.then(()=>Un(Jt)),Promise.resolve()):Promise.resolve()}function fi(vt,Jt){if(Et.get().streaming.protection.ignoreEmeEncryptedEvent)return;if(gn.debug("DRM: onNeedKey"),vt.key.initDataType!==f.A.INITIALIZATION_DATA_TYPE_CENC&&vt.key.initDataType!==f.A.INITIALIZATION_DATA_TYPE_SINF)return void gn.warn("DRM: Only 'cenc' and 'sinf' initData are supported! Ignoring initData of type: "+vt.key.initDataType);if($t.length===0&&(gn.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(Jt=Jt===void 0?1:Jt+1)<5))return void Pn.push(setTimeout(()=>{fi(vt,Jt)},500));let An=vt.key.initData;ArrayBuffer.isView(An)&&(An=An.buffer);const Un=vt.key.initDataType===f.A.INITIALIZATION_DATA_TYPE_SINF;if(jt){const Ln=Un?An:E.getPSSHForKeySystem(jt,An);if(Ln&&Rr(Ln))return}let Dn;gn.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(An))),Dn=Un?_t.getSupportedKeySystemMetadataForSinf(An,Dt,Fe):_t.getSupportedKeySystemMetadataFromSegmentPssh(An,Dt,Fe),Dn.length!==0?(function(Ln){ct.push(Ln),Xn(Ln,!1)})(Dn):gn.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!")}function Gr(vt,Jt){if(vt.size<=0)return!1;if(Jt.size>0&&[...vt].every(Un=>{const Dn=Jt.get(Un);return Dn!==void 0&&Dn!==""}))return!0;const An=ln.getSessionTokens();if(An&&An.length>0){const Un=An.filter(Dn=>[...vt].includes(Dn.normalizedKeyId));if(Un.some(Dn=>!Dn.hasTriggeredKeyStatusMapUpdate)||Un.length===0)return!1}return!Et.get().streaming.protection.ignoreKeyStatuses&&vt&&vt.size>0&&Jt&&Jt.size>0}return cn={areKeyIdsExpired:function(vt){try{return!!Gr(vt,qt)&&[...vt].every(Jt=>qt.get(Jt)===f.A.MEDIA_KEY_STATUSES.EXPIRED)}catch(Jt){return gn.error(Jt),!1}},areKeyIdsUsable:function(vt){try{return!Gr(vt,qt)||[...vt].some(Jt=>{const An=qt.get(Jt);return An&&An!==f.A.MEDIA_KEY_STATUSES.INTERNAL_ERROR&&An!==f.A.MEDIA_KEY_STATUSES.OUTPUT_RESTRICTED})}catch(Jt){return gn.error(Jt),!0}},clearMediaInfoArray:function(){$t=[]},closeKeySession:ui,createKeySession:Lr,getKeySystems:function(){return _t?_t.getKeySystems():[]},getProtectionData:function(){return Dt},getSupportedKeySystemMetadataFromContentProtection:function(vt){return zn(),_t.getSupportedKeySystemMetadataFromContentProtection(vt,Dt,Fe)},handleKeySystemFromManifest:function(){if(!$t||$t.length===0)return;let vt=[];$t.forEach(Jt=>{const An=_t.getSupportedKeySystemMetadataFromContentProtection(Jt.contentProtection,Dt,Fe);An.length>0&&(vt.length===0&&(vt=An),ct.push(An))}),vt&&vt.length>0&&Xn(vt,!0)},initializeForMedia:function(vt){if(!vt)throw new Error("mediaInfo can not be null or undefined");zn(),$t.push(vt)},loadKeySession:kr,removeKeySession:function(vt){zn(),ln.removeKeySession(vt)},reset:function(){ft.off(Pt.INTERNAL_KEY_MESSAGE,ci,cn),zn(),mi(),pi(null),jt=null,dn=!1,qt=new Map,pn=new Map,ln&&(ln.reset(),ln=null),Pn.forEach(vt=>clearTimeout(vt)),Pn=[],$t=[],ct=[]},setKeySystems:function(vt){_t&&_t.setKeySystems(vt)},setMediaElement:pi,setProtectionData:function(vt){Dt=ce.A.sanitizeProtectionDataCertUrls(vt),_t.setProtectionData(Dt)},setRobustnessLevel:function(vt){Vt=vt},setServerCertificate:function(vt){return zn(),ln.setServerCertificate(vt)},setSessionType:function(vt){Fe=vt},stop:function(){mi(),ln&&ln.stop()},updateKeyStatusesMap:function(vt){try{if(!vt||!vt.sessionToken||!vt.parsedKeyStatuses)return;vt.sessionToken.hasTriggeredKeyStatusMapUpdate=!0;const Jt=vt.parsedKeyStatuses,An=ge.A.parseUserAgent(),Un=An&&An.browser&&An.browser.name&&An.browser.name.toLowerCase()==="edge";Jt.forEach(Dn=>{Un&&jt.uuid===f.A.PLAYREADY_UUID&&Dn.keyId&&Dn.keyId.byteLength===16&&(function(qn){const Cn=ge.A.bufferSourceToDataView(qn),Sn=Cn.getUint32(0,!0),Yn=Cn.getUint16(4,!0),Kn=Cn.getUint16(6,!0);Cn.setUint32(0,Sn,!1),Cn.setUint16(4,Yn,!1),Cn.setUint16(6,Kn,!1)})(Dn.keyId);const Ln=ge.A.bufferSourceToHex(Dn.keyId).slice(0,32);Ln&&Ln!==""&&qt.set(Ln,Dn.status)}),ft.trigger(Pt.KEY_STATUSES_MAP_UPDATED,{keyStatusMap:qt})}catch(Jt){gn.error(Jt)}}},gn=nt.getLogger(cn),ct=[],$t=[],Fe="temporary",Vt="",yn=null,Mn=null,qt=new Map,pn=new Map,At=null,ft.on(Pt.INTERNAL_KEY_MESSAGE,ci,cn),cn}ve.__dashjs_factory_name="ProtectionController";var je=Te.A.getClassFactory(ve),tt=class{constructor(Ce,Ve){this.keyID=Ce,this.key=Ve}},re=class{constructor(Ce,Ve){if(Ve&&Ve!=="persistent"&&Ve!=="temporary")throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=Ce,this.type=Ve}toJWK(){let Ce,Ve=this.keyPairs.length,Ne={keys:[]};for(Ce=0;Ce<Ve;Ce++){let Pt={kty:"oct",alg:"A128KW",kid:this.keyPairs[Ce].keyID,k:this.keyPairs[Ce].key};Ne.keys.push(Pt)}this.type&&(Ne.type=this.type);let Ge=JSON.stringify(Ne);const st=Ge.length;let nt=new ArrayBuffer(st),ft=new Uint8Array(nt);for(Ce=0;Ce<st;Ce++)ft[Ce]=Ge.charCodeAt(Ce);return nt}};const z=f.A.CLEARKEY_UUID,he=f.A.CLEARKEY_KEYSTEM_STRING,we="urn:uuid:"+z;function Be(Ce){let Ve;const Ne=(Ce=Ce||{}).BASE64;return Ve={uuid:z,schemeIdURI:we,systemString:he,getInitData:function(Ge,st){try{let nt=E.parseInitDataFromContentProtection(Ge,Ne);if(!nt&&st){const ft={kids:[(function(Pt){try{let _t=Pt.replace(/-/g,"");return _t=btoa(_t.match(/\w{2}/g).map(Et=>String.fromCharCode(parseInt(Et,16))).join("")),_t.replace(/=/g,"").replace(/\//g,"_").replace(/\+/g,"-")}catch{return null}})(st.cencDefaultKid)]};nt=new TextEncoder().encode(JSON.stringify(ft))}return nt}catch{return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(Ge){return JSON.stringify(JSON.parse(String.fromCharCode.apply(null,new Uint8Array(Ge))))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(Ge,st){let nt=null;if(Ge){const ft=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(st))),Pt=[];for(let _t=0;_t<ft.kids.length;_t++){const Et=ft.kids[_t],Dt=Ge.clearkeys&&Ge.clearkeys.hasOwnProperty(Et)?Ge.clearkeys[Et]:null;if(!Dt)throw new Error("DRM: ClearKey keyID ("+Et+") is not known!");Pt.push(new tt(Et,Dt))}nt=new re(Pt)}return nt}},Ve}Be.__dashjs_factory_name="KeySystemClearKey";var pt=Te.A.getSingletonFactory(Be);const ye=f.A.W3C_CLEARKEY_UUID,mt=f.A.CLEARKEY_KEYSTEM_STRING,Ze="urn:uuid:"+ye;function He(Ce){let Ve;const Ne=Ce.BASE64,Ge=Ce.debug.getLogger(Ve);return Ve={uuid:ye,schemeIdURI:Ze,systemString:mt,getInitData:function(st){return E.parseInitDataFromContentProtection(st,Ne)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(st){return new Uint8Array(st)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(st,nt){let ft=null;if(st){const Pt=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(nt))),_t=[];for(let Et=0;Et<Pt.kids.length;Et++){const Dt=Pt.kids[Et],pn=st.clearkeys&&st.clearkeys.hasOwnProperty(Dt)?st.clearkeys[Dt]:null;if(!pn)throw new Error("DRM: ClearKey keyID ("+Dt+") is not known!");_t.push(new tt(Dt,pn))}ft=new re(_t),Ge.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return ft}},Ve}He.__dashjs_factory_name="KeySystemW3CClearKey";var U=Te.A.getSingletonFactory(He);const Bt=f.A.WIDEVINE_UUID,Ut=f.A.WIDEVINE_KEYSTEM_STRING,kt="urn:uuid:"+Bt;function Kt(Ce){let Ve;const Ne=(Ce=Ce||{}).BASE64;return Ve={uuid:Bt,schemeIdURI:kt,systemString:Ut,getInitData:function(Ge){return E.parseInitDataFromContentProtection(Ge,Ne)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(Ge){return new Uint8Array(Ge)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}},Ve}Kt.__dashjs_factory_name="KeySystemWidevine";var on=Te.A.getSingletonFactory(Kt);const un=f.A.PLAYREADY_UUID,hn=f.A.PLAYREADY_KEYSTEM_STRING,Le="urn:uuid:"+un;function Ee(Ce){let Ve,Ne="utf-16";const Ge=(Ce=Ce||{}).BASE64,st=Ce.settings;function nt(){if(!Ge||!Ge.hasOwnProperty("decodeArray")||!Ge.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return Ve={uuid:un,schemeIdURI:Le,systemString:hn,getInitData:function(ft){const Pt=new Uint8Array([112,115,115,104,0,0,0,0]),_t=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);let Et,Dt,pn,cn,qt,dn=0,Mn=null;if(nt(),!ft)return null;if("pssh"in ft&&ft.pssh)return E.parseInitDataFromContentProtection(ft,Ge);if("pro"in ft&&ft.pro)Mn=Ge.decodeArray(ft.pro.__text);else{if(!("prheader"in ft)||!ft.prheader)return null;Mn=Ge.decodeArray(ft.prheader.__text)}return Et=Mn.length,Dt=4+Pt.length+_t.length+4+Et,pn=new ArrayBuffer(Dt),cn=new Uint8Array(pn),qt=new DataView(pn),qt.setUint32(dn,Dt),dn+=4,cn.set(Pt,dn),dn+=Pt.length,cn.set(_t,dn),dn+=_t.length,qt.setUint32(dn,Et),dn+=4,cn.set(Mn,dn),dn+=Et,cn.buffer},getRequestHeadersFromMessage:function(ft){let Pt,_t;const Et={},Dt=new DOMParser;if(st&&st.get().streaming.protection.detectPlayreadyMessageFormat&&Ne==="utf-16"&&ft&&ft.byteLength%2==1)return Et["Content-Type"]="text/xml; charset=utf-8",Et;const pn=Ne==="utf-16"?new Uint16Array(ft):new Uint8Array(ft);Pt=String.fromCharCode.apply(null,pn),_t=Dt.parseFromString(Pt,"application/xml");const cn=_t.getElementsByTagName("name"),qt=_t.getElementsByTagName("value");for(let dn=0;dn<cn.length;dn++)Et[cn[dn].childNodes[0].nodeValue]=qt[dn].childNodes[0].nodeValue;return Et.hasOwnProperty("Content")&&(Et["Content-Type"]=Et.Content,delete Et.Content),Et.hasOwnProperty("Content-Type")||(Et["Content-Type"]="text/xml; charset=utf-8"),Et},getLicenseRequestFromMessage:function(ft){let Pt=null;const _t=new DOMParser;if(st&&st.get().streaming.protection.detectPlayreadyMessageFormat&&Ne==="utf-16"&&ft&&ft.byteLength%2==1)return ft;const Et=Ne==="utf-16"?new Uint16Array(ft):new Uint8Array(ft);nt();const Dt=String.fromCharCode.apply(null,Et),pn=_t.parseFromString(Dt,"application/xml");if(!pn.getElementsByTagName("PlayReadyKeyMessage")[0])return ft;{const cn=pn.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;cn&&(Pt=Ge.decode(cn))}return Pt},getLicenseServerURLFromInitData:function(ft){if(ft){const Pt=new DataView(ft),_t=Pt.getUint16(4,!0);let Et=6;const Dt=new DOMParser;for(let pn=0;pn<_t;pn++){const cn=Pt.getUint16(Et,!0);Et+=2;const qt=Pt.getUint16(Et,!0);if(Et+=2,cn!==1){Et+=qt;continue}const dn=ft.slice(Et,Et+qt),Mn=String.fromCharCode.apply(null,new Uint16Array(dn)),yn=Dt.parseFromString(Mn,"application/xml");if(yn.getElementsByTagName("LA_URL")[0]){const gn=yn.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(gn)return gn}if(yn.getElementsByTagName("LUI_URL")[0]){const gn=yn.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(gn)return gn}}}return null},getCDMData:function(ft){let Pt,_t,Et,Dt;if(nt(),!ft)return null;for(Pt=[],Dt=0;Dt<ft.length;++Dt)Pt.push(ft.charCodeAt(Dt)),Pt.push(0);for(Pt=String.fromCharCode.apply(null,Pt),Pt=Ge.encode(Pt),_t='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",Pt),Et=[],Dt=0;Dt<_t.length;++Dt)Et.push(_t.charCodeAt(Dt)),Et.push(0);return new Uint8Array(Et).buffer},setPlayReadyMessageFormat:function(ft){if(ft!=="utf-8"&&ft!=="utf-16")throw new Error('Specified message format is not one of "utf-8" or "utf-16"');Ne=ft}},Ve}Ee.__dashjs_factory_name="KeySystemPlayReady";var Tt=Te.A.getSingletonFactory(Ee);const Ct=f.A.FAIRPLAY_UUID,Ye=f.A.FAIRPLAY_KEYSTEM_STRING,K="urn:uuid:"+Ct;function S(){let Ce;return Ce={uuid:Ct,schemeIdURI:K,systemString:Ye,getInitData:function(){return null},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/octet-stream"}},getLicenseRequestFromMessage:function(Ve){return new Uint8Array(Ve)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}},Ce}S.__dashjs_factory_name="KeySystemFairPlay";var ae=Te.A.getSingletonFactory(S);function P(Ce){const Ve=(Ce=Ce||{}).BASE64,Ne={};let Ge;return Ne[f.A.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(st){return Ve.decodeArray(st.license)},getErrorResponse:function(st){return st}},Ne[f.A.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(st){return st},getErrorResponse:function(st){return String.fromCharCode.apply(null,new Uint8Array(st))}},Ge={getServerURLFromMessage:function(st){return st},getHTTPMethod:function(){return"POST"},getResponseType:function(st){return Ne[st].responseType},getLicenseMessage:function(st,nt){return(function(){if(!Ve||!Ve.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")})(),Ne[nt].getLicenseMessage(st)},getErrorResponse:function(st,nt){return Ne[nt].getErrorResponse(st)}},Ge}P.__dashjs_factory_name="DRMToday";var _e=Te.A.getSingletonFactory(P);function Ue(){let Ce;const Ve="http://schemas.xmlsoap.org/soap/envelope/";function Ne(nt){const ft=String.fromCharCode.apply(null,new Uint8Array(nt));return decodeURIComponent(escape(ft))}function Ge(nt){if(window.DOMParser){const ft=Ne(nt),Pt=new window.DOMParser().parseFromString(ft,"text/xml"),_t=Pt?Pt.getElementsByTagNameNS(Ve,"Envelope")[0]:null,Et=_t?_t.getElementsByTagNameNS(Ve,"Body")[0]:null;if(Et&&Et.getElementsByTagNameNS(Ve,"Fault")[0])return null}return nt}function st(nt){let ft="",Pt="",_t="",Et=-1,Dt=-1;if(window.DOMParser){const cn=Ne(nt),qt=new window.DOMParser().parseFromString(cn,"text/xml"),dn=qt?qt.getElementsByTagNameNS(Ve,"Envelope")[0]:null,Mn=dn?dn.getElementsByTagNameNS(Ve,"Body")[0]:null,yn=Mn?Mn.getElementsByTagNameNS(Ve,"Fault")[0]:null,gn=yn?yn.getElementsByTagName("detail")[0]:null,$t=gn?gn.getElementsByTagName("Exception")[0]:null;let At=null;if(yn===null)return cn;At=yn.getElementsByTagName("faultstring")[0].firstChild,ft=At?At.nodeValue:null,$t!==null&&(At=$t.getElementsByTagName("StatusCode")[0],Pt=At?At.firstChild.nodeValue:null,At=$t.getElementsByTagName("Message")[0],_t=At?At.firstChild.nodeValue:null,Et=_t?_t.lastIndexOf("[")+1:-1,Dt=_t?_t.indexOf("]"):-1,_t=_t?_t.substring(Et,Dt):"")}let pn=`code: ${Pt}, name: ${ft}`;return _t&&(pn+=`, message: ${_t}`),pn}return Ce={getServerURLFromMessage:function(nt){return nt},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(nt){return Ge.call(this,nt)},getErrorResponse:function(nt){return st.call(this,nt)}},Ce}Ue.__dashjs_factory_name="PlayReady";var Pe=Te.A.getSingletonFactory(Ue);function Je(){let Ce;return Ce={getServerURLFromMessage:function(Ve){return Ve},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(Ve){return Ve},getErrorResponse:function(Ve){return String.fromCharCode.apply(null,new Uint8Array(Ve))}},Ce}Je.__dashjs_factory_name="Widevine";var g=Te.A.getSingletonFactory(Je);function y(){let Ce;function Ve(Ne){const Ge=atob(Ne),st=new Uint8Array(Ge.length);for(let nt=0;nt<Ge.length;nt++)st[nt]=Ge.charCodeAt(nt);return st.buffer}return Ce={getErrorResponse:function(Ne){return String.fromCharCode.apply(null,new Uint8Array(Ne))},getHTTPMethod:function(){return"POST"},getLicenseMessage:function(Ne){if(!Ne||!Ne.byteLength)return Ne;let Ge;try{Ge=String.fromCharCode.apply(null,new Uint8Array(Ne))}catch{const st=new Uint8Array(Ne);let nt="";for(let ft=0;ft<st.length;ft++)nt+=String.fromCharCode(st[ft]);Ge=nt}if(!Ge)return Ne;if(Ge=Ge.trim(),Ge.substr(0,5)==="<ckc>"&&Ge.substr(-6)==="</ckc>")return Ve(Ge.slice(5,-6));try{const st=JSON.parse(Ge),nt=st.ckc||st.CkcMessage||st.License;if(nt)return Ve(nt)}catch{}return/^[A-Za-z0-9+/\r\n]+=*$/.test(Ge)&&Ge.length>0?Ve(Ge):Ne},getResponseType:function(){return"arraybuffer"},getServerURLFromMessage:function(Ne){return Ne}},Ce}y.__dashjs_factory_name="FairPlay";var R=Te.A.getSingletonFactory(y);function ne(){let Ce;return Ce={getServerURLFromMessage:function(Ve){return Ve},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(Ve){if(!Ve.hasOwnProperty("keys"))return null;let Ne=[];for(let Ge=0;Ge<Ve.keys.length;Ge++){let st=Ve.keys[Ge],nt=st.kid.replace(/=/g,""),ft=st.k.replace(/=/g,"");Ne.push(new tt(nt,ft))}return new re(Ne)},getErrorResponse:function(Ve){return String.fromCharCode.apply(null,new Uint8Array(Ve))}},Ce}ne.__dashjs_factory_name="ClearKey";var Z=Te.A.getSingletonFactory(ne),de=C(2076);function qe(){let Ce,Ve,Ne,Ge,st,nt,ft,Pt,_t=this.context;function Et(qt){for(let dn=0;dn<Ge.length;dn++)if(Ge[dn].systemString===qt)return Ge[dn];return null}function Dt(qt,dn){return dn&&qt in dn?dn[qt]:null}function pn(qt,dn){return qt&&qt.sessionId?qt.sessionId:dn&&dn.sessionId?dn.sessionId:null}function cn(qt,dn){return qt&&qt.sessionType?qt.sessionType:dn}return Ce={getKeySystemBySystemString:Et,getKeySystems:function(){return Ge},getLicenseServerModelInstance:function(qt,dn,Mn){if(Mn===f.A.MEDIA_KEY_MESSAGE_TYPES.LICENSE_RELEASE||Mn===f.A.MEDIA_KEY_MESSAGE_TYPES.INDIVIDUALIZATION_REQUEST)return null;let yn=null;return dn&&dn.hasOwnProperty("drmtoday")?yn=_e(_t).getInstance({BASE64:st}):qt.systemString===f.A.WIDEVINE_KEYSTEM_STRING?yn=g(_t).getInstance():qt.systemString===f.A.FAIRPLAY_KEYSTEM_STRING?yn=R(_t).getInstance():qt.systemString===f.A.PLAYREADY_KEYSTEM_STRING?yn=Pe(_t).getInstance():qt.systemString===f.A.CLEARKEY_KEYSTEM_STRING&&(yn=Z(_t).getInstance()),yn},getSupportedKeySystemMetadataForSinf:function(qt,dn,Mn){const yn=Et(f.A.FAIRPLAY_KEYSTEM_STRING);if(!yn)return[];const gn=(function(At){if(!At||At.byteLength<12)return null;let ct;try{const Vt=String.fromCharCode.apply(null,new Uint8Array(At)),jt=JSON.parse(Vt);if(jt.sinf&&jt.sinf.length>0){const Fe=atob(jt.sinf[0]);ct=new Uint8Array(Fe.length);for(let ln=0;ln<Fe.length;ln++)ct[ln]=Fe.charCodeAt(ln)}}catch{ct=new Uint8Array(At)}if(!ct||ct.length<12)return null;for(let Vt=0;Vt<ct.length-28;Vt++)if(ct[Vt]===116&&ct[Vt+1]===101&&ct[Vt+2]===110&&ct[Vt+3]===99){const jt=Vt+12;if(jt+16>ct.length)return null;const Fe=ct.subarray(jt,jt+16),ln=Array.from(Fe).map(Pn=>Pn.toString(16).padStart(2,"0")).join("");return ln.slice(0,8)+"-"+ln.slice(8,12)+"-"+ln.slice(12,16)+"-"+ln.slice(16,20)+"-"+ln.slice(20,32)}return null})(qt),$t=dn&&dn[f.A.FAIRPLAY_KEYSTEM_STRING]||null;return[{ks:yn,keyId:gn,initData:qt,protData:$t,cdmData:yn.getCDMData($t?$t.cdmData:null),sessionType:Mn}]},getSupportedKeySystemMetadataFromContentProtection:function(qt,dn,Mn){let yn,gn,$t,At,ct=[];if(!qt||!qt.length)return ct;const Vt=E.findMp4ProtectionElement(qt);for($t=0;$t<Ge.length;$t++){gn=Ge[$t];const jt=Dt(gn.systemString,dn);for(At=0;At<qt.length;At++)if(yn=qt[At],yn.schemeIdUri.toLowerCase()===gn.schemeIdURI){let Fe=gn.getInitData(yn,Vt);const ln=new de.A({ks:Ge[$t],keyId:yn.keyId,initData:Fe,protData:jt,cdmData:gn.getCDMData(jt?jt.cdmData:null),sessionId:pn(jt,yn),sessionType:cn(jt,Mn)});jt?ct.unshift(ln):ct.push(ln)}}return ct},getSupportedKeySystemMetadataFromSegmentPssh:function(qt,dn,Mn){let yn,gn,$t=[],At=E.parsePSSHList(qt);for(let ct=0;ct<Ge.length;++ct){yn=Ge[ct],gn=yn.systemString;const Vt=Dt(gn,dn);yn.uuid in At&&$t.push({ks:yn,initData:At[yn.uuid],protData:Vt,cdmData:yn.getCDMData(Vt?Vt.cdmData:null),sessionId:pn(Vt),sessionType:cn(Vt,Mn)})}return $t},initDataEquals:function(qt,dn){if(qt.byteLength===dn.byteLength){let Mn=new Uint8Array(qt),yn=new Uint8Array(dn);for(let gn=0;gn<Mn.length;gn++)if(Mn[gn]!==yn[gn])return!1;return!0}return!1},initialize:function(){let qt;Ge=[],qt=Tt(_t).getInstance({BASE64:st,settings:nt}),Ge.push(qt),qt=on(_t).getInstance({BASE64:st}),Ge.push(qt),qt=ae(_t).getInstance(),Ge.push(qt),qt=pt(_t).getInstance({BASE64:st}),Ge.push(qt),ft=qt,qt=U(_t).getInstance({BASE64:st,debug:Ve}),Ge.push(qt),Pt=qt},isClearKey:function(qt){return qt===ft||qt===Pt},processClearKeyLicenseRequest:function(qt,dn,Mn){try{return qt.getClearKeysFromProtectionData(dn,Mn)}catch{return Ne.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(qt){qt&&(qt.debug&&(Ve=qt.debug,Ne=Ve.getLogger(Ce)),qt.BASE64&&(st=qt.BASE64),qt.settings&&(nt=qt.settings))},setKeySystems:function(qt){Ge=qt},setProtectionData:function(qt){for(var dn=function(gn){var $t=null;return qt&&($t=gn in qt?qt[gn]:null),$t},Mn=0;Mn<Ge.length;Mn++){var yn=Ge[Mn];yn.hasOwnProperty("init")&&yn.init(dn(yn.systemString))}}},Ce}qe.__dashjs_factory_name="ProtectionKeyController";var yt=Te.A.getSingletonFactory(qe),Lt=C(445),Ft=class{constructor(Ce,Ve){this.initData=Ce,this.initDataType=Ve}},X=class{constructor(Ce,Ve,Ne,Ge){this.sessionToken=Ce,this.message=Ve,this.defaultURL=Ne,this.messageType=Ge||f.A.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST}},De=class{constructor(Ce,Ve){this.keySystem=Ce,this.ksConfiguration=Ve,this.nativeMediaKeySystemAccessObject=null,this.selectedSystemString=null}};function it(Ce){Ce=Ce||{};const Ve=this.context,Ne=Ce.eventBus,Ge=Ce.events,st=Ce.debug;let nt,ft,Pt,_t,Et,Dt,pn,cn;function qt(At,ct,Vt,jt){if(navigator.requestMediaKeySystemAccess===void 0||typeof navigator.requestMediaKeySystemAccess!="function"){const Pn="Insecure origins are not allowed";return Ne.trigger(Ge.KEY_SYSTEM_ACCESS_COMPLETE,{error:Pn}),void jt({error:Pn})}const Fe=At[ct].configs,ln=At[ct].ks;(function(Pn,zn){return new Promise((Xn,ar)=>{dn(Pn,zn,0,Xn,ar)})})(de.A.getSystemStringsToApply(ln,At[ct].protData),Fe).then(Pn=>{const zn=Pn&&Pn.nativeMediaKeySystemAccessObject&&typeof Pn.nativeMediaKeySystemAccessObject.getConfiguration=="function"?Pn.nativeMediaKeySystemAccessObject.getConfiguration():null,Xn=new De(ln,zn);Xn.selectedSystemString=Pn.selectedSystemString,Xn.nativeMediaKeySystemAccessObject=Pn.nativeMediaKeySystemAccessObject,Ne.trigger(Ge.KEY_SYSTEM_ACCESS_COMPLETE,{data:Xn}),Vt({data:Xn})}).catch(Pn=>{if(ct+1<At.length)qt(At,ct+1,Vt,jt);else{const zn="Key system access denied! ";Ne.trigger(Ge.KEY_SYSTEM_ACCESS_COMPLETE,{error:zn+Pn.message}),jt({error:zn+Pn.message})}})}function dn(At,ct,Vt,jt,Fe){const ln=At[Vt];ft.debug(`Requesting key system access for system string ${ln}`),navigator.requestMediaKeySystemAccess(ln,ct).then(Pn=>{jt({nativeMediaKeySystemAccessObject:Pn,selectedSystemString:ln})}).catch(Pn=>{Vt+1<At.length?dn(At,ct,Vt+1,jt,Fe):Fe(Pn)})}function Mn(At){if(!At||!At.session)return Promise.resolve;const ct=At.session;return ct.removeEventListener("keystatuseschange",At),ct.removeEventListener("message",At),ct.close()}function yn(At){for(let ct=0;ct<Dt.length;ct++)if(Dt[ct]===At){Dt.splice(ct,1);break}}function gn(At,ct){const Vt={session:At,keyId:ct.keyId,normalizedKeyId:ct&&ct.keyId&&typeof ct.keyId=="string"?ct.keyId.replace(/-/g,"").toLowerCase():"",initData:ct.initData,sessionId:ct.sessionId,sessionType:ct.sessionType,hasTriggeredKeyStatusMapUpdate:!1,handleEvent:function(jt){switch(jt.type){case"keystatuseschange":this._onKeyStatusesChange(jt);break;case"message":this._onKeyMessage(jt)}},_onKeyStatusesChange:function(jt){Ne.trigger(Ge.KEY_STATUSES_CHANGED,{data:this});const Fe=[];jt.target.keyStatuses.forEach(function(){Fe.push($t(arguments))}),Ne.trigger(Ge.INTERNAL_KEY_STATUSES_CHANGED,{parsedKeyStatuses:Fe,sessionToken:Vt})},_onKeyMessage:function(jt){let Fe=ArrayBuffer.isView(jt.message)?jt.message.buffer:jt.message;Ne.trigger(Ge.INTERNAL_KEY_MESSAGE,{data:new X(this,Fe,void 0,jt.messageType)})},getKeyId:function(){return this.keyId},getSessionId:function(){return At.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return At.expiration},getKeyStatuses:function(){return At.keyStatuses},getUsable:function(){let jt=!1;return At.keyStatuses.forEach(function(){$t(arguments).status===f.A.MEDIA_KEY_STATUSES.USABLE&&(jt=!0)}),jt}};return At.addEventListener("keystatuseschange",Vt),At.addEventListener("message",Vt),At.closed.then(()=>{yn(Vt),ft.debug("DRM: Session closed. SessionID = "+Vt.getSessionId()),Ne.trigger(Ge.KEY_SESSION_CLOSED,{data:Vt.getSessionId()})}),Dt.push(Vt),Vt}function $t(At){let ct,Vt;return At&&At.length>0&&(At[0]&&(typeof At[0]=="string"?ct=At[0]:Vt=At[0]),At[1]&&(typeof At[1]=="string"?ct=At[1]:Vt=At[1])),{status:ct,keyId:Vt}}return nt={closeKeySession:function(At){Mn(At).catch(function(ct){yn(At),Ne.trigger(Ge.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+At.getSessionId()+") "+ct.name})})},createKeySession:function(At){if(!Pt||!Et)throw new Error("Can not create sessions until you have selected a key system");const ct=Et.createSession(At.sessionType),Vt=gn(ct,At);let jt;jt=Pt.systemString===f.A.CLEARKEY_KEYSTEM_STRING&&(At.initData||At.protData&&At.protData.clearkeys)?f.A.INITIALIZATION_DATA_TYPE_KEYIDS:Pt.systemString===f.A.FAIRPLAY_KEYSTEM_STRING?f.A.INITIALIZATION_DATA_TYPE_SINF:f.A.INITIALIZATION_DATA_TYPE_CENC,ct.generateRequest(jt,At.initData).then(function(){ft.debug("DRM: Session created. SessionID = "+Vt.getSessionId()),Ne.trigger(Ge.KEY_SESSION_CREATED,{data:Vt})}).catch(function(Fe){yn(Vt),Ne.trigger(Ge.KEY_SESSION_CREATED,{data:null,error:new Q.A(T.A.KEY_SESSION_CREATED_ERROR_CODE,T.A.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+Fe.name)})})},getAllInitData:function(){const At=[];for(let ct=0;ct<Dt.length;ct++)Dt[ct].initData&&At.push(Dt[ct].initData);return At},getSessionTokens:function(){return Dt},loadKeySession:function(At){if(!Pt||!Et)throw new Error("Can not load sessions until you have selected a key system");const ct=At.sessionId;for(let Fe=0;Fe<Dt.length;Fe++)if(ct===Dt[Fe].sessionId)return void ft.warn("DRM: Ignoring session ID because we have already seen it!");const Vt=Et.createSession(At.sessionType),jt=gn(Vt,At);jt.hasTriggeredKeyStatusMapUpdate=!0,Vt.load(ct).then(function(Fe){Fe?(ft.debug("DRM: Session loaded. SessionID = "+jt.getSessionId()),Ne.trigger(Ge.KEY_SESSION_CREATED,{data:jt})):(yn(jt),Ne.trigger(Ge.KEY_SESSION_CREATED,{data:null,error:new Q.A(T.A.KEY_SESSION_CREATED_ERROR_CODE,T.A.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+ct+")")}))}).catch(function(Fe){yn(jt),Ne.trigger(Ge.KEY_SESSION_CREATED,{data:null,error:new Q.A(T.A.KEY_SESSION_CREATED_ERROR_CODE,T.A.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+ct+")! "+Fe.name)})})},removeKeySession:function(At){At.session.remove().then(function(){ft.debug("DRM: Session removed. SessionID = "+At.getSessionId()),Ne.trigger(Ge.KEY_SESSION_REMOVED,{data:At.getSessionId()})},function(ct){Ne.trigger(Ge.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+At.getSessionId()+"). "+ct.name})})},requestKeySystemAccess:function(At){return new Promise((ct,Vt)=>{qt(At,0,ct,Vt)})},reset:function(){const At=Dt.length;let ct;if(At!==0){const Vt=function(jt){yn(jt),Dt.length===0&&(_t?(_t.removeEventListener("encrypted",pn),_t.setMediaKeys(null).then(function(){Ne.trigger(Ge.TEARDOWN_COMPLETE)})):Ne.trigger(Ge.TEARDOWN_COMPLETE))};for(let jt=0;jt<At;jt++)ct=Dt[jt],(function(Fe){Mn(ct),Vt(Fe)})(ct)}else Ne.trigger(Ge.TEARDOWN_COMPLETE)},selectKeySystem:function(At){return new Promise((ct,Vt)=>{At.nativeMediaKeySystemAccessObject.createMediaKeys().then(jt=>(Pt=At.keySystem,Et=jt,_t?_t.setMediaKeys(Et):Promise.resolve())).then(()=>{ct(Pt)}).catch(function(){Vt({error:"Error selecting keys system ("+At.keySystem.systemString+")! Could not create MediaKeys -- TODO"})})})},setMediaElement:function(At){_t!==At&&(_t&&(_t.removeEventListener("encrypted",pn),_t.setMediaKeys&&_t.setMediaKeys(null)),_t=At,_t&&(_t.addEventListener("encrypted",pn),_t.setMediaKeys&&Et&&_t.setMediaKeys(Et)))},setServerCertificate:function(At){return new Promise((ct,Vt)=>{Et.setServerCertificate(At).then(function(){ft.info("DRM: License server certificate successfully updated."),Ne.trigger(Ge.SERVER_CERTIFICATE_UPDATED),ct()}).catch(jt=>{Vt(jt),Ne.trigger(Ge.SERVER_CERTIFICATE_UPDATED,{error:new Q.A(T.A.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,T.A.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+jt.name)})})})},stop:function(){let At;for(let ct=0;ct<Dt.length;ct++)At=Dt[ct],At.getUsable()||(Mn(At),yn(At))},updateKeySession:function(At,ct){const Vt=At.session;cn.isClearKey(Pt)&&(ct=ct.toJWK()),Vt.update(ct).then(()=>{Ne.trigger(Ge.KEY_SESSION_UPDATED)}).catch(function(jt){Ne.trigger(Ge.KEY_ERROR,{error:new Q.A(T.A.MEDIA_KEYERR_CODE,"Error sending update() message! "+jt.name,At)})})}},ft=st.getLogger(nt),Pt=null,_t=null,Et=null,Dt=[],cn=yt(Ve).getInstance(),pn={handleEvent:function(At){if(At.type==="encrypted"&&At.initData){let ct=ArrayBuffer.isView(At.initData)?At.initData.buffer:At.initData;Ne.trigger(Ge.NEED_KEY,{key:new Ft(ct,At.initDataType)})}}},nt}it.__dashjs_factory_name="DefaultProtectionModel";var dt=Te.A.getClassFactory(it);function It(Ce){Ce=Ce||{};const Ve=this.context,Ne=Ce.eventBus,Ge=Ce.events,st=Ce.debug,nt=Ce.api;let ft,Pt,_t,Et,Dt,pn,cn,qt,dn;function Mn(){try{for(let $t=0;$t<cn.length;$t++)yn(cn[$t]);_t&&_t.removeEventListener(nt.needkey,qt),Ne.trigger(Ge.TEARDOWN_COMPLETE)}catch($t){Ne.trigger(Ge.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+$t.message})}}function yn($t){const At=$t.session;At.removeEventListener(nt.error,$t),At.removeEventListener(nt.message,$t),At.removeEventListener(nt.ready,$t),At.removeEventListener(nt.close,$t);for(let ct=0;ct<cn.length;ct++)if(cn[ct]===$t){cn.splice(ct,1);break}At[nt.release]()}function gn(){let $t=null;const At=function(){_t.removeEventListener("loadedmetadata",$t),_t[nt.setMediaKeys](Dt),Ne.trigger(Ge.VIDEO_ELEMENT_SELECTED)};_t.readyState>=1?At():($t=At.bind(this),_t.addEventListener("loadedmetadata",$t))}return ft={getAllInitData:function(){const $t=[];for(let At=0;At<cn.length;At++)$t.push(cn[At].initData);return $t},getSessionTokens:function(){return cn},requestKeySystemAccess:function($t){return new Promise((At,ct)=>{let Vt=!1;for(let jt=0;jt<$t.length;jt++){const Fe=$t[jt].ks.systemString,ln=$t[jt].configs;let Pn=null,zn=null;for(let Xn=0;Xn<ln.length;Xn++){const ar=ln[Xn].audioCapabilities,tr=ln[Xn].videoCapabilities;if(ar&&ar.length!==0){Pn=[];for(let cr=0;cr<ar.length;cr++)window[nt.MediaKeys].isTypeSupported(Fe,ar[cr].contentType)&&Pn.push(ar[cr])}if(tr&&tr.length!==0){zn=[];for(let cr=0;cr<tr.length;cr++)window[nt.MediaKeys].isTypeSupported(Fe,tr[cr].contentType)&&zn.push(tr[cr])}if(!Pn&&!zn||Pn&&Pn.length===0||zn&&zn.length===0)continue;Vt=!0;const Ir=new b(Pn,zn),ir=dn.getKeySystemBySystemString(Fe),Or=new De(ir,Ir);Ne.trigger(Ge.KEY_SYSTEM_ACCESS_COMPLETE,{data:Or}),At({data:Or});break}}if(!Vt){const jt="Key system access denied! -- No valid audio/video content configurations detected!";Ne.trigger(Ge.KEY_SYSTEM_ACCESS_COMPLETE,{error:jt}),ct({error:jt})}})},selectKeySystem:function($t){return new Promise((At,ct)=>{try{Dt=$t.mediaKeys=new window[nt.MediaKeys]($t.keySystem.systemString),Et=$t.keySystem,pn=$t,_t&&gn(),At(Et)}catch{ct({error:"Error selecting keys system ("+Et.systemString+")! Could not create MediaKeys -- TODO"})}})},setMediaElement:function($t){_t!==$t&&(_t&&_t.removeEventListener(nt.needkey,qt),_t=$t,_t&&(_t.addEventListener(nt.needkey,qt),Dt&&gn()))},createKeySession:function($t){if(!Et||!Dt||!pn)throw new Error("Can not create sessions until you have selected a key system");let At=null;if(pn.ksConfiguration.videoCapabilities&&pn.ksConfiguration.videoCapabilities.length>0&&(At=pn.ksConfiguration.videoCapabilities[0]),At===null&&pn.ksConfiguration.audioCapabilities&&pn.ksConfiguration.audioCapabilities.length>0&&(At=pn.ksConfiguration.audioCapabilities[0]),At===null)throw new Error("Can not create sessions for unknown content types.");const ct=At.contentType,Vt=Dt.createSession(ct,new Uint8Array($t.initData),$t.cdmData?new Uint8Array($t.cdmData):null),jt=(function(Fe,ln){return{session:Fe,keyId:ln.keyId,normalizedKeyId:ln&&ln.keyId&&typeof ln.keyId=="string"?ln.keyId.replace(/-/g,"").toLowerCase():"",initData:ln.initData,hasTriggeredKeyStatusMapUpdate:!1,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},getKeyStatuses:function(){return{size:0,has:()=>!1,get:()=>{}}},handleEvent:function(Pn){switch(Pn.type){case nt.error:let zn="KeyError";Ne.trigger(Ge.KEY_ERROR,{error:new Q.A(T.A.MEDIA_KEYERR_CODE,zn,this)});break;case nt.message:let Xn=ArrayBuffer.isView(Pn.message)?Pn.message.buffer:Pn.message;Ne.trigger(Ge.INTERNAL_KEY_MESSAGE,{data:new X(this,Xn,Pn.destinationURL)});break;case nt.ready:Pt.debug("DRM: Key added."),Ne.trigger(Ge.KEY_ADDED);break;case nt.close:Pt.debug("DRM: Session closed. SessionID = "+this.getSessionId()),Ne.trigger(Ge.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}})(Vt,$t);Vt.addEventListener(nt.error,jt),Vt.addEventListener(nt.message,jt),Vt.addEventListener(nt.ready,jt),Vt.addEventListener(nt.close,jt),cn.push(jt),Pt.debug("DRM: Session created. SessionID = "+jt.getSessionId()),Ne.trigger(Ge.KEY_SESSION_CREATED,{data:jt})},updateKeySession:function($t,At){const ct=$t.session;dn.isClearKey(Et)?ct.update(new Uint8Array(At.toJWK())):ct.update(new Uint8Array(At)),Ne.trigger(Ge.KEY_SESSION_UPDATED)},closeKeySession:yn,setServerCertificate:function(){return Promise.resolve()},loadKeySession:function(){},removeKeySession:function(){},stop:Mn,reset:Mn},Pt=st.getLogger(ft),_t=null,Et=null,Dt=null,pn=null,cn=[],dn=yt(Ve).getInstance(),qt={handleEvent:function($t){if($t.type===nt.needkey&&$t.initData){const At=ArrayBuffer.isView($t.initData)?$t.initData.buffer:$t.initData;Ne.trigger(Ge.NEED_KEY,{key:new Ft(At,f.A.INITIALIZATION_DATA_TYPE_CENC)})}}},ft}It.__dashjs_factory_name="ProtectionModel_3Feb2014";var lt=Te.A.getClassFactory(It);function Yt(Ce){Ce=Ce||{};const Ve=this.context,Ne=Ce.eventBus,Ge=Ce.events,st=Ce.debug,nt=Ce.api,ft=Ce.errHandler;let Pt,_t,Et,Dt,pn,cn,qt,dn,Mn;function yn(){Et&&At();for(let ct=0;ct<qt.length;ct++)gn(qt[ct]);Ne.trigger(Ge.TEARDOWN_COMPLETE)}function gn(ct){try{Et[nt.cancelKeyRequest](Dt.systemString,ct.sessionId)}catch(Vt){Ne.trigger(Ge.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+ct.sessionId+") "+Vt.message})}}function $t(ct,Vt){if(Vt&&ct){const jt=ct.length;for(let Fe=0;Fe<jt;Fe++)if(ct[Fe].sessionId==Vt)return ct[Fe];return null}return null}function At(){Et.removeEventListener(nt.keyerror,Mn),Et.removeEventListener(nt.needkey,Mn),Et.removeEventListener(nt.keymessage,Mn),Et.removeEventListener(nt.keyadded,Mn)}return Pt={getAllInitData:function(){const ct=[];for(let Vt=0;Vt<cn.length;Vt++)ct.push(cn[Vt].initData);for(let Vt=0;Vt<qt.length;Vt++)ct.push(qt[Vt].initData);return ct},getSessionTokens:function(){return qt.concat(cn)},requestKeySystemAccess:function(ct){return new Promise((Vt,jt)=>{let Fe=Et;Fe||(Fe=document.createElement("video"));let ln=!1;for(let Pn=0;Pn<ct.length;Pn++){const zn=ct[Pn].ks.systemString,Xn=ct[Pn].configs;let ar=null,tr=null;for(let Ir=0;Ir<Xn.length;Ir++){const ir=Xn[Ir].videoCapabilities;if(ir&&ir.length!==0){tr=[];for(let Lr=0;Lr<ir.length;Lr++)Fe.canPlayType(ir[Lr].contentType,zn)!==""&&tr.push(ir[Lr])}if(!tr||ar||tr&&tr.length===0)continue;ln=!0;const Or=new b(ar,tr),cr=pn.getKeySystemBySystemString(zn),kr=new De(cr,Or);Ne.trigger(Ge.KEY_SYSTEM_ACCESS_COMPLETE,{data:kr}),Vt({data:kr});break}}if(!ln){const Pn="Key system access denied! -- No valid audio/video content configurations detected!";Ne.trigger(Ge.KEY_SYSTEM_ACCESS_COMPLETE,{error:Pn}),jt({error:Pn})}})},selectKeySystem:function(ct){return Dt=ct.keySystem,Promise.resolve(Dt)},setMediaElement:function(ct){if(Et!==ct){if(Et){At();for(var Vt=0;Vt<qt.length;Vt++)gn(qt[Vt]);qt=[]}Et=ct,Et&&(Et.addEventListener(nt.keyerror,Mn),Et.addEventListener(nt.needkey,Mn),Et.addEventListener(nt.keymessage,Mn),Et.addEventListener(nt.keyadded,Mn),Ne.trigger(Ge.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(ct){if(!Dt)throw new Error("Can not create sessions until you have selected a key system");if(dn||qt.length===0){const Vt={sessionId:null,keyId:ct.keyId,normalizedKeyId:ct&&ct.keyId&&typeof ct.keyId=="string"?ct.keyId.replace(/-/g,"").toLowerCase():"",initData:ct.initData,hasTriggeredKeyStatusMapUpdate:!1,getKeyId:function(){return this.keyId},getSessionId:function(){return this.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},getKeyStatuses:function(){return{size:0,has:()=>!1,get:()=>{}}}};return cn.push(Vt),Et[nt.generateKeyRequest](Dt.systemString,new Uint8Array(ct.initData)),Vt}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(ct,Vt){const jt=ct.sessionId;if(pn.isClearKey(Dt))for(let Fe=0;Fe<Vt.keyPairs.length;Fe++)Et[nt.addKey](Dt.systemString,Vt.keyPairs[Fe].key,Vt.keyPairs[Fe].keyID,jt);else Et[nt.addKey](Dt.systemString,new Uint8Array(Vt),new Uint8Array(ct.initData),jt);Ne.trigger(Ge.KEY_SESSION_UPDATED)},closeKeySession:gn,setServerCertificate:function(){return Promise.resolve()},loadKeySession:function(){},removeKeySession:function(){},stop:yn,reset:yn},_t=st.getLogger(Pt),Et=null,Dt=null,cn=[],qt=[],pn=yt(Ve).getInstance(),Mn={handleEvent:function(ct){let Vt=null;switch(ct.type){case nt.needkey:let jt=ArrayBuffer.isView(ct.initData)?ct.initData.buffer:ct.initData;Ne.trigger(Ge.NEED_KEY,{key:new Ft(jt,f.A.INITIALIZATION_DATA_TYPE_CENC)});break;case nt.keyerror:if(Vt=$t(qt,ct.sessionId),Vt||(Vt=$t(cn,ct.sessionId)),Vt){let Fe=T.A.MEDIA_KEYERR_CODE,ln="";switch(ct.errorCode.code){case 1:Fe=T.A.MEDIA_KEYERR_UNKNOWN_CODE,ln+="MEDIA_KEYERR_UNKNOWN - "+T.A.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:Fe=T.A.MEDIA_KEYERR_CLIENT_CODE,ln+="MEDIA_KEYERR_CLIENT - "+T.A.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:Fe=T.A.MEDIA_KEYERR_SERVICE_CODE,ln+="MEDIA_KEYERR_SERVICE - "+T.A.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:Fe=T.A.MEDIA_KEYERR_OUTPUT_CODE,ln+="MEDIA_KEYERR_OUTPUT - "+T.A.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:Fe=T.A.MEDIA_KEYERR_HARDWARECHANGE_CODE,ln+="MEDIA_KEYERR_HARDWARECHANGE - "+T.A.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:Fe=T.A.MEDIA_KEYERR_DOMAIN_CODE,ln+="MEDIA_KEYERR_DOMAIN - "+T.A.MEDIA_KEYERR_DOMAIN_MESSAGE}ln+=" System Code = "+ct.systemCode,Ne.trigger(Ge.KEY_ERROR,{error:new Q.A(Fe,ln,Vt)})}else _t.error("No session token found for key error");break;case nt.keyadded:Vt=$t(qt,ct.sessionId),Vt||(Vt=$t(cn,ct.sessionId)),Vt?(_t.debug("DRM: Key added."),Ne.trigger(Ge.KEY_ADDED,{data:Vt})):_t.debug("No session token found for key added");break;case nt.keymessage:if(dn=ct.sessionId!==null&&ct.sessionId!==void 0,dn?(Vt=$t(qt,ct.sessionId),!Vt&&cn.length>0&&(Vt=cn.shift(),qt.push(Vt),Vt.sessionId=ct.sessionId,Ne.trigger(Ge.KEY_SESSION_CREATED,{data:Vt}))):cn.length>0&&(Vt=cn.shift(),qt.push(Vt),cn.length!==0&&ft.error(new Q.A(T.A.MEDIA_KEY_MESSAGE_ERROR_CODE,T.A.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),Vt){let Fe=ArrayBuffer.isView(ct.message)?ct.message.buffer:ct.message;Vt.keyMessage=Fe,Ne.trigger(Ge.INTERNAL_KEY_MESSAGE,{data:new X(Vt,Fe,ct.defaultURL)})}else _t.warn("No session token found for key message")}}},Pt}Yt.__dashjs_factory_name="ProtectionModel_01b";var Xt=Te.A.getClassFactory(Yt);const Zt=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],Gt=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function mn(){let Ce;const Ve=this.context;function Ne(Ge,st){for(let nt=0;nt<st.length;nt++){const ft=st[nt];if(typeof Ge[ft[Object.keys(ft)[0]]]=="function")return ft}return null}return Ce={createProtectionSystem:function(Ge){let st=null;const nt=yt(Ve).getInstance();nt.setConfig({debug:Ge.debug,BASE64:Ge.BASE64,settings:Ge.settings}),nt.initialize();let ft=(function(Pt){const _t=Pt.debug,Et=_t.getLogger(Ce),Dt=Pt.eventBus,pn=Pt.errHandler,cn=Pt.videoModel?Pt.videoModel.getElement():null;return cn&&cn.onencrypted===void 0||cn&&cn.mediaKeys===void 0?Ne(cn,Gt)?(Et.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),lt(Ve).create({debug:_t,eventBus:Dt,events:Pt.events,api:Ne(cn,Gt)})):Ne(cn,Zt)?(Et.info("EME detected on this user agent! (ProtectionModel_01b)"),Xt(Ve).create({debug:_t,eventBus:Dt,errHandler:pn,events:Pt.events,api:Ne(cn,Zt)})):(Et.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(Et.info("EME detected on this user agent! (DefaultProtectionModel"),dt(Ve).create({debug:_t,eventBus:Dt,events:Pt.events}))})(Ge);return ft&&(st=je(Ve).create({BASE64:Ge.BASE64,cmcdController:Ge.cmcdController,constants:Ge.constants,customParametersModel:Ge.customParametersModel,debug:Ge.debug,eventBus:Ge.eventBus,events:Ge.events,protectionKeyController:nt,protectionModel:ft,settings:Ge.settings}),Ge.capabilities.setEncryptedMediaSupported(!0)),st}},Ce}mn.__dashjs_factory_name="Protection";const sn=Te.A.getClassFactory(mn);sn.events=Lt.A,sn.errors=T.A,Te.A.updateClassFactory(mn.__dashjs_factory_name,sn);var Me=sn},445:function(Nt,Re,C){var j=C(7252);class f extends j.A{constructor(){super(),this.INTERNAL_KEY_MESSAGE="internalKeyMessage",this.INTERNAL_KEY_STATUSES_CHANGED="internalkeyStatusesChanged",this.KEY_ADDED="public_keyAdded",this.KEY_ERROR="public_keyError",this.KEY_MESSAGE="public_keyMessage",this.KEY_SESSION_CLOSED="public_keySessionClosed",this.KEY_SESSION_CREATED="public_keySessionCreated",this.KEY_SESSION_REMOVED="public_keySessionRemoved",this.KEY_STATUSES_CHANGED="public_keyStatusesChanged",this.KEY_STATUSES_MAP_UPDATED="keyStatusesMapUpdated",this.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",this.KEY_SYSTEM_SELECTED="public_keySystemSelected",this.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",this.LICENSE_REQUEST_SENDING="public_licenseRequestSending",this.NEED_KEY="needkey",this.PROTECTION_CREATED="public_protectioncreated",this.PROTECTION_DESTROYED="public_protectiondestroyed",this.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",this.TEARDOWN_COMPLETE="protectionTeardownComplete",this.VIDEO_ELEMENT_SELECTED="videoElementSelected",this.KEY_SESSION_UPDATED="public_keySessionUpdated"}}let o=new f;Re.A=o},1923:function(Nt,Re,C){var j=C(8748);class f extends j.A{constructor(){super(),this.MEDIA_KEYERR_CODE=100,this.MEDIA_KEYERR_UNKNOWN_CODE=101,this.MEDIA_KEYERR_CLIENT_CODE=102,this.MEDIA_KEYERR_SERVICE_CODE=103,this.MEDIA_KEYERR_OUTPUT_CODE=104,this.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,this.MEDIA_KEYERR_DOMAIN_CODE=106,this.MEDIA_KEY_MESSAGE_ERROR_CODE=107,this.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,this.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,this.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,this.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,this.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,this.KEY_SESSION_CREATED_ERROR_CODE=113,this.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,this.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",this.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",this.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",this.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",this.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",this.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",this.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",this.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",this.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",this.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",this.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",this.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",this.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",this.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --"}}let o=new f;Re.A=o},2076:function(Nt,Re,C){var j=C(2861);Re.A=class{constructor(f){this.ks=f.ks,this.keyId=f.keyId,this.initData=f.initData,this.protData=f.protData,this.cdmData=f.cdmData,this.sessionId=f.sessionId,this.sessionType=f.sessionType}static getSystemStringsToApply(f,o){return o&&o.systemStringPriority&&o.systemStringPriority.length>0&&o.systemStringPriority||j.A.DEFAULT_SYSTEM_STRING_PRIORITY[f.systemString]||[f.systemString]}}},4246:function(Nt,Re,C){var j=C(138);const f={DEFAULT:.5,STRONG:1,WEAK:0};function o(E,m,b,T){let Q,V,se,Y,ce;return V=E===void 0?null:E,se=(function(ge){let Te=f.DEFAULT;return ge!==f.DEFAULT&&ge!==f.STRONG&&ge!==f.WEAK||(Te=ge),Te})(b),Y=m===void 0?null:m,ce=T===void 0?null:T,Q={representation:V,reason:Y,rule:ce,priority:se},Q}o.__dashjs_factory_name="SwitchRequest";const u=j.A.getClassFactory(o);u.NO_CHANGE=null,u.PRIORITY=f,j.A.updateClassFactory(o.__dashjs_factory_name,u),Re.A=u},559:function(Nt,Re,C){C.d(Re,{a:function(){return b}});var j=C(138),f=C(5212),o=C(2861),u=C(2076),E=C(7393),m=C(649);function b(){let Q="ManagedMediaSource"in window,V="WebKitMediaSource"in window,se="MediaSource"in window;return Q||V||se}function T(){let Q,V,se,Y,ce,ge;const Te=this.context,ue=(0,E.A)(Te).getInstance();function F(z,he){let we;he===f.A.VIDEO?we=(function(pt){const ye={video:{}};return pt&&(pt.width&&(ye.video.width=pt.width),pt.height&&(ye.video.height=pt.height),pt.framerate&&(ye.video.framerate=parseFloat(pt.framerate)),pt.hdrMetadataType&&(ye.video.hdrMetadataType=pt.hdrMetadataType),pt.colorGamut&&(ye.video.colorGamut=pt.colorGamut),pt.transferFunction&&(ye.video.transferFunction=pt.transferFunction)),ye})(z):he===f.A.AUDIO&&(we=(function(pt){const ye={audio:{}};return pt.samplerate&&(ye.audio.samplerate=pt.samplerate),pt.channels&&(ye.audio.channels=pt.channels),ye})(z)),we[he].contentType=z.codec,we[he].bitrate=parseInt(z.bitrate),we.type="media-source";let Be=z.codec;return z.width&&z.height&&(Be+=';width="'+z.width+'";height="'+z.height+'"'),we.mediaSourceCodecString=Be,(function(pt,ye,mt){if(!ye||!ye.keySystemsMetadata||ye.keySystemsMetadata.length===0)return[pt];const Ze=[];return ye.keySystemsMetadata.forEach(He=>{He.ks?u.A.getSystemStringsToApply(He.ks,He.protData).forEach(U=>{const Bt={...pt};Bt.keySystemConfiguration={},U&&(Bt.keySystemConfiguration.keySystem=U);let Ut="";He.ks.systemString===o.A.WIDEVINE_KEYSTEM_STRING&&(Ut=o.A.ROBUSTNESS_STRINGS.WIDEVINE.SW_SECURE_CRYPTO);const kt=He.protData,Kt=kt&&kt.audioRobustness&&kt.audioRobustness.length>0?kt.audioRobustness:Ut,on=kt&&kt.videoRobustness&&kt.videoRobustness.length>0?kt.videoRobustness:Ut;mt===f.A.AUDIO?Bt.keySystemConfiguration[mt]={robustness:Kt}:mt===f.A.VIDEO&&(Bt.keySystemConfiguration[mt]={robustness:on}),Ze.push(Bt)}):Ze.push({...pt})}),Ze})(we,z,he)}function ve(z){return V.get().streaming.enhancement.codecs.some(he=>z.includes(he))}function je(z){if(Y&&Y.length!==0&&z)return Y.find(he=>{const we=tt(z,he,f.A.AUDIO),Be=tt(z,he,f.A.VIDEO),pt=tt(z,he,"keySystemConfiguration");return we&&Be&&pt})}function tt(z,he,we){return!z[we]&&!he[we]||!(!z[we]||!he[we])&&ue.areEqual(z[we],he[we])}function re(z,he){return(z=z.filter(we=>!(we.schemeIdUri&&he.some(Be=>Be.schemeIdUri===we.schemeIdUri)))).push(...he),z}return Q={areKeyIdsExpired:function(z){return!!(se&&z&&z.normalizedKeyIds&&z.normalizedKeyIds.size!==0)&&se.areKeyIdsExpired(z.normalizedKeyIds)},areKeyIdsUsable:function(z){return!(se&&z&&z.normalizedKeyIds&&z.normalizedKeyIds.size!==0)||se.areKeyIdsUsable(z.normalizedKeyIds)},isCodecSupportedBasedOnTestedConfigurations:function(z,he){if(!z||!z.codec||z.isSupported===!1)return!1;const we=F(z,he).map(Be=>je(Be)).filter(Be=>Be!=null);return!(we&&we.length>0)||(function(Be){return Be.some(pt=>pt&&pt.decodingInfo&&pt.decodingInfo.supported)})(we)},isProtectionCompatible:function(z,he){return!he||!(!z.isEncrypted&&he.isEncrypted)},runCodecSupportCheck:function(z,he){if(he!==f.A.AUDIO&&he!==f.A.VIDEO)return Promise.resolve();if(V.get().streaming.enhancement.enabled&&ve(z.codec))return Y=Y.filter(Be=>!ve(Be.mediaSourceCodecString)),Promise.resolve(!0);const we=F(z,he);return(function(Be,pt){return V.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(Be.codec&&pt===f.A.AUDIO||pt===f.A.VIDEO&&Be.codec&&Be.width&&Be.height&&Be.bitrate&&Be.framerate)})(z,he)?(function(Be){return new Promise(pt=>{if(!Be||Be.length===0)return void pt();const ye=Be.map(mt=>(function(Ze){return new Promise(He=>{je(Ze)?He():navigator.mediaCapabilities.decodingInfo(Ze).then(U=>{Ze.decodingInfo=U,Y.push(Ze),He()}).catch(U=>{Ze.decodingInfo={supported:!1},Y.push(Ze),ge.error(U),He()})})})(mt));Promise.allSettled(ye).then(()=>{pt()}).catch(mt=>{ge.error(mt),pt()})})})(we):((function(Be){if(!Be||!Be.length)return;const pt=Be[0];if(je(pt))return;let ye={supported:!1};("ManagedMediaSource"in window&&ManagedMediaSource.isTypeSupported(pt.mediaSourceCodecString)||"MediaSource"in window&&MediaSource.isTypeSupported(pt.mediaSourceCodecString)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(pt.mediaSourceCodecString))&&(ye.supported=!0),pt.decodingInfo=ye,Y.push(pt)})(we),Promise.resolve())},setConfig:function(z){z&&(z.settings&&(V=z.settings),z.protectionController&&(se=z.protectionController))},setEncryptedMediaSupported:function(z){ce=z},setProtectionController:function(z){se=z},supportsChangeType:function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType},supportsEncryptedMedia:function(){return ce},supportsEssentialProperty:function(z){let he=V.get().streaming.capabilities.supportedEssentialProperties;V.get().streaming.capabilities.useMediaCapabilitiesApi&&V.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&(he=re(he,[{schemeIdUri:f.A.COLOUR_PRIMARIES_SCHEME_ID_URI},{schemeIdUri:f.A.MATRIX_COEFFICIENTS_SCHEME_ID_URI},{schemeIdUri:f.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI}])),V.get().streaming.capabilities.useMediaCapabilitiesApi&&V.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&(he=re(he,[{schemeIdUri:f.A.HDR_METADATA_FORMAT_SCHEME_ID_URI}]));try{return z.inArray(he)}catch{return!0}},supportsMediaSource:b},ce=!1,Y=[],ge=(0,m.A)(Te).getInstance().getLogger(Q),Q}T.__dashjs_factory_name="Capabilities",Re.A=j.A.getSingletonFactory(T)},1349:function(Nt,Re){function C(f){return f?(Array.isArray(f)?f:[f]).map(o=>{if(!o)return null;if(typeof o=="string"){const u=o.trim();return u?{url:u,certType:null}:null}if(typeof o=="object"){let u=(o.__text||o.text||"").trim();u||typeof o.url!="string"||(u=o.url.trim());let E=o.certType||o["@certType"]||null;return E&&typeof E=="string"?(E=E.trim(),E===""&&(E=null)):E=null,u?{url:u,certType:E}:null}return null}).filter(Boolean):[]}function j(f){if(!Array.isArray(f)||f.length===0)return[];const o=new Set,u=[];for(let E=0;E<f.length;E++){const m=f[E];if(!m||!m.url)continue;const b=m.url+"||"+(m.certType||"");o.has(b)||(o.add(b),u.push(m))}return u}Re.A={normalizeCertUrls:C,dedupeCertUrls:j,sanitizeProtectionDataCertUrls:function(f){return f&&typeof f=="object"&&Object.keys(f).forEach(o=>{const u=f[o];u&&Array.isArray(u.certUrls)&&(u.certUrls=j(C(u.certUrls)))}),f}}},7377:function(Nt,Re,C){var j=C(138),f=C(656);function o(){return{customTimeRangeArray:[],length:0,add:function(u,E){let m;for(m=0;m<this.customTimeRangeArray.length&&u>this.customTimeRangeArray[m].start;m++);for(this.customTimeRangeArray.splice(m,0,{start:u,end:E}),m=0;m<this.customTimeRangeArray.length-1;m++)this.mergeRanges(m,m+1)&&m--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(u,E){for(let m=0;m<this.customTimeRangeArray.length;m++)if(u<=this.customTimeRangeArray[m].start&&E>=this.customTimeRangeArray[m].end)this.customTimeRangeArray.splice(m,1),m--;else{if(u>this.customTimeRangeArray[m].start&&E<this.customTimeRangeArray[m].end){this.customTimeRangeArray.splice(m+1,0,{start:E,end:this.customTimeRangeArray[m].end}),this.customTimeRangeArray[m].end=u;break}u>this.customTimeRangeArray[m].start&&u<this.customTimeRangeArray[m].end?this.customTimeRangeArray[m].end=u:E>this.customTimeRangeArray[m].start&&E<this.customTimeRangeArray[m].end&&(this.customTimeRangeArray[m].start=E)}this.length=this.customTimeRangeArray.length},mergeRanges:function(u,E){let m=this.customTimeRangeArray[u],b=this.customTimeRangeArray[E];return m.start<=b.start&&b.start<=m.end&&m.end<=b.end?(m.end=b.end,this.customTimeRangeArray.splice(E,1),!0):b.start<=m.start&&m.start<=b.end&&b.end<=m.end?(m.start=b.start,this.customTimeRangeArray.splice(E,1),!0):b.start<=m.start&&m.start<=b.end&&m.end<=b.end?(this.customTimeRangeArray.splice(u,1),!0):m.start<=b.start&&b.start<=m.end&&b.end<=m.end&&(this.customTimeRangeArray.splice(E,1),!0)},start:function(u){return(0,f.zQ)(u),u>=this.customTimeRangeArray.length||u<0?NaN:this.customTimeRangeArray[u].start},end:function(u){return(0,f.zQ)(u),u>=this.customTimeRangeArray.length||u<0?NaN:this.customTimeRangeArray[u].end}}}o.__dashjs_factory_name="CustomTimeRanges",Re.A=j.A.getClassFactory(o)},9026:function(Nt,Re,C){var j=C(138);function f(){let o;const u=/^[a-z][a-z0-9+\-_.]*:/i,E=/^https?:\/\//i,m=/^https:\/\//i,b=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,T=(ue,F)=>{try{return new window.URL(ue,F).toString()}catch{return ue}},Q=(ue,F)=>{let ve=V;if(!F||!ce(ue))return ue;ge(ue)&&(ve=se),Te(ue)&&(ve=Y);const je=ve(F),tt=je.charAt(je.length-1)!=="/"&&ue.charAt(0)!=="/"?"/":"";return[je,ue].join(tt)};function V(ue){const F=ue.indexOf("/"),ve=ue.lastIndexOf("/");return F!==-1?ve===F+1?ue:(ue.indexOf("?")!==-1&&(ue=ue.substring(0,ue.indexOf("?"))),ue.substring(0,ve+1)):""}function se(ue){const F=ue.match(b);return F?F[1]:""}function Y(ue){const F=ue.match(u);return F?F[0]:""}function ce(ue){return!u.test(ue)}function ge(ue){return ce(ue)&&ue.charAt(0)==="/"}function Te(ue){return ue.indexOf("//")===0}return(function(){try{new window.URL("x","http://y"),o=T}catch{}finally{o=o||Q}})(),{parseBaseUrl:V,parseOrigin:se,parseScheme:Y,isRelative:ce,isPathAbsolute:ge,isSchemeRelative:Te,isHTTPURL:function(ue){return E.test(ue)},isHTTPS:function(ue){return m.test(ue)},removeHostname:function(ue){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(ue)[2].substring(1)},resolve:function(ue,F){return o(ue,F)}}}f.__dashjs_factory_name="DefaultURLUtils",Re.A=j.A.getSingletonFactory(f)},7393:function(Nt,Re,C){var j=C(138),f=C(7316);function o(){let u;return u={areEqual:function(E,m){return f(E,m)}},u}o.__dashjs_factory_name="ObjectUtils",Re.A=j.A.getSingletonFactory(o)},656:function(Nt,Re,C){C.d(Re,{sq:function(){return f},zQ:function(){return o}});var j=C(5212);function f(u,E){if(typeof u!==E)throw j.A.BAD_ARGUMENT_ERROR}function o(u){if(u===null||isNaN(u)||u%1!=0)throw j.A.BAD_ARGUMENT_ERROR+" : argument is not an integer"}},6503:function(Nt,Re,C){var j=C(138),f=C(9026);function o(){let E,m,b=[];const T=this.context;function Q(V,se,Y){let ce=(function(ge){let Te;for(Te=0;Te<b.length;Te++)if(b[Te].regex.test(ge))return b[Te].utils;return m})(Y||se);return ce&&typeof ce[V]=="function"?ce[V](se,Y):m[V](se,Y)}return m=(0,f.A)(T).getInstance(),E={registerUrlRegex:function(V,se){b.push({regex:V,utils:se})},parseBaseUrl:function(V){return Q("parseBaseUrl",V)},parseOrigin:function(V){return Q("parseOrigin",V)},parseScheme:function(V){return Q("parseScheme",V)},isRelative:function(V){return Q("isRelative",V)},isPathAbsolute:function(V){return Q("isPathAbsolute",V)},isSchemeRelative:function(V){return Q("isSchemeRelative",V)},isHTTPURL:function(V){return Q("isHTTPURL",V)},isHTTPS:function(V){return Q("isHTTPS",V)},removeHostname:function(V){return Q("removeHostname",V)},resolve:function(V,se){return Q("resolve",V,se)}},E}o.__dashjs_factory_name="URLUtils";const u=j.A.getSingletonFactory(o);Re.A=u},1613:function(Nt,Re,C){var j=C(2842);class f extends j.A{constructor(u){super(),this.method=u||null}}Re.A=f},447:function(Nt,Re){Re.A=class{constructor(C){this.url=C.url,this.method=C.method,this.body=C.body!==void 0?C.body:null,this.responseType=C.responseType!==void 0?C.responseType:null,this.headers=C.headers!==void 0?C.headers:{},this.credentials=C.credentials!==void 0?C.credentials:null,this.mode=C.mode!==void 0?C.mode:null,this.timeout=C.timeout!==void 0?C.timeout:0,this.customData=C.customData!==void 0?C.customData:{}}}},5099:function(Nt,Re){Re.A=class{constructor(C){this.request=C.request,this.url=C.url!==void 0?C.url:null,this.redirected=C.redirected!==void 0&&C.redirected,this.status=C.status!==void 0?C.status:null,this.statusText=C.statusText!==void 0?C.statusText:"",this.type=C.type!==void 0?C.type:"",this.headers=C.headers!==void 0?C.headers:{},this.data=C.data!==void 0?C.data:null,this.resourceTiming=C.resourceTiming!==void 0?C.resourceTiming:null}}},1944:function(Nt,Re){Re.A=class{constructor(C,j,f){this.code=C||null,this.message=j||null,this.data=f||null}}},5560:function(Nt,Re,C){var j=C(8854);Re.A=class{constructor(f){this.id=f.id,this.url=f.url,this.language=f.language,this.mimeType=f.mimeType,this.bandwidth=f.bandwidth,this.periodId=f.periodId||null}serializeToMpdParserFormat(){return{tagName:j.A.ADAPTATION_SET,mimeType:this.mimeType,lang:this.language,Representation:[{tagName:j.A.REPRESENTATION,id:this.id,bandwidth:this.bandwidth,BaseURL:[{tagName:j.A.BASE_URL,__text:this.url}],mimeType:this.mimeType}]}}}},2842:function(Nt,Re,C){var j=C(7568);class f{constructor(u){this.action=f.ACTION_DOWNLOAD,this.availabilityEndTime=null,this.availabilityStartTime=null,this.bandwidth=NaN,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.duration=NaN,this.endDate=null,this.firstByteDate=null,this.index=NaN,this.isPartialSegmentRequest=!1,this.mediaStartTime=NaN,this.mediaType=null,this.presentationStartTime=NaN,this.range=null,this.representation=null,this.responseType="arraybuffer",this.retryAttempts=0,this.serviceLocation=null,this.startDate=null,this.startTime=NaN,this.timescale=NaN,this.type=null,this.url=u||null,this.wallStartTime=null}isInitializationRequest(){return this.type&&this.type===j.G.INIT_SEGMENT_TYPE}setInfo(u){this.type=u&&u.init?j.G.INIT_SEGMENT_TYPE:j.G.MEDIA_SEGMENT_TYPE,this.url=u&&u.url?u.url:null,this.range=u&&u.range?u.range.start+"-"+u.range.end:null,this.mediaType=u&&u.mediaType?u.mediaType:null,this.representation=u&&u.representation?u.representation:null}}f.ACTION_DOWNLOAD="download",f.ACTION_COMPLETE="complete",Re.A=f},7568:function(Nt,Re,C){C.d(Re,{G:function(){return j},N:function(){return f}});class j{constructor(){this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this._stream=null,this._tfinish=null,this._mediaduration=null,this._responseHeaders=null,this._serviceLocation=null,this._fileLoaderType=null,this._resourceTimingValues=null,this._cmsd=null}get cmsd(){return this._cmsd}}class f{constructor(){this.s=null,this.d=null,this.b=[]}}j.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",j.CONTENT_STEERING_TYPE="ContentSteering",j.DVB_REPORTING_TYPE="DVBReporting",j.GET="GET",j.POST="POST",j.HEAD="HEAD",j.INDEX_SEGMENT_TYPE="IndexSegment",j.INIT_SEGMENT_TYPE="InitializationSegment",j.LICENSE="license",j.LICENSE_CERTIFICATE="licenseCertificate",j.MEDIA_SEGMENT_TYPE="MediaSegment",j.MPD_TYPE="MPD",j.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",j.CMCD_EVENT="CmcdEvent",j.OTHER_TYPE="other",j.XLINK_EXPANSION_TYPE="XLinkExpansion"}},xs={};function fr(Nt){var Re=xs[Nt];if(Re!==void 0)return Re.exports;var C=xs[Nt]={exports:{}};return au[Nt](C,C.exports,fr),C.exports}fr.d=function(Nt,Re){if(Array.isArray(Re))for(var C=0;C<Re.length;){var j=Re[C++],f=Re[C++],o=f===0?{enumerable:!0,value:Re[C++]}:{enumerable:!0,get:f};fr.o(Nt,j)||Object.defineProperty(Nt,j,o)}else for(var j in Re)fr.o(Re,j)&&!fr.o(Nt,j)&&Object.defineProperty(Nt,j,{enumerable:!0,get:Re[j]})},fr.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})(),fr.o=function(Nt,Re){return Object.prototype.hasOwnProperty.call(Nt,Re)};var Br=fr(5393),Bs=fr(4469),ks=fr(6334),lu=fr(4355);let wi=(function(){const Nt="application/dash+xml";let Re;function C(f,o,u){if(!f||!/^VIDEO$/i.test(f.nodeName))return null;if(f._dashjs_player)return f._dashjs_player;let E,m=f.id||f.name||"video element";if(!(o=o||[].slice.call(f.querySelectorAll("source")).filter(function(b){return b.type==Nt})[0])&&f.src)(o=document.createElement("source")).src=f.src;else if(!o&&!f.src)return null;return u=u||{},E=(0,lu.A)(u).create(),E.initialize(f,o.src,f.autoplay),Re||(Re=E.getDebug().getLogger()),Re.debug("Converted "+m+" to dash.js player and added content: "+o.src),f._dashjs_player=E,E}function j(f){return/^VIDEO$/i.test(f.nodeName)?f:j(f.parentNode)}return{create:C,createAll:function(f,o){let u=[];f=f||"[data-dashjs-player]";let E=(o=o||document).querySelectorAll(f);for(let b=0;b<E.length;b++){let T=C(E[b],null);u.push(T)}let m=o.querySelectorAll('source[type="'+Nt+'"]');for(let b=0;b<m.length;b++){let T=C(j(m[b]),null);u.push(T)}return u}}})();if(typeof window<"u"&&window){let Nt=function(){window.removeEventListener("load",Nt),wi.createAll()},Re=function(){window.dashjs&&(window.clearInterval(C),wi.createAll())},C;(!window.dashjs||!window.dashjs.skipAutoCreate)&&window.addEventListener&&(window.document.readyState==="complete"?window.dashjs?wi.createAll():C=window.setInterval(Re,500):window.addEventListener("load",Nt))}var uu=wi,Gs=fr(649),Ys=fr(5212),qs=fr(559),Vs=fr(5560);Br.Ay.Protection=ks.A,Br.Ay.MetricsReporting=Bs.A,Br.Ay.MediaPlayerFactory=uu,Br.Ay.Debug=Gs.A,Br.Ay.supportsMediaSource=qs.a,Br.Ay.Constants=Ys.A,Br.Ay.ExternalSubtitle=Vs.A,Br.Ay,Ys.A,Gs.A,Vs.A;var Ks=Br.KJ;Bs.A,ks.A,qs.a;const cu=Nt=>Nt===24||Nt>=100&&Nt<=116,du=new Set([10,11,12,15,16,17,18,19,25,26,27,28,29]),fu=new Set([23,35]),gu=new Set([33]),hu="managedMediaSourceStartStreaming";class pu{constructor(Re,C,j,f){Pr(this,"player"),Pr(this,"auto",!0),Pr(this,"extCap",-1),Pr(this,"fitPlayer",!1),Pr(this,"resize",null),Pr(this,"textIndex",-1),Pr(this,"cueTimer",null),Pr(this,"copied",-1),Pr(this,"video"),Pr(this,"syncCues",()=>{var T;const Q=this.textInfos()[this.textIndex];for(const Y of Array.from(this.video.textTracks))Y.mode==="showing"&&this.isDashTrack(Y)&&(Y.mode="hidden");if(!Q||!this.cb.onCues)return;const V=Array.from(this.video.textTracks).find(Y=>this.isDashTrack(Y)&&Y.language===(Q.lang??"")&&Y.label===String(Q.id??Y.label));if(!((T=V?.cues)!=null&&T.length)||V.cues.length===this.copied)return;this.copied=V.cues.length;const se=[];for(const Y of Array.from(V.cues))se.push(new VTTCue(Y.startTime,Y.endTime,Y.text));this.cb.onCues(`dash:${this.textIndex}`,se)});var o,u;this.cb=f;const E=Ks().create();if(this.player=E,this.video=Re,Re.addEventListener("timeupdate",this.syncCues),Re.textTracks.addEventListener("addtrack",this.syncCues),E.updateSettings({streaming:{text:{defaultEnabled:!1}}}),j.cmcd&&E.updateSettings({streaming:{cmcd:{enabled:!0,sid:j.cmcd.sessionId,cid:j.cmcd.contentId??null,mode:j.cmcd.mode??"query"}}}),this.fitPlayer=!!j.fitPlayer,this.fitPlayer&&typeof ResizeObserver<"u"&&(this.resize=new ResizeObserver(()=>this.applyCap()),this.resize.observe(Re)),(o=j.dash)!=null&&o.settings&&E.updateSettings(j.dash.settings),(u=j.dash)!=null&&u.withCredentials)for(const T of["MPD","MediaSegment","InitializationSegment","IndexSegment"])E.setXHRWithCredentialsForType(T,!0);ou(j.drm)&&E.setProtectionData(su(j.drm));const m=Ks.events,b=(T,Q)=>m?.[T]??Q;E.on(b("STREAM_INITIALIZED","streamInitialized"),()=>{this.applyCap(),this.reportLevels(),this.reportAudio(),this.reportText()}),E.on(b("QUALITY_CHANGE_RENDERED","qualityChangeRendered"),(T=>{T.mediaType==="video"&&this.reportLevels()})),E.on(b("TRACK_CHANGE_RENDERED","trackChangeRendered"),(T=>{T.mediaType==="audio"&&this.reportAudio()})),E.on(b("KEY_SYSTEM_SELECTED","public_keySystemSelected"),(T=>{var Q,V,se;const Y=(V=(Q=T.data)==null?void 0:Q.keySystem)==null?void 0:V.systemString;Y&&((se=f.onDrm)==null||se.call(f,Y))})),E.on(b("ERROR","error"),(T=>{var Q,V;const se=Number(((Q=T.error)==null?void 0:Q.code)??0),Y=!gu.has(se);f.onError({code:se,message:String(((V=T.error)==null?void 0:V.message)??"DASH error"),fatal:Y}),Y&&f.onFatal(cu(se)?"drm":du.has(se)?"network":fu.has(se)?"unsupported":"media")})),E.initialize(Re,C,j.autoplay)}reps(){try{return this.player.getRepresentationsByType("video")??[]}catch{return[]}}reportLevels(){const Re=this.reps(),C=this.player.getCurrentRepresentationForType("video"),j=Re.map((f,o)=>({index:o,height:f.height,bitrate:f.bandwidth}));this.cb.onLevels(j,this.auto?-1:Re.findIndex(f=>f.id===C?.id))}reportAudio(){const Re=this.player.getTracksFor("audio")??[],C=this.player.getCurrentTrackFor("audio"),j=Re.map((f,o)=>{var u,E;return{index:o,label:((E=(u=f.labels)==null?void 0:u[0])==null?void 0:E.text)||f.lang||`${o+1}`,lang:f.lang??""}});this.cb.onAudioTracks(j.length>1?j:[],Re.findIndex(f=>f.id===C?.id&&f.lang===C?.lang))}textInfos(){try{return this.player.getTracksFor("text")??[]}catch{return[]}}reportText(){var Re,C;const j=this.textInfos().map((f,o)=>{var u,E;const m=(f.roles??[]).map(b=>String(b.value??"")).join(" ");return{id:`dash:${o}`,kind:/caption/i.test(m)?"captions":"subtitles",label:((E=(u=f.labels)==null?void 0:u[0])==null?void 0:E.text)||"",lang:f.lang??""}});(C=(Re=this.cb).onTextTracks)==null||C.call(Re,j)}selectText(Re){const C=Re!=null&&Re.startsWith("dash:")?Number(Re.slice(5)):-1;this.textIndex=Number.isInteger(C)&&C>=0?C:-1;try{this.textIndex>=0&&"ManagedMediaSource"in window&&this.player.trigger(hu,{},{}),this.player.setTextTrack(this.textIndex)}catch{}this.copied=-1,this.cueTimer&&clearInterval(this.cueTimer),this.cueTimer=this.textIndex>=0?setInterval(this.syncCues,500):null,this.syncCues()}isDashTrack(Re){return this.textInfos().some(C=>String(C.id??"")===Re.label&&(C.lang??"")===Re.language)}setLevel(Re){const C=this.reps()[Re];this.auto=Re<0||!C,this.player.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:this.auto}}}}),this.auto||this.player.setRepresentationForTypeById("video",C.id,!0),this.reportLevels()}setMaxLevel(Re){this.extCap=Re,this.applyCap()}applyCap(){const Re=this.reps();if(!Re.length)return;let C=Re[this.extCap];if(this.fitPlayer&&this.video.clientHeight>0){const f=this.video.clientHeight*(window.devicePixelRatio||1),o=[...Re].sort((E,m)=>E.height-m.height),u=o.find(E=>E.height>=f)??o[o.length-1];(!C||u.bandwidth<C.bandwidth)&&(C=u)}this.player.updateSettings({streaming:{abr:{maxBitrate:{video:C?Math.ceil(C.bandwidth/1e3):-1}}}});const j=this.player.getCurrentRepresentationForType("video");!C||!this.auto||!j||j.bandwidth<=C.bandwidth||(this.player.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!1}}}}),this.player.setRepresentationForTypeById("video",C.id,!0),this.player.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!0}}}}))}setAudioTrack(Re){var C;const j=(C=this.player.getTracksFor("audio"))==null?void 0:C[Re];j&&this.player.setCurrentTrack(j)}currentLevel(){const Re=this.player.getCurrentRepresentationForType("video");return Re?{height:Re.height,bitrate:Re.bandwidth}:null}get isLive(){try{return this.player.isDynamic()}catch{return!1}}destroy(){var Re;this.video.removeEventListener("timeupdate",this.syncCues),(Re=this.resize)==null||Re.disconnect(),this.cueTimer&&clearInterval(this.cueTimer),this.video.textTracks.removeEventListener("addtrack",this.syncCues);try{this.player.destroy()}catch{}}}export{pu as DashEngine};
22
+ //# sourceMappingURL=dash-CWjy-y7B.js.map