@clickview/streamable-learning 0.34.1-dev.1 → 0.35.0-rc.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.
- package/dist/bundles.json +2 -2
- package/dist/css/103-streamable-learning-5060b6cda5.chunk.css +7 -0
- package/dist/css/1269-streamable-learning-a12c4ebc99.chunk.css +2 -0
- package/dist/css/1457-streamable-learning-c8c8b3b9b1.chunk.css +50 -0
- package/dist/css/2334-streamable-learning-de03ae073a.chunk.css +2 -0
- package/dist/css/3322-streamable-learning-510e1aa3f3.chunk.css +34 -0
- package/dist/css/3838-streamable-learning-da10685fe8.chunk.css +22 -0
- package/dist/css/4254-streamable-learning-e493f4a027.chunk.css +2 -0
- package/dist/css/4607-streamable-learning-2605302fc2.chunk.css +90 -0
- package/dist/css/4772-streamable-learning-f83b838d71.chunk.css +9 -0
- package/dist/css/5003-streamable-learning-b38d2ddbbe.chunk.css +98 -0
- package/dist/css/5565-streamable-learning-0caae3809b.chunk.css +13 -0
- package/dist/css/6017-streamable-learning-098a205d01.chunk.css +6 -0
- package/dist/css/6356-streamable-learning-8c5b220bf6.chunk.css +1 -0
- package/dist/css/6987-streamable-learning-8f682301c6.chunk.css +1 -0
- package/dist/css/7317-streamable-learning-b5d226bbb6.chunk.css +5 -0
- package/dist/css/8058-streamable-learning-539cf7be18.chunk.css +12 -0
- package/dist/css/8294-streamable-learning-c797263ac2.chunk.css +1 -0
- package/dist/css/8496-streamable-learning-ce19f6ca52.chunk.css +13 -0
- package/dist/css/8601-streamable-learning-f525210660.chunk.css +6 -0
- package/dist/css/9514-streamable-learning-251703c6d1.chunk.css +2 -0
- package/dist/css/9766-streamable-learning-31650ffe5d.chunk.css +8 -0
- package/dist/css/9842-streamable-learning-24729103f7.chunk.css +4 -0
- package/dist/css/9899-streamable-learning-0338f8d2dc.chunk.css +4 -0
- package/dist/css/streamable-learning-dd0c1095d5.css +23 -0
- package/dist/languages/en.json +1 -0
- package/dist/scripts/103-aceced8961-streamable-learning.chunk.js +1 -0
- package/dist/scripts/1097-680a971192-streamable-learning.chunk.js +2 -0
- package/dist/scripts/1097-680a971192-streamable-learning.chunk.js.LICENSE.txt +105 -0
- package/dist/scripts/1269-2d0b903343-streamable-learning.chunk.js +2 -0
- package/dist/scripts/1269-2d0b903343-streamable-learning.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/1457-899f40d09a-streamable-learning.chunk.js +1 -0
- package/dist/scripts/1482-b1dd75897c-streamable-learning.chunk.js +1 -0
- package/dist/scripts/1934-fc017df0da-streamable-learning.chunk.js +2 -0
- package/dist/scripts/1934-fc017df0da-streamable-learning.chunk.js.LICENSE.txt +9 -0
- package/dist/scripts/2042-d51622d63e-streamable-learning.chunk.js +1 -0
- package/dist/scripts/2087-eba9033b1c-streamable-learning.chunk.js +1 -0
- package/dist/scripts/2245-8cd3224e1b-streamable-learning.chunk.js +1 -0
- package/dist/scripts/2334-00b028191d-streamable-learning.chunk.js +1 -0
- package/dist/scripts/2676-c842ec7e8d-streamable-learning.chunk.js +2 -0
- package/dist/scripts/2676-c842ec7e8d-streamable-learning.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/2877-5ffc9711f6-streamable-learning.chunk.js +1 -0
- package/dist/scripts/2911-2ec3a6600a-streamable-learning.chunk.js +1 -0
- package/dist/scripts/3057-731a8ca978-streamable-learning.chunk.js +1 -0
- package/dist/scripts/3093-efbcc927ea-streamable-learning.chunk.js +1 -0
- package/dist/scripts/3186-d1a6ccffde-streamable-learning.chunk.js +1 -0
- package/dist/scripts/3322-33c015dec9-streamable-learning.chunk.js +1 -0
- package/dist/scripts/3472-50ca92bde3-streamable-learning.chunk.js +1 -0
- package/dist/scripts/3838-4a38f33dc2-streamable-learning.chunk.js +1 -0
- package/dist/scripts/3941-2ef15ca9ac-streamable-learning.chunk.js +1 -0
- package/dist/scripts/4254-ef581b8105-streamable-learning.chunk.js +1 -0
- package/dist/scripts/4607-a4edb06dba-streamable-learning.chunk.js +2 -0
- package/dist/scripts/4607-a4edb06dba-streamable-learning.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/4772-3cb280f959-streamable-learning.chunk.js +2 -0
- package/dist/scripts/4772-3cb280f959-streamable-learning.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/4951-df701c6a8d-streamable-learning.chunk.js +1 -0
- package/dist/scripts/5003-7468a75d64-streamable-learning.chunk.js +2 -0
- package/dist/scripts/5003-7468a75d64-streamable-learning.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/5088-2e09e1ba6e-streamable-learning.chunk.js +1 -0
- package/dist/scripts/5173-a800a17d0d-streamable-learning.chunk.js +1 -0
- package/dist/scripts/5446-2cbe9f9d1b-streamable-learning.chunk.js +1 -0
- package/dist/scripts/5543-205aaa36a6-streamable-learning.chunk.js +1 -0
- package/dist/scripts/5565-224d86dc1b-streamable-learning.chunk.js +1 -0
- package/dist/scripts/578-2cc99f46f7-streamable-learning.chunk.js +1 -0
- package/dist/scripts/6017-5bd6f9bf7a-streamable-learning.chunk.js +2 -0
- package/dist/scripts/6017-5bd6f9bf7a-streamable-learning.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/6356-eefa3ff22e-streamable-learning.chunk.js +1 -0
- package/dist/scripts/6979-ef9a3931a2-streamable-learning.chunk.js +2 -0
- package/dist/scripts/6979-ef9a3931a2-streamable-learning.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/6987-e58de31cfe-streamable-learning.chunk.js +1 -0
- package/dist/scripts/7317-6b7186c85d-streamable-learning.chunk.js +1 -0
- package/dist/scripts/7347-772848ba8a-streamable-learning.chunk.js +1 -0
- package/dist/scripts/7570-cd4f70ff52-streamable-learning.chunk.js +2 -0
- package/dist/scripts/7570-cd4f70ff52-streamable-learning.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/7904-96574373ca-streamable-learning.chunk.js +1 -0
- package/dist/scripts/7925-1e1cfa2a04-streamable-learning.chunk.js +1 -0
- package/dist/scripts/8058-51c4b442d6-streamable-learning.chunk.js +1 -0
- package/dist/scripts/8126-9d09959b28-streamable-learning.chunk.js +2 -0
- package/dist/scripts/8126-9d09959b28-streamable-learning.chunk.js.LICENSE.txt +60 -0
- package/dist/scripts/8397-39ce77876d-streamable-learning.chunk.js +1 -0
- package/dist/scripts/8496-1b2519f9fd-streamable-learning.chunk.js +2 -0
- package/dist/scripts/8496-1b2519f9fd-streamable-learning.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/8599-b74e1ab6e3-streamable-learning.chunk.js +1 -0
- package/dist/scripts/8601-37783cf18b-streamable-learning.chunk.js +1 -0
- package/dist/scripts/8819-2a50dd6a9b-streamable-learning.chunk.js +1 -0
- package/dist/scripts/8937-5103db88d8-streamable-learning.chunk.js +1 -0
- package/dist/scripts/9390-bbaf07ad0f-streamable-learning.chunk.js +1 -0
- package/dist/scripts/9514-a31ca9af06-streamable-learning.chunk.js +1 -0
- package/dist/scripts/9766-48d72d9285-streamable-learning.chunk.js +2 -0
- package/dist/scripts/9766-48d72d9285-streamable-learning.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/9842-36d830ee87-streamable-learning.chunk.js +1 -0
- package/dist/scripts/9899-f33e8f1d43-streamable-learning.chunk.js +2 -0
- package/dist/scripts/9899-f33e8f1d43-streamable-learning.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/bundle-7ea4deeaa8.min.js +2 -0
- package/dist/scripts/bundle-7ea4deeaa8.min.js.LICENSE.txt +108 -0
- package/dist/scripts/pdf.worker.entry-a2092a6670.min.worker.js +2 -0
- package/dist/scripts/pdf.worker.entry-a2092a6670.min.worker.js.LICENSE.txt +21 -0
- package/package.json +3 -5
- package/typings/utils/imports.d.ts +1 -2
- package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/css/B-attovs.chunk.css +0 -9
- package/dist/css/B1NucFMn.chunk.css +0 -1
- package/dist/css/BPdg7JW4.chunk.css +0 -1
- package/dist/css/BPrUSCaY.chunk.css +0 -1
- package/dist/css/BR0fUt9D.chunk.css +0 -1
- package/dist/css/BhYm6SRm.chunk.css +0 -1
- package/dist/css/BiRz4h1c.chunk.css +0 -1
- package/dist/css/Bq1ChJn4.chunk.css +0 -1
- package/dist/css/Bt85j9js.chunk.css +0 -1
- package/dist/css/BuYrqi9E.chunk.css +0 -1
- package/dist/css/BugV1Bpa.chunk.css +0 -1
- package/dist/css/BuuVPl7n.chunk.css +0 -1
- package/dist/css/C1NkrNqQ.chunk.css +0 -1
- package/dist/css/C1qv5jz5.chunk.css +0 -1
- package/dist/css/C7XoyEPr.chunk.css +0 -1
- package/dist/css/C7_MDu56.chunk.css +0 -1
- package/dist/css/CC5F5C8O.chunk.css +0 -1
- package/dist/css/CChSC6Ta.chunk.css +0 -1
- package/dist/css/CCsCPLDG.chunk.css +0 -1
- package/dist/css/CD1qrI1T.chunk.css +0 -1
- package/dist/css/CKqvCBj4.chunk.css +0 -1
- package/dist/css/CLZ0Ycds.chunk.css +0 -1
- package/dist/css/CO7M4rZW.chunk.css +0 -1
- package/dist/css/CY0yvCW4.chunk.css +0 -1
- package/dist/css/CYGsw8FT.chunk.css +0 -1
- package/dist/css/Cbi3KYBa.chunk.css +0 -1
- package/dist/css/CliS8Q8r.chunk.css +0 -1
- package/dist/css/D-kQKsZN.chunk.css +0 -1
- package/dist/css/D2NwUVrK.chunk.css +0 -1
- package/dist/css/D4g1IoUU.chunk.css +0 -1
- package/dist/css/DBgpcO3T.chunk.css +0 -1
- package/dist/css/DDnpOnVB.chunk.css +0 -1
- package/dist/css/DZJSONGP.chunk.css +0 -1
- package/dist/css/Dc0zNt2E.chunk.css +0 -1
- package/dist/css/DeAfaPiD.chunk.css +0 -1
- package/dist/css/Dj731zLm.chunk.css +0 -1
- package/dist/css/DjPPxa0A.chunk.css +0 -1
- package/dist/css/DlOtoSz0.chunk.css +0 -1
- package/dist/css/DwduQat7.chunk.css +0 -1
- package/dist/css/Dzuu2GTx.chunk.css +0 -1
- package/dist/css/JAvsJreH.chunk.css +0 -1
- package/dist/css/NKlFYVOc.chunk.css +0 -1
- package/dist/css/VZd8qGtK.chunk.css +0 -1
- package/dist/css/Y7U--2na.chunk.css +0 -1
- package/dist/css/ir3IcK_l.chunk.css +0 -1
- package/dist/css/jbMisi9r.chunk.css +0 -1
- package/dist/css/kS5aDtIJ.chunk.css +0 -1
- package/dist/css/mqCL1o7m.chunk.css +0 -1
- package/dist/css/qZzkUeZk.chunk.css +0 -1
- package/dist/css/sC_H3yXE.chunk.css +0 -1
- package/dist/css/wR_6C_NV.chunk.css +0 -1
- package/dist/en.json +0 -1
- package/dist/scripts/-Oi3rE3V.chunk.js +0 -5
- package/dist/scripts/-Oi3rE3V.chunk.js.map +0 -1
- package/dist/scripts/-cwk-1Iv.chunk.js +0 -2
- package/dist/scripts/-cwk-1Iv.chunk.js.map +0 -1
- package/dist/scripts/4oi1ldJ4.chunk.js +0 -3
- package/dist/scripts/4oi1ldJ4.chunk.js.map +0 -1
- package/dist/scripts/6UeJLeAd.chunk.js +0 -2
- package/dist/scripts/6UeJLeAd.chunk.js.map +0 -1
- package/dist/scripts/8zar0u1i.chunk.js +0 -2
- package/dist/scripts/8zar0u1i.chunk.js.map +0 -1
- package/dist/scripts/9NIa7Pi_.chunk.js +0 -2
- package/dist/scripts/9NIa7Pi_.chunk.js.map +0 -1
- package/dist/scripts/B5OOLcT3.chunk.js +0 -2
- package/dist/scripts/B5OOLcT3.chunk.js.map +0 -1
- package/dist/scripts/B8XJmK96.chunk.js +0 -8
- package/dist/scripts/B8XJmK96.chunk.js.map +0 -1
- package/dist/scripts/BA6k9XoA.chunk.js +0 -2
- package/dist/scripts/BA6k9XoA.chunk.js.map +0 -1
- package/dist/scripts/BBnDr_iy.chunk.js +0 -2
- package/dist/scripts/BBnDr_iy.chunk.js.map +0 -1
- package/dist/scripts/BEL0opwe.chunk.js +0 -2
- package/dist/scripts/BEL0opwe.chunk.js.map +0 -1
- package/dist/scripts/BHmtLW9C.chunk.js +0 -2
- package/dist/scripts/BHmtLW9C.chunk.js.map +0 -1
- package/dist/scripts/BJ0C6oH6.chunk.js +0 -2
- package/dist/scripts/BJ0C6oH6.chunk.js.map +0 -1
- package/dist/scripts/BPcJv8Nj.chunk.js +0 -2
- package/dist/scripts/BPcJv8Nj.chunk.js.map +0 -1
- package/dist/scripts/BQQ9SPei.chunk.js +0 -10
- package/dist/scripts/BQQ9SPei.chunk.js.map +0 -1
- package/dist/scripts/BQQZ0Zva.chunk.js +0 -2
- package/dist/scripts/BQQZ0Zva.chunk.js.map +0 -1
- package/dist/scripts/BRKKXF-k.chunk.js +0 -2
- package/dist/scripts/BRKKXF-k.chunk.js.map +0 -1
- package/dist/scripts/BUhbk0mt.chunk.js +0 -2
- package/dist/scripts/BUhbk0mt.chunk.js.map +0 -1
- package/dist/scripts/BXKrMYdw.chunk.js +0 -2
- package/dist/scripts/BXKrMYdw.chunk.js.map +0 -1
- package/dist/scripts/B_eK8A25.chunk.js +0 -2
- package/dist/scripts/B_eK8A25.chunk.js.map +0 -1
- package/dist/scripts/BbjveACT.chunk.js +0 -2
- package/dist/scripts/BbjveACT.chunk.js.map +0 -1
- package/dist/scripts/BdHxGaRy.chunk.js +0 -2
- package/dist/scripts/BdHxGaRy.chunk.js.map +0 -1
- package/dist/scripts/BeHz9c4V.chunk.js +0 -2
- package/dist/scripts/BeHz9c4V.chunk.js.map +0 -1
- package/dist/scripts/BexFb8rj.chunk.js +0 -2
- package/dist/scripts/BexFb8rj.chunk.js.map +0 -1
- package/dist/scripts/Bi8YRFeY.chunk.js +0 -2
- package/dist/scripts/Bi8YRFeY.chunk.js.map +0 -1
- package/dist/scripts/Bj3i6I7i.chunk.js +0 -2
- package/dist/scripts/Bj3i6I7i.chunk.js.map +0 -1
- package/dist/scripts/BktU87GA.chunk.js +0 -2
- package/dist/scripts/BktU87GA.chunk.js.map +0 -1
- package/dist/scripts/Bl1HvG0b.chunk.js +0 -2
- package/dist/scripts/Bl1HvG0b.chunk.js.map +0 -1
- package/dist/scripts/BnWlQ7-4.chunk.js +0 -2
- package/dist/scripts/BnWlQ7-4.chunk.js.map +0 -1
- package/dist/scripts/BoqzK1u7.chunk.js +0 -2
- package/dist/scripts/BoqzK1u7.chunk.js.map +0 -1
- package/dist/scripts/Bsa3zcW0.chunk.js +0 -2
- package/dist/scripts/Bsa3zcW0.chunk.js.map +0 -1
- package/dist/scripts/Bt3kaRtU.chunk.js +0 -6
- package/dist/scripts/Bt3kaRtU.chunk.js.map +0 -1
- package/dist/scripts/BtiKTu8r.chunk.js +0 -2
- package/dist/scripts/BtiKTu8r.chunk.js.map +0 -1
- package/dist/scripts/BwOoIPmc.chunk.js +0 -2
- package/dist/scripts/BwOoIPmc.chunk.js.map +0 -1
- package/dist/scripts/BwuSNwcs.chunk.js +0 -2
- package/dist/scripts/BwuSNwcs.chunk.js.map +0 -1
- package/dist/scripts/Byn8R7bs.chunk.js +0 -2
- package/dist/scripts/Byn8R7bs.chunk.js.map +0 -1
- package/dist/scripts/C2Zu5vKc.chunk.js +0 -2
- package/dist/scripts/C2Zu5vKc.chunk.js.map +0 -1
- package/dist/scripts/C2uxO8e2.chunk.js +0 -2
- package/dist/scripts/C2uxO8e2.chunk.js.map +0 -1
- package/dist/scripts/C35NlkUr.chunk.js +0 -2
- package/dist/scripts/C35NlkUr.chunk.js.map +0 -1
- package/dist/scripts/C5QPXJGU.chunk.js +0 -15
- package/dist/scripts/C5QPXJGU.chunk.js.map +0 -1
- package/dist/scripts/C6mGMCz4.chunk.js +0 -2
- package/dist/scripts/C6mGMCz4.chunk.js.map +0 -1
- package/dist/scripts/C8ZuWYfb.chunk.js +0 -2
- package/dist/scripts/C8ZuWYfb.chunk.js.map +0 -1
- package/dist/scripts/CEmtkty-.chunk.js +0 -2
- package/dist/scripts/CEmtkty-.chunk.js.map +0 -1
- package/dist/scripts/CICkmQW6.chunk.js +0 -2
- package/dist/scripts/CICkmQW6.chunk.js.map +0 -1
- package/dist/scripts/CLumRL-T.chunk.js +0 -2
- package/dist/scripts/CLumRL-T.chunk.js.map +0 -1
- package/dist/scripts/CO_D2O4I.chunk.js +0 -2
- package/dist/scripts/CO_D2O4I.chunk.js.map +0 -1
- package/dist/scripts/CPXlV0fg.chunk.js +0 -2
- package/dist/scripts/CPXlV0fg.chunk.js.map +0 -1
- package/dist/scripts/CQZOieOF.chunk.js +0 -2
- package/dist/scripts/CQZOieOF.chunk.js.map +0 -1
- package/dist/scripts/CQoWqq54.chunk.js +0 -2
- package/dist/scripts/CQoWqq54.chunk.js.map +0 -1
- package/dist/scripts/CRT9qru0.chunk.js +0 -2
- package/dist/scripts/CRT9qru0.chunk.js.map +0 -1
- package/dist/scripts/CU6iZ8MR.chunk.js +0 -2
- package/dist/scripts/CU6iZ8MR.chunk.js.map +0 -1
- package/dist/scripts/CUltMbyK.chunk.js +0 -2
- package/dist/scripts/CUltMbyK.chunk.js.map +0 -1
- package/dist/scripts/CW7x8M-z.chunk.js +0 -2
- package/dist/scripts/CW7x8M-z.chunk.js.map +0 -1
- package/dist/scripts/CYlwi5iC.chunk.js +0 -7
- package/dist/scripts/CYlwi5iC.chunk.js.map +0 -1
- package/dist/scripts/CgJckl-g.chunk.js +0 -2
- package/dist/scripts/CgJckl-g.chunk.js.map +0 -1
- package/dist/scripts/Cj5ETNHP.chunk.js +0 -2
- package/dist/scripts/Cj5ETNHP.chunk.js.map +0 -1
- package/dist/scripts/Cmu1J2M7.chunk.js +0 -262
- package/dist/scripts/Cmu1J2M7.chunk.js.map +0 -1
- package/dist/scripts/Cr8fUgj9.chunk.js +0 -2
- package/dist/scripts/Cr8fUgj9.chunk.js.map +0 -1
- package/dist/scripts/CtM_cXum.chunk.js +0 -2
- package/dist/scripts/CtM_cXum.chunk.js.map +0 -1
- package/dist/scripts/Cv1FGdNu.chunk.js +0 -2
- package/dist/scripts/Cv1FGdNu.chunk.js.map +0 -1
- package/dist/scripts/CvPDjx7y.chunk.js +0 -2
- package/dist/scripts/CvPDjx7y.chunk.js.map +0 -1
- package/dist/scripts/D0bydDVL.chunk.js +0 -2
- package/dist/scripts/D0bydDVL.chunk.js.map +0 -1
- package/dist/scripts/D1EE4AEz.chunk.js +0 -356
- package/dist/scripts/D1EE4AEz.chunk.js.map +0 -1
- package/dist/scripts/D84-WY3k.chunk.js +0 -2
- package/dist/scripts/D84-WY3k.chunk.js.map +0 -1
- package/dist/scripts/DAh7Ea13.chunk.js +0 -2
- package/dist/scripts/DAh7Ea13.chunk.js.map +0 -1
- package/dist/scripts/DBIkG3Bu.chunk.js +0 -2
- package/dist/scripts/DBIkG3Bu.chunk.js.map +0 -1
- package/dist/scripts/DCcI7sWt.chunk.js +0 -2
- package/dist/scripts/DCcI7sWt.chunk.js.map +0 -1
- package/dist/scripts/DEP24A-f.chunk.js +0 -2
- package/dist/scripts/DEP24A-f.chunk.js.map +0 -1
- package/dist/scripts/DGFORsAE.chunk.js +0 -2
- package/dist/scripts/DGFORsAE.chunk.js.map +0 -1
- package/dist/scripts/DGaf-Jy9.chunk.js +0 -2
- package/dist/scripts/DGaf-Jy9.chunk.js.map +0 -1
- package/dist/scripts/DJyZ6Hx7.chunk.js +0 -2
- package/dist/scripts/DJyZ6Hx7.chunk.js.map +0 -1
- package/dist/scripts/DOCam-GK.chunk.js +0 -2
- package/dist/scripts/DOCam-GK.chunk.js.map +0 -1
- package/dist/scripts/DSLX3H2r.chunk.js +0 -2
- package/dist/scripts/DSLX3H2r.chunk.js.map +0 -1
- package/dist/scripts/DSq4f4jm.chunk.js +0 -2
- package/dist/scripts/DSq4f4jm.chunk.js.map +0 -1
- package/dist/scripts/DXxBqeLg.chunk.js +0 -2
- package/dist/scripts/DXxBqeLg.chunk.js.map +0 -1
- package/dist/scripts/DZ6Jrm23.chunk.js +0 -2
- package/dist/scripts/DZ6Jrm23.chunk.js.map +0 -1
- package/dist/scripts/Daes5Wgy.chunk.js +0 -2
- package/dist/scripts/Daes5Wgy.chunk.js.map +0 -1
- package/dist/scripts/DeUbJqVo.chunk.js +0 -2
- package/dist/scripts/DeUbJqVo.chunk.js.map +0 -1
- package/dist/scripts/DgEqkZy0.chunk.js +0 -8
- package/dist/scripts/DgEqkZy0.chunk.js.map +0 -1
- package/dist/scripts/DhB-Uugx.chunk.js +0 -2
- package/dist/scripts/DhB-Uugx.chunk.js.map +0 -1
- package/dist/scripts/DhqAA1wT.chunk.js +0 -2
- package/dist/scripts/DhqAA1wT.chunk.js.map +0 -1
- package/dist/scripts/Di5-l4QJ.chunk.js +0 -2
- package/dist/scripts/Di5-l4QJ.chunk.js.map +0 -1
- package/dist/scripts/DiQkAtUx.chunk.js +0 -53
- package/dist/scripts/DiQkAtUx.chunk.js.map +0 -1
- package/dist/scripts/DireiQEp.chunk.js +0 -2
- package/dist/scripts/DireiQEp.chunk.js.map +0 -1
- package/dist/scripts/Dj66TI5y.chunk.js +0 -2
- package/dist/scripts/Dj66TI5y.chunk.js.map +0 -1
- package/dist/scripts/DkFkYS-j.chunk.js +0 -2
- package/dist/scripts/DkFkYS-j.chunk.js.map +0 -1
- package/dist/scripts/Dkq5GtOV.chunk.js +0 -2
- package/dist/scripts/Dkq5GtOV.chunk.js.map +0 -1
- package/dist/scripts/DmSSmUHZ.chunk.js +0 -2
- package/dist/scripts/DmSSmUHZ.chunk.js.map +0 -1
- package/dist/scripts/DoQU9vjn.chunk.js +0 -2
- package/dist/scripts/DoQU9vjn.chunk.js.map +0 -1
- package/dist/scripts/DtHh_hpg.chunk.js +0 -2
- package/dist/scripts/DtHh_hpg.chunk.js.map +0 -1
- package/dist/scripts/DvDdiDQN.chunk.js +0 -7
- package/dist/scripts/DvDdiDQN.chunk.js.map +0 -1
- package/dist/scripts/DwhG2uva.chunk.js +0 -2
- package/dist/scripts/DwhG2uva.chunk.js.map +0 -1
- package/dist/scripts/DxJlWHZr.chunk.js +0 -2
- package/dist/scripts/DxJlWHZr.chunk.js.map +0 -1
- package/dist/scripts/DxmeZ4C9.chunk.js +0 -2
- package/dist/scripts/DxmeZ4C9.chunk.js.map +0 -1
- package/dist/scripts/KuveJuNy.chunk.js +0 -2
- package/dist/scripts/KuveJuNy.chunk.js.map +0 -1
- package/dist/scripts/LKCLmV2A.chunk.js +0 -2
- package/dist/scripts/LKCLmV2A.chunk.js.map +0 -1
- package/dist/scripts/RnuR8yr3.chunk.js +0 -2
- package/dist/scripts/RnuR8yr3.chunk.js.map +0 -1
- package/dist/scripts/XxrnElSv.chunk.js +0 -2
- package/dist/scripts/XxrnElSv.chunk.js.map +0 -1
- package/dist/scripts/YF_QoXEj.chunk.js +0 -3
- package/dist/scripts/YF_QoXEj.chunk.js.map +0 -1
- package/dist/scripts/Z2sDSVPb.chunk.js +0 -2
- package/dist/scripts/Z2sDSVPb.chunk.js.map +0 -1
- package/dist/scripts/Zbze2j9b.chunk.js +0 -2
- package/dist/scripts/Zbze2j9b.chunk.js.map +0 -1
- package/dist/scripts/app-C56EnOMP.js +0 -216
- package/dist/scripts/app-C56EnOMP.js.map +0 -1
- package/dist/scripts/cvX-F_mx.chunk.js +0 -2
- package/dist/scripts/cvX-F_mx.chunk.js.map +0 -1
- package/dist/scripts/h34ZSRKe.chunk.js +0 -2
- package/dist/scripts/h34ZSRKe.chunk.js.map +0 -1
- package/dist/scripts/leubTuJo.chunk.js +0 -2
- package/dist/scripts/leubTuJo.chunk.js.map +0 -1
- package/dist/scripts/m5XtnRaH.chunk.js +0 -2
- package/dist/scripts/m5XtnRaH.chunk.js.map +0 -1
- package/dist/scripts/nay4aGaa.chunk.js +0 -2
- package/dist/scripts/nay4aGaa.chunk.js.map +0 -1
- package/dist/scripts/p61U8kXz.chunk.js +0 -2
- package/dist/scripts/p61U8kXz.chunk.js.map +0 -1
- package/dist/scripts/pkzD5BEm.chunk.js +0 -2
- package/dist/scripts/pkzD5BEm.chunk.js.map +0 -1
- package/dist/scripts/sc9-PV9Y.chunk.js +0 -2
- package/dist/scripts/sc9-PV9Y.chunk.js.map +0 -1
- package/dist/scripts/tAsRziXo.chunk.js +0 -8
- package/dist/scripts/tAsRziXo.chunk.js.map +0 -1
- package/dist/scripts/xrHhD6CF.chunk.js +0 -8
- package/dist/scripts/xrHhD6CF.chunk.js.map +0 -1
- package/dist/scripts/xxo027lm.chunk.js +0 -2
- package/dist/scripts/xxo027lm.chunk.js.map +0 -1
- package/vite.config.ts +0 -6
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
import{bz as sa,c as Kt,a5 as xl,a6 as Ww,bJ as Gw,cF as t0,o as Vr,aD as i0,R as at,a1 as Rm,cG as Kw,n as Xw,j as te,ah as gi,cH as Yw,T as Ar,ad as Hs,O as bp,z as Bm,F as Fm,cI as Qw,ar as Sp,M as En,cJ as Av,L as r0,J as n0,b6 as Jw,k as Jt,i as xi,h as Ir,D as Iv,l as rs,m as s0,d as Zw,b5 as a0,aJ as ia,b4 as Al,ag as qi,cK as vt,e as o0,cL as qs,cM as Pv,cN as ek,cO as Dv,cP as tk,cQ as l0,cR as we,cS as We,cT as ra,bM as Nv,cU as ik,cV as rk,cW as nk,cX as sk,cY as ak,cZ as ok,c_ as lk,c$ as uk,d0 as ck,d1 as hk,d2 as dk,d3 as fk,d4 as pk,d5 as mk,d6 as gk,d7 as vk,bX as yk,g as _k,Y as u0,ac as c0,d8 as Tk,au as bk,aw as Sk,ak as h0,d9 as Hu,a3 as Ck,bj as qu,I as d0,bn as Ek,da as wk,db as kk,aK as xk,x as Um,W as Cp,X as Ep,a0 as Wd,V as Ak,a4 as Ik,s as Pk,dc as Dk,v as Nk,w as Lk,a2 as Ok,$ as Mk,bg as Rk}from"./app-C56EnOMP.js";import{P as Bk}from"./pkzD5BEm.chunk.js";import{V as it}from"./DxJlWHZr.chunk.js";import{A as Fk}from"./DmSSmUHZ.chunk.js";import{V as wp}from"./DGFORsAE.chunk.js";import{R as Uk}from"./Cj5ETNHP.chunk.js";import{u as $k}from"./BtiKTu8r.chunk.js";import{b as jk,V as Vk,B as Hk,A as qk,P as zk,u as Wk}from"./4oi1ldJ4.chunk.js";import{S as Gk}from"./C8ZuWYfb.chunk.js";import{s as Kk,T as Xk}from"./D0bydDVL.chunk.js";import{T as Lv}from"./Z2sDSVPb.chunk.js";import{D as f0}from"./leubTuJo.chunk.js";import{L as Yk}from"./-Oi3rE3V.chunk.js";import{c as Qk,F as Jk,R as Zk,W as ex}from"./tAsRziXo.chunk.js";import{A as tx}from"./CRT9qru0.chunk.js";import{r as ix,_ as rx,a as nx}from"./BQQZ0Zva.chunk.js";import{r as p0}from"./CW7x8M-z.chunk.js";import{C as sx}from"./CLumRL-T.chunk.js";import"./BUhbk0mt.chunk.js";import{D as ax}from"./DBIkG3Bu.chunk.js";import{G as ox}from"./6UeJLeAd.chunk.js";import{D as lx}from"./h34ZSRKe.chunk.js";import{C as ux}from"./CUltMbyK.chunk.js";import{b as cx}from"./BwuSNwcs.chunk.js";import{u as hx}from"./BPcJv8Nj.chunk.js";import{u as m0}from"./Di5-l4QJ.chunk.js";import"./CEmtkty-.chunk.js";import"./RnuR8yr3.chunk.js";import"./m5XtnRaH.chunk.js";import"./8zar0u1i.chunk.js";import"./DXxBqeLg.chunk.js";import"./BdHxGaRy.chunk.js";import"./sc9-PV9Y.chunk.js";import"./DSq4f4jm.chunk.js";import"./-cwk-1Iv.chunk.js";import"./B5OOLcT3.chunk.js";import"./CU6iZ8MR.chunk.js";import"./BexFb8rj.chunk.js";import"./cvX-F_mx.chunk.js";import"./DkFkYS-j.chunk.js";import"./9NIa7Pi_.chunk.js";var g0=(s=>(s.Share="share",s.MasterObject="masterobject",s))(g0||{});const Gd="shared.videoNotFoundError";class dx extends sa{constructor(){super(Kt.getPhrase(Gd,"title"))}get name(){return"VideoNotFoundError"}get heading(){return Kt.getPhrase(Gd,"heading")}get description(){return Kt.getPhrase(Gd,"description")}}const fx="shared.videoPrivateError",Ga=Kt.encloseNamespace(fx);function Ov(s){return it.isClip(s)?Ga("clipTitle"):it.isInteractive(s)?Ga("interactiveTitle"):Ga("videoTitle")}function px(s){return it.isClip(s)?Ga("clipDescription"):it.isInteractive(s)?Ga("interactiveDescription"):Ga("videoDescription")}class v0 extends sa{constructor(e){super(Ov(e)),this.video=e}get name(){return"VideoPrivateError"}get heading(){return Ov(this.video)}get description(){return px(this.video)}}const mx={createViewKey(s,e,t,r,i){const n={mediaId:s.toString(),mediaIdType:e};return t&&(n.shareContextId=t),{url:"/api/player/create-view-key",key:`view:key:${s}:${e}`,type:xl.POST,data:n,cacheDuration:28800,success:r,error:i}}},gx={theme(s){return{url:`/api/domain/v1/themes/${s}`,key:`themes:${s}`}},themeImages(s,e){return{url:Ww.urlBuilder("/api/domain/v1/themes",{name:s,type:e}),key:`themes:${s}:${e}`}},themes(s){let e="/api/domain/v1/themes",t="themes";return s&&(e+=`?type=${s}`,t+=`:type:${s}`),{url:e,key:t,formatData:r=>r.sort((i,n)=>i.name.localeCompare(n.name))}},createTheme(s,e,t,r){return{url:"/api/domain/v1/themes",key:"theme",data:s,type:xl.POST,invalidationKeys:"themes",success:e,error:t,always:r}},updateTheme(s,e,t,r,i){return{url:`/api/domain/v1/themes/${s}`,key:`update:theme:${s}`,data:e,type:xl.PUT,success:t,error:r,always:i}},deleteTheme(s,e,t,r){return{url:`/api/domain/v1/themes/${s}`,key:`delete:theme:${s}`,type:xl.DELETE,invalidationKeys:"themes",success:e,error:t,always:r}}};var y0=(s=>(s.Integrations="4407268725529",s.Classrooms="4405362551833",s.MakeInteractive="4405370510873",s.EditSsoAccounts="8202605666073",s.UploadToLibraryEditor="10672936659865",s.AddFromLite="10671345281561",s.ManageSsoYearGroups="14691130889241",s.ContentReview="18525199576601",s.ContentPermissions="14692125209497",s.AccessSettings="27927466562201",s.ContentGuidelines="24133696186009",s.FoxtelFaq="24133519542169",s.ViviIntegration="23826297956377",s.AppleTvIntegration="25832373739929",s.RssFeed="32567445635097",s.ManageGroupPermissions="35407217335705",s.MarcFormatDifferences="48276917260441",s.ExportLibraries="17684275853465",s.StudentSharingGuide="50326395499417",s.Sharing="49512742828953",s))(y0||{});const zu="shared.restrictedLibraryError";class vx extends sa{constructor(){super(Kt.getPhrase(zu,"title"))}get name(){return"RestrictedLibraryError"}get heading(){return Kt.getPhrase(zu,"heading")}get description(){return Kt.getPhrase(zu,"description")}get cta(){return{text:Kt.getPhrase(zu,"cta"),url:Gw.getLiteArticle(y0.StudentSharingGuide),openInNewTab:!0}}}const yx="shared.loginRequired",Il=Kt.encloseNamespace(yx);function _x(s){return it.isClip(s)?Il("clipDescription"):it.isInteractive(s)?Il("interactiveDescription"):Il("videoDescription")}class kp extends t0{constructor(e){super(Il("title")),this.video=e}get name(){return"LoginRequiredError"}get heading(){return Il("title")}get description(){return _x(this.video)}}const Tx="shared.videoNotInSubscriptionError",Mv=Kt.encloseNamespace(Tx);class bx extends sa{constructor(e){super("VideoNotInSubscriptionError"),this.video=e}get name(){return"VideoNotInSubscriptionError"}get heading(){return Mv("title")}get description(){return Mv("description")}}const Sx="shared.parentVideoDeletedError",Ka=Kt.encloseNamespace(Sx);function Rv(s){return it.isClip(s)?Ka("clipTitle"):it.isInteractive(s)?Ka("interactiveTitle"):Ka("videoTitle")}function Cx(s){return it.isClip(s)?Ka("clipDescription"):it.isInteractive(s)?Ka("interactiveDescription"):Ka("videoDescription")}class Ex extends sa{constructor(e){super(Rv(e)),this.video=e}get name(){return"ParentVideoDeletedError"}get heading(){return Rv(this.video)}get description(){return Cx(this.video)}}const wx="shared.videoRatingAccess",Xa=Kt.encloseNamespace(wx);function Bv(s){return it.isClip(s)?Xa("clipTitle"):it.isInteractive(s)?Xa("interactiveTitle"):Xa("videoTitle")}function kx(s){return it.isClip(s)?Xa("clipDescription"):it.isInteractive(s)?Xa("interactiveDescription"):Xa("videoDescription")}class xx extends sa{constructor(e){super(Bv(e)),this.video=e}get name(){return"VideoRatingAccessError"}get heading(){return Bv(this.video)}get description(){return kx(this.video)}}const Ax="shared.videoRestrictedError",Ya=Kt.encloseNamespace(Ax);function Fv(s){return it.isClip(s)?Ya("clipTitle"):it.isInteractive(s)?Ya("interactiveTitle"):Ya("videoTitle")}function Ix(s){return it.isClip(s)?Ya("clipDescription"):it.isInteractive(s)?Ya("interactiveDescription"):Ya("videoDescription")}class Px extends sa{constructor(e){super(Fv(e)),this.video=e}get name(){return"VideoRestrictedError"}get heading(){return Fv(this.video)}get description(){return Ix(this.video)}}const _0={"rating-not-allowed":xx,"video-deleted":Ex,private:v0,"clickview-private":bx,"login-required":kp,"restricted-access":Px,"content-region-violated":Uk,"restricted-library":vx},Dx={..._0,private:kp,"clickview-private":kp},Nx=(s,e={})=>{const t=Vr(i0.currentUser());at.useEffect(()=>{if(!s.hasCompleted||!t.hasCompleted)return;const r=s.data;if(!r)return;const{canConsume:i,reason:n}=it.getCanBeConsumed(r);if(i)return;const o={...t.data.isAuthenticated?_0:Dx,...e}[n??"private"]??Kw;Rm.throw(new o(r))},[s.hasCompleted,t.hasCompleted])},T0={getTagActionProps:(s,e,t)=>t?{onClick:r=>{e&&e();const i=s?s(r):null;if(i)return Xw.trigger(i)}}:{getAppLink:r=>s?s(r):null,onClick:e}};function Uv(s){var e;switch((e=s.tagType)==null?void 0:e.toLowerCase()){case Lv.Pedagogy:return 0;case Lv.Skill:return 1;default:return 2}}function b0(s){if(!s.tags)return te.jsx(te.Fragment,{});const e=[...s.tags].sort((t,r)=>Uv(t)-Uv(r));return te.jsx("div",{className:`${Kk.tagList} ${s.className}`,children:e.map(t=>{const r=typeof s.getAppLink=="function"?s.getAppLink(t):null,i=typeof s.onRemove=="function"?()=>s.onRemove(t):null,n=typeof s.onClick=="function"?()=>s.onClick(t):null;return te.jsx(Xk,{tag:t,appLink:r,themeColours:s.themeColours,onRemove:i,onClick:n},t.id||t.name)})})}class Lx{constructor(){this.listeners={}}subscribe(e,t){this.registerListener(e,t)}subscribeOnce(e,t){this.registerListener(e,t,1)}unsubscribe(e,t){this.deregisterListener(e,t)}trigger(e,...t){this.triggerCallbacks(e,t)}registerListener(e,t,r){if(typeof e!="string")throw new Error("Event name must be a string");if(typeof t!="function")throw new Error("Event callback must be a function");if(r&&typeof r!="number")throw new Error("Execution limit must be a number or undefined");this.listeners[e]=this.listeners[e]??[],this.listeners[e].push({callback:t,executionLimit:r})}deregisterListener(e,t){var i;if(typeof e!="string")throw new Error("Event name must be a string");if(t&&typeof t!="function")throw new Error("Event callback must be a function");if(!t){this.listeners[e]=[];return}const r=(i=this.listeners[e])==null?void 0:i.findIndex(n=>n.callback===t);typeof r!="number"||r===-1||(this.listeners[e].splice(r,1),this.listeners[e].length===0&&delete this.listeners[e])}triggerCallbacks(e,...t){if(!this.listeners[e])return;const r=[];this.listeners[e].forEach(i=>{typeof i.executionLimit=="number"&&(i.executionCount=i.executionCount??0,i.executionCount++,i.executionCount===i.executionLimit&&r.push(i.callback)),i.callback.apply(null,...t)}),r.length&&r.forEach(i=>this.deregisterListener(e,i))}}const $l=new Lx;function $v(s,e,t,r){const i=()=>{$l.unsubscribe(s,e)};return gi.useEffect(()=>{if(r)return $l.subscribe(s,e),()=>{i()}},[]),i}const Ox="_container_an6o0_1",Mx="_background_an6o0_4",Rx="_topLeft_an6o0_13",Bx="_bottomLeft_an6o0_16",Fx="_topRight_an6o0_19",Ux="_bottomRight_an6o0_22",$x="_detailsBtn_an6o0_25",jx="_content_an6o0_29",Vx="_highlightPoi_an6o0_37",Ms={container:Ox,background:Mx,topLeft:Rx,bottomLeft:Bx,topRight:Fx,bottomRight:Ux,detailsBtn:$x,content:jx,highlightPoi:Vx},Hx=/(\[.*\]\(cv:\/\/poi\?id=[0-9]+\))/g,qx=/[0-9]+/,jv=/\[.*\]/,zx=/[\[\]]/g;function Wx(s,e,t){return e!=null&&e.length?s.content.replace(Hx,r=>{const i=r.match(qx);if(!(i!=null&&i.length))return r;const n=e.find(u=>u.id.toString()===i[0]),a=r.match(jv);if(!n||!(a!=null&&a.length))return r;const o=`<span class="me-2">${f0.ToDisplayDuration(n.startTime*1e3)}</span>`;let l=a[0];return l=l.replace(zx,""),l=l||n.description,l=`${o} ${l}`,t?`<span class="d-flex">${l}</span>`:r.replace(jv,`[${l}]`)}):s.content}function Gx(s,e,t){const r=Wx(s,e,t);return Yw(r,{async:!1}).split('a href="cv://poi').join('a class="d-flex" href="cv://poi')}function Kx(s,e,t){s.preventDefault();const r=s.target.getAttribute("href");if(!(r!=null&&r.includes("cv://poi"))||!(e!=null&&e.length))return;const i=r.split("cv://poi?id=")[1],n=e.find(a=>a.id.toString()===i);t&&n&&t(n.startTime)}function Xx(s,e,t,r){var a;const[i,n]=gi.useState("");return gi.useEffect(()=>{if(!t)return;const o=Gx(s.glance,e,r);n(o)},[(a=s.glance)==null?void 0:a.content,e==null?void 0:e.length,t]),i}function Yx(s,e){const t=gi.useRef(null);$v("player:poi:mouseover",r,null,e),$v("player:poi:mouseleave",i,null,e),gi.useEffect(()=>{if(!t.current||!e)return;const u=l();return u.forEach(c=>c.addEventListener("mouseover",n)),u.forEach(c=>c.addEventListener("mouseleave",a)),()=>{u.forEach(c=>c.removeEventListener("mouseover",n)),u.forEach(c=>c.removeEventListener("mouseleave",a))}},[t.current]);function r(u){var h;const c=u==null?void 0:u.id;c&&((h=o(c))==null||h.classList.add(Ms.highlightPoi))}function i(){var u;(u=l())==null||u.forEach(c=>c.classList.remove(Ms.highlightPoi))}function n(){const u=this.getAttribute("href");if(!(u!=null&&u.includes("cv://poi"))||!(s!=null&&s.length))return;const c=u.split("cv://poi?id=")[1];if(!c)return;const h=s.find(f=>f.id.toString()===c);h&&$l.trigger("glance:poi:mouseover",h)}function a(){$l.trigger("glance:poi:mouseleave")}function o(u){var c;return(c=t.current)==null?void 0:c.querySelector(`[href="cv://poi?id=${u}"]`)}function l(){var u;return(u=t.current)==null?void 0:u.querySelectorAll('[href*="cv://poi"]')}return t}function S0(s,e){var t,r;return e&&((t=s.glance)==null?void 0:t.content)&&((r=s.glance)==null?void 0:r.format)==="text/markdown"}const Kd="shared.videoAtAGlance";function Qx(s){var e,t,r,i;return(t=(e=s==null?void 0:s.data)==null?void 0:e.colours)!=null&&t.primary&&((i=(r=s==null?void 0:s.data)==null?void 0:r.colours)!=null&&i.secondary)?s.data.colours:{primary:"#F5F4FF",secondary:"#9294FF"}}function Jx(s){const e=S0(s.video,s.theme),t=Xx(s.video,s.pointsOfInterest,e,s.suppressInteractivity),r=Yx(s.pointsOfInterest,e);if(!e)return te.jsx(te.Fragment,{});const i=Qx(s.theme),n=typeof s.onClickShowDescription=="function",a=typeof s.onClickShowCurriculumLinks=="function";return te.jsxs("div",{className:`rounded border px-3 px-sm-5 py-3 mb-3 position-relative d-flex justify-content-center ${Ms.container}`,style:{backgroundColor:i.primary},children:[te.jsx("div",{className:`${Ms.content} d-flex align-items-center pt-4 pt-sm-0`,children:te.jsxs("div",{children:[te.jsx("h2",{className:"h4",children:te.jsx(Ar,{namespace:Kd,phrase:"videoAtAGlance"})}),n&&te.jsx(Hs,{onClick:s.onClickShowDescription,className:`${Ms.detailsBtn} position-absolute cursor-pointer me-4 fw-semibold text-info`,children:te.jsx(Ar,{namespace:Kd,phrase:"readFullDescription"})}),te.jsx("div",{ref:r,onClick:o=>Kx(o,s.pointsOfInterest,s.setStartTime),dangerouslySetInnerHTML:{__html:t}}),(()=>{var o,l,u,c;return(l=(o=s.video.tags)==null?void 0:o.data)!=null&&l.length?te.jsx("div",{className:"py-1",children:te.jsx(b0,{tags:(c=(u=s.video)==null?void 0:u.tags)==null?void 0:c.data,themeColours:i,...T0.getTagActionProps(s.getTagAppLink,null,s.suppressInteractivity)})}):te.jsx(te.Fragment,{})})(),te.jsx("div",{className:"mt-2",children:a&&te.jsx(Hs,{onClick:s.onClickShowCurriculumLinks,className:"cursor-pointer d-inline-block fw-semibold text-info",children:te.jsx(Ar,{namespace:Kd,phrase:"seeCurriculumLinks"})})})]})}),(()=>{var u,c;const o=((c=(u=s.theme)==null?void 0:u.data)==null?void 0:c.images)??{};return bp.keys(o).filter(h=>!bp.isEmpty(o[h])).map(h=>{var g,C;const f=Bm.createUrl((g=o[h])==null?void 0:g.url,{size:Fm.Medium});return te.jsx("div",{className:`${Ms[h]} ${Ms.background} d-none d-lg-block`,style:{backgroundImage:`url('${f}')`}},(C=o[h])==null?void 0:C.fileId)})})()]})}var Xd={exports:{}},Vv;function Zx(){return Vv||(Vv=1,(function(s,e){(function(t,r){s.exports=r()})(window,(function(){return(function(t){var r={};function i(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=r,i.d=function(n,a,o){i.o(n,a)||Object.defineProperty(n,a,{enumerable:!0,get:o})},i.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},i.t=function(n,a){if(1&a&&(n=i(n)),8&a||4&a&&typeof n=="object"&&n&&n.__esModule)return n;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),2&a&&typeof n!="string")for(var l in n)i.d(o,l,(function(u){return n[u]}).bind(null,l));return o},i.n=function(n){var a=n&&n.__esModule?function(){return n.default}:function(){return n};return i.d(a,"a",a),a},i.o=function(n,a){return Object.prototype.hasOwnProperty.call(n,a)},i.p="",i(i.s=1)})([function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),(function(n){n[n.Disable=0]="Disable",n[n.Enable=1]="Enable"})(r.CookiePolicy||(r.CookiePolicy={}))},function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var n=i(2);r.renderButtons=n.renderButtons;var a=i(3);r.close=a.close,r.launchAsync=a.launchAsync;var o=i(0);r.CookiePolicy=o.CookiePolicy,window.addEventListener("load",(function(){var l,u;window.hasOwnProperty("Promise")||(l="https://contentstorage.onenote.office.net/onenoteltir/permanent-static-resources/promise-polyfill.min.js",(u=document.createElement("script")).src=l,document.head.appendChild(u)),n.renderButtons()}))},function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var n={af:"Indompelende leser",am:"በህያው ስሜት ፈጣሪ ዕይታ አንባቢ",ar:"القارئ الشامل",as:"ইমাৰচিভ ৰিডাৰ",az:"İmmersiv Oxuyucu",be:"Імерсіўны чытальнік",bg:"Концентриран четец",bn:"মনোগ্রাহী পাঠক","bn-bd":"ইমার্সিভ পাঠক",bs:"Koncentrirani čitalac",ca:"Lector immersiu",cs:"Asistivní čtečka","cy-gb":"Darllenydd Ymdrwythol",da:"Forenklet læser",de:"Plastischer Reader",el:"Προηγμένο πρόγραμμα ανάγνωσης",en:"Immersive Reader",es:"Lector inmersivo",et:"Süvaluger",eu:"Irakurgailu murgiltzailea",fa:"خواننده همهجانبه",fi:"Syventävä lukuohjelma",fil:"Immersive Reader",fr:"Lecteur immersif","ga-ie":"Léitheoir tumthach",gd:"An leughadair ùr-nòsach",gl:"Lector avanzado",gu:"ઇમર્સિવ રીડર",ha:"Mai karatu Mai barbazawa",he:"תצוגת קריאה מודרנית",hi:"इमर्सिव रीडर",hr:"Stopljeni čitač",hu:"Modern olvasó",hy:"Խորասուզված ընթերցիչ",id:"Pembaca Imersif",ig:"Ọgụụ Kenzipụtara",is:"Aðgengilegt lestrarumhverfi",it:"Strumento di lettura immersiva",ja:"イマーシブ リーダー",ka:"იმერსიული წამკითხველი",kk:"Иммерсивті оқу құралы",km:"កម្មវិធីអានពណ៌រំលេចនៅលើអេក្រង់",kn:"ಇಮ್ಮರ್ಸಿವ್ ಓದುಗ",ko:"몰입형 리더",kok:"तंद्री लागिल्लो वाचक","ku-arab":"خوێنەری پڕ",ky:"Курчаган Окугуч",lb:"Immersive Reader",lo:"ຕົວອ່ານອິມເມີສີບ",lt:"Įtraukianti skaitytuvė",lv:"Tīrskata lasītājs",mi:"Pūpānui Rumaki",mk:"Сеопфатен читач",ml:"ഇമ്മേഴ്സീവ് റീഡർ",mn:"Идэвхтэй уншигч",mr:"इमर्सिव्ह वाचक",ms:"Pembaca Imersif",mt:"Qarrej Immersiv",ne:"इमेर्सिभ रिडर",nl:"Insluitende lezer","nn-no":"Engasjerande lesar",no:"Engasjerende leser",nso:"Go Bala ka Mongwalo o Mokoto",or:"ଇମରସିଭ୍ ରିଡର୍",pa:"ਇਮਰਸਿਵ ਰੀਡਰ","pa-arab":"گھیرن آلا مطالعہ کار",pl:"Czytnik immersyjny",prs:"خواننده نمایش",pt:"Leitura Avançada",quc:"Nim ucholajil sik'inel uwach",quz:"Wankisqa Ñawiq",ro:"Immersive Reader",ru:"Иммерсивное средство чтения",rw:"Insakazasoma",sd:"امرسو ريڊر",si:"ගිලෙන සුළු කියවනය",sk:"Imerzná čítačka",sl:"Potopni bralnik",sq:"Lexuesi kredhës","sr-cyrl-ba":"Концентрисани читалац","sr-cyrl-rs":"Концентрисани читалац","sr-latn-rs":"Koncentrisani čitalac",sv:"Avancerad läsare",sw:"Kisomaji cha Kuzamisha",ta:"அற்புதமான ரீடர்",te:"మంత్రముగ్ధులను చేసే పఠన సాధనం","tg-cyrl-tj":"Хонандаи фарогир",th:"โปรแกรมช่วยอ่าน",ti:"ኣንባቢ ሕሉው ስምዒት ፈጣሪ",tk:"Giňişleýin okaýjy",tn:"Sebadi sa Imesife",tr:"Tam Ekran Okuyucu",tt:"Чолгап алучы уку чарасы","ug-cn":"چۆكمە ئوقۇغۇچ",uk:"Занурення в текст",ur:"امرسیو مطالعہ کار",uz:"Immersiv mutolaa vositasi",vi:"Trình đọc Chân thực",wo:"Jàngukaay bu Rafet",xh:"Isifundi Esikhulu",yo:"Ìwò Alámùtán",zh:"沉浸式阅读器","zh-hant":"沈浸式閱讀程式",zu:"Isifundi Sokuzizwisa"};function a(c){var h=document.createElement("img");h.src="https://contentstorage.onenote.office.net/onenoteltir/permanent-static-resources/immersive-reader-icon.svg";var f=c.getAttribute("data-icon-px-size")||"20";h.style.height=h.style.width=f+"px",h.style.verticalAlign="middle",h.style.marginTop="-2px";var g=c.getAttribute("data-locale")||"en";h.alt=u(g),c.appendChild(h)}function o(c){var h=document.createElement("span");h.style.marginLeft="8px",c.appendChild(h)}function l(c){var h=document.createElement("span"),f=c.getAttribute("data-locale")||"en";h.textContent=u(f),c.appendChild(h)}function u(c){return c=c.toLowerCase(),n[c]?n[c]:c==="zh-hk"||c==="zh-mo"||c==="zh-tw"?n["zh-hant"]:(c=c.substring(0,c.lastIndexOf("-")),n[c]?n[c]:(c=c.substring(0,c.lastIndexOf("-")),n[c]?n[c]:n.en))}r.renderButtons=function(c){var h=document.createElement("style");h.innerHTML=".immersive-reader-button{cursor:pointer;display:inline-block;padding:5px;} .immersive-reader-button:hover{background:rgba(0,0,0,.05);border-radius:2px",document.head.appendChild(h);var f=[].slice.call(document.getElementsByClassName("immersive-reader-button"));c&&c.elements&&(f=c.elements);for(var g=0,C=f;g<C.length;g++){var p=C[g];p.setAttribute("role","button");var T=p.getAttribute("data-locale")||"en";switch(p.setAttribute("aria-label",u(T)),p.getAttribute("data-button-style")||"icon"){case"icon":a(p);break;case"text":l(p);break;case"iconAndText":a(p),o(p),l(p)}}}},function(t,r,i){var n=this&&this.__assign||function(){return(n=Object.assign||function(c){for(var h,f=1,g=arguments.length;f<g;f++)for(var C in h=arguments[f])Object.prototype.hasOwnProperty.call(h,C)&&(c[C]=h[C]);return c}).apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0});var a=i(0),o=i(4),l={};function u(c){return c?new RegExp("^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])$").test(c):!1}l[o.ErrorCode.TokenExpired]="The access token supplied is expired.",l[o.ErrorCode.Throttled]="You have exceeded your quota.",l[o.ErrorCode.ServerError]="An error occurred when calling the server to process the text.",l[o.ErrorCode.InvalidSubdomain]="The subdomain supplied is invalid.",r.launchAsync=function(c,h,f,g){return new Promise((function(C,p){if(c)if(f)if(f.chunks)if(f.chunks.length)if(u(h)||g&&g.customDomain){var T=Date.now();(g=n({uiZIndex:1e3,timeout:15e3,useWebview:!1,allowFullscreen:!0,hideExitButton:!1,cookiePolicy:a.CookiePolicy.Disable},g)).uiZIndex&&typeof g.uiZIndex=="number"||(g.uiZIndex=1e3);var A=null,N=document.createElement("div"),F=g.useWebview?document.createElement("webview"):document.createElement("iframe"),V=document.createElement("style");V.innerHTML="body{height:100%;overflow:hidden;}";var R=function(){A&&(window.clearTimeout(A),A=null)},O=function(){document.body.contains(N)&&document.body.removeChild(N),window.removeEventListener("message",U),R(),V.parentNode&&V.parentNode.removeChild(V)},M=function(){O(),g.onExit&&g.onExit()};O();var U=function(P){if(P&&P.data){if(P.data==="ImmersiveReader-ReadyForContent"){R();var Y={cogSvcsAccessToken:c,cogSvcsSubdomain:h,request:f,launchToPostMessageSentDurationInMs:Date.now()-T};F.contentWindow.postMessage(JSON.stringify({messageType:"Content",messageValue:Y}),"*")}else if(P.data==="ImmersiveReader-Exit")M();else if(P.data.startsWith("ImmersiveReader-LaunchResponse:")){var G=null,K=null,le=null;try{le=JSON.parse(P.data.substring(31))}catch{}le&&le.success?G={container:N,sessionId:le.sessionId}:K=le&&!le.success?{code:le.errorCode,message:l[le.errorCode],sessionId:le.sessionId}:{code:o.ErrorCode.ServerError,message:l[o.ErrorCode.ServerError]},G?(R(),C(G)):K&&(M(),p(K))}}};window.addEventListener("message",U),A=window.setTimeout((function(){O(),p({code:o.ErrorCode.Timeout,message:"Page failed to load after timeout ("+g.timeout+" ms)"})}),g.timeout),g.allowFullscreen&&F.setAttribute("allowfullscreen",""),F.style.cssText="position: static; width: 100vw; height: 100vh; left: 0; top: 0; border-width: 0",g.useWebview&&F.addEventListener("loadstop",(function(){F.contentWindow.postMessage(JSON.stringify({messageType:"WebviewHost"}),"*")}));var E=(g.customDomain?g.customDomain:"https://"+h+".cognitiveservices.azure.com/immersivereader/webapp/v1.0/")+"reader?exitCallback=ImmersiveReader-Exit&sdkPlatform=js&sdkVersion=1.0.0";E+="&cookiePolicy="+(g.cookiePolicy===a.CookiePolicy.Enable?"enable":"disable"),g.hideExitButton&&(E+="&hideExitButton=true"),g.uiLang&&(E+="&omkt="+g.uiLang),F.src=E,N.style.cssText="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; border-width: 0; -webkit-perspective: 1px; z-index: "+g.uiZIndex+"; background: white; overflow: hidden",N.appendChild(F),document.body.appendChild(N),document.head.appendChild(V)}else p({code:o.ErrorCode.InvalidSubdomain,message:l[o.ErrorCode.InvalidSubdomain]});else p({code:o.ErrorCode.BadArgument,message:"Chunks must not be empty"});else p({code:o.ErrorCode.BadArgument,message:"Chunks must not be null"});else p({code:o.ErrorCode.BadArgument,message:"Content must not be null"});else p({code:o.ErrorCode.BadArgument,message:"Token must not be null"})}))},r.close=function(){window.postMessage("ImmersiveReader-Exit","*")},r.isValidSubdomain=u},function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0}),(function(n){n.BadArgument="BadArgument",n.Timeout="Timeout",n.TokenExpired="TokenExpired",n.Throttled="Throttled",n.ServerError="ServerError",n.InvalidSubdomain="InvalidSubdomain"})(r.ErrorCode||(r.ErrorCode={}))}])}))})(Xd)),Xd.exports}var eA=Zx();const tA="_button_6xsqi_1",iA={button:tA};let Wu=null,Yd=!1;const rA="shared.immersiveReader";function nA(s){const[e,t]=gi.useState(Wu);!Wu&&!Yd&&(Yd=!0,Qw({resource:"/api/integrations/token/immersive-reader",type:xl.GET,success:r,error:()=>{}}));function r(n){Wu=n,t(n),window.setTimeout(()=>{Wu=null,Yd=!1},9e5)}if(!e)return te.jsx(te.Fragment,{});s.title||(s.title=Kt.getPhrase(rA,"titleFallback"));function i(){Sp.isFunction(s.onLaunch)&&s.onLaunch(),En.logUserAction(s.analyticsData,s.analyticsOptions);const n={title:s.title,chunks:[{content:s.text,mimeType:s.html?"text/html":"text/plain"}]},{subdomain:a,token:o}=e,l={uiZIndex:5e3,onExit:()=>{Sp.isFunction(s.onExit)&&s.onExit()}};eA.launchAsync(o,a,n,l)}return te.jsx("span",{className:`${iA.button} ${s.className||""}`,onClick:i,children:te.jsxs("svg",{viewBox:"0 0 40 37",children:[te.jsx("path",{d:"M37.4,0.9 L37.4,9.6 L35.4,9.6 L35.4,2.9 L24.4,2.9 C22.9,3.3 20,4.5 20,6 L20,17.2 L18,17.2 L18,6 C18,5 15.6,3.6 13.8,2.9 L2,2.9 L2,29 L12.4,29 L12.4,31 L0,31 L0,0.9 L14.1,0.9 L14.3,1 C15,1.2 17.5,2.2 18.9,3.7 C20.5,1.9 23.5,1.1 23.9,1 L24.1,1 L37.4,1 L37.4,0.9 Z",fill:"#000000"}),te.jsx("path",{d:"M27.4,37 L25.8,37 L18.4,29.4 L14,29.4 L14,21 L18.4,20.9 L26.1,13 L27.4,13 L27.4,37 Z M16,27.4 L19.2,27.4 L25.3,33.7 L25.3,16.6 L19.2,22.9 L15.9,22.9 L15.9,27.4 L16,27.4 Z",fill:"#0197F2"}),te.jsx("path",{d:"M31.3,32.7 L29.6,31.7 C29.6,31.7 31.7,28.3 31.7,25.2 C31.7,21.9 29.6,18.5 29.6,18.4 L31.3,17.4 C31.4,17.6 33.7,21.3 33.7,25.2 C33.7,28.8 31.4,32.6 31.3,32.7 Z",fill:"#0197F2"}),te.jsx("path",{d:"M36.4,36.2 L34.8,35 C34.8,35 38,30.8 38,25.2 C38,19.6 34.8,15.4 34.8,15.4 L36.4,14.2 C36.5,14.4 40,19 40,25.3 C40,31.5 36.5,36 36.4,36.2 Z",fill:"#0197F2"})]})})}const sA=368;function aA(s){const{page:e,totalPages:t}=s,r=Av.isNumber(e)&&e>0&&e<t&&e+1,i=Av.isNumber(e)&&e>1&&e-1,n={};if(r&&r<=t&&(n.next=r.toString()),i&&(n.previous=i.toString()),!bp.isEmpty(n))return n}const C0={isEmpty(s){return s&&!(s.data&&s.data.length)},length(s){return s&&s.data&&s.data.length},at(s,e){if(!(!s||!s.data||!s.data.length||e>s.data.length))return s.data[e]},get(s,e){if(!(!s||!s.data||!s.data.length))return s.data.find(t=>t.id&&t.id.toString()===e)},flattenCollections(s){if(!s||!s.length)return;let e=[];return s.forEach(t=>{e=[...e,...t.data]}),e},getNextCursor(s){return s.pagination&&s.pagination.cursors&&s.pagination.cursors.next},convertLegacyPaginatedCollection(s){if(s)return{data:s.data,pagination:{cursors:aA(s.pagination),limit:s.pagination.pageSize}}},hasData(s){return!C0.isEmpty(s)}};function oA(s){return it.isVideo(s)?s:it.isClip(s)?s._parentVideo:null}function lA(s){const e=C0.hasData,t=oA(s);return t?e(t.productionCompanies)||e(t.producers)||e(t.distributors)||e(t.directors):!1}const uA="_closeButton_1bg8h_1",cA="_descriptionBorder_1bg8h_7",Hv={closeButton:uA,descriptionBorder:cA},xp="shared.videoDetails",Gu=Kt.encloseNamespace(xp);function Ku(s){const{label:e,items:t,className:r}=s;if(!(t&&t.data&&t.data.length))return te.jsx(te.Fragment,{});const n=t.data.map(a=>a.name).join(", ");return te.jsxs("div",{className:r,children:[e,": ",n]})}function hA(s){var r,i,n,a,o,l,u,c;const{video:e}=s;if(!it.isVideo(e)&&!it.isClip(e))return te.jsx(te.Fragment,{});const t=it.getParentVideo(e);return te.jsxs("div",{className:e.description?"col-md-5 ps-md-3 pt-3 pt-md-0":"col-12",children:[te.jsx("h2",{className:"h6 mb-1",children:te.jsx(Ar,{phrase:"details"})}),!!t.productionYear&&te.jsx("div",{className:"mb-1",children:te.jsx(Ar,{phrase:"productionYear",options:{year:t.productionYear}})}),te.jsx(Ku,{label:Gu("productionCompanies",{smartCount:(i=(r=t.productionCompanies)==null?void 0:r.data)==null?void 0:i.length}),items:t.productionCompanies,className:"mb-1"}),te.jsx(Ku,{label:Gu("distributors",{smartCount:(a=(n=t.distributors)==null?void 0:n.data)==null?void 0:a.length}),items:t.distributors,className:"mb-1"}),te.jsx(Ku,{label:Gu("producers",{smartCount:(l=(o=t.producers)==null?void 0:o.data)==null?void 0:l.length}),items:t.producers,className:"mb-1"}),te.jsx(Ku,{label:Gu("directors",{smartCount:(c=(u=t.directors)==null?void 0:u.data)==null?void 0:c.length}),items:t.directors,className:"mb-1"}),!!t.dateBroadcast&&te.jsx("div",{className:"mb-1",children:te.jsx(Ar,{phrase:"dateBroadcast",options:{date:Iv.format(t.dateBroadcast,"DD/MM/YYYY")}})}),!!t.channel&&te.jsx("div",{className:"mb-1",children:te.jsx(Ar,{phrase:"channel",options:{channel:t.channel.name}})}),it.canViewUploadDate(s.video)&&te.jsx("div",{className:"mb-1",children:te.jsx(Ar,{phrase:"dateUploaded",options:{date:Iv.format(e.dateCreated,"DD/MM/YYYY")}})})]})}function dA(s){const{video:e,maxHeight:t=sA}=s,r=it.getParentVideo(e),i=!!s.video.description,n=lA(s.video)||!!r.productionYear||!!r.dateBroadcast||!!r.channel||it.canViewUploadDate(s.video),a=typeof s.onClickClose=="function",o=typeof s.onClickShowCurriculumLinks=="function";function l(){var u,c;return s.hideTags||it.isInteractive(s.video)||!((c=(u=s.video.tags)==null?void 0:u.data)!=null&&c.length)?null:s.video.tags.data}return!i&&!n?te.jsx(te.Fragment,{}):te.jsx(r0.Provider,{value:xp,children:te.jsxs("div",{className:"rounded border p-3 mb-3 position-relative",children:[te.jsx(n0.Scrollbars,{autoHeight:!0,autoHeightMax:t,children:te.jsxs("div",{className:"row g-0",children:[i&&te.jsxs("div",{className:n?`${Hv.descriptionBorder} pe-3 col-md-7`:"col-12",children:[te.jsxs("div",{className:"d-flex align-items-center",children:[te.jsx("h2",{className:"h6 mb-1",children:te.jsx(Ar,{phrase:"description"})}),te.jsx(nA,{text:e.description,title:e.name,className:"ps-2",onLaunch:s.onLaunchImmersiveReader,onExit:s.onExitImmersiveReader,analyticsOptions:{location:Ir.PlayPage,entity:xi.Video,actionType:Jt.Click,descriptor:Jw.LaunchImmersiveReader},analyticsData:{id:e.id,type:"description"}})]}),te.jsx("p",{className:"mb-0",dangerouslySetInnerHTML:{__html:Yk.linkifyText(s.video.description,{nl2br:!0})}}),te.jsx(b0,{tags:l(),...T0.getTagActionProps(s.getTagAppLink,null,s.suppressInteractivity),className:"mt-1"}),o&&te.jsx(Hs,{onClick:s.onClickShowCurriculumLinks,className:"cursor-pointer d-inline-block fw-semibold text-info mt-2 mb-1",children:te.jsx(Ar,{namespace:xp,phrase:"seeCurriculumLinks"})})]}),n&&te.jsx(hA,{...s})]})}),a&&te.jsx("button",{type:"button",className:`btn-close ${Hv.closeButton}`,"aria-label":"Close",onClick:s.onClickClose})]})})}function fA(){return te.jsx("div",{className:"p-3 mb-3 border rounded",children:te.jsxs("div",{className:"row",children:[te.jsxs("div",{className:"pe-3 col-md-7 border-right",children:[te.jsx("div",{className:"partial-loading-background mb-2",style:{height:"1.5rem",width:"12rem"}}),te.jsx("div",{className:"partial-loading-background mb-2",style:{height:"4.5rem"}}),te.jsx("div",{className:"partial-loading-background",style:{height:"1.5rem",width:"15rem"}})]}),te.jsxs("div",{className:"col-md-5 ps-md-3 pt-3 pt-md-0",children:[te.jsx("div",{className:"partial-loading-background mb-2",style:{height:"1.5rem",width:"7rem"}}),te.jsx("div",{className:"partial-loading-background mb-2",style:{height:"1.5rem",width:"10rem"}}),te.jsx("div",{className:"partial-loading-background mb-2",style:{height:"1.5rem",width:"12rem"}}),te.jsx("div",{className:"partial-loading-background mb-2 me-2 d-inline-block",style:{height:"1.5rem",width:"3rem"}}),te.jsx("div",{className:"partial-loading-background mb-2 me-2 d-inline-block",style:{height:"1.5rem",width:"4rem"}}),te.jsx("div",{className:"partial-loading-background mb-2 me-2 d-inline-block",style:{height:"1.5rem",width:"3.5rem"}}),te.jsx("div",{className:"partial-loading-background mb-2 me-2 d-inline-block",style:{height:"1.5rem",width:"4.5rem"}})]})]})})}const pA="shared.playPage";function mA(){const s=Kt.encloseNamespace(pA);return te.jsxs("div",{className:"alert bg-light-blue p-3 rounded-3 d-flex justify-content-between align-items-center",children:[te.jsx(rs,{svg:tx,size:s0.Standard,className:"me-2 svg-container"}),te.jsxs("div",{className:"w-100",children:[te.jsx("p",{className:"fw-semibold mb-0",children:s("archivedInfoTitle")}),te.jsx("p",{className:"mb-1",children:s("archivedInfo")})]})]})}const gA="_series_1xytj_1",vA={series:gA};function yA(s){var t;const e=jk((t=s.video.subjectPresentationAudiences)==null?void 0:t.data,s.audiences);return te.jsxs("section",{className:"position-relative",children:[te.jsxs("div",{className:"d-inline-block",children:[te.jsx(Vk,{type:"productionCompany",video:s.video,appLink:s.getSubTextAppLink(s.video),className:`${vA.series} text-truncate mw-100`,analyticsOptions:{location:Ir.PlayPage}}),te.jsx("h1",{className:"h4 d-inline-flex align-items-center mb-2 mt-n1 mw-100 mb-0 pt-2",children:te.jsx("span",{className:"align-self-center",children:s.video.name})})]}),e&&te.jsx(Hk,{className:"mb-3",children:te.jsx(qk,{audience:e,className:"bg-white text-dark",border:"dark"})})]})}const _A="_mask_vq9tb_1",TA="_centeredIcon_vq9tb_10",bA="_bgImage_vq9tb_21",Qd={mask:_A,centeredIcon:TA,bgImage:bA};function SA(s){var t;const e=Bm.createUrl(((t=it.getThumbnail(s.video))==null?void 0:t.url)??"",{size:Fm.Large});return te.jsx("div",{className:`position-relative responsive-img ${Qd.bgImage}`,style:{backgroundImage:`url('${e}')`},children:te.jsxs(Zw,{appLink:s.appLink,analyticsOptions:{actionType:Jt.Click,location:Ir.PlayPage,entity:xi.AppLink,workflowPhase:ia.Start,descriptor:a0.SignUp},analyticsData:{},children:[te.jsx(rs,{svg:zk,className:Qd.centeredIcon}),te.jsx("div",{className:Qd.mask})]})})}const CA=()=>{const[,s]=at.useState(Date.now());return()=>{s(Date.now())}},EA=3,wA=300;class kA{constructor(e){this.hasLogged=!1,this.options=e,this.player=e.player,this.analyticsLocation=e.analyticsLocation,this.onTimeUpdate=this.onTimeUpdate.bind(this),this.initialize()}initialize(){this.bindListeners()}bindListeners(){this.player.on("timeupdate",this.onTimeUpdate),this.player.one("dispose",()=>{this.player.off("timeupdate",this.onTimeUpdate)})}unbindListeners(){this.player.off("timeupdate",this.onTimeUpdate)}setAnalyticsLocation(e){this.analyticsLocation=e}onTimeUpdate(){if(!(this.player.currentTime()<EA||this.hasLogged))try{const e=`m:${this.options.video.id}`;if(this.hasCoolDownTime()&&Al.cacheExists(e))return;En.logUserAction(this.getAnalyticsData(),{actionType:Jt.Stream,entity:it.getAnalyticsEntity(this.options.video),location:this.analyticsLocation}),this.hasCoolDownTime()&&Al.cacheSet(e,null,wA)}finally{this.hasLogged=!0,this.unbindListeners()}}hasCoolDownTime(){return it.isVideo(this.options.video)}getAnalyticsData(){var t;const e={name:this.options.video.name};if(this.options.shareId&&(e.shareId=this.options.shareId),it.isVideo(this.options.video)&&(e.id=this.options.video.id),it.isClip(this.options.video)&&(e.id=(t=this.options.video._parentVideo)==null?void 0:t.id,e.clip={id:this.options.video.id}),it.isInteractive(this.options.video)){const r=this.options.video._parentVideo;e.id=r==null?void 0:r.id,e.interactive={id:this.options.video.id}}return e}}var Jd,qv;function Io(){if(qv)return Jd;qv=1;var s;return typeof window<"u"?s=window:typeof globalThis<"u"?s=globalThis:typeof self<"u"?s=self:s={},Jd=s,Jd}var xA=Io();const D=qi(xA);var Zd,zv;function E0(){if(zv)return Zd;zv=1;var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},e=ix,t;return typeof document<"u"?t=document:(t=s["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=s["__GLOBAL_DOCUMENT_CACHE@4"]=e)),Zd=t,Zd}var AA=E0();const ue=qi(AA);var Xu={exports:{}},ef,Wv;function w0(){if(Wv)return ef;Wv=1,ef=e;var s=Object.prototype.toString;function e(t){if(!t)return!1;var r=s.call(t);return r==="[object Function]"||typeof t=="function"&&r!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}return ef}var tf,Gv;function IA(){if(Gv)return tf;Gv=1;function s(i,n){var a=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(a)return(a=a.call(i)).next.bind(a);if(Array.isArray(i)||(a=e(i))||n){a&&(i=a);var o=0;return function(){return o>=i.length?{done:!0}:{done:!1,value:i[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(i,n){if(i){if(typeof i=="string")return t(i,n);var a=Object.prototype.toString.call(i).slice(8,-1);if(a==="Object"&&i.constructor&&(a=i.constructor.name),a==="Map"||a==="Set")return Array.from(i);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return t(i,n)}}function t(i,n){(n==null||n>i.length)&&(n=i.length);for(var a=0,o=new Array(n);a<n;a++)o[a]=i[a];return o}var r=(function(){function i(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var n=i.prototype;return n.getIsEnabled=function(){return this.enabled_},n.enable=function(){this.enabled_=!0},n.disable=function(){this.enabled_=!1},n.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},n.addInterceptor=function(o,l){this.typeToInterceptorsMap_.has(o)||this.typeToInterceptorsMap_.set(o,new Set);var u=this.typeToInterceptorsMap_.get(o);return u.has(l)?!1:(u.add(l),!0)},n.removeInterceptor=function(o,l){var u=this.typeToInterceptorsMap_.get(o);return u&&u.has(l)?(u.delete(l),!0):!1},n.clearInterceptorsByType=function(o){var l=this.typeToInterceptorsMap_.get(o);return l?(this.typeToInterceptorsMap_.delete(o),this.typeToInterceptorsMap_.set(o,new Set),!0):!1},n.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},n.getForType=function(o){return this.typeToInterceptorsMap_.get(o)||new Set},n.execute=function(o,l){for(var u=this.getForType(o),c=s(u),h;!(h=c()).done;){var f=h.value;try{l=f(l)}catch{}}return l},i})();return tf=r,tf}var rf,Kv;function PA(){if(Kv)return rf;Kv=1;var s=(function(){function t(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var r=t.prototype;return r.getIsEnabled=function(){return this.enabled_},r.enable=function(){this.enabled_=!0},r.disable=function(){this.enabled_=!1},r.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},r.getMaxAttempts=function(){return this.maxAttempts_},r.setMaxAttempts=function(n){this.maxAttempts_=n},r.getDelayFactor=function(){return this.delayFactor_},r.setDelayFactor=function(n){this.delayFactor_=n},r.getFuzzFactor=function(){return this.fuzzFactor_},r.setFuzzFactor=function(n){this.fuzzFactor_=n},r.getInitialDelay=function(){return this.initialDelay_},r.setInitialDelay=function(n){this.initialDelay_=n},r.createRetry=function(n){var a=n===void 0?{}:n,o=a.maxAttempts,l=a.delayFactor,u=a.fuzzFactor,c=a.initialDelay;return new e({maxAttempts:o||this.maxAttempts_,delayFactor:l||this.delayFactor_,fuzzFactor:u||this.fuzzFactor_,initialDelay:c||this.initialDelay_})},t})(),e=(function(){function t(i){this.maxAttempts_=i.maxAttempts,this.delayFactor_=i.delayFactor,this.fuzzFactor_=i.fuzzFactor,this.currentDelay_=i.initialDelay,this.currentAttempt_=1}var r=t.prototype;return r.moveToNextAttempt=function(){this.currentAttempt_++;var n=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+n},r.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},r.getCurrentDelay=function(){return this.currentDelay_},r.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},r.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},r.getCurrentFuzzedDelay=function(){var n=this.getCurrentMinPossibleDelay(),a=this.getCurrentMaxPossibleDelay();return n+Math.random()*(a-n)},t})();return rf=s,rf}var nf,Xv;function DA(){if(Xv)return nf;Xv=1;var s=Io(),e=function(i,n){return n===void 0&&(n=!1),function(a,o,l){if(a){i(a);return}if(o.statusCode>=400&&o.statusCode<=599){var u=l;if(n)if(s.TextDecoder){var c=t(o.headers&&o.headers["content-type"]);try{u=new TextDecoder(c).decode(l)}catch{}}else u=String.fromCharCode.apply(null,new Uint8Array(l));i({cause:u});return}i(null,l)}};function t(r){return r===void 0&&(r=""),r.toLowerCase().split(";").reduce(function(i,n){var a=n.split("="),o=a[0],l=a[1];return o.trim()==="charset"?l.trim():i},"utf-8")}return nf=e,nf}var Yv;function NA(){if(Yv)return Xu.exports;Yv=1;var s=Io(),e=p0(),t=w0(),r=IA(),i=PA();u.httpHandler=DA(),u.requestInterceptorsStorage=new r,u.responseInterceptorsStorage=new r,u.retryManager=new i;/**
|
|
3
|
-
* @license
|
|
4
|
-
* slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
|
|
5
|
-
* Copyright (c) 2014 David Björklund
|
|
6
|
-
* Available under the MIT license
|
|
7
|
-
* <https://github.com/kesla/parse-headers/blob/master/LICENCE>
|
|
8
|
-
*/var n=function(C){var p={};return C&&C.trim().split(`
|
|
9
|
-
`).forEach(function(T){var A=T.indexOf(":"),N=T.slice(0,A).trim().toLowerCase(),F=T.slice(A+1).trim();typeof p[N]>"u"?p[N]=F:Array.isArray(p[N])?p[N].push(F):p[N]=[p[N],F]}),p};Xu.exports=u,Xu.exports.default=u,u.XMLHttpRequest=s.XMLHttpRequest||f,u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:s.XDomainRequest,a(["get","put","post","patch","head","delete"],function(g){u[g==="delete"?"del":g]=function(C,p,T){return p=l(C,p,T),p.method=g.toUpperCase(),c(p)}});function a(g,C){for(var p=0;p<g.length;p++)C(g[p])}function o(g){for(var C in g)if(g.hasOwnProperty(C))return!1;return!0}function l(g,C,p){var T=g;return t(C)?(p=C,typeof g=="string"&&(T={uri:g})):T=e({},C,{uri:g}),T.callback=p,T}function u(g,C,p){return C=l(g,C,p),c(C)}function c(g){if(typeof g.callback>"u")throw new Error("callback argument missing");if(g.requestType&&u.requestInterceptorsStorage.getIsEnabled()){var C={uri:g.uri||g.url,headers:g.headers||{},body:g.body,metadata:g.metadata||{},retry:g.retry,timeout:g.timeout},p=u.requestInterceptorsStorage.execute(g.requestType,C);g.uri=p.uri,g.headers=p.headers,g.body=p.body,g.metadata=p.metadata,g.retry=p.retry,g.timeout=p.timeout}var T=!1,A=function(ae,ce,he){T||(T=!0,g.callback(ae,ce,he))};function N(){O.readyState===4&&!u.responseInterceptorsStorage.getIsEnabled()&&setTimeout(R,0)}function F(){var se=void 0;if(O.response?se=O.response:se=O.responseText||h(O),le)try{se=JSON.parse(se)}catch{}return se}function V(se){if(clearTimeout(de),clearTimeout(g.retryTimeout),se instanceof Error||(se=new Error(""+(se||"Unknown XMLHttpRequest Error"))),se.statusCode=0,!U&&u.retryManager.getIsEnabled()&&g.retry&&g.retry.shouldRetry()){g.retryTimeout=setTimeout(function(){g.retry.moveToNextAttempt(),g.xhr=O,c(g)},g.retry.getCurrentFuzzedDelay());return}if(g.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var ae={headers:pe.headers||{},body:pe.body,responseUrl:O.responseURL,responseType:O.responseType},ce=u.responseInterceptorsStorage.execute(g.requestType,ae);pe.body=ce.body,pe.headers=ce.headers}return A(se,pe)}function R(){if(!U){var se;clearTimeout(de),clearTimeout(g.retryTimeout),g.useXDR&&O.status===void 0?se=200:se=O.status===1223?204:O.status;var ae=pe,ce=null;if(se!==0?(ae={body:F(),statusCode:se,method:P,headers:{},url:E,rawRequest:O},O.getAllResponseHeaders&&(ae.headers=n(O.getAllResponseHeaders()))):ce=new Error("Internal XMLHttpRequest Error"),g.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var he={headers:ae.headers||{},body:ae.body,responseUrl:O.responseURL,responseType:O.responseType},ve=u.responseInterceptorsStorage.execute(g.requestType,he);ae.body=ve.body,ae.headers=ve.headers}return A(ce,ae,ae.body)}}var O=g.xhr||null;O||(g.cors||g.useXDR?O=new u.XDomainRequest:O=new u.XMLHttpRequest);var M,U,E=O.url=g.uri||g.url,P=O.method=g.method||"GET",Y=g.body||g.data,G=O.headers=g.headers||{},K=!!g.sync,le=!1,de,pe={body:void 0,headers:{},statusCode:0,method:P,url:E,rawRequest:O};if("json"in g&&g.json!==!1&&(le=!0,G.accept||G.Accept||(G.Accept="application/json"),P!=="GET"&&P!=="HEAD"&&(G["content-type"]||G["Content-Type"]||(G["Content-Type"]="application/json"),Y=JSON.stringify(g.json===!0?Y:g.json))),O.onreadystatechange=N,O.onload=R,O.onerror=V,O.onprogress=function(){},O.onabort=function(){U=!0,clearTimeout(g.retryTimeout)},O.ontimeout=V,O.open(P,E,!K,g.username,g.password),K||(O.withCredentials=!!g.withCredentials),!K&&g.timeout>0&&(de=setTimeout(function(){if(!U){U=!0,O.abort("timeout");var se=new Error("XMLHttpRequest timeout");se.code="ETIMEDOUT",V(se)}},g.timeout)),O.setRequestHeader)for(M in G)G.hasOwnProperty(M)&&O.setRequestHeader(M,G[M]);else if(g.headers&&!o(g.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in g&&(O.responseType=g.responseType),"beforeSend"in g&&typeof g.beforeSend=="function"&&g.beforeSend(O),O.send(Y||null),O}function h(g){try{if(g.responseType==="document")return g.responseXML;var C=g.responseXML&&g.responseXML.documentElement.nodeName==="parsererror";if(g.responseType===""&&!C)return g.responseXML}catch{}return null}function f(){}return Xu.exports}var LA=NA();const k0=qi(LA);var sf={exports:{}},af,Qv;function OA(){if(Qv)return af;Qv=1;var s=E0(),e=Object.create||(function(){function E(){}return function(P){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return E.prototype=P,new E}})();function t(E,P){this.name="ParsingError",this.code=E.code,this.message=P||E.message}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function r(E){function P(G,K,le,de){return(G|0)*3600+(K|0)*60+(le|0)+(de|0)/1e3}var Y=E.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return Y?Y[3]?P(Y[1],Y[2],Y[3].replace(":",""),Y[4]):Y[1]>59?P(Y[1],Y[2],0,Y[4]):P(0,Y[1],Y[2],Y[4]):null}function i(){this.values=e(null)}i.prototype={set:function(E,P){!this.get(E)&&P!==""&&(this.values[E]=P)},get:function(E,P,Y){return Y?this.has(E)?this.values[E]:P[Y]:this.has(E)?this.values[E]:P},has:function(E){return E in this.values},alt:function(E,P,Y){for(var G=0;G<Y.length;++G)if(P===Y[G]){this.set(E,P);break}},integer:function(E,P){/^-?\d+$/.test(P)&&this.set(E,parseInt(P,10))},percent:function(E,P){return P.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(P=parseFloat(P),P>=0&&P<=100)?(this.set(E,P),!0):!1}};function n(E,P,Y,G){var K=G?E.split(G):[E];for(var le in K)if(typeof K[le]=="string"){var de=K[le].split(Y);if(de.length===2){var pe=de[0].trim(),se=de[1].trim();P(pe,se)}}}function a(E,P,Y){var G=E;function K(){var pe=r(E);if(pe===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+G);return E=E.replace(/^[^\sa-zA-Z-]+/,""),pe}function le(pe,se){var ae=new i;n(pe,function(ce,he){switch(ce){case"region":for(var ve=Y.length-1;ve>=0;ve--)if(Y[ve].id===he){ae.set(ce,Y[ve].region);break}break;case"vertical":ae.alt(ce,he,["rl","lr"]);break;case"line":var Ae=he.split(","),De=Ae[0];ae.integer(ce,De),ae.percent(ce,De)&&ae.set("snapToLines",!1),ae.alt(ce,De,["auto"]),Ae.length===2&&ae.alt("lineAlign",Ae[1],["start","center","end"]);break;case"position":Ae=he.split(","),ae.percent(ce,Ae[0]),Ae.length===2&&ae.alt("positionAlign",Ae[1],["start","center","end"]);break;case"size":ae.percent(ce,he);break;case"align":ae.alt(ce,he,["start","center","end","left","right"]);break}},/:/,/\s/),se.region=ae.get("region",null),se.vertical=ae.get("vertical","");try{se.line=ae.get("line","auto")}catch{}se.lineAlign=ae.get("lineAlign","start"),se.snapToLines=ae.get("snapToLines",!0),se.size=ae.get("size",100);try{se.align=ae.get("align","center")}catch{se.align=ae.get("align","middle")}try{se.position=ae.get("position","auto")}catch{se.position=ae.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},se.align)}se.positionAlign=ae.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},se.align)}function de(){E=E.replace(/^\s+/,"")}if(de(),P.startTime=K(),de(),E.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+G);E=E.substr(3),de(),P.endTime=K(),de(),le(E,P)}var o=s.createElement&&s.createElement("textarea"),l={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},u={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},c={v:"title",lang:"lang"},h={rt:"ruby"};function f(E,P){function Y(){if(!P)return null;function De(Ne){return P=P.substr(Ne.length),Ne}var Me=P.match(/^([^<]*)(<[^>]*>?)?/);return De(Me[1]?Me[1]:Me[2])}function G(De){return o.innerHTML=De,De=o.textContent,o.textContent="",De}function K(De,Me){return!h[Me.localName]||h[Me.localName]===De.localName}function le(De,Me){var Ne=l[De];if(!Ne)return null;var Je=E.document.createElement(Ne),Re=c[De];return Re&&Me&&(Je[Re]=Me.trim()),Je}for(var de=E.document.createElement("div"),pe=de,se,ae=[];(se=Y())!==null;){if(se[0]==="<"){if(se[1]==="/"){ae.length&&ae[ae.length-1]===se.substr(2).replace(">","")&&(ae.pop(),pe=pe.parentNode);continue}var ce=r(se.substr(1,se.length-2)),he;if(ce){he=E.document.createProcessingInstruction("timestamp",ce),pe.appendChild(he);continue}var ve=se.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!ve||(he=le(ve[1],ve[3]),!he)||!K(pe,he))continue;if(ve[2]){var Ae=ve[2].split(".");Ae.forEach(function(De){var Me=/^bg_/.test(De),Ne=Me?De.slice(3):De;if(u.hasOwnProperty(Ne)){var Je=Me?"background-color":"color",Re=u[Ne];he.style[Je]=Re}}),he.className=Ae.join(" ")}ae.push(ve[1]),pe.appendChild(he),pe=he;continue}pe.appendChild(E.document.createTextNode(G(se)))}return de}var g=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function C(E){for(var P=0;P<g.length;P++){var Y=g[P];if(E>=Y[0]&&E<=Y[1])return!0}return!1}function p(E){var P=[],Y="",G;if(!E||!E.childNodes)return"ltr";function K(pe,se){for(var ae=se.childNodes.length-1;ae>=0;ae--)pe.push(se.childNodes[ae])}function le(pe){if(!pe||!pe.length)return null;var se=pe.pop(),ae=se.textContent||se.innerText;if(ae){var ce=ae.match(/^.*(\n|\r)/);return ce?(pe.length=0,ce[0]):ae}if(se.tagName==="ruby")return le(pe);if(se.childNodes)return K(pe,se),le(pe)}for(K(P,E);Y=le(P);)for(var de=0;de<Y.length;de++)if(G=Y.charCodeAt(de),C(G))return"rtl";return"ltr"}function T(E){if(typeof E.line=="number"&&(E.snapToLines||E.line>=0&&E.line<=100))return E.line;if(!E.track||!E.track.textTrackList||!E.track.textTrackList.mediaElement)return-1;for(var P=E.track,Y=P.textTrackList,G=0,K=0;K<Y.length&&Y[K]!==P;K++)Y[K].mode==="showing"&&G++;return++G*-1}function A(){}A.prototype.applyStyles=function(E,P){P=P||this.div;for(var Y in E)E.hasOwnProperty(Y)&&(P.style[Y]=E[Y])},A.prototype.formatStyle=function(E,P){return E===0?0:E+P};function N(E,P,Y){A.call(this),this.cue=P,this.cueDiv=f(E,P.text);var G={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:P.vertical===""?"horizontal-tb":P.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(G,this.cueDiv),this.div=E.document.createElement("div"),G={direction:p(this.cueDiv),writingMode:P.vertical===""?"horizontal-tb":P.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:P.align==="middle"?"center":P.align,font:Y.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(G),this.div.appendChild(this.cueDiv);var K=0;switch(P.positionAlign){case"start":case"line-left":K=P.position;break;case"center":K=P.position-P.size/2;break;case"end":case"line-right":K=P.position-P.size;break}P.vertical===""?this.applyStyles({left:this.formatStyle(K,"%"),width:this.formatStyle(P.size,"%")}):this.applyStyles({top:this.formatStyle(K,"%"),height:this.formatStyle(P.size,"%")}),this.move=function(le){this.applyStyles({top:this.formatStyle(le.top,"px"),bottom:this.formatStyle(le.bottom,"px"),left:this.formatStyle(le.left,"px"),right:this.formatStyle(le.right,"px"),height:this.formatStyle(le.height,"px"),width:this.formatStyle(le.width,"px")})}}N.prototype=e(A.prototype),N.prototype.constructor=N;function F(E){var P,Y,G,K;if(E.div){Y=E.div.offsetHeight,G=E.div.offsetWidth,K=E.div.offsetTop;var le=(le=E.div.childNodes)&&(le=le[0])&&le.getClientRects&&le.getClientRects();E=E.div.getBoundingClientRect(),P=le?Math.max(le[0]&&le[0].height||0,E.height/le.length):0}this.left=E.left,this.right=E.right,this.top=E.top||K,this.height=E.height||Y,this.bottom=E.bottom||K+(E.height||Y),this.width=E.width||G,this.lineHeight=P!==void 0?P:E.lineHeight}F.prototype.move=function(E,P){switch(P=P!==void 0?P:this.lineHeight,E){case"+x":this.left+=P,this.right+=P;break;case"-x":this.left-=P,this.right-=P;break;case"+y":this.top+=P,this.bottom+=P;break;case"-y":this.top-=P,this.bottom-=P;break}},F.prototype.overlaps=function(E){return this.left<E.right&&this.right>E.left&&this.top<E.bottom&&this.bottom>E.top},F.prototype.overlapsAny=function(E){for(var P=0;P<E.length;P++)if(this.overlaps(E[P]))return!0;return!1},F.prototype.within=function(E){return this.top>=E.top&&this.bottom<=E.bottom&&this.left>=E.left&&this.right<=E.right},F.prototype.overlapsOppositeAxis=function(E,P){switch(P){case"+x":return this.left<E.left;case"-x":return this.right>E.right;case"+y":return this.top<E.top;case"-y":return this.bottom>E.bottom}},F.prototype.intersectPercentage=function(E){var P=Math.max(0,Math.min(this.right,E.right)-Math.max(this.left,E.left)),Y=Math.max(0,Math.min(this.bottom,E.bottom)-Math.max(this.top,E.top)),G=P*Y;return G/(this.height*this.width)},F.prototype.toCSSCompatValues=function(E){return{top:this.top-E.top,bottom:E.bottom-this.bottom,left:this.left-E.left,right:E.right-this.right,height:this.height,width:this.width}},F.getSimpleBoxPosition=function(E){var P=E.div?E.div.offsetHeight:E.tagName?E.offsetHeight:0,Y=E.div?E.div.offsetWidth:E.tagName?E.offsetWidth:0,G=E.div?E.div.offsetTop:E.tagName?E.offsetTop:0;E=E.div?E.div.getBoundingClientRect():E.tagName?E.getBoundingClientRect():E;var K={left:E.left,right:E.right,top:E.top||G,height:E.height||P,bottom:E.bottom||G+(E.height||P),width:E.width||Y};return K};function V(E,P,Y,G){function K(Ne,Je){for(var Re,Oe=new F(Ne),He=1,ot=0;ot<Je.length;ot++){for(;Ne.overlapsOppositeAxis(Y,Je[ot])||Ne.within(Y)&&Ne.overlapsAny(G);)Ne.move(Je[ot]);if(Ne.within(Y))return Ne;var wt=Ne.intersectPercentage(Y);He>wt&&(Re=new F(Ne),He=wt),Ne=new F(Oe)}return Re||Oe}var le=new F(P),de=P.cue,pe=T(de),se=[];if(de.snapToLines){var ae;switch(de.vertical){case"":se=["+y","-y"],ae="height";break;case"rl":se=["+x","-x"],ae="width";break;case"lr":se=["-x","+x"],ae="width";break}var ce=le.lineHeight,he=ce*Math.round(pe),ve=Y[ae]+ce,Ae=se[0];Math.abs(he)>ve&&(he=he<0?-1:1,he*=Math.ceil(ve/ce)*ce),pe<0&&(he+=de.vertical===""?Y.height:Y.width,se=se.reverse()),le.move(Ae,he)}else{var De=le.lineHeight/Y.height*100;switch(de.lineAlign){case"center":pe-=De/2;break;case"end":pe-=De;break}switch(de.vertical){case"":P.applyStyles({top:P.formatStyle(pe,"%")});break;case"rl":P.applyStyles({left:P.formatStyle(pe,"%")});break;case"lr":P.applyStyles({right:P.formatStyle(pe,"%")});break}se=["+y","-x","+x","-y"],le=new F(P)}var Me=K(le,se);P.move(Me.toCSSCompatValues(Y))}function R(){}R.StringDecoder=function(){return{decode:function(E){if(!E)return"";if(typeof E!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(E))}}},R.convertCueToDOMTree=function(E,P){return!E||!P?null:f(E,P)};var O=.05,M="sans-serif",U="1.5%";return R.processCues=function(E,P,Y){if(!E||!P||!Y)return null;for(;Y.firstChild;)Y.removeChild(Y.firstChild);var G=E.document.createElement("div");G.style.position="absolute",G.style.left="0",G.style.right="0",G.style.top="0",G.style.bottom="0",G.style.margin=U,Y.appendChild(G);function K(ce){for(var he=0;he<ce.length;he++)if(ce[he].hasBeenReset||!ce[he].displayState)return!0;return!1}if(!K(P)){for(var le=0;le<P.length;le++)G.appendChild(P[le].displayState);return}var de=[],pe=F.getSimpleBoxPosition(G),se=Math.round(pe.height*O*100)/100,ae={font:se+"px "+M};(function(){for(var ce,he,ve=0;ve<P.length;ve++)he=P[ve],ce=new N(E,he,ae),G.appendChild(ce.div),V(E,ce,pe,de),he.displayState=ce.div,de.push(F.getSimpleBoxPosition(ce))})()},R.Parser=function(E,P,Y){Y||(Y=P,P={}),P||(P={}),this.window=E,this.vttjs=P,this.state="INITIAL",this.buffer="",this.decoder=Y||new TextDecoder("utf8"),this.regionList=[]},R.Parser.prototype={reportOrThrowError:function(E){if(E instanceof t)this.onparsingerror&&this.onparsingerror(E);else throw E},parse:function(E){var P=this;E&&(P.buffer+=P.decoder.decode(E,{stream:!0}));function Y(){for(var ce=P.buffer,he=0;he<ce.length&&ce[he]!=="\r"&&ce[he]!==`
|
|
10
|
-
`;)++he;var ve=ce.substr(0,he);return ce[he]==="\r"&&++he,ce[he]===`
|
|
11
|
-
`&&++he,P.buffer=ce.substr(he),ve}function G(ce){var he=new i;if(n(ce,function(Ae,De){switch(Ae){case"id":he.set(Ae,De);break;case"width":he.percent(Ae,De);break;case"lines":he.integer(Ae,De);break;case"regionanchor":case"viewportanchor":var Me=De.split(",");if(Me.length!==2)break;var Ne=new i;if(Ne.percent("x",Me[0]),Ne.percent("y",Me[1]),!Ne.has("x")||!Ne.has("y"))break;he.set(Ae+"X",Ne.get("x")),he.set(Ae+"Y",Ne.get("y"));break;case"scroll":he.alt(Ae,De,["up"]);break}},/=/,/\s/),he.has("id")){var ve=new(P.vttjs.VTTRegion||P.window.VTTRegion);ve.width=he.get("width",100),ve.lines=he.get("lines",3),ve.regionAnchorX=he.get("regionanchorX",0),ve.regionAnchorY=he.get("regionanchorY",100),ve.viewportAnchorX=he.get("viewportanchorX",0),ve.viewportAnchorY=he.get("viewportanchorY",100),ve.scroll=he.get("scroll",""),P.onregion&&P.onregion(ve),P.regionList.push({id:he.get("id"),region:ve})}}function K(ce){var he=new i;n(ce,function(ve,Ae){switch(ve){case"MPEGT":he.integer(ve+"S",Ae);break;case"LOCA":he.set(ve+"L",r(Ae));break}},/[^\d]:/,/,/),P.ontimestampmap&&P.ontimestampmap({MPEGTS:he.get("MPEGTS"),LOCAL:he.get("LOCAL")})}function le(ce){ce.match(/X-TIMESTAMP-MAP/)?n(ce,function(he,ve){switch(he){case"X-TIMESTAMP-MAP":K(ve);break}},/=/):n(ce,function(he,ve){switch(he){case"Region":G(ve);break}},/:/)}try{var de;if(P.state==="INITIAL"){if(!/\r\n|\n/.test(P.buffer))return this;de=Y();var pe=de.match(/^WEBVTT([ \t].*)?$/);if(!pe||!pe[0])throw new t(t.Errors.BadSignature);P.state="HEADER"}for(var se=!1;P.buffer;){if(!/\r\n|\n/.test(P.buffer))return this;switch(se?se=!1:de=Y(),P.state){case"HEADER":/:/.test(de)?le(de):de||(P.state="ID");continue;case"NOTE":de||(P.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(de)){P.state="NOTE";break}if(!de)continue;P.cue=new(P.vttjs.VTTCue||P.window.VTTCue)(0,0,"");try{P.cue.align="center"}catch{P.cue.align="middle"}if(P.state="CUE",de.indexOf("-->")===-1){P.cue.id=de;continue}case"CUE":try{a(de,P.cue,P.regionList)}catch(ce){P.reportOrThrowError(ce),P.cue=null,P.state="BADCUE";continue}P.state="CUETEXT";continue;case"CUETEXT":var ae=de.indexOf("-->")!==-1;if(!de||ae&&(se=!0)){P.oncue&&P.oncue(P.cue),P.cue=null,P.state="ID";continue}P.cue.text&&(P.cue.text+=`
|
|
12
|
-
`),P.cue.text+=de.replace(/\u2028/g,`
|
|
13
|
-
`).replace(/u2029/g,`
|
|
14
|
-
`);continue;case"BADCUE":de||(P.state="ID");continue}}}catch(ce){P.reportOrThrowError(ce),P.state==="CUETEXT"&&P.cue&&P.oncue&&P.oncue(P.cue),P.cue=null,P.state=P.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var E=this;try{if(E.buffer+=E.decoder.decode(),(E.cue||E.state==="HEADER")&&(E.buffer+=`
|
|
15
|
-
|
|
16
|
-
`,E.parse()),E.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(P){E.reportOrThrowError(P)}return E.onflush&&E.onflush(),this}},af=R,af}var of,Jv;function MA(){if(Jv)return of;Jv=1;var s="auto",e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function r(a){if(typeof a!="string")return!1;var o=e[a.toLowerCase()];return o?a.toLowerCase():!1}function i(a){if(typeof a!="string")return!1;var o=t[a.toLowerCase()];return o?a.toLowerCase():!1}function n(a,o,l){this.hasBeenReset=!1;var u="",c=!1,h=a,f=o,g=l,C=null,p="",T=!0,A="auto",N="start",F="auto",V="auto",R=100,O="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return u},set:function(M){u=""+M}},pauseOnExit:{enumerable:!0,get:function(){return c},set:function(M){c=!!M}},startTime:{enumerable:!0,get:function(){return h},set:function(M){if(typeof M!="number")throw new TypeError("Start time must be set to a number.");h=M,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return f},set:function(M){if(typeof M!="number")throw new TypeError("End time must be set to a number.");f=M,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return g},set:function(M){g=""+M,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return C},set:function(M){C=M,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return p},set:function(M){var U=r(M);if(U===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");p=U,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return T},set:function(M){T=!!M,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return A},set:function(M){if(typeof M!="number"&&M!==s)throw new SyntaxError("Line: an invalid number or illegal string was specified.");A=M,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return N},set:function(M){var U=i(M);U?(N=U,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return F},set:function(M){if(M<0||M>100)throw new Error("Position must be between 0 and 100.");F=M,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return V},set:function(M){var U=i(M);U?(V=U,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return R},set:function(M){if(M<0||M>100)throw new Error("Size must be between 0 and 100.");R=M,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return O},set:function(M){var U=i(M);if(!U)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");O=U,this.hasBeenReset=!0}}}),this.displayState=void 0}return n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},of=n,of}var lf,Zv;function RA(){if(Zv)return lf;Zv=1;var s={"":!0,up:!0};function e(i){if(typeof i!="string")return!1;var n=s[i.toLowerCase()];return n?i.toLowerCase():!1}function t(i){return typeof i=="number"&&i>=0&&i<=100}function r(){var i=100,n=3,a=0,o=100,l=0,u=100,c="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(h){if(!t(h))throw new Error("Width must be between 0 and 100.");i=h}},lines:{enumerable:!0,get:function(){return n},set:function(h){if(typeof h!="number")throw new TypeError("Lines must be set to a number.");n=h}},regionAnchorY:{enumerable:!0,get:function(){return o},set:function(h){if(!t(h))throw new Error("RegionAnchorX must be between 0 and 100.");o=h}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(h){if(!t(h))throw new Error("RegionAnchorY must be between 0 and 100.");a=h}},viewportAnchorY:{enumerable:!0,get:function(){return u},set:function(h){if(!t(h))throw new Error("ViewportAnchorY must be between 0 and 100.");u=h}},viewportAnchorX:{enumerable:!0,get:function(){return l},set:function(h){if(!t(h))throw new Error("ViewportAnchorX must be between 0 and 100.");l=h}},scroll:{enumerable:!0,get:function(){return c},set:function(h){var f=e(h);f===!1?console.warn("Scroll: an invalid or illegal string was specified."):c=f}}})}return lf=r,lf}var ey;function BA(){if(ey)return sf.exports;ey=1;var s=Io(),e=sf.exports={WebVTT:OA(),VTTCue:MA(),VTTRegion:RA()};s.vttjs=e,s.WebVTT=e.WebVTT;var t=e.VTTCue,r=e.VTTRegion,i=s.VTTCue,n=s.VTTRegion;return e.shim=function(){s.VTTCue=t,s.VTTRegion=r},e.restore=function(){s.VTTCue=i,s.VTTRegion=n},s.VTTCue||e.shim(),sf.exports}var FA=BA();const lo=qi(FA);var ty="https://example.com",xh=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=D.location&&D.location.href||"");var r=/^\/\//.test(e),i=!D.location&&!/\/\//i.test(e);e=new D.URL(e,D.location||ty);var n=new URL(t,e);return i?n.href.slice(ty.length):r?n.href.slice(n.protocol.length):n.href},$m=(function(){function s(){this.listeners={}}var e=s.prototype;return e.on=function(r,i){this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push(i)},e.off=function(r,i){if(!this.listeners[r])return!1;var n=this.listeners[r].indexOf(i);return this.listeners[r]=this.listeners[r].slice(0),this.listeners[r].splice(n,1),n>-1},e.trigger=function(r){var i=this.listeners[r];if(i)if(arguments.length===2)for(var n=i.length,a=0;a<n;++a)i[a].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),l=i.length,u=0;u<l;++u)i[u].apply(this,o)},e.dispose=function(){this.listeners={}},e.pipe=function(r){this.on("data",function(i){r.push(i)})},s})(),UA=function(e){return D.atob?D.atob(e):Buffer.from(e,"base64").toString("binary")};function x0(s){for(var e=UA(s),t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */let $A=class extends $m{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(`
|
|
17
|
-
`);t>-1;t=this.buffer.indexOf(`
|
|
18
|
-
`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}};const jA=" ",uf=function(s){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(s||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},VA=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},Si=function(s){const e={};if(!s)return e;const t=s.split(VA());let r=t.length,i;for(;r--;)t[r]!==""&&(i=/([^=]*)=(.*)/.exec(t[r]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),e[i[0]]=i[1]);return e},iy=s=>{const e=s.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};let HA=class extends $m{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,r;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const o=a(e);return o===e?n:n.concat([o])},[e]).forEach(n=>{for(let a=0;a<this.customParsers.length;a++)if(this.customParsers[a].call(this,n))return;if(n.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:n.slice(1)});return}if(n=n.replace("\r",""),t=/^#EXTM3U/.exec(n),t){this.trigger("data",{type:"tag",tagType:"m3u"});return}if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(n),t){r={type:"tag",tagType:"inf"},t[1]&&(r.duration=parseFloat(t[1])),t[2]&&(r.title=t[2]),this.trigger("data",r);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"targetduration"},t[1]&&(r.duration=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"version"},t[1]&&(r.version=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"media-sequence"},t[1]&&(r.number=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(r.number=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(n),t){r={type:"tag",tagType:"playlist-type"},t[1]&&(r.playlistType=t[1]),this.trigger("data",r);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(n),t){r=vt(uf(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",r);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(n),t){r={type:"tag",tagType:"allow-cache"},t[1]&&(r.allowed=!/NO/.test(t[1])),this.trigger("data",r);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(n),t){if(r={type:"tag",tagType:"map"},t[1]){const a=Si(t[1]);a.URI&&(r.uri=a.URI),a.BYTERANGE&&(r.byterange=uf(a.BYTERANGE))}this.trigger("data",r);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(n),t){r={type:"tag",tagType:"stream-inf"},t[1]&&(r.attributes=Si(t[1]),r.attributes.RESOLUTION&&(r.attributes.RESOLUTION=iy(r.attributes.RESOLUTION)),r.attributes.BANDWIDTH&&(r.attributes.BANDWIDTH=parseInt(r.attributes.BANDWIDTH,10)),r.attributes["FRAME-RATE"]&&(r.attributes["FRAME-RATE"]=parseFloat(r.attributes["FRAME-RATE"])),r.attributes["PROGRAM-ID"]&&(r.attributes["PROGRAM-ID"]=parseInt(r.attributes["PROGRAM-ID"],10))),this.trigger("data",r);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(n),t){r={type:"tag",tagType:"media"},t[1]&&(r.attributes=Si(t[1])),this.trigger("data",r);return}if(t=/^#EXT-X-ENDLIST/.exec(n),t){this.trigger("data",{type:"tag",tagType:"endlist"});return}if(t=/^#EXT-X-DISCONTINUITY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(n),t){r={type:"tag",tagType:"program-date-time"},t[1]&&(r.dateTimeString=t[1],r.dateTimeObject=new Date(t[1])),this.trigger("data",r);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(n),t){r={type:"tag",tagType:"key"},t[1]&&(r.attributes=Si(t[1]),r.attributes.IV&&(r.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(r.attributes.IV=r.attributes.IV.substring(2)),r.attributes.IV=r.attributes.IV.match(/.{8}/g),r.attributes.IV[0]=parseInt(r.attributes.IV[0],16),r.attributes.IV[1]=parseInt(r.attributes.IV[1],16),r.attributes.IV[2]=parseInt(r.attributes.IV[2],16),r.attributes.IV[3]=parseInt(r.attributes.IV[3],16),r.attributes.IV=new Uint32Array(r.attributes.IV))),this.trigger("data",r);return}if(t=/^#EXT-X-START:(.*)$/.exec(n),t){r={type:"tag",tagType:"start"},t[1]&&(r.attributes=Si(t[1]),r.attributes["TIME-OFFSET"]=parseFloat(r.attributes["TIME-OFFSET"]),r.attributes.PRECISE=/YES/.test(r.attributes.PRECISE)),this.trigger("data",r);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(n),t){r={type:"tag",tagType:"cue-out-cont"},t[1]?r.data=t[1]:r.data="",this.trigger("data",r);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(n),t){r={type:"tag",tagType:"cue-out"},t[1]?r.data=t[1]:r.data="",this.trigger("data",r);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(n),t){r={type:"tag",tagType:"cue-in"},t[1]?r.data=t[1]:r.data="",this.trigger("data",r);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"skip"},r.attributes=Si(t[1]),r.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(r.attributes["SKIPPED-SEGMENTS"]=parseInt(r.attributes["SKIPPED-SEGMENTS"],10)),r.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(r.attributes["RECENTLY-REMOVED-DATERANGES"]=r.attributes["RECENTLY-REMOVED-DATERANGES"].split(jA)),this.trigger("data",r);return}if(t=/^#EXT-X-PART:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"part"},r.attributes=Si(t[1]),["DURATION"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseFloat(r.attributes[a]))}),["INDEPENDENT","GAP"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=/YES/.test(r.attributes[a]))}),r.attributes.hasOwnProperty("BYTERANGE")&&(r.attributes.byterange=uf(r.attributes.BYTERANGE)),this.trigger("data",r);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"server-control"},r.attributes=Si(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseFloat(r.attributes[a]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=/YES/.test(r.attributes[a]))}),this.trigger("data",r);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"part-inf"},r.attributes=Si(t[1]),["PART-TARGET"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseFloat(r.attributes[a]))}),this.trigger("data",r);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"preload-hint"},r.attributes=Si(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(r.attributes.hasOwnProperty(a)){r.attributes[a]=parseInt(r.attributes[a],10);const o=a==="BYTERANGE-LENGTH"?"length":"offset";r.attributes.byterange=r.attributes.byterange||{},r.attributes.byterange[o]=r.attributes[a],delete r.attributes[a]}}),this.trigger("data",r);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"rendition-report"},r.attributes=Si(t[1]),["LAST-MSN","LAST-PART"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseInt(r.attributes[a],10))}),this.trigger("data",r);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"daterange"},r.attributes=Si(t[1]),["ID","CLASS"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=String(r.attributes[o]))}),["START-DATE","END-DATE"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=new Date(r.attributes[o]))}),["DURATION","PLANNED-DURATION"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=parseFloat(r.attributes[o]))}),["END-ON-NEXT"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=/YES/i.test(r.attributes[o]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(o){r.attributes.hasOwnProperty(o)&&(r.attributes[o]=r.attributes[o].toString(16))});const a=/^X-([A-Z]+-)+[A-Z]+$/;for(const o in r.attributes){if(!a.test(o))continue;const l=/[0-9A-Fa-f]{6}/g.test(r.attributes[o]),u=/^\d+(\.\d+)?$/.test(r.attributes[o]);r.attributes[o]=l?r.attributes[o].toString(16):u?parseFloat(r.attributes[o]):String(r.attributes[o])}this.trigger("data",r);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(n),t){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"i-frames-only"});return}if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(n),t){r={type:"tag",tagType:"content-steering"},r.attributes=Si(t[1]),this.trigger("data",r);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(n),t){r={type:"tag",tagType:"i-frame-playlist"},r.attributes=Si(t[1]),r.attributes.URI&&(r.uri=r.attributes.URI),r.attributes.BANDWIDTH&&(r.attributes.BANDWIDTH=parseInt(r.attributes.BANDWIDTH,10)),r.attributes.RESOLUTION&&(r.attributes.RESOLUTION=iy(r.attributes.RESOLUTION)),r.attributes["AVERAGE-BANDWIDTH"]&&(r.attributes["AVERAGE-BANDWIDTH"]=parseInt(r.attributes["AVERAGE-BANDWIDTH"],10)),r.attributes["FRAME-RATE"]&&(r.attributes["FRAME-RATE"]=parseFloat(r.attributes["FRAME-RATE"])),this.trigger("data",r);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(n),t){r={type:"tag",tagType:"define"},r.attributes=Si(t[1]),this.trigger("data",r);return}this.trigger("data",{type:"tag",data:n.slice(4)})})}addParser({expression:e,customType:t,dataParser:r,segment:i}){typeof r!="function"&&(r=n=>n),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:r(n),customType:t,segment:i}),!0})}addTagMapper({expression:e,map:t}){const r=i=>e.test(i)?t(i):i;this.tagMappers.push(r)}};const qA=s=>s.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),Xn=function(s){const e={};return Object.keys(s).forEach(function(t){e[qA(t)]=s[t]}),e},cf=function(s){const{serverControl:e,targetDuration:t,partTargetDuration:r}=s;if(!e)return;const i="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",o=t&&t*3,l=r&&r*2;t&&!e.hasOwnProperty(n)&&(e[n]=o,this.trigger("info",{message:`${i} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[n]<o&&(this.trigger("warn",{message:`${i} clamping HOLD-BACK (${e[n]}) to targetDuration * 3 (${o})`}),e[n]=o),r&&!e.hasOwnProperty(a)&&(e[a]=r*3,this.trigger("info",{message:`${i} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),r&&e[a]<l&&(this.trigger("warn",{message:`${i} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${l}).`}),e[a]=l)};let zA=class extends $m{constructor(e={}){super(),this.lineStream=new $A,this.parseStream=new HA,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,r=[];let i={},n,a,o=!1;const l=function(){},u={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},c="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let h=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let f=0,g=0;const C={};this.on("end",()=>{i.uri||!i.parts&&!i.preloadHints||(!i.map&&n&&(i.map=n),!i.key&&a&&(i.key=a),!i.timeline&&typeof h=="number"&&(i.timeline=h),this.manifest.preloadSegment=i)}),this.parseStream.on("data",function(p){let T,A;if(t.manifest.definitions){for(const N in t.manifest.definitions)if(p.uri&&(p.uri=p.uri.replace(`{$${N}}`,t.manifest.definitions[N])),p.attributes)for(const F in p.attributes)typeof p.attributes[F]=="string"&&(p.attributes[F]=p.attributes[F].replace(`{$${N}}`,t.manifest.definitions[N]))}({tag(){({version(){p.version&&(this.manifest.version=p.version)},"allow-cache"(){this.manifest.allowCache=p.allowed,"allowed"in p||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const N={};"length"in p&&(i.byterange=N,N.length=p.length,"offset"in p||(p.offset=f)),"offset"in p&&(i.byterange=N,N.offset=p.offset),f=N.offset+N.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),p.title&&(i.title=p.title),p.duration>0&&(i.duration=p.duration),p.duration===0&&(i.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=r},key(){if(!p.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(p.attributes.METHOD==="NONE"){a=null;return}if(!p.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(p.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:p.attributes};return}if(p.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:p.attributes.URI};return}if(p.attributes.KEYFORMAT===c){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(p.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(p.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),p.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(p.attributes.KEYID&&p.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:p.attributes.KEYFORMAT,keyId:p.attributes.KEYID.substring(2)},pssh:x0(p.attributes.URI.split(",")[1])};return}p.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:p.attributes.METHOD||"AES-128",uri:p.attributes.URI},typeof p.attributes.IV<"u"&&(a.iv=p.attributes.IV)},"media-sequence"(){if(!isFinite(p.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+p.number});return}this.manifest.mediaSequence=p.number},"discontinuity-sequence"(){if(!isFinite(p.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+p.number});return}this.manifest.discontinuitySequence=p.number,h=p.number},"playlist-type"(){if(!/VOD|EVENT/.test(p.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+p.playlist});return}this.manifest.playlistType=p.playlistType},map(){n={},p.uri&&(n.uri=p.uri),p.byterange&&(n.byterange=p.byterange),a&&(n.key=a)},"stream-inf"(){if(this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||u,!p.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}i.attributes||(i.attributes={}),vt(i.attributes,p.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||u,!(p.attributes&&p.attributes.TYPE&&p.attributes["GROUP-ID"]&&p.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const N=this.manifest.mediaGroups[p.attributes.TYPE];N[p.attributes["GROUP-ID"]]=N[p.attributes["GROUP-ID"]]||{},T=N[p.attributes["GROUP-ID"]],A={default:/yes/i.test(p.attributes.DEFAULT)},A.default?A.autoselect=!0:A.autoselect=/yes/i.test(p.attributes.AUTOSELECT),p.attributes.LANGUAGE&&(A.language=p.attributes.LANGUAGE),p.attributes.URI&&(A.uri=p.attributes.URI),p.attributes["INSTREAM-ID"]&&(A.instreamId=p.attributes["INSTREAM-ID"]),p.attributes.CHARACTERISTICS&&(A.characteristics=p.attributes.CHARACTERISTICS),p.attributes.FORCED&&(A.forced=/yes/i.test(p.attributes.FORCED)),T[p.attributes.NAME]=A},discontinuity(){h+=1,i.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=p.dateTimeString,this.manifest.dateTimeObject=p.dateTimeObject),i.dateTimeString=p.dateTimeString,i.dateTimeObject=p.dateTimeObject;const{lastProgramDateTime:N}=this;this.lastProgramDateTime=new Date(p.dateTimeString).getTime(),N===null&&this.manifest.segments.reduceRight((F,V)=>(V.programDateTime=F-V.duration*1e3,V.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(p.duration)||p.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+p.duration});return}this.manifest.targetDuration=p.duration,cf.call(this,this.manifest)},start(){if(!p.attributes||isNaN(p.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:p.attributes["TIME-OFFSET"],precise:p.attributes.PRECISE}},"cue-out"(){i.cueOut=p.data},"cue-out-cont"(){i.cueOutCont=p.data},"cue-in"(){i.cueIn=p.data},skip(){this.manifest.skip=Xn(p.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",p.attributes,["SKIPPED-SEGMENTS"])},part(){o=!0;const N=this.manifest.segments.length,F=Xn(p.attributes);i.parts=i.parts||[],i.parts.push(F),F.byterange&&(F.byterange.hasOwnProperty("offset")||(F.byterange.offset=g),g=F.byterange.offset+F.byterange.length);const V=i.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${V} for segment #${N}`,p.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((R,O)=>{R.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${O} lacks required attribute(s): LAST-PART`})})},"server-control"(){const N=this.manifest.serverControl=Xn(p.attributes);N.hasOwnProperty("canBlockReload")||(N.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),cf.call(this,this.manifest),N.canSkipDateranges&&!N.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const N=this.manifest.segments.length,F=Xn(p.attributes),V=F.type&&F.type==="PART";i.preloadHints=i.preloadHints||[],i.preloadHints.push(F),F.byterange&&(F.byterange.hasOwnProperty("offset")||(F.byterange.offset=V?g:0,V&&(g=F.byterange.offset+F.byterange.length)));const R=i.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${R} for segment #${N}`,p.attributes,["TYPE","URI"]),!!F.type)for(let O=0;O<i.preloadHints.length-1;O++){const M=i.preloadHints[O];M.type&&M.type===F.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${R} for segment #${N} has the same TYPE ${F.type} as preload hint #${O}`})}},"rendition-report"(){const N=Xn(p.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(N);const F=this.manifest.renditionReports.length-1,V=["LAST-MSN","URI"];o&&V.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${F}`,p.attributes,V)},"part-inf"(){this.manifest.partInf=Xn(p.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",p.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),cf.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(Xn(p.attributes));const N=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${N}`,p.attributes,["ID","START-DATE"]);const F=this.manifest.dateRanges[N];F.endDate&&F.startDate&&new Date(F.endDate)<new Date(F.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),F.duration&&F.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),F.plannedDuration&&F.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const V=!!F.endOnNext;if(V&&!F.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),V&&(F.duration||F.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),F.duration&&F.endDate){const O=F.startDate.getTime()+F.duration*1e3;this.manifest.dateRanges[N].endDate=new Date(O)}if(!C[F.id])C[F.id]=F;else{for(const O in C[F.id])if(F[O]&&JSON.stringify(C[F.id][O])!==JSON.stringify(F[O])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const R=this.manifest.dateRanges.findIndex(O=>O.id===F.id);this.manifest.dateRanges[R]=vt(this.manifest.dateRanges[R],F),C[F.id]=vt(C[F.id],F),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=Xn(p.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",p.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const N=(F,V)=>{if(F in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${F}`});return}this.manifest.definitions[F]=V};if("QUERYPARAM"in p.attributes){if("NAME"in p.attributes||"IMPORT"in p.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const F=this.params.get(p.attributes.QUERYPARAM);if(!F){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${p.attributes.QUERYPARAM}`});return}N(p.attributes.QUERYPARAM,decodeURIComponent(F));return}if("NAME"in p.attributes){if("IMPORT"in p.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in p.attributes)||typeof p.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${p.attributes.NAME}`});return}N(p.attributes.NAME,p.attributes.VALUE);return}if("IMPORT"in p.attributes){if(!this.mainDefinitions[p.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${p.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}N(p.attributes.IMPORT,this.mainDefinitions[p.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:p.attributes,uri:p.uri,timeline:h}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",p.attributes,["BANDWIDTH","URI"])}}[p.tagType]||l).call(t)},uri(){i.uri=p.uri,r.push(i),this.manifest.targetDuration&&!("duration"in i)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),i.duration=this.manifest.targetDuration),a&&(i.key=a),i.timeline=h,n&&(i.map=n),g=0,this.lastProgramDateTime!==null&&(i.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=i.duration*1e3),i={}},comment(){},custom(){p.segment?(i.custom=i.custom||{},i.custom[p.customType]=p.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[p.customType]=p.data)}})[p.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,r){const i=[];r.forEach(function(n){t.hasOwnProperty(n)||i.push(n)}),i.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${i.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(`
|
|
19
|
-
`),this.manifest.dateRanges.length&&this.lastProgramDateTime===null&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}};var zs={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},WA=["video","audio","text"],ry=["Video","Audio","Text"],A0=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,r,i){var n=("00"+Number(r).toString(16)).slice(-2),a=("00"+Number(i).toString(16)).slice(-2);return"avc1."+n+"00"+a})},Hr=function(e){e===void 0&&(e="");var t=e.split(","),r=[];return t.forEach(function(i){i=i.trim();var n;WA.forEach(function(a){var o=zs[a].exec(i.toLowerCase());if(!(!o||o.length<=1)){n=a;var l=i.substring(0,o[1].length),u=i.replace(l,"");r.push({type:l,details:u,mediaType:a})}}),n||r.push({type:i,details:"",mediaType:"unknown"})}),r},GA=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var r=e.mediaGroups.AUDIO[t];if(!r)return null;for(var i in r){var n=r[i];if(n.default&&n.playlists)return Hr(n.playlists[0].attributes.CODECS)}return null},I0=function(e){return e===void 0&&(e=""),zs.audio.test(e.trim().toLowerCase())},KA=function(e){return e===void 0&&(e=""),zs.text.test(e.trim().toLowerCase())},uo=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return A0(n.trim())}),r="video";t.length===1&&I0(t[0])?r="audio":t.length===1&&KA(t[0])&&(r="application");var i="mp4";return t.every(function(n){return zs.mp4.test(n)})?i="mp4":t.every(function(n){return zs.webm.test(n)})?i="webm":t.every(function(n){return zs.ogg.test(n)})&&(i="ogg"),r+"/"+i+';codecs="'+e+'"'}},Pl=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),D.MediaSource&&D.MediaSource.isTypeSupported&&D.MediaSource.isTypeSupported(uo(e))||t&&D.ManagedMediaSource&&D.ManagedMediaSource.isTypeSupported&&D.ManagedMediaSource.isTypeSupported(uo(e))||!1},hf=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var r=0;r<ry.length;r++){var i=ry[r];if(zs["muxer"+i].test(t))return!0}return!1})},ny="mp4a.40.2",XA="avc1.4d400d",YA=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,QA=/^application\/dash\+xml/i,P0=function(e){return YA.test(e)?"hls":QA.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},JA=function(e){return e.toString(2).length},ZA=function(e){return Math.ceil(JA(e)/8)},D0=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},eI=function(e){return D0(e)},$e=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!eI(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},ui=D.BigInt||Number,Ap=[ui("0x1"),ui("0x100"),ui("0x10000"),ui("0x1000000"),ui("0x100000000"),ui("0x10000000000"),ui("0x1000000000000"),ui("0x100000000000000"),ui("0x10000000000000000")];(function(){var s=new Uint16Array([65484]),e=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var tI=function(e,t){var r=t===void 0?{}:t,i=r.signed,n=i===void 0?!1:i,a=r.le,o=a===void 0?!1:a;e=$e(e);var l=o?"reduce":"reduceRight",u=e[l]?e[l]:Array.prototype[l],c=u.call(e,function(f,g,C){var p=o?C:Math.abs(C+1-e.length);return f+ui(g)*Ap[p]},ui(0));if(n){var h=Ap[e.length]/ui(2)-ui(1);c=ui(c),c>h&&(c-=h,c-=h,c-=ui(2))}return Number(c)},iI=function(e,t){var r={},i=r.le,n=i===void 0?!1:i;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=ui(e);for(var a=ZA(e),o=new Uint8Array(new ArrayBuffer(a)),l=0;l<a;l++){var u=n?l:Math.abs(l+1-o.length);o[u]=Number(e/Ap[l]&ui(255)),e<0&&(o[u]=Math.abs(~o[u]),o[u]-=l===0?1:2)}return o},N0=function(e,t){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var r=new Uint8Array(e.length),i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r},rI=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t=t.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),t.length<=1)return $e(t[0]);var i=t.reduce(function(o,l,u){return o+(l.byteLength||l.length)},0),n=new Uint8Array(i),a=0;return t.forEach(function(o){o=$e(o),n.set(o,a),a+=o.byteLength}),n},Pt=function(e,t,r){var i=r===void 0?{}:r,n=i.offset,a=n===void 0?0:n,o=i.mask,l=o===void 0?[]:o;e=$e(e),t=$e(t);var u=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,function(c,h){var f=l[h]?l[h]&e[a+h]:e[a+h];return c===f})},nI=function(e,t,r){t.forEach(function(i){for(var n in e.mediaGroups[i])for(var a in e.mediaGroups[i][n]){var o=e.mediaGroups[i][n][a];r(o,i,n,a)}})},ol={},vn={},Is={},sy;function Ah(){if(sy)return Is;sy=1;function s(n,a,o){if(o===void 0&&(o=Array.prototype),n&&typeof o.find=="function")return o.find.call(n,a);for(var l=0;l<n.length;l++)if(Object.prototype.hasOwnProperty.call(n,l)){var u=n[l];if(a.call(void 0,u,l,n))return u}}function e(n,a){return a===void 0&&(a=Object),a&&typeof a.freeze=="function"?a.freeze(n):n}function t(n,a){if(n===null||typeof n!="object")throw new TypeError("target is not an object");for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o]);return n}var r=e({HTML:"text/html",isHTML:function(n){return n===r.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),i=e({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(n){return n===i.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});return Is.assign=t,Is.find=s,Is.freeze=e,Is.MIME_TYPE=r,Is.NAMESPACE=i,Is}var ay;function L0(){if(ay)return vn;ay=1;var s=Ah(),e=s.find,t=s.NAMESPACE;function r(j){return j!==""}function i(j){return j?j.split(/[\t\n\f\r ]+/).filter(r):[]}function n(j,H){return j.hasOwnProperty(H)||(j[H]=!0),j}function a(j){if(!j)return[];var H=i(j);return Object.keys(H.reduce(n,{}))}function o(j){return function(H){return j&&j.indexOf(H)!==-1}}function l(j,H){for(var ee in j)Object.prototype.hasOwnProperty.call(j,ee)&&(H[ee]=j[ee])}function u(j,H){var ee=j.prototype;if(!(ee instanceof H)){let fe=function(){};fe.prototype=H.prototype,fe=new fe,l(ee,fe),j.prototype=ee=fe}ee.constructor!=j&&(typeof j!="function"&&console.error("unknown Class:"+j),ee.constructor=j)}var c={},h=c.ELEMENT_NODE=1,f=c.ATTRIBUTE_NODE=2,g=c.TEXT_NODE=3,C=c.CDATA_SECTION_NODE=4,p=c.ENTITY_REFERENCE_NODE=5,T=c.ENTITY_NODE=6,A=c.PROCESSING_INSTRUCTION_NODE=7,N=c.COMMENT_NODE=8,F=c.DOCUMENT_NODE=9,V=c.DOCUMENT_TYPE_NODE=10,R=c.DOCUMENT_FRAGMENT_NODE=11,O=c.NOTATION_NODE=12,M={},U={};M.INDEX_SIZE_ERR=(U[1]="Index size error",1),M.DOMSTRING_SIZE_ERR=(U[2]="DOMString size error",2);var E=M.HIERARCHY_REQUEST_ERR=(U[3]="Hierarchy request error",3);M.WRONG_DOCUMENT_ERR=(U[4]="Wrong document",4),M.INVALID_CHARACTER_ERR=(U[5]="Invalid character",5),M.NO_DATA_ALLOWED_ERR=(U[6]="No data allowed",6),M.NO_MODIFICATION_ALLOWED_ERR=(U[7]="No modification allowed",7);var P=M.NOT_FOUND_ERR=(U[8]="Not found",8);M.NOT_SUPPORTED_ERR=(U[9]="Not supported",9);var Y=M.INUSE_ATTRIBUTE_ERR=(U[10]="Attribute in use",10);M.INVALID_STATE_ERR=(U[11]="Invalid state",11),M.SYNTAX_ERR=(U[12]="Syntax error",12),M.INVALID_MODIFICATION_ERR=(U[13]="Invalid modification",13),M.NAMESPACE_ERR=(U[14]="Invalid namespace",14),M.INVALID_ACCESS_ERR=(U[15]="Invalid access",15);function G(j,H){if(H instanceof Error)var ee=H;else ee=this,Error.call(this,U[j]),this.message=U[j],Error.captureStackTrace&&Error.captureStackTrace(this,G);return ee.code=j,H&&(this.message=this.message+": "+H),ee}G.prototype=Error.prototype,l(M,G);function K(){}K.prototype={length:0,item:function(j){return j>=0&&j<this.length?this[j]:null},toString:function(j,H){for(var ee=[],fe=0;fe<this.length;fe++)Rr(this[fe],ee,j,H);return ee.join("")},filter:function(j){return Array.prototype.filter.call(this,j)},indexOf:function(j){return Array.prototype.indexOf.call(this,j)}};function le(j,H){this._node=j,this._refresh=H,de(this)}function de(j){var H=j._node._inc||j._node.ownerDocument._inc;if(j._inc!==H){var ee=j._refresh(j._node);if(ha(j,"length",ee.length),!j.$$length||ee.length<j.$$length)for(var fe=ee.length;fe in j;fe++)Object.prototype.hasOwnProperty.call(j,fe)&&delete j[fe];l(ee,j),j._inc=H}}le.prototype.item=function(j){return de(this),this[j]||null},u(le,K);function pe(){}function se(j,H){for(var ee=j.length;ee--;)if(j[ee]===H)return ee}function ae(j,H,ee,fe){if(fe?H[se(H,fe)]=ee:H[H.length++]=ee,j){ee.ownerElement=j;var Ce=j.ownerDocument;Ce&&(fe&&Je(Ce,j,fe),Ne(Ce,j,ee))}}function ce(j,H,ee){var fe=se(H,ee);if(fe>=0){for(var Ce=H.length-1;fe<Ce;)H[fe]=H[++fe];if(H.length=Ce,j){var Ve=j.ownerDocument;Ve&&(Je(Ve,j,ee),ee.ownerElement=null)}}else throw new G(P,new Error(j.tagName+"@"+ee))}pe.prototype={length:0,item:K.prototype.item,getNamedItem:function(j){for(var H=this.length;H--;){var ee=this[H];if(ee.nodeName==j)return ee}},setNamedItem:function(j){var H=j.ownerElement;if(H&&H!=this._ownerElement)throw new G(Y);var ee=this.getNamedItem(j.nodeName);return ae(this._ownerElement,this,j,ee),ee},setNamedItemNS:function(j){var H=j.ownerElement,ee;if(H&&H!=this._ownerElement)throw new G(Y);return ee=this.getNamedItemNS(j.namespaceURI,j.localName),ae(this._ownerElement,this,j,ee),ee},removeNamedItem:function(j){var H=this.getNamedItem(j);return ce(this._ownerElement,this,H),H},removeNamedItemNS:function(j,H){var ee=this.getNamedItemNS(j,H);return ce(this._ownerElement,this,ee),ee},getNamedItemNS:function(j,H){for(var ee=this.length;ee--;){var fe=this[ee];if(fe.localName==H&&fe.namespaceURI==j)return fe}return null}};function he(){}he.prototype={hasFeature:function(j,H){return!0},createDocument:function(j,H,ee){var fe=new Me;if(fe.implementation=this,fe.childNodes=new K,fe.doctype=ee||null,ee&&fe.appendChild(ee),H){var Ce=fe.createElementNS(j,H);fe.appendChild(Ce)}return fe},createDocumentType:function(j,H,ee){var fe=new _r;return fe.name=j,fe.nodeName=j,fe.publicId=H||"",fe.systemId=ee||"",fe}};function ve(){}ve.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(j,H){return Be(this,j,H)},replaceChild:function(j,H){Be(this,j,H,Fe),H&&this.removeChild(H)},removeChild:function(j){return Oe(this,j)},appendChild:function(j){return this.insertBefore(j,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(j){return hs(this.ownerDocument||this,this,j)},normalize:function(){for(var j=this.firstChild;j;){var H=j.nextSibling;H&&H.nodeType==g&&j.nodeType==g?(this.removeChild(H),j.appendData(H.data)):(j.normalize(),j=H)}},isSupported:function(j,H){return this.ownerDocument.implementation.hasFeature(j,H)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(j){for(var H=this;H;){var ee=H._nsMap;if(ee){for(var fe in ee)if(Object.prototype.hasOwnProperty.call(ee,fe)&&ee[fe]===j)return fe}H=H.nodeType==f?H.ownerDocument:H.parentNode}return null},lookupNamespaceURI:function(j){for(var H=this;H;){var ee=H._nsMap;if(ee&&Object.prototype.hasOwnProperty.call(ee,j))return ee[j];H=H.nodeType==f?H.ownerDocument:H.parentNode}return null},isDefaultNamespace:function(j){var H=this.lookupPrefix(j);return H==null}};function Ae(j){return j=="<"&&"<"||j==">"&&">"||j=="&"&&"&"||j=='"'&&"""||"&#"+j.charCodeAt()+";"}l(c,ve),l(c,ve.prototype);function De(j,H){if(H(j))return!0;if(j=j.firstChild)do if(De(j,H))return!0;while(j=j.nextSibling)}function Me(){this.ownerDocument=this}function Ne(j,H,ee){j&&j._inc++;var fe=ee.namespaceURI;fe===t.XMLNS&&(H._nsMap[ee.prefix?ee.localName:""]=ee.value)}function Je(j,H,ee,fe){j&&j._inc++;var Ce=ee.namespaceURI;Ce===t.XMLNS&&delete H._nsMap[ee.prefix?ee.localName:""]}function Re(j,H,ee){if(j&&j._inc){j._inc++;var fe=H.childNodes;if(ee)fe[fe.length++]=ee;else{for(var Ce=H.firstChild,Ve=0;Ce;)fe[Ve++]=Ce,Ce=Ce.nextSibling;fe.length=Ve,delete fe[fe.length]}}}function Oe(j,H){var ee=H.previousSibling,fe=H.nextSibling;return ee?ee.nextSibling=fe:j.firstChild=fe,fe?fe.previousSibling=ee:j.lastChild=ee,H.parentNode=null,H.previousSibling=null,H.nextSibling=null,Re(j.ownerDocument,j),H}function He(j){return j&&(j.nodeType===ve.DOCUMENT_NODE||j.nodeType===ve.DOCUMENT_FRAGMENT_NODE||j.nodeType===ve.ELEMENT_NODE)}function ot(j){return j&&(Lt(j)||Oi(j)||wt(j)||j.nodeType===ve.DOCUMENT_FRAGMENT_NODE||j.nodeType===ve.COMMENT_NODE||j.nodeType===ve.PROCESSING_INSTRUCTION_NODE)}function wt(j){return j&&j.nodeType===ve.DOCUMENT_TYPE_NODE}function Lt(j){return j&&j.nodeType===ve.ELEMENT_NODE}function Oi(j){return j&&j.nodeType===ve.TEXT_NODE}function Ft(j,H){var ee=j.childNodes||[];if(e(ee,Lt)||wt(H))return!1;var fe=e(ee,wt);return!(H&&fe&&ee.indexOf(fe)>ee.indexOf(H))}function zi(j,H){var ee=j.childNodes||[];function fe(Ve){return Lt(Ve)&&Ve!==H}if(e(ee,fe))return!1;var Ce=e(ee,wt);return!(H&&Ce&&ee.indexOf(Ce)>ee.indexOf(H))}function Te(j,H,ee){if(!He(j))throw new G(E,"Unexpected parent node type "+j.nodeType);if(ee&&ee.parentNode!==j)throw new G(P,"child not in parent");if(!ot(H)||wt(H)&&j.nodeType!==ve.DOCUMENT_NODE)throw new G(E,"Unexpected node type "+H.nodeType+" for parent node type "+j.nodeType)}function ke(j,H,ee){var fe=j.childNodes||[],Ce=H.childNodes||[];if(H.nodeType===ve.DOCUMENT_FRAGMENT_NODE){var Ve=Ce.filter(Lt);if(Ve.length>1||e(Ce,Oi))throw new G(E,"More than one element or text in fragment");if(Ve.length===1&&!Ft(j,ee))throw new G(E,"Element in fragment can not be inserted before doctype")}if(Lt(H)&&!Ft(j,ee))throw new G(E,"Only one element can be added and only after doctype");if(wt(H)){if(e(fe,wt))throw new G(E,"Only one doctype is allowed");var dt=e(fe,Lt);if(ee&&fe.indexOf(dt)<fe.indexOf(ee))throw new G(E,"Doctype can only be inserted before an element");if(!ee&&dt)throw new G(E,"Doctype can not be appended since element is present")}}function Fe(j,H,ee){var fe=j.childNodes||[],Ce=H.childNodes||[];if(H.nodeType===ve.DOCUMENT_FRAGMENT_NODE){var Ve=Ce.filter(Lt);if(Ve.length>1||e(Ce,Oi))throw new G(E,"More than one element or text in fragment");if(Ve.length===1&&!zi(j,ee))throw new G(E,"Element in fragment can not be inserted before doctype")}if(Lt(H)&&!zi(j,ee))throw new G(E,"Only one element can be added and only after doctype");if(wt(H)){if(e(fe,function(yt){return wt(yt)&&yt!==ee}))throw new G(E,"Only one doctype is allowed");var dt=e(fe,Lt);if(ee&&fe.indexOf(dt)<fe.indexOf(ee))throw new G(E,"Doctype can only be inserted before an element")}}function Be(j,H,ee,fe){Te(j,H,ee),j.nodeType===ve.DOCUMENT_NODE&&(fe||ke)(j,H,ee);var Ce=H.parentNode;if(Ce&&Ce.removeChild(H),H.nodeType===R){var Ve=H.firstChild;if(Ve==null)return H;var dt=H.lastChild}else Ve=dt=H;var Ut=ee?ee.previousSibling:j.lastChild;Ve.previousSibling=Ut,dt.nextSibling=ee,Ut?Ut.nextSibling=Ve:j.firstChild=Ve,ee==null?j.lastChild=dt:ee.previousSibling=dt;do{Ve.parentNode=j;var yt=j.ownerDocument||j;Ke(Ve,yt)}while(Ve!==dt&&(Ve=Ve.nextSibling));return Re(j.ownerDocument||j,j),H.nodeType==R&&(H.firstChild=H.lastChild=null),H}function Ke(j,H){if(j.ownerDocument!==H){if(j.ownerDocument=H,j.nodeType===h&&j.attributes)for(var ee=0;ee<j.attributes.length;ee++){var fe=j.attributes.item(ee);fe&&(fe.ownerDocument=H)}for(var Ce=j.firstChild;Ce;)Ke(Ce,H),Ce=Ce.nextSibling}}function nt(j,H){H.parentNode&&H.parentNode.removeChild(H),H.parentNode=j,H.previousSibling=j.lastChild,H.nextSibling=null,H.previousSibling?H.previousSibling.nextSibling=H:j.firstChild=H,j.lastChild=H,Re(j.ownerDocument,j,H);var ee=j.ownerDocument||j;return Ke(H,ee),H}Me.prototype={nodeName:"#document",nodeType:F,doctype:null,documentElement:null,_inc:1,insertBefore:function(j,H){if(j.nodeType==R){for(var ee=j.firstChild;ee;){var fe=ee.nextSibling;this.insertBefore(ee,H),ee=fe}return j}return Be(this,j,H),Ke(j,this),this.documentElement===null&&j.nodeType===h&&(this.documentElement=j),j},removeChild:function(j){return this.documentElement==j&&(this.documentElement=null),Oe(this,j)},replaceChild:function(j,H){Be(this,j,H,Fe),Ke(j,this),H&&this.removeChild(H),Lt(j)&&(this.documentElement=j)},importNode:function(j,H){return ca(this,j,H)},getElementById:function(j){var H=null;return De(this.documentElement,function(ee){if(ee.nodeType==h&&ee.getAttribute("id")==j)return H=ee,!0}),H},getElementsByClassName:function(j){var H=a(j);return new le(this,function(ee){var fe=[];return H.length>0&&De(ee.documentElement,function(Ce){if(Ce!==ee&&Ce.nodeType===h){var Ve=Ce.getAttribute("class");if(Ve){var dt=j===Ve;if(!dt){var Ut=a(Ve);dt=H.every(o(Ut))}dt&&fe.push(Ce)}}}),fe})},createElement:function(j){var H=new ht;H.ownerDocument=this,H.nodeName=j,H.tagName=j,H.localName=j,H.childNodes=new K;var ee=H.attributes=new pe;return ee._ownerElement=H,H},createDocumentFragment:function(){var j=new st;return j.ownerDocument=this,j.childNodes=new K,j},createTextNode:function(j){var H=new yr;return H.ownerDocument=this,H.appendData(j),H},createComment:function(j){var H=new ar;return H.ownerDocument=this,H.appendData(j),H},createCDATASection:function(j){var H=new or;return H.ownerDocument=this,H.appendData(j),H},createProcessingInstruction:function(j,H){var ee=new cs;return ee.ownerDocument=this,ee.tagName=ee.nodeName=ee.target=j,ee.nodeValue=ee.data=H,ee},createAttribute:function(j){var H=new sr;return H.ownerDocument=this,H.name=j,H.nodeName=j,H.localName=j,H.specified=!0,H},createEntityReference:function(j){var H=new tt;return H.ownerDocument=this,H.nodeName=j,H},createElementNS:function(j,H){var ee=new ht,fe=H.split(":"),Ce=ee.attributes=new pe;return ee.childNodes=new K,ee.ownerDocument=this,ee.nodeName=H,ee.tagName=H,ee.namespaceURI=j,fe.length==2?(ee.prefix=fe[0],ee.localName=fe[1]):ee.localName=H,Ce._ownerElement=ee,ee},createAttributeNS:function(j,H){var ee=new sr,fe=H.split(":");return ee.ownerDocument=this,ee.nodeName=H,ee.name=H,ee.namespaceURI=j,ee.specified=!0,fe.length==2?(ee.prefix=fe[0],ee.localName=fe[1]):ee.localName=H,ee}},u(Me,ve);function ht(){this._nsMap={}}ht.prototype={nodeType:h,hasAttribute:function(j){return this.getAttributeNode(j)!=null},getAttribute:function(j){var H=this.getAttributeNode(j);return H&&H.value||""},getAttributeNode:function(j){return this.attributes.getNamedItem(j)},setAttribute:function(j,H){var ee=this.ownerDocument.createAttribute(j);ee.value=ee.nodeValue=""+H,this.setAttributeNode(ee)},removeAttribute:function(j){var H=this.getAttributeNode(j);H&&this.removeAttributeNode(H)},appendChild:function(j){return j.nodeType===R?this.insertBefore(j,null):nt(this,j)},setAttributeNode:function(j){return this.attributes.setNamedItem(j)},setAttributeNodeNS:function(j){return this.attributes.setNamedItemNS(j)},removeAttributeNode:function(j){return this.attributes.removeNamedItem(j.nodeName)},removeAttributeNS:function(j,H){var ee=this.getAttributeNodeNS(j,H);ee&&this.removeAttributeNode(ee)},hasAttributeNS:function(j,H){return this.getAttributeNodeNS(j,H)!=null},getAttributeNS:function(j,H){var ee=this.getAttributeNodeNS(j,H);return ee&&ee.value||""},setAttributeNS:function(j,H,ee){var fe=this.ownerDocument.createAttributeNS(j,H);fe.value=fe.nodeValue=""+ee,this.setAttributeNode(fe)},getAttributeNodeNS:function(j,H){return this.attributes.getNamedItemNS(j,H)},getElementsByTagName:function(j){return new le(this,function(H){var ee=[];return De(H,function(fe){fe!==H&&fe.nodeType==h&&(j==="*"||fe.tagName==j)&&ee.push(fe)}),ee})},getElementsByTagNameNS:function(j,H){return new le(this,function(ee){var fe=[];return De(ee,function(Ce){Ce!==ee&&Ce.nodeType===h&&(j==="*"||Ce.namespaceURI===j)&&(H==="*"||Ce.localName==H)&&fe.push(Ce)}),fe})}},Me.prototype.getElementsByTagName=ht.prototype.getElementsByTagName,Me.prototype.getElementsByTagNameNS=ht.prototype.getElementsByTagNameNS,u(ht,ve);function sr(){}sr.prototype.nodeType=f,u(sr,ve);function Wi(){}Wi.prototype={data:"",substringData:function(j,H){return this.data.substring(j,j+H)},appendData:function(j){j=this.data+j,this.nodeValue=this.data=j,this.length=j.length},insertData:function(j,H){this.replaceData(j,0,H)},appendChild:function(j){throw new Error(U[E])},deleteData:function(j,H){this.replaceData(j,H,"")},replaceData:function(j,H,ee){var fe=this.data.substring(0,j),Ce=this.data.substring(j+H);ee=fe+ee+Ce,this.nodeValue=this.data=ee,this.length=ee.length}},u(Wi,ve);function yr(){}yr.prototype={nodeName:"#text",nodeType:g,splitText:function(j){var H=this.data,ee=H.substring(j);H=H.substring(0,j),this.data=this.nodeValue=H,this.length=H.length;var fe=this.ownerDocument.createTextNode(ee);return this.parentNode&&this.parentNode.insertBefore(fe,this.nextSibling),fe}},u(yr,Wi);function ar(){}ar.prototype={nodeName:"#comment",nodeType:N},u(ar,Wi);function or(){}or.prototype={nodeName:"#cdata-section",nodeType:C},u(or,Wi);function _r(){}_r.prototype.nodeType=V,u(_r,ve);function Ln(){}Ln.prototype.nodeType=O,u(Ln,ve);function On(){}On.prototype.nodeType=T,u(On,ve);function tt(){}tt.prototype.nodeType=p,u(tt,ve);function st(){}st.prototype.nodeName="#document-fragment",st.prototype.nodeType=R,u(st,ve);function cs(){}cs.prototype.nodeType=A,u(cs,ve);function on(){}on.prototype.serializeToString=function(j,H,ee){return la.call(j,H,ee)},ve.prototype.toString=la;function la(j,H){var ee=[],fe=this.nodeType==9&&this.documentElement||this,Ce=fe.prefix,Ve=fe.namespaceURI;if(Ve&&Ce==null){var Ce=fe.lookupPrefix(Ve);if(Ce==null)var dt=[{namespace:Ve,prefix:null}]}return Rr(this,ee,j,H,dt),ee.join("")}function ua(j,H,ee){var fe=j.prefix||"",Ce=j.namespaceURI;if(!Ce||fe==="xml"&&Ce===t.XML||Ce===t.XMLNS)return!1;for(var Ve=ee.length;Ve--;){var dt=ee[Ve];if(dt.prefix===fe)return dt.namespace!==Ce}return!0}function Mr(j,H,ee){j.push(" ",H,'="',ee.replace(/[<>&"\t\n\r]/g,Ae),'"')}function Rr(j,H,ee,fe,Ce){if(Ce||(Ce=[]),fe)if(j=fe(j),j){if(typeof j=="string"){H.push(j);return}}else return;switch(j.nodeType){case h:var Ve=j.attributes,dt=Ve.length,lt=j.firstChild,Ut=j.tagName;ee=t.isHTML(j.namespaceURI)||ee;var yt=Ut;if(!ee&&!j.prefix&&j.namespaceURI){for(var lr,Mi=0;Mi<Ve.length;Mi++)if(Ve.item(Mi).name==="xmlns"){lr=Ve.item(Mi).value;break}if(!lr)for(var di=Ce.length-1;di>=0;di--){var $t=Ce[di];if($t.prefix===""&&$t.namespace===j.namespaceURI){lr=$t.namespace;break}}if(lr!==j.namespaceURI)for(var di=Ce.length-1;di>=0;di--){var $t=Ce[di];if($t.namespace===j.namespaceURI){$t.prefix&&(yt=$t.prefix+":"+Ut);break}}}H.push("<",yt);for(var _t=0;_t<dt;_t++){var Ze=Ve.item(_t);Ze.prefix=="xmlns"?Ce.push({prefix:Ze.localName,namespace:Ze.value}):Ze.nodeName=="xmlns"&&Ce.push({prefix:"",namespace:Ze.value})}for(var _t=0;_t<dt;_t++){var Ze=Ve.item(_t);if(ua(Ze,ee,Ce)){var Tr=Ze.prefix||"",Ti=Ze.namespaceURI;Mr(H,Tr?"xmlns:"+Tr:"xmlns",Ti),Ce.push({prefix:Tr,namespace:Ti})}Rr(Ze,H,ee,fe,Ce)}if(Ut===yt&&ua(j,ee,Ce)){var Tr=j.prefix||"",Ti=j.namespaceURI;Mr(H,Tr?"xmlns:"+Tr:"xmlns",Ti),Ce.push({prefix:Tr,namespace:Ti})}if(lt||ee&&!/^(?:meta|link|img|br|hr|input)$/i.test(Ut)){if(H.push(">"),ee&&/^script$/i.test(Ut))for(;lt;)lt.data?H.push(lt.data):Rr(lt,H,ee,fe,Ce.slice()),lt=lt.nextSibling;else for(;lt;)Rr(lt,H,ee,fe,Ce.slice()),lt=lt.nextSibling;H.push("</",yt,">")}else H.push("/>");return;case F:case R:for(var lt=j.firstChild;lt;)Rr(lt,H,ee,fe,Ce.slice()),lt=lt.nextSibling;return;case f:return Mr(H,j.name,j.value);case g:return H.push(j.data.replace(/[<&>]/g,Ae));case C:return H.push("<![CDATA[",j.data,"]]>");case N:return H.push("<!--",j.data,"-->");case V:var ln=j.publicId,Xe=j.systemId;if(H.push("<!DOCTYPE ",j.name),ln)H.push(" PUBLIC ",ln),Xe&&Xe!="."&&H.push(" ",Xe),H.push(">");else if(Xe&&Xe!=".")H.push(" SYSTEM ",Xe,">");else{var mt=j.internalSubset;mt&&H.push(" [",mt,"]"),H.push(">")}return;case A:return H.push("<?",j.target," ",j.data,"?>");case p:return H.push("&",j.nodeName,";");default:H.push("??",j.nodeName)}}function ca(j,H,ee){var fe;switch(H.nodeType){case h:fe=H.cloneNode(!1),fe.ownerDocument=j;case R:break;case f:ee=!0;break}if(fe||(fe=H.cloneNode(!1)),fe.ownerDocument=j,fe.parentNode=null,ee)for(var Ce=H.firstChild;Ce;)fe.appendChild(ca(j,Ce,ee)),Ce=Ce.nextSibling;return fe}function hs(j,H,ee){var fe=new H.constructor;for(var Ce in H)if(Object.prototype.hasOwnProperty.call(H,Ce)){var Ve=H[Ce];typeof Ve!="object"&&Ve!=fe[Ce]&&(fe[Ce]=Ve)}switch(H.childNodes&&(fe.childNodes=new K),fe.ownerDocument=j,fe.nodeType){case h:var dt=H.attributes,Ut=fe.attributes=new pe,yt=dt.length;Ut._ownerElement=fe;for(var lr=0;lr<yt;lr++)fe.setAttributeNode(hs(j,dt.item(lr),!0));break;case f:ee=!0}if(ee)for(var Mi=H.firstChild;Mi;)fe.appendChild(hs(j,Mi,ee)),Mi=Mi.nextSibling;return fe}function ha(j,H,ee){j[H]=ee}try{if(Object.defineProperty){let j=function(H){switch(H.nodeType){case h:case R:var ee=[];for(H=H.firstChild;H;)H.nodeType!==7&&H.nodeType!==8&&ee.push(j(H)),H=H.nextSibling;return ee.join("");default:return H.nodeValue}};Object.defineProperty(le.prototype,"length",{get:function(){return de(this),this.$$length}}),Object.defineProperty(ve.prototype,"textContent",{get:function(){return j(this)},set:function(H){switch(this.nodeType){case h:case R:for(;this.firstChild;)this.removeChild(this.firstChild);(H||String(H))&&this.appendChild(this.ownerDocument.createTextNode(H));break;default:this.data=H,this.value=H,this.nodeValue=H}}}),ha=function(H,ee,fe){H["$$"+ee]=fe}}}catch{}return vn.DocumentType=_r,vn.DOMException=G,vn.DOMImplementation=he,vn.Element=ht,vn.Node=ve,vn.NodeList=K,vn.XMLSerializer=on,vn}var ll={},df={},oy;function sI(){return oy||(oy=1,(function(s){var e=Ah().freeze;s.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),s.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
|
|
20
|
-
`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}),s.entityMap=s.HTML_ENTITIES})(df)),df}var Yu={},ly;function aI(){if(ly)return Yu;ly=1;var s=Ah().NAMESPACE,e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),r=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),i=0,n=1,a=2,o=3,l=4,u=5,c=6,h=7;function f(E,P){this.message=E,this.locator=P,Error.captureStackTrace&&Error.captureStackTrace(this,f)}f.prototype=new Error,f.prototype.name=f.name;function g(){}g.prototype={parse:function(E,P,Y){var G=this.domBuilder;G.startDocument(),V(P,P={}),C(E,P,Y,G,this.errorHandler),G.endDocument()}};function C(E,P,Y,G,K){function le(nt){if(nt>65535){nt-=65536;var ht=55296+(nt>>10),sr=56320+(nt&1023);return String.fromCharCode(ht,sr)}else return String.fromCharCode(nt)}function de(nt){var ht=nt.slice(1,-1);return Object.hasOwnProperty.call(Y,ht)?Y[ht]:ht.charAt(0)==="#"?le(parseInt(ht.substr(1).replace("x","0x"))):(K.error("entity not found:"+nt),nt)}function pe(nt){if(nt>Me){var ht=E.substring(Me,nt).replace(/&#?\w+;/g,de);ve&&se(Me),G.characters(ht,0,nt-Me),Me=nt}}function se(nt,ht){for(;nt>=ce&&(ht=he.exec(E));)ae=ht.index,ce=ae+ht[0].length,ve.lineNumber++;ve.columnNumber=nt-ae+1}for(var ae=0,ce=0,he=/.*(?:\r\n?|\n)|.*$/g,ve=G.locator,Ae=[{currentNSMap:P}],De={},Me=0;;){try{var Ne=E.indexOf("<",Me);if(Ne<0){if(!E.substr(Me).match(/^\s*$/)){var Je=G.doc,Re=Je.createTextNode(E.substr(Me));Je.appendChild(Re),G.currentElement=Re}return}switch(Ne>Me&&pe(Ne),E.charAt(Ne+1)){case"/":var Te=E.indexOf(">",Ne+3),Oe=E.substring(Ne+2,Te).replace(/[ \t\n\r]+$/g,""),He=Ae.pop();Te<0?(Oe=E.substring(Ne+2).replace(/[\s<].*/,""),K.error("end tag name: "+Oe+" is not complete:"+He.tagName),Te=Ne+1+Oe.length):Oe.match(/\s</)&&(Oe=Oe.replace(/[\s<].*/,""),K.error("end tag name: "+Oe+" maybe not complete"),Te=Ne+1+Oe.length);var ot=He.localNSMap,wt=He.tagName==Oe,Lt=wt||He.tagName&&He.tagName.toLowerCase()==Oe.toLowerCase();if(Lt){if(G.endElement(He.uri,He.localName,Oe),ot)for(var Oi in ot)Object.prototype.hasOwnProperty.call(ot,Oi)&&G.endPrefixMapping(Oi);wt||K.fatalError("end tag name: "+Oe+" is not match the current start tagName:"+He.tagName)}else Ae.push(He);Te++;break;case"?":ve&&se(Ne),Te=O(E,Ne,G);break;case"!":ve&&se(Ne),Te=R(E,Ne,G,K);break;default:ve&&se(Ne);var Ft=new M,zi=Ae[Ae.length-1].currentNSMap,Te=T(E,Ne,Ft,zi,de,K),ke=Ft.length;if(!Ft.closed&&F(E,Te,Ft.tagName,De)&&(Ft.closed=!0,Y.nbsp||K.warning("unclosed xml attribute")),ve&&ke){for(var Fe=p(ve,{}),Be=0;Be<ke;Be++){var Ke=Ft[Be];se(Ke.offset),Ke.locator=p(ve,{})}G.locator=Fe,A(Ft,G,zi)&&Ae.push(Ft),G.locator=ve}else A(Ft,G,zi)&&Ae.push(Ft);s.isHTML(Ft.uri)&&!Ft.closed?Te=N(E,Te,Ft.tagName,de,G):Te++}}catch(nt){if(nt instanceof f)throw nt;K.error("element parse error: "+nt),Te=-1}Te>Me?Me=Te:pe(Math.max(Ne,Me)+1)}}function p(E,P){return P.lineNumber=E.lineNumber,P.columnNumber=E.columnNumber,P}function T(E,P,Y,G,K,le){function de(ve,Ae,De){Y.attributeNames.hasOwnProperty(ve)&&le.fatalError("Attribute "+ve+" redefined"),Y.addValue(ve,Ae.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,K),De)}for(var pe,se,ae=++P,ce=i;;){var he=E.charAt(ae);switch(he){case"=":if(ce===n)pe=E.slice(P,ae),ce=o;else if(ce===a)ce=o;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(ce===o||ce===n)if(ce===n&&(le.warning('attribute value must after "="'),pe=E.slice(P,ae)),P=ae+1,ae=E.indexOf(he,P),ae>0)se=E.slice(P,ae),de(pe,se,P-1),ce=u;else throw new Error("attribute value no end '"+he+"' match");else if(ce==l)se=E.slice(P,ae),de(pe,se,P),le.warning('attribute "'+pe+'" missed start quot('+he+")!!"),P=ae+1,ce=u;else throw new Error('attribute value must after "="');break;case"/":switch(ce){case i:Y.setTagName(E.slice(P,ae));case u:case c:case h:ce=h,Y.closed=!0;case l:case n:break;case a:Y.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return le.error("unexpected end of input"),ce==i&&Y.setTagName(E.slice(P,ae)),ae;case">":switch(ce){case i:Y.setTagName(E.slice(P,ae));case u:case c:case h:break;case l:case n:se=E.slice(P,ae),se.slice(-1)==="/"&&(Y.closed=!0,se=se.slice(0,-1));case a:ce===a&&(se=pe),ce==l?(le.warning('attribute "'+se+'" missed quot(")!'),de(pe,se,P)):((!s.isHTML(G[""])||!se.match(/^(?:disabled|checked|selected)$/i))&&le.warning('attribute "'+se+'" missed value!! "'+se+'" instead!!'),de(se,se,P));break;case o:throw new Error("attribute value missed!!")}return ae;case"":he=" ";default:if(he<=" ")switch(ce){case i:Y.setTagName(E.slice(P,ae)),ce=c;break;case n:pe=E.slice(P,ae),ce=a;break;case l:var se=E.slice(P,ae);le.warning('attribute "'+se+'" missed quot(")!!'),de(pe,se,P);case u:ce=c;break}else switch(ce){case a:Y.tagName,(!s.isHTML(G[""])||!pe.match(/^(?:disabled|checked|selected)$/i))&&le.warning('attribute "'+pe+'" missed value!! "'+pe+'" instead2!!'),de(pe,pe,P),P=ae,ce=n;break;case u:le.warning('attribute space is required"'+pe+'"!!');case c:ce=n,P=ae;break;case o:ce=l,P=ae;break;case h:throw new Error("elements closed character '/' and '>' must be connected to")}}ae++}}function A(E,P,Y){for(var G=E.tagName,K=null,he=E.length;he--;){var le=E[he],de=le.qName,pe=le.value,ve=de.indexOf(":");if(ve>0)var se=le.prefix=de.slice(0,ve),ae=de.slice(ve+1),ce=se==="xmlns"&&ae;else ae=de,se=null,ce=de==="xmlns"&&"";le.localName=ae,ce!==!1&&(K==null&&(K={},V(Y,Y={})),Y[ce]=K[ce]=pe,le.uri=s.XMLNS,P.startPrefixMapping(ce,pe))}for(var he=E.length;he--;){le=E[he];var se=le.prefix;se&&(se==="xml"&&(le.uri=s.XML),se!=="xmlns"&&(le.uri=Y[se||""]))}var ve=G.indexOf(":");ve>0?(se=E.prefix=G.slice(0,ve),ae=E.localName=G.slice(ve+1)):(se=null,ae=E.localName=G);var Ae=E.uri=Y[se||""];if(P.startElement(Ae,ae,G,E),E.closed){if(P.endElement(Ae,ae,G),K)for(se in K)Object.prototype.hasOwnProperty.call(K,se)&&P.endPrefixMapping(se)}else return E.currentNSMap=Y,E.localNSMap=K,!0}function N(E,P,Y,G,K){if(/^(?:script|textarea)$/i.test(Y)){var le=E.indexOf("</"+Y+">",P),de=E.substring(P+1,le);if(/[&<]/.test(de))return/^script$/i.test(Y)?(K.characters(de,0,de.length),le):(de=de.replace(/&#?\w+;/g,G),K.characters(de,0,de.length),le)}return P+1}function F(E,P,Y,G){var K=G[Y];return K==null&&(K=E.lastIndexOf("</"+Y+">"),K<P&&(K=E.lastIndexOf("</"+Y)),G[Y]=K),K<P}function V(E,P){for(var Y in E)Object.prototype.hasOwnProperty.call(E,Y)&&(P[Y]=E[Y])}function R(E,P,Y,G){var K=E.charAt(P+2);switch(K){case"-":if(E.charAt(P+3)==="-"){var le=E.indexOf("-->",P+4);return le>P?(Y.comment(E,P+4,le-P-4),le+3):(G.error("Unclosed comment"),-1)}else return-1;default:if(E.substr(P+3,6)=="CDATA["){var le=E.indexOf("]]>",P+9);return Y.startCDATA(),Y.characters(E,P+9,le-P-9),Y.endCDATA(),le+3}var de=U(E,P),pe=de.length;if(pe>1&&/!doctype/i.test(de[0][0])){var se=de[1][0],ae=!1,ce=!1;pe>3&&(/^public$/i.test(de[2][0])?(ae=de[3][0],ce=pe>4&&de[4][0]):/^system$/i.test(de[2][0])&&(ce=de[3][0]));var he=de[pe-1];return Y.startDTD(se,ae,ce),Y.endDTD(),he.index+he[0].length}}return-1}function O(E,P,Y){var G=E.indexOf("?>",P);if(G){var K=E.substring(P,G).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return K?(K[0].length,Y.processingInstruction(K[1],K[2]),G+2):-1}return-1}function M(){this.attributeNames={}}M.prototype={setTagName:function(E){if(!r.test(E))throw new Error("invalid tagName:"+E);this.tagName=E},addValue:function(E,P,Y){if(!r.test(E))throw new Error("invalid attribute:"+E);this.attributeNames[E]=this.length,this[this.length++]={qName:E,value:P,offset:Y}},length:0,getLocalName:function(E){return this[E].localName},getLocator:function(E){return this[E].locator},getQName:function(E){return this[E].qName},getURI:function(E){return this[E].uri},getValue:function(E){return this[E].value}};function U(E,P){var Y,G=[],K=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(K.lastIndex=P,K.exec(E);Y=K.exec(E);)if(G.push(Y),Y[1])return G}return Yu.XMLReader=g,Yu.ParseError=f,Yu}var uy;function oI(){if(uy)return ll;uy=1;var s=Ah(),e=L0(),t=sI(),r=aI(),i=e.DOMImplementation,n=s.NAMESPACE,a=r.ParseError,o=r.XMLReader;function l(T){return T.replace(/\r[\n\u0085]/g,`
|
|
21
|
-
`).replace(/[\r\u0085\u2028]/g,`
|
|
22
|
-
`)}function u(T){this.options=T||{locator:{}}}u.prototype.parseFromString=function(T,A){var N=this.options,F=new o,V=N.domBuilder||new h,R=N.errorHandler,O=N.locator,M=N.xmlns||{},U=/\/x?html?$/.test(A),E=U?t.HTML_ENTITIES:t.XML_ENTITIES;O&&V.setDocumentLocator(O),F.errorHandler=c(R,V,O),F.domBuilder=N.domBuilder||V,U&&(M[""]=n.HTML),M.xml=M.xml||n.XML;var P=N.normalizeLineEndings||l;return T&&typeof T=="string"?F.parse(P(T),M,E):F.errorHandler.error("invalid doc source"),V.doc};function c(T,A,N){if(!T){if(A instanceof h)return A;T=A}var F={},V=T instanceof Function;N=N||{};function R(O){var M=T[O];!M&&V&&(M=T.length==2?function(U){T(O,U)}:T),F[O]=M&&function(U){M("[xmldom "+O+"] "+U+g(N))}||function(){}}return R("warning"),R("error"),R("fatalError"),F}function h(){this.cdata=!1}function f(T,A){A.lineNumber=T.lineNumber,A.columnNumber=T.columnNumber}h.prototype={startDocument:function(){this.doc=new i().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(T,A,N,F){var V=this.doc,R=V.createElementNS(T,N||A),O=F.length;p(this,R),this.currentElement=R,this.locator&&f(this.locator,R);for(var M=0;M<O;M++){var T=F.getURI(M),U=F.getValue(M),N=F.getQName(M),E=V.createAttributeNS(T,N);this.locator&&f(F.getLocator(M),E),E.value=E.nodeValue=U,R.setAttributeNode(E)}},endElement:function(T,A,N){var F=this.currentElement;F.tagName,this.currentElement=F.parentNode},startPrefixMapping:function(T,A){},endPrefixMapping:function(T){},processingInstruction:function(T,A){var N=this.doc.createProcessingInstruction(T,A);this.locator&&f(this.locator,N),p(this,N)},ignorableWhitespace:function(T,A,N){},characters:function(T,A,N){if(T=C.apply(this,arguments),T){if(this.cdata)var F=this.doc.createCDATASection(T);else var F=this.doc.createTextNode(T);this.currentElement?this.currentElement.appendChild(F):/^\s*$/.test(T)&&this.doc.appendChild(F),this.locator&&f(this.locator,F)}},skippedEntity:function(T){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(T){(this.locator=T)&&(T.lineNumber=0)},comment:function(T,A,N){T=C.apply(this,arguments);var F=this.doc.createComment(T);this.locator&&f(this.locator,F),p(this,F)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(T,A,N){var F=this.doc.implementation;if(F&&F.createDocumentType){var V=F.createDocumentType(T,A,N);this.locator&&f(this.locator,V),p(this,V),this.doc.doctype=V}},warning:function(T){console.warn("[xmldom warning] "+T,g(this.locator))},error:function(T){console.error("[xmldom error] "+T,g(this.locator))},fatalError:function(T){throw new a(T,this.locator)}};function g(T){if(T)return`
|
|
23
|
-
@`+(T.systemId||"")+"#[line:"+T.lineNumber+",col:"+T.columnNumber+"]"}function C(T,A,N){return typeof T=="string"?T.substr(A,N):T.length>=A+N||A?new java.lang.String(T,A,N)+"":T}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(T){h.prototype[T]=function(){return null}});function p(T,A){T.currentElement?T.currentElement.appendChild(A):T.doc.appendChild(A)}return ll.__DOMHandler=h,ll.normalizeLineEndings=l,ll.DOMParser=u,ll}var cy;function lI(){if(cy)return ol;cy=1;var s=L0();return ol.DOMImplementation=s.DOMImplementation,ol.XMLSerializer=s.XMLSerializer,ol.DOMParser=oI().DOMParser,ol}var O0=lI();/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const hy=s=>!!s&&typeof s=="object",ni=(...s)=>s.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(r=>{Array.isArray(e[r])&&Array.isArray(t[r])?e[r]=e[r].concat(t[r]):hy(e[r])&&hy(t[r])?e[r]=ni(e[r],t[r]):e[r]=t[r]}),e),{}),M0=s=>Object.keys(s).map(e=>s[e]),uI=(s,e)=>{const t=[];for(let r=s;r<e;r++)t.push(r);return t},co=s=>s.reduce((e,t)=>e.concat(t),[]),R0=s=>{if(!s.length)return[];const e=[];for(let t=0;t<s.length;t++)e.push(s[t]);return e},cI=(s,e)=>s.reduce((t,r,i)=>(r[e]&&t.push(i),t),[]),hI=(s,e)=>M0(s.reduce((t,r)=>(r.forEach(i=>{t[e(i)]=i}),t),{}));var ho={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const jl=({baseUrl:s="",source:e="",range:t="",indexRange:r=""})=>{const i={uri:e,resolvedUri:xh(s||"",e)};if(t||r){const a=(t||r).split("-");let o=D.BigInt?D.BigInt(a[0]):parseInt(a[0],10),l=D.BigInt?D.BigInt(a[1]):parseInt(a[1],10);o<Number.MAX_SAFE_INTEGER&&typeof o=="bigint"&&(o=Number(o)),l<Number.MAX_SAFE_INTEGER&&typeof l=="bigint"&&(l=Number(l));let u;typeof l=="bigint"||typeof o=="bigint"?u=D.BigInt(l)-D.BigInt(o)+D.BigInt(1):u=l-o+1,typeof u=="bigint"&&u<Number.MAX_SAFE_INTEGER&&(u=Number(u)),i.byterange={length:u,offset:o}}return i},dI=s=>{let e;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=D.BigInt(s.offset)+D.BigInt(s.length)-D.BigInt(1):e=s.offset+s.length-1,`${s.offset}-${e}`},dy=s=>(s&&typeof s!="number"&&(s=parseInt(s,10)),isNaN(s)?null:s),fI={static(s){const{duration:e,timescale:t=1,sourceDuration:r,periodDuration:i}=s,n=dy(s.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof i=="number"?{start:0,end:i/a}:{start:0,end:r/a}},dynamic(s){const{NOW:e,clientOffset:t,availabilityStartTime:r,timescale:i=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=s,u=dy(s.endNumber),c=(e+t)/1e3,h=r+a,g=c+o-h,C=Math.ceil(g*i/n),p=Math.floor((c-h-l)*i/n),T=Math.floor((c-h)*i/n);return{start:Math.max(0,p),end:typeof u=="number"?u:Math.min(C,T)}}},pI=s=>e=>{const{duration:t,timescale:r=1,periodStart:i,startNumber:n=1}=s;return{number:n+e,duration:t/r,timeline:i,time:e*t}},jm=s=>{const{type:e,duration:t,timescale:r=1,periodDuration:i,sourceDuration:n}=s,{start:a,end:o}=fI[e](s),l=uI(a,o).map(pI(s));if(e==="static"){const u=l.length-1,c=typeof i=="number"?i:n;l[u].duration=c-t/r*u}return l},B0=s=>{const{baseUrl:e,initialization:t={},sourceDuration:r,indexRange:i="",periodStart:n,presentationTime:a,number:o=0,duration:l}=s;if(!e)throw new Error(ho.NO_BASE_URL);const u=jl({baseUrl:e,source:t.sourceURL,range:t.range}),c=jl({baseUrl:e,source:e,indexRange:i});if(c.map=u,l){const h=jm(s);h.length&&(c.duration=h[0].duration,c.timeline=h[0].timeline)}else r&&(c.duration=r,c.timeline=n);return c.presentationTime=a||n,c.number=o,[c]},Vm=(s,e,t)=>{const r=s.sidx.map?s.sidx.map:null,i=s.sidx.duration,n=s.timeline||0,a=s.sidx.byterange,o=a.offset+a.length,l=e.timescale,u=e.references.filter(T=>T.referenceType!==1),c=[],h=s.endList?"static":"dynamic",f=s.sidx.timeline;let g=f,C=s.mediaSequence||0,p;typeof e.firstOffset=="bigint"?p=D.BigInt(o)+e.firstOffset:p=o+e.firstOffset;for(let T=0;T<u.length;T++){const A=e.references[T],N=A.referencedSize,F=A.subsegmentDuration;let V;typeof p=="bigint"?V=p+D.BigInt(N)-D.BigInt(1):V=p+N-1;const R=`${p}-${V}`,M=B0({baseUrl:t,timescale:l,timeline:n,periodStart:f,presentationTime:g,number:C,duration:F,sourceDuration:i,indexRange:R,type:h})[0];r&&(M.map=r),c.push(M),typeof p=="bigint"?p+=D.BigInt(N):p+=N,g+=F/l,C++}return s.segments=c,s},mI=["AUDIO","SUBTITLES"],gI=1/60,F0=s=>hI(s,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),vI=(s,e)=>{for(let t=0;t<s.length;t++)if(s[t].attributes.NAME===e)return s[t];return null},fy=s=>{let e=[];return nI(s,mI,(t,r,i,n)=>{e=e.concat(t.playlists||[])}),e},py=({playlist:s,mediaSequence:e})=>{s.mediaSequence=e,s.segments.forEach((t,r)=>{t.number=s.mediaSequence+r})},yI=({oldPlaylists:s,newPlaylists:e,timelineStarts:t})=>{e.forEach(r=>{r.discontinuitySequence=t.findIndex(function({timeline:l}){return l===r.timeline});const i=vI(s,r.attributes.NAME);if(!i||r.sidx)return;const n=r.segments[0],a=i.segments.findIndex(function(l){return Math.abs(l.presentationTime-n.presentationTime)<gI});if(a===-1){py({playlist:r,mediaSequence:i.mediaSequence+i.segments.length}),r.segments[0].discontinuity=!0,r.discontinuityStarts.unshift(0),(!i.segments.length&&r.timeline>i.timeline||i.segments.length&&r.timeline>i.segments[i.segments.length-1].timeline)&&r.discontinuitySequence--;return}i.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,r.discontinuityStarts.unshift(0),r.discontinuitySequence--),py({playlist:r,mediaSequence:i.segments[a].number})})},_I=({oldManifest:s,newManifest:e})=>{const t=s.playlists.concat(fy(s)),r=e.playlists.concat(fy(e));return e.timelineStarts=F0([s.timelineStarts,e.timelineStarts]),yI({oldPlaylists:t,newPlaylists:r,timelineStarts:e.timelineStarts}),e},Ih=s=>s&&s.uri+"-"+dI(s.byterange),ff=s=>{const e=s.reduce(function(r,i){return r[i.attributes.baseUrl]||(r[i.attributes.baseUrl]=[]),r[i.attributes.baseUrl].push(i),r},{});let t=[];return Object.values(e).forEach(r=>{const i=M0(r.reduce((n,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return n[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[o].segments.push(...a.segments)),a.attributes.contentProtection&&(n[o].attributes.contentProtection=a.attributes.contentProtection)):(n[o]=a,n[o].attributes.timelineStarts=[]),n[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(i)}),t.map(r=>(r.discontinuityStarts=cI(r.segments||[],"discontinuity"),r))},Hm=(s,e)=>{const t=Ih(s.sidx),r=t&&e[t]&&e[t].sidx;return r&&Vm(s,r,s.sidx.resolvedUri),s},TI=(s,e={})=>{if(!Object.keys(e).length)return s;for(const t in s)s[t]=Hm(s[t],e);return s},bI=({attributes:s,segments:e,sidx:t,mediaSequence:r,discontinuitySequence:i,discontinuityStarts:n},a)=>{const o={attributes:{NAME:s.id,BANDWIDTH:s.bandwidth,CODECS:s.codecs,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuitySequence:i,discontinuityStarts:n,timelineStarts:s.timelineStarts,mediaSequence:r,segments:e};return s.contentProtection&&(o.contentProtection=s.contentProtection),s.serviceLocation&&(o.attributes.serviceLocation=s.serviceLocation),t&&(o.sidx=t),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},SI=({attributes:s,segments:e,mediaSequence:t,discontinuityStarts:r,discontinuitySequence:i})=>{typeof e>"u"&&(e=[{uri:s.baseUrl,timeline:s.periodStart,resolvedUri:s.baseUrl||"",duration:s.sourceDuration,number:0}],s.duration=s.sourceDuration);const n={NAME:s.id,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1};s.codecs&&(n.CODECS=s.codecs);const a={attributes:n,uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,timelineStarts:s.timelineStarts,discontinuityStarts:r,discontinuitySequence:i,mediaSequence:t,segments:e};return s.serviceLocation&&(a.attributes.serviceLocation=s.serviceLocation),a},CI=(s,e={},t=!1)=>{let r;const i=s.reduce((n,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",l=a.attributes.lang||"";let u=a.attributes.label||"main";if(l&&!a.attributes.label){const h=o?` (${o})`:"";u=`${a.attributes.lang}${h}`}n[u]||(n[u]={language:l,autoselect:!0,default:o==="main",playlists:[],uri:""});const c=Hm(bI(a,t),e);return n[u].playlists.push(c),typeof r>"u"&&o==="main"&&(r=a,r.default=!0),n},{});if(!r){const n=Object.keys(i)[0];i[n].default=!0}return i},EI=(s,e={})=>s.reduce((t,r)=>{const i=r.attributes.label||r.attributes.lang||"text",n=r.attributes.lang||"und";return t[i]||(t[i]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[i].playlists.push(Hm(SI(r),e)),t},{}),wI=s=>s.reduce((e,t)=>(t&&t.forEach(r=>{const{channel:i,language:n}=r;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},r.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=r.aspectRatio),r.hasOwnProperty("easyReader")&&(e[n].easyReader=r.easyReader),r.hasOwnProperty("3D")&&(e[n]["3D"]=r["3D"])}),e),{}),kI=({attributes:s,segments:e,sidx:t,discontinuityStarts:r})=>{const i={attributes:{NAME:s.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:s.width,height:s.height},CODECS:s.codecs,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuityStarts:r,timelineStarts:s.timelineStarts,segments:e};return s.frameRate&&(i.attributes["FRAME-RATE"]=s.frameRate),s.contentProtection&&(i.contentProtection=s.contentProtection),s.serviceLocation&&(i.attributes.serviceLocation=s.serviceLocation),t&&(i.sidx=t),i},xI=({attributes:s})=>s.mimeType==="video/mp4"||s.mimeType==="video/webm"||s.contentType==="video",AI=({attributes:s})=>s.mimeType==="audio/mp4"||s.mimeType==="audio/webm"||s.contentType==="audio",II=({attributes:s})=>s.mimeType==="text/vtt"||s.contentType==="text",PI=(s,e)=>{s.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:r}){return r===t.timeline}),t.segments&&t.segments.forEach((r,i)=>{r.number=i})})},my=s=>s?Object.keys(s).reduce((e,t)=>{const r=s[t];return e.concat(r.playlists)},[]):[],DI=({dashPlaylists:s,locations:e,contentSteering:t,sidxMapping:r={},previousManifest:i,eventStream:n})=>{if(!s.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:u}=s[0].attributes,c=ff(s.filter(xI)).map(kI),h=ff(s.filter(AI)),f=ff(s.filter(II)),g=s.map(V=>V.attributes.captionServices).filter(Boolean),C={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:TI(c,r)};u>=0&&(C.minimumUpdatePeriod=u*1e3),e&&(C.locations=e),t&&(C.contentSteering=t),o==="dynamic"&&(C.suggestedPresentationDelay=l),n&&n.length>0&&(C.eventStream=n);const p=C.playlists.length===0,T=h.length?CI(h,r,p):null,A=f.length?EI(f,r):null,N=c.concat(my(T),my(A)),F=N.map(({timelineStarts:V})=>V);return C.timelineStarts=F0(F),PI(N,C.timelineStarts),T&&(C.mediaGroups.AUDIO.audio=T),A&&(C.mediaGroups.SUBTITLES.subs=A),g.length&&(C.mediaGroups["CLOSED-CAPTIONS"].cc=wI(g)),i?_I({oldManifest:i,newManifest:C}):C},NI=(s,e,t)=>{const{NOW:r,clientOffset:i,availabilityStartTime:n,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=s,u=(r+i)/1e3,c=n+o,f=u+l-c;return Math.ceil((f*a-e)/t)},U0=(s,e)=>{const{type:t,minimumUpdatePeriod:r=0,media:i="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:l}=s,u=[];let c=-1;for(let h=0;h<e.length;h++){const f=e[h],g=f.d,C=f.r||0,p=f.t||0;c<0&&(c=p),p&&p>c&&(c=p);let T;if(C<0){const F=h+1;F===e.length?t==="dynamic"&&r>0&&i.indexOf("$Number$")>0?T=NI(s,c,g):T=(n*a-c)/g:T=(e[F].t-c)/g}else T=C+1;const A=o+u.length+T;let N=o+u.length;for(;N<A;)u.push({number:N,duration:g/a,time:c,timeline:l}),c+=g,N++}return u},LI=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,OI=s=>(e,t,r,i)=>{if(e==="$$")return"$";if(typeof s[t]>"u")return e;const n=""+s[t];return t==="RepresentationID"||(r?i=parseInt(i,10):i=1,n.length>=i)?n:`${new Array(i-n.length+1).join("0")}${n}`},gy=(s,e)=>s.replace(LI,OI(e)),MI=(s,e)=>!s.duration&&!e?[{number:s.startNumber||1,duration:s.sourceDuration,time:0,timeline:s.periodStart}]:s.duration?jm(s):U0(s,e),RI=(s,e)=>{const t={RepresentationID:s.id,Bandwidth:s.bandwidth||0},{initialization:r={sourceURL:"",range:""}}=s,i=jl({baseUrl:s.baseUrl,source:gy(r.sourceURL,t),range:r.range});return MI(s,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=gy(s.media||"",t),l=s.timescale||1,u=s.presentationTimeOffset||0,c=s.periodStart+(a.time-u)/l;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:xh(s.baseUrl||"",o),map:i,number:a.number,presentationTime:c}})},BI=(s,e)=>{const{baseUrl:t,initialization:r={}}=s,i=jl({baseUrl:t,source:r.sourceURL,range:r.range}),n=jl({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=i,n},FI=(s,e)=>{const{duration:t,segmentUrls:r=[],periodStart:i}=s;if(!t&&!e||t&&e)throw new Error(ho.SEGMENT_TIME_UNSPECIFIED);const n=r.map(l=>BI(s,l));let a;return t&&(a=jm(s)),e&&(a=U0(s,e)),a.map((l,u)=>{if(n[u]){const c=n[u],h=s.timescale||1,f=s.presentationTimeOffset||0;return c.timeline=l.timeline,c.duration=l.duration,c.number=l.number,c.presentationTime=i+(l.time-f)/h,c}}).filter(l=>l)},UI=({attributes:s,segmentInfo:e})=>{let t,r;e.template?(r=RI,t=ni(s,e.template)):e.base?(r=B0,t=ni(s,e.base)):e.list&&(r=FI,t=ni(s,e.list));const i={attributes:s};if(!r)return i;const n=r(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:o=1}=t;t.duration=a/o}else n.length?t.duration=n.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):t.duration=0;return i.attributes=t,i.segments=n,e.base&&t.indexRange&&(i.sidx=n[0],i.segments=[]),i},$I=s=>s.map(UI),Nt=(s,e)=>R0(s.childNodes).filter(({tagName:t})=>t===e),eu=s=>s.textContent.trim(),jI=s=>parseFloat(s.split("/").reduce((e,t)=>e/t)),Da=s=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(s);if(!o)return 0;const[l,u,c,h,f,g]=o.slice(1);return parseFloat(l||0)*31536e3+parseFloat(u||0)*2592e3+parseFloat(c||0)*86400+parseFloat(h||0)*3600+parseFloat(f||0)*60+parseFloat(g||0)},VI=s=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(s)&&(s+="Z"),Date.parse(s)),vy={mediaPresentationDuration(s){return Da(s)},availabilityStartTime(s){return VI(s)/1e3},minimumUpdatePeriod(s){return Da(s)},suggestedPresentationDelay(s){return Da(s)},type(s){return s},timeShiftBufferDepth(s){return Da(s)},start(s){return Da(s)},width(s){return parseInt(s,10)},height(s){return parseInt(s,10)},bandwidth(s){return parseInt(s,10)},frameRate(s){return jI(s)},startNumber(s){return parseInt(s,10)},timescale(s){return parseInt(s,10)},presentationTimeOffset(s){return parseInt(s,10)},duration(s){const e=parseInt(s,10);return isNaN(e)?Da(s):e},d(s){return parseInt(s,10)},t(s){return parseInt(s,10)},r(s){return parseInt(s,10)},presentationTime(s){return parseInt(s,10)},DEFAULT(s){return s}},Xt=s=>s&&s.attributes?R0(s.attributes).reduce((e,t)=>{const r=vy[t.name]||vy.DEFAULT;return e[t.name]=r(t.value),e},{}):{},HI={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Ph=(s,e)=>e.length?co(s.map(function(t){return e.map(function(r){const i=eu(r),n=xh(t.baseUrl,i),a=ni(Xt(r),{baseUrl:n});return n!==i&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):s,qm=s=>{const e=Nt(s,"SegmentTemplate")[0],t=Nt(s,"SegmentList")[0],r=t&&Nt(t,"SegmentURL").map(h=>ni({tag:"SegmentURL"},Xt(h))),i=Nt(s,"SegmentBase")[0],n=t||e,a=n&&Nt(n,"SegmentTimeline")[0],o=t||i||e,l=o&&Nt(o,"Initialization")[0],u=e&&Xt(e);u&&l?u.initialization=l&&Xt(l):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});const c={template:u,segmentTimeline:a&&Nt(a,"S").map(h=>Xt(h)),list:t&&ni(Xt(t),{segmentUrls:r,initialization:Xt(l)}),base:i&&ni(Xt(i),{initialization:Xt(l)})};return Object.keys(c).forEach(h=>{c[h]||delete c[h]}),c},qI=(s,e,t)=>r=>{const i=Nt(r,"BaseURL"),n=Ph(e,i),a=ni(s,Xt(r)),o=qm(r);return n.map(l=>({segmentInfo:ni(t,o),attributes:ni(a,l)}))},zI=s=>s.reduce((e,t)=>{const r=Xt(t);r.schemeIdUri&&(r.schemeIdUri=r.schemeIdUri.toLowerCase());const i=HI[r.schemeIdUri];if(i){e[i]={attributes:r};const n=Nt(t,"cenc:pssh")[0];if(n){const a=eu(n);e[i].pssh=a&&x0(a)}}return e},{}),WI=s=>{if(s.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(t=>{let r,i;return i=t,/^CC\d=/.test(t)?[r,i]=t.split("="):/^CC\d$/.test(t)&&(r=t),{channel:r,language:i}});if(s.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(t=>{const r={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[i,n=""]=t.split("=");r.channel=i,r.language=t,n.split(",").forEach(a=>{const[o,l]=a.split(":");o==="lang"?r.language=l:o==="er"?r.easyReader=Number(l):o==="war"?r.aspectRatio=Number(l):o==="3D"&&(r["3D"]=Number(l))})}else r.language=t;return r.channel&&(r.channel="SERVICE"+r.channel),r})},GI=s=>co(Nt(s.node,"EventStream").map(e=>{const t=Xt(e),r=t.schemeIdUri;return Nt(e,"Event").map(i=>{const n=Xt(i),a=n.presentationTime||0,o=t.timescale||1,l=n.duration||0,u=a/o+s.attributes.start;return{schemeIdUri:r,value:t.value,id:n.id,start:u,end:u+l/o,messageData:eu(i)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),KI=(s,e,t)=>r=>{const i=Xt(r),n=Ph(e,Nt(r,"BaseURL")),a=Nt(r,"Role")[0],o={role:Xt(a)};let l=ni(s,i,o);const u=Nt(r,"Accessibility")[0],c=WI(Xt(u));c&&(l=ni(l,{captionServices:c}));const h=Nt(r,"Label")[0];if(h&&h.childNodes.length){const T=h.childNodes[0].nodeValue.trim();l=ni(l,{label:T})}const f=zI(Nt(r,"ContentProtection"));Object.keys(f).length&&(l=ni(l,{contentProtection:f}));const g=qm(r),C=Nt(r,"Representation"),p=ni(t,g);return co(C.map(qI(l,n,p)))},XI=(s,e)=>(t,r)=>{const i=Ph(e,Nt(t.node,"BaseURL")),n=ni(s,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=Nt(t.node,"AdaptationSet"),o=qm(t.node);return co(a.map(KI(n,i,o)))},YI=(s,e)=>{if(s.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!s.length)return null;const t=ni({serverURL:eu(s[0])},Xt(s[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},QI=({attributes:s,priorPeriodAttributes:e,mpdType:t})=>typeof s.start=="number"?s.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,JI=(s,e={})=>{const{manifestUri:t="",NOW:r=Date.now(),clientOffset:i=0,eventHandler:n=function(){}}=e,a=Nt(s,"Period");if(!a.length)throw new Error(ho.INVALID_NUMBER_OF_PERIOD);const o=Nt(s,"Location"),l=Xt(s),u=Ph([{baseUrl:t}],Nt(s,"BaseURL")),c=Nt(s,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=r,l.clientOffset=i,o.length&&(l.locations=o.map(eu));const h=[];return a.forEach((f,g)=>{const C=Xt(f),p=h[g-1];C.start=QI({attributes:C,priorPeriodAttributes:p?p.attributes:null,mpdType:l.type}),h.push({node:f,attributes:C})}),{locations:l.locations,contentSteeringInfo:YI(c,n),representationInfo:co(h.map(XI(l,u))),eventStream:co(h.map(GI))}},$0=s=>{if(s==="")throw new Error(ho.DASH_EMPTY_MANIFEST);const e=new O0.DOMParser;let t,r;try{t=e.parseFromString(s,"application/xml"),r=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error(ho.DASH_INVALID_XML);return r},ZI=s=>{const e=Nt(s,"UTCTiming")[0];if(!e)return null;const t=Xt(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(ho.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},eP=(s,e={})=>{const t=JI($0(s),e),r=$I(t.representationInfo);return DI({dashPlaylists:r,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},tP=s=>ZI($0(s));var pf,yy;function iP(){if(yy)return pf;yy=1;var s=Math.pow(2,32),e=function(t){var r=new DataView(t.buffer,t.byteOffset,t.byteLength),i;return r.getBigUint64?(i=r.getBigUint64(0),i<Number.MAX_SAFE_INTEGER?Number(i):i):r.getUint32(0)*s+r.getUint32(4)};return pf={getUint64:e,MAX_UINT32:s},pf}var mf,_y;function rP(){if(_y)return mf;_y=1;var s=iP().getUint64,e=function(t){var r=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:r.getUint32(4),timescale:r.getUint32(8)},n=12;i.version===0?(i.earliestPresentationTime=r.getUint32(n),i.firstOffset=r.getUint32(n+4),n+=8):(i.earliestPresentationTime=s(t.subarray(n)),i.firstOffset=s(t.subarray(n+8)),n+=16),n+=2;var a=r.getUint16(n);for(n+=2;a>0;n+=12,a--)i.references.push({referenceType:(t[n]&128)>>>7,referencedSize:r.getUint32(n)&2147483647,subsegmentDuration:r.getUint32(n+4),startsWithSap:!!(t[n+8]&128),sapType:(t[n+8]&112)>>>4,sapDeltaTime:r.getUint32(n+8)&268435455});return i};return mf=e,mf}var nP=rP();const sP=qi(nP);var aP=$e([73,68,51]),oP=function(e,t){t===void 0&&(t=0),e=$e(e);var r=e[t+5],i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(r&16)>>4;return n?i+20:i+10},Tl=function s(e,t){return t===void 0&&(t=0),e=$e(e),e.length-t<10||!Pt(e,aP,{offset:t})?t:(t+=oP(e,t),s(e,t))},Ty=function(e){return typeof e=="string"?N0(e):e},lP=function(e){return Array.isArray(e)?e.map(function(t){return Ty(t)}):[Ty(e)]},uP=function s(e,t,r){r===void 0&&(r=!1),t=lP(t),e=$e(e);var i=[];if(!t.length)return i;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,o=e.subarray(n+4,n+8);if(a===0)break;var l=n+a;if(l>e.length){if(r)break;l=e.length}var u=e.subarray(n+8,l);Pt(o,t[0])&&(t.length===1?i.push(u):i.push.apply(i,s(u,t.slice(1),r))),n=l}return i},Qu={EBML:$e([26,69,223,163]),DocType:$e([66,130]),Segment:$e([24,83,128,103]),SegmentInfo:$e([21,73,169,102]),Tracks:$e([22,84,174,107]),Track:$e([174]),TrackNumber:$e([215]),DefaultDuration:$e([35,227,131]),TrackEntry:$e([174]),TrackType:$e([131]),FlagDefault:$e([136]),CodecID:$e([134]),CodecPrivate:$e([99,162]),VideoTrack:$e([224]),AudioTrack:$e([225]),Cluster:$e([31,67,182,117]),Timestamp:$e([231]),TimestampScale:$e([42,215,177]),BlockGroup:$e([160]),BlockDuration:$e([155]),Block:$e([161]),SimpleBlock:$e([163])},Ip=[128,64,32,16,8,4,2,1],cP=function(e){for(var t=1,r=0;r<Ip.length&&!(e&Ip[r]);r++)t++;return t},Dc=function(e,t,r,i){r===void 0&&(r=!0),i===void 0&&(i=!1);var n=cP(e[t]),a=e.subarray(t,t+n);return r&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=Ip[n-1]),{length:n,value:tI(a,{signed:i}),bytes:a}},by=function s(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return s(t)}):typeof e=="number"?iI(e):e},hP=function(e){return Array.isArray(e)?e.map(function(t){return by(t)}):[by(e)]},dP=function s(e,t,r){if(r>=t.length)return t.length;var i=Dc(t,r,!1);if(Pt(e.bytes,i.bytes))return r;var n=Dc(t,r+i.length);return s(e,t,r+n.length+n.value+i.length)},Sy=function s(e,t){t=hP(t),e=$e(e);var r=[];if(!t.length)return r;for(var i=0;i<e.length;){var n=Dc(e,i,!1),a=Dc(e,i+n.length),o=i+n.length+a.length;a.value===127&&(a.value=dP(n,e,o),a.value!==e.length&&(a.value-=o));var l=o+a.value>e.length?e.length:o+a.value,u=e.subarray(o,l);Pt(t[0],n.bytes)&&(t.length===1?r.push(u):r=r.concat(s(u,t.slice(1))));var c=n.length+a.length+u.length;i+=c}return r},fP=$e([0,0,0,1]),pP=$e([0,0,1]),mP=$e([0,0,3]),gP=function(e){for(var t=[],r=1;r<e.length-2;)Pt(e.subarray(r,r+3),mP)&&(t.push(r+2),r++),r++;if(t.length===0)return e;var i=e.length-t.length,n=new Uint8Array(i),a=0;for(r=0;r<i;a++,r++)a===t[0]&&(a++,t.shift()),n[r]=e[a];return n},j0=function(e,t,r,i){e=$e(e),r=[].concat(r);for(var n=0,a,o=0;n<e.length&&(o<i||a);){var l=void 0;if(Pt(e.subarray(n),fP)?l=4:Pt(e.subarray(n),pP)&&(l=3),!l){n++;continue}if(o++,a)return gP(e.subarray(a,n));var u=void 0;t==="h264"?u=e[n+l]&31:t==="h265"&&(u=e[n+l]>>1&63),r.indexOf(u)!==-1&&(a=n+l),n+=l+(t==="h264"?1:2)}return e.subarray(0,0)},vP=function(e,t,r){return j0(e,"h264",t,r)},yP=function(e,t,r){return j0(e,"h265",t,r)},Ci={webm:$e([119,101,98,109]),matroska:$e([109,97,116,114,111,115,107,97]),flac:$e([102,76,97,67]),ogg:$e([79,103,103,83]),ac3:$e([11,119]),riff:$e([82,73,70,70]),avi:$e([65,86,73]),wav:$e([87,65,86,69]),"3gp":$e([102,116,121,112,51,103]),mp4:$e([102,116,121,112]),fmp4:$e([115,116,121,112]),mov:$e([102,116,121,112,113,116]),moov:$e([109,111,111,118]),moof:$e([109,111,111,102])},fo={aac:function(e){var t=Tl(e);return Pt(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Tl(e);return Pt(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Sy(e,[Qu.EBML,Qu.DocType])[0];return Pt(t,Ci.webm)},mkv:function(e){var t=Sy(e,[Qu.EBML,Qu.DocType])[0];return Pt(t,Ci.matroska)},mp4:function(e){if(fo["3gp"](e)||fo.mov(e))return!1;if(Pt(e,Ci.mp4,{offset:4})||Pt(e,Ci.fmp4,{offset:4})||Pt(e,Ci.moof,{offset:4})||Pt(e,Ci.moov,{offset:4}))return!0},mov:function(e){return Pt(e,Ci.mov,{offset:4})},"3gp":function(e){return Pt(e,Ci["3gp"],{offset:4})},ac3:function(e){var t=Tl(e);return Pt(e,Ci.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=Tl(e);return Pt(e,Ci.flac,{offset:t})},ogg:function(e){return Pt(e,Ci.ogg)},avi:function(e){return Pt(e,Ci.riff)&&Pt(e,Ci.avi,{offset:8})},wav:function(e){return Pt(e,Ci.riff)&&Pt(e,Ci.wav,{offset:8})},h264:function(e){return vP(e,7,3).length},h265:function(e){return yP(e,[32,33],3).length}},Pp=Object.keys(fo).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);Pp.forEach(function(s){var e=fo[s];fo[s]=function(t){return e($e(t))}});var _P=fo,zm=function(e){e=$e(e);for(var t=0;t<Pp.length;t++){var r=Pp[t];if(_P[r](e))return r}return""},TP=function(e){return uP(e,["moof"]).length>0},gf,Cy;function bP(){if(Cy)return gf;Cy=1;var s=9e4,e,t,r,i,n,a,o;return e=function(l){return l*s},t=function(l,u){return l*u},r=function(l){return l/s},i=function(l,u){return l/u},n=function(l,u){return e(i(l,u))},a=function(l,u){return t(r(l),u)},o=function(l,u,c){return r(c?l:l-u)},gf={ONE_SECOND_IN_TS:s,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:r,audioTsToSeconds:i,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:o},gf}var Fs=bP();/**
|
|
24
|
-
* @license
|
|
25
|
-
* Video.js 8.20.0 <http://videojs.com/>
|
|
26
|
-
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
|
|
27
|
-
* Available under Apache License Version 2.0
|
|
28
|
-
* <https://github.com/videojs/video.js/blob/main/LICENSE>
|
|
29
|
-
*
|
|
30
|
-
* Includes vtt.js <https://github.com/mozilla/vtt.js>
|
|
31
|
-
* Available under Apache License Version 2.0
|
|
32
|
-
* <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
|
|
33
|
-
*/var Dp="8.20.0";const Tn={},ns=function(s,e){return Tn[s]=Tn[s]||[],e&&(Tn[s]=Tn[s].concat(e)),Tn[s]},SP=function(s,e){ns(s,e)},V0=function(s,e){const t=ns(s).indexOf(e);return t<=-1?!1:(Tn[s]=Tn[s].slice(),Tn[s].splice(t,1),!0)},CP=function(s,e){ns(s,[].concat(e).map(t=>{const r=(...i)=>(V0(s,r),t(...i));return r}))},Nc={prefixed:!0},yc=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],Ey=yc[0];let bl;for(let s=0;s<yc.length;s++)if(yc[s][1]in ue){bl=yc[s];break}if(bl){for(let s=0;s<bl.length;s++)Nc[Ey[s]]=bl[s];Nc.prefixed=bl[0]!==Ey[0]}let Ui=[];const EP=(s,e,t)=>(r,i,n)=>{const a=e.levels[i],o=new RegExp(`^(${a})$`);let l=s;if(r!=="log"&&n.unshift(r.toUpperCase()+":"),t&&(l=`%c${s}`,n.unshift(t)),n.unshift(l+":"),Ui){Ui.push([].concat(n));const c=Ui.length-1e3;Ui.splice(0,c>0?c:0)}if(!D.console)return;let u=D.console[r];!u&&r==="debug"&&(u=D.console.info||D.console.log),!(!u||!a||!o.test(r))&&u[Array.isArray(n)?"apply":"call"](D.console,n)};function Np(s,e=":",t=""){let r="info",i;function n(...a){i("log",r,a)}return i=EP(s,n,t),n.createLogger=(a,o,l)=>{const u=o!==void 0?o:e,c=l!==void 0?l:t,h=`${s} ${u} ${a}`;return Np(h,u,c)},n.createNewLogger=(a,o,l)=>Np(a,o,l),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);r=a}return r},n.history=()=>Ui?[].concat(Ui):[],n.history.filter=a=>(Ui||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),n.history.clear=()=>{Ui&&(Ui.length=0)},n.history.disable=()=>{Ui!==null&&(Ui.length=0,Ui=null)},n.history.enable=()=>{Ui===null&&(Ui=[])},n.error=(...a)=>i("error",r,a),n.warn=(...a)=>i("warn",r,a),n.debug=(...a)=>i("debug",r,a),n}const et=Np("VIDEOJS"),H0=et.createLogger,wP=Object.prototype.toString,q0=function(s){return en(s)?Object.keys(s):[]};function Qa(s,e){q0(s).forEach(t=>e(s[t],t))}function z0(s,e,t=0){return q0(s).reduce((r,i)=>e(r,s[i],i),t)}function en(s){return!!s&&typeof s=="object"}function po(s){return en(s)&&wP.call(s)==="[object Object]"&&s.constructor===Object}function St(...s){const e={};return s.forEach(t=>{t&&Qa(t,(r,i)=>{if(!po(r)){e[i]=r;return}po(e[i])||(e[i]={}),e[i]=St(e[i],r)})}),e}function W0(s={}){const e=[];for(const t in s)if(s.hasOwnProperty(t)){const r=s[t];e.push(r)}return e}function Dh(s,e,t,r=!0){const i=a=>Object.defineProperty(s,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return i(a),a}};return r&&(n.set=i),Object.defineProperty(s,e,n)}var kP=Object.freeze({__proto__:null,each:Qa,reduce:z0,isObject:en,isPlain:po,merge:St,values:W0,defineLazyProperty:Dh});let Wm=!1,G0=null,tn=!1,K0,X0=!1,Ja=!1,Za=!1,rn=!1,Gm=null,Nh=null;const xP=!!(D.cast&&D.cast.framework&&D.cast.framework.CastReceiverContext);let Y0=null,Lc=!1,Lh=!1,Oc=!1,Oh=!1,Mc=!1,Rc=!1,Bc=!1;const Vl=!!(Po()&&("ontouchstart"in D||D.navigator.maxTouchPoints||D.DocumentTouch&&D.document instanceof D.DocumentTouch)),Yn=D.navigator&&D.navigator.userAgentData;Yn&&Yn.platform&&Yn.brands&&(tn=Yn.platform==="Android",Ja=!!Yn.brands.find(s=>s.brand==="Microsoft Edge"),Za=!!Yn.brands.find(s=>s.brand==="Chromium"),rn=!Ja&&Za,Gm=Nh=(Yn.brands.find(s=>s.brand==="Chromium")||{}).version||null,Lh=Yn.platform==="Windows");if(!Za){const s=D.navigator&&D.navigator.userAgent||"";Wm=/iPod/i.test(s),G0=(function(){const e=s.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null})(),tn=/Android/i.test(s),K0=(function(){const e=s.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),r=e[2]&&parseFloat(e[2]);return t&&r?parseFloat(e[1]+"."+e[2]):t||null})(),X0=/Firefox/i.test(s),Ja=/Edg/i.test(s),Za=/Chrome/i.test(s)||/CriOS/i.test(s),rn=!Ja&&Za,Gm=Nh=(function(){const e=s.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null})(),Y0=(function(){const e=/MSIE\s(\d+)\.\d/.exec(s);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(s)&&/rv:11.0/.test(s)&&(t=11),t})(),Mc=/Tizen/i.test(s),Rc=/Web0S/i.test(s),Bc=Mc||Rc,Lc=/Safari/i.test(s)&&!rn&&!tn&&!Ja&&!Bc,Lh=/Windows/i.test(s),Oc=/iPad/i.test(s)||Lc&&Vl&&!/iPhone/i.test(s),Oh=/iPhone/i.test(s)&&!Oc}const Ni=Oh||Oc||Wm,Mh=(Lc||Ni)&&!rn;var Q0=Object.freeze({__proto__:null,get IS_IPOD(){return Wm},get IOS_VERSION(){return G0},get IS_ANDROID(){return tn},get ANDROID_VERSION(){return K0},get IS_FIREFOX(){return X0},get IS_EDGE(){return Ja},get IS_CHROMIUM(){return Za},get IS_CHROME(){return rn},get CHROMIUM_VERSION(){return Gm},get CHROME_VERSION(){return Nh},IS_CHROMECAST_RECEIVER:xP,get IE_VERSION(){return Y0},get IS_SAFARI(){return Lc},get IS_WINDOWS(){return Lh},get IS_IPAD(){return Oc},get IS_IPHONE(){return Oh},get IS_TIZEN(){return Mc},get IS_WEBOS(){return Rc},get IS_SMART_TV(){return Bc},TOUCH_ENABLED:Vl,IS_IOS:Ni,IS_ANY_SAFARI:Mh});function wy(s){return typeof s=="string"&&!!s.trim()}function AP(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Po(){return ue===D.document}function Do(s){return en(s)&&s.nodeType===1}function J0(){try{return D.parent!==D.self}catch{return!0}}function Z0(s){return function(e,t){if(!wy(e))return ue[s](null);wy(t)&&(t=ue.querySelector(t));const r=Do(t)?t:ue;return r[s]&&r[s](e)}}function qe(s="div",e={},t={},r){const i=ue.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?us(i,a):(i[n]!==a||n==="tabIndex")&&(i[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){i.setAttribute(n,t[n])}),r&&Km(i,r),i}function us(s,e){return typeof s.textContent>"u"?s.innerText=e:s.textContent=e,s}function Lp(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function Dl(s,e){return AP(e),s.classList.contains(e)}function Ws(s,...e){return s.classList.add(...e.reduce((t,r)=>t.concat(r.split(/\s+/)),[])),s}function Rh(s,...e){return s?(s.classList.remove(...e.reduce((t,r)=>t.concat(r.split(/\s+/)),[])),s):(et.warn("removeClass was called with an element that doesn't exist"),null)}function eS(s,e,t){return typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(r=>s.classList.toggle(r,t)),s}function tS(s,e){Object.getOwnPropertyNames(e).forEach(function(t){const r=e[t];r===null||typeof r>"u"||r===!1?s.removeAttribute(t):s.setAttribute(t,r===!0?"":r)})}function ts(s){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(s&&s.attributes&&s.attributes.length>0){const r=s.attributes;for(let i=r.length-1;i>=0;i--){const n=r[i].name;let a=r[i].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function iS(s,e){return s.getAttribute(e)}function mo(s,e,t){s.setAttribute(e,t)}function Bh(s,e){s.removeAttribute(e)}function rS(){ue.body.focus(),ue.onselectstart=function(){return!1}}function nS(){ue.onselectstart=function(){return!0}}function go(s){if(s&&s.getBoundingClientRect&&s.parentNode){const e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(r=>{e[r]!==void 0&&(t[r]=e[r])}),t.height||(t.height=parseFloat(vo(s,"height"))),t.width||(t.width=parseFloat(vo(s,"width"))),t}}function Hl(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};const e=s.offsetWidth,t=s.offsetHeight;let r=0,i=0;for(;s.offsetParent&&s!==ue[Nc.fullscreenElement];)r+=s.offsetLeft,i+=s.offsetTop,s=s.offsetParent;return{left:r,top:i,width:e,height:t}}function Fh(s,e){const t={x:0,y:0};if(Ni){let c=s;for(;c&&c.nodeName.toLowerCase()!=="html";){const h=vo(c,"transform");if(/^matrix/.test(h)){const f=h.slice(7,-1).split(/,\s/).map(Number);t.x+=f[4],t.y+=f[5]}else if(/^matrix3d/.test(h)){const f=h.slice(9,-1).split(/,\s/).map(Number);t.x+=f[12],t.y+=f[13]}if(c.assignedSlot&&c.assignedSlot.parentElement&&D.WebKitCSSMatrix){const f=D.getComputedStyle(c.assignedSlot.parentElement).transform,g=new D.WebKitCSSMatrix(f);t.x+=g.m41,t.y+=g.m42}c=c.parentNode||c.host}}const r={},i=Hl(e.target),n=Hl(s),a=n.width,o=n.height;let l=e.offsetY-(n.top-i.top),u=e.offsetX-(n.left-i.left);return e.changedTouches&&(u=e.changedTouches[0].pageX-n.left,l=e.changedTouches[0].pageY+n.top,Ni&&(u-=t.x,l-=t.y)),r.y=1-Math.max(0,Math.min(1,l/o)),r.x=Math.max(0,Math.min(1,u/a)),r}function sS(s){return en(s)&&s.nodeType===3}function Uh(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function aS(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(e=>{if(typeof e=="function"&&(e=e()),Do(e)||sS(e))return e;if(typeof e=="string"&&/\S/.test(e))return ue.createTextNode(e)}).filter(e=>e)}function Km(s,e){return aS(e).forEach(t=>s.appendChild(t)),s}function oS(s,e){return Km(Uh(s),e)}function ql(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0||s.type==="mousedown"&&s.button===0&&s.buttons===0?!0:!(s.button!==0||s.buttons!==1)}const ss=Z0("querySelector"),lS=Z0("querySelectorAll");function vo(s,e){if(!s||!e)return"";if(typeof D.getComputedStyle=="function"){let t;try{t=D.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function uS(s){[...ue.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(i=>i.cssText).join(""),r=ue.createElement("style");r.textContent=t,s.document.head.appendChild(r)}catch{const r=ue.createElement("link");r.rel="stylesheet",r.type=e.type,r.media=e.media.mediaText,r.href=e.href,s.document.head.appendChild(r)}})}var cS=Object.freeze({__proto__:null,isReal:Po,isEl:Do,isInFrame:J0,createEl:qe,textContent:us,prependTo:Lp,hasClass:Dl,addClass:Ws,removeClass:Rh,toggleClass:eS,setAttributes:tS,getAttributes:ts,getAttribute:iS,setAttribute:mo,removeAttribute:Bh,blockTextSelection:rS,unblockTextSelection:nS,getBoundingClientRect:go,findPosition:Hl,getPointerPosition:Fh,isTextNode:sS,emptyEl:Uh,normalizeContent:aS,appendContent:Km,insertContent:oS,isSingleLeftClick:ql,$:ss,$$:lS,computedStyle:vo,copyStyleSheetsToWindow:uS});let hS=!1,Op;const IP=function(){if(Op.options.autoSetup===!1)return;const s=Array.prototype.slice.call(ue.getElementsByTagName("video")),e=Array.prototype.slice.call(ue.getElementsByTagName("audio")),t=Array.prototype.slice.call(ue.getElementsByTagName("video-js")),r=s.concat(e,t);if(r&&r.length>0)for(let i=0,n=r.length;i<n;i++){const a=r[i];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&Op(a);else{Mp(1);break}}else hS||Mp(1)};function Mp(s,e){Po()&&(e&&(Op=e),D.setTimeout(IP,s))}function Rp(){hS=!0,D.removeEventListener("load",Rp)}Po()&&(ue.readyState==="complete"?Rp():D.addEventListener("load",Rp));const dS=function(s){const e=ue.createElement("style");return e.className=s,e},fS=function(s,e){s.styleSheet?s.styleSheet.cssText=e:s.textContent=e};var Ai=new WeakMap;const PP=3;let DP=PP;function mr(){return DP++}function ky(s,e){if(!Ai.has(s))return;const t=Ai.get(s);t.handlers[e].length===0&&(delete t.handlers[e],s.removeEventListener?s.removeEventListener(e,t.dispatcher,!1):s.detachEvent&&s.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&Ai.delete(s)}function Xm(s,e,t,r){t.forEach(function(i){s(e,i,r)})}function $h(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){const r=s||D.event;s={};const i=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const n in r)i.includes(n)||n==="returnValue"&&r.preventDefault||(s[n]=r[n]);if(s.target||(s.target=s.srcElement||ue),s.relatedTarget||(s.relatedTarget=s.fromElement===s.target?s.toElement:s.fromElement),s.preventDefault=function(){r.preventDefault&&r.preventDefault(),s.returnValue=!1,r.returnValue=!1,s.defaultPrevented=!0},s.defaultPrevented=!1,s.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),s.cancelBubble=!0,r.cancelBubble=!0,s.isPropagationStopped=e},s.isPropagationStopped=t,s.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),s.isImmediatePropagationStopped=e,s.stopPropagation()},s.isImmediatePropagationStopped=t,s.clientX!==null&&s.clientX!==void 0){const n=ue.documentElement,a=ue.body;s.pageX=s.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),s.pageY=s.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}s.which=s.charCode||s.keyCode,s.button!==null&&s.button!==void 0&&(s.button=s.button&1?0:s.button&4?1:s.button&2?2:0)}return s.fixed_=!0,s}let Ju;const NP=function(){if(typeof Ju!="boolean"){Ju=!1;try{const s=Object.defineProperty({},"passive",{get(){Ju=!0}});D.addEventListener("test",null,s),D.removeEventListener("test",null,s)}catch{}}return Ju},LP=["touchstart","touchmove"];function tr(s,e,t){if(Array.isArray(e))return Xm(tr,s,e,t);Ai.has(s)||Ai.set(s,{});const r=Ai.get(s);if(r.handlers||(r.handlers={}),r.handlers[e]||(r.handlers[e]=[]),t.guid||(t.guid=mr()),r.handlers[e].push(t),r.dispatcher||(r.disabled=!1,r.dispatcher=function(i,n){if(r.disabled)return;i=$h(i);const a=r.handlers[i.type];if(a){const o=a.slice(0);for(let l=0,u=o.length;l<u&&!i.isImmediatePropagationStopped();l++)try{o[l].call(s,i,n)}catch(c){et.error(c)}}}),r.handlers[e].length===1)if(s.addEventListener){let i=!1;NP()&&LP.indexOf(e)>-1&&(i={passive:!0}),s.addEventListener(e,r.dispatcher,i)}else s.attachEvent&&s.attachEvent("on"+e,r.dispatcher)}function vi(s,e,t){if(!Ai.has(s))return;const r=Ai.get(s);if(!r.handlers)return;if(Array.isArray(e))return Xm(vi,s,e,t);const i=function(a,o){r.handlers[o]=[],ky(a,o)};if(e===void 0){for(const a in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},a)&&i(s,a);return}const n=r.handlers[e];if(n){if(!t){i(s,e);return}if(t.guid)for(let a=0;a<n.length;a++)n[a].guid===t.guid&&n.splice(a--,1);ky(s,e)}}function No(s,e,t){const r=Ai.has(s)?Ai.get(s):{},i=s.parentNode||s.ownerDocument;if(typeof e=="string"?e={type:e,target:s}:e.target||(e.target=s),e=$h(e),r.dispatcher&&r.dispatcher.call(s,e,t),i&&!e.isPropagationStopped()&&e.bubbles===!0)No.call(null,i,e,t);else if(!i&&!e.defaultPrevented&&e.target&&e.target[e.type]){Ai.has(e.target)||Ai.set(e.target,{});const n=Ai.get(e.target);e.target[e.type]&&(n.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),n.disabled=!1)}return!e.defaultPrevented}function jh(s,e,t){if(Array.isArray(e))return Xm(jh,s,e,t);const r=function(){vi(s,e,r),t.apply(this,arguments)};r.guid=t.guid=t.guid||mr(),tr(s,e,r)}function Ym(s,e,t){const r=function(){vi(s,e,r),t.apply(this,arguments)};r.guid=t.guid=t.guid||mr(),tr(s,e,r)}var OP=Object.freeze({__proto__:null,fixEvent:$h,on:tr,off:vi,trigger:No,one:jh,any:Ym});const gr=30,kt=function(s,e,t){e.guid||(e.guid=mr());const r=e.bind(s);return r.guid=t?t+"_"+e.guid:e.guid,r},nn=function(s,e){let t=D.performance.now();return function(...i){const n=D.performance.now();n-t>=e&&(s(...i),t=n)}},pS=function(s,e,t,r=D){let i;const n=()=>{r.clearTimeout(i),i=null},a=function(){const o=this,l=arguments;let u=function(){i=null,u=null,t||s.apply(o,l)};!i&&t&&s.apply(o,l),r.clearTimeout(i),i=r.setTimeout(u,e)};return a.cancel=n,a};var MP=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:gr,bind_:kt,throttle:nn,debounce:pS});let ul,ir=class{on(e,t){const r=this.addEventListener;this.addEventListener=()=>{},tr(this,e,t),this.addEventListener=r}off(e,t){vi(this,e,t)}one(e,t){const r=this.addEventListener;this.addEventListener=()=>{},jh(this,e,t),this.addEventListener=r}any(e,t){const r=this.addEventListener;this.addEventListener=()=>{},Ym(this,e,t),this.addEventListener=r}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=$h(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),No(this,e)}queueTrigger(e){ul||(ul=new Map);const t=e.type||e;let r=ul.get(this);r||(r=new Map,ul.set(this,r));const i=r.get(t);r.delete(t),D.clearTimeout(i);const n=D.setTimeout(()=>{r.delete(t),r.size===0&&(r=null,ul.delete(this)),this.trigger(e)},0);r.set(t,n)}};ir.prototype.allowedEvents_={};ir.prototype.addEventListener=ir.prototype.on;ir.prototype.removeEventListener=ir.prototype.off;ir.prototype.dispatchEvent=ir.prototype.trigger;const Vh=s=>typeof s.name=="function"?s.name():typeof s.name=="string"?s.name:s.name_?s.name_:s.constructor&&s.constructor.name?s.constructor.name:typeof s,wn=s=>s instanceof ir||!!s.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof s[e]=="function"),RP=(s,e)=>{wn(s)?e():(s.eventedCallbacks||(s.eventedCallbacks=[]),s.eventedCallbacks.push(e))},Bp=s=>typeof s=="string"&&/\S/.test(s)||Array.isArray(s)&&!!s.length,Fc=(s,e,t)=>{if(!s||!s.nodeName&&!wn(s))throw new Error(`Invalid target for ${Vh(e)}#${t}; must be a DOM node or evented object.`)},mS=(s,e,t)=>{if(!Bp(s))throw new Error(`Invalid event type for ${Vh(e)}#${t}; must be a non-empty string or array.`)},gS=(s,e,t)=>{if(typeof s!="function")throw new Error(`Invalid listener for ${Vh(e)}#${t}; must be a function.`)},vf=(s,e,t)=>{const r=e.length<3||e[0]===s||e[0]===s.eventBusEl_;let i,n,a;return r?(i=s.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(i=e[0],n=e[1],a=e[2]),Fc(i,s,t),mS(n,s,t),gS(a,s,t),a=kt(s,a),{isTargetingSelf:r,target:i,type:n,listener:a}},Ps=(s,e,t,r)=>{Fc(s,s,e),s.nodeName?OP[e](s,t,r):s[e](t,r)},BP={on(...s){const{isTargetingSelf:e,target:t,type:r,listener:i}=vf(this,s,"on");if(Ps(t,"on",r,i),!e){const n=()=>this.off(t,r,i);n.guid=i.guid;const a=()=>this.off("dispose",n);a.guid=i.guid,Ps(this,"on","dispose",n),Ps(t,"on","dispose",a)}},one(...s){const{isTargetingSelf:e,target:t,type:r,listener:i}=vf(this,s,"one");if(e)Ps(t,"one",r,i);else{const n=(...a)=>{this.off(t,r,n),i.apply(null,a)};n.guid=i.guid,Ps(t,"one",r,n)}},any(...s){const{isTargetingSelf:e,target:t,type:r,listener:i}=vf(this,s,"any");if(e)Ps(t,"any",r,i);else{const n=(...a)=>{this.off(t,r,n),i.apply(null,a)};n.guid=i.guid,Ps(t,"any",r,n)}},off(s,e,t){if(!s||Bp(s))vi(this.eventBusEl_,s,e);else{const r=s,i=e;Fc(r,this,"off"),mS(i,this,"off"),gS(t,this,"off"),t=kt(this,t),this.off("dispose",t),r.nodeName?(vi(r,i,t),vi(r,"dispose",t)):wn(r)&&(r.off(i,t),r.off("dispose",t))}},trigger(s,e){Fc(this.eventBusEl_,this,"trigger");const t=s&&typeof s!="string"?s.type:s;if(!Bp(t))throw new Error(`Invalid event type for ${Vh(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return No(this.eventBusEl_,s,e)}};function Qm(s,e={}){const{eventBusKey:t}=e;if(t){if(!s[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);s.eventBusEl_=s[t]}else s.eventBusEl_=qe("span",{className:"vjs-event-bus"});return Object.assign(s,BP),s.eventedCallbacks&&s.eventedCallbacks.forEach(r=>{r()}),s.on("dispose",()=>{s.off(),[s,s.el_,s.eventBusEl_].forEach(function(r){r&&Ai.has(r)&&Ai.delete(r)}),D.setTimeout(()=>{s.eventBusEl_=null},0)}),s}const FP={state:{},setState(s){typeof s=="function"&&(s=s());let e;return Qa(s,(t,r)=>{this.state[r]!==t&&(e=e||{},e[r]={from:this.state[r],to:t}),this.state[r]=t}),e&&wn(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function vS(s,e){return Object.assign(s,FP),s.state=Object.assign({},s.state,e),typeof s.handleStateChanged=="function"&&wn(s)&&s.on("statechanged",s.handleStateChanged),s}const Nl=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toLowerCase())},qt=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},yS=function(s,e){return qt(s)===qt(e)};var UP=Object.freeze({__proto__:null,toLowerCase:Nl,toTitleCase:qt,titleCaseEquals:yS});let _e=class Fi{constructor(e,t,r){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=St({},this.options_),t=this.options_=St(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const i=e&&e.id&&e.id()||"no_player";this.id_=`${i}_component_${mr()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(i=>this.addClass(i)),["on","off","one","any","trigger"].forEach(i=>{this[i]=void 0}),t.evented!==!1&&(Qm(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),vS(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(r),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=St(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,r){return qe(e,t,r)}localize(e,t,r=e){const i=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[i],o=i&&i.split("-")[0],l=n&&n[o];let u=r;return a&&a[e]?u=a[e]:l&&l[e]&&(u=l[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(c,h){const f=t[h-1];let g=f;return typeof f>"u"&&(g=c),g})),u}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((r,i)=>r.concat(i),[]);let t=this;for(let r=0;r<e.length;r++)if(t=t.getChild(e[r]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const r="http://www.w3.org/2000/svg",i=qe("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=ue.createElementNS(r,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const a=ue.createElementNS(r,"use");return n.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),i.appendChild(n),this.iconIsSet_?t.replaceChild(i,t.querySelector(".vjs-icon-placeholder")):t.appendChild(i),this.iconIsSet_=!0,i}addChild(e,t={},r=this.children_.length){let i,n;if(typeof e=="string"){n=qt(e);const a=t.componentClass||n;t.name=n;const o=Fi.getComponent(a);if(!o)throw new Error(`Component ${a} does not exist`);if(typeof o!="function")return null;i=new o(this.player_||this,t)}else i=e;if(i.parentComponent_&&i.parentComponent_.removeChild(i),this.children_.splice(r,0,i),i.parentComponent_=this,typeof i.id=="function"&&(this.childIndex_[i.id()]=i),n=n||i.name&&qt(i.name()),n&&(this.childNameIndex_[n]=i,this.childNameIndex_[Nl(n)]=i),typeof i.el=="function"&&i.el()){let a=null;this.children_[r+1]&&(this.children_[r+1].el_?a=this.children_[r+1].el_:Do(this.children_[r+1])&&(a=this.children_[r+1])),this.contentEl().insertBefore(i.el(),a)}return i}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[qt(e.name())]=null,this.childNameIndex_[Nl(e.name())]=null;const r=e.el();r&&r.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,r=a=>{const o=a.name;let l=a.opts;if(t[o]!==void 0&&(l=t[o]),l===!1)return;l===!0&&(l={}),l.playerOptions=this.options_.playerOptions;const u=this.addChild(o,l);u&&(this[o]=u)};let i;const n=Fi.getComponent("Tech");Array.isArray(e)?i=e:i=Object.keys(e),i.concat(Object.keys(this.options_).filter(function(a){return!i.some(function(o){return typeof o=="string"?a===o:a===o.name})})).map(a=>{let o,l;return typeof a=="string"?(o=a,l=e[o]||this.options_[o]||{}):(o=a.name,l=a),{name:o,opts:l}}).filter(a=>{const o=Fi.getComponent(a.opts.componentClass||qt(a.name));return o&&!n.isTech(o)}).forEach(r)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return ss(e,t||this.contentEl())}$$(e,t){return lS(e,t||this.contentEl())}hasClass(e){return Dl(this.el_,e)}addClass(...e){Ws(this.el_,...e)}removeClass(...e){Rh(this.el_,...e)}toggleClass(e,t){eS(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return iS(this.el_,e)}setAttribute(e,t){mo(this.el_,e,t)}removeAttribute(e){Bh(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,r){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",r||this.trigger("componentresize");return}if(!this.el_)return 0;const i=this.el_.style[e],n=i.indexOf("px");return parseInt(n!==-1?i.slice(0,n):this.el_["offset"+qt(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=vo(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const r=`offset${qt(e)}`;t=this.el_[r]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},r={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:r}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const r=10,i=200;let n;this.on("touchstart",function(o){o.touches.length===1&&(t={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},e=D.performance.now(),n=!0)}),this.on("touchmove",function(o){if(o.touches.length>1)n=!1;else if(t){const l=o.touches[0].pageX-t.pageX,u=o.touches[0].pageY-t.pageY;Math.sqrt(l*l+u*u)>r&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(o){t=null,n===!0&&D.performance.now()-e<i&&(o.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=kt(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const r=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",r),this.on("touchcancel",r)}setTimeout(e,t){var r;return e=kt(this,e),this.clearTimersOnDispose_(),r=D.setTimeout(()=>{this.setTimeoutIds_.has(r)&&this.setTimeoutIds_.delete(r),e()},t),this.setTimeoutIds_.add(r),r}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),D.clearTimeout(e)),e}setInterval(e,t){e=kt(this,e),this.clearTimersOnDispose_();const r=D.setInterval(e,t);return this.setIntervalIds_.add(r),r}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),D.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=kt(this,e),t=D.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=kt(this,t);const r=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,r),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),D.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((r,i)=>this[t](i))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=D.getComputedStyle(n,null),o=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(o)}function r(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||D.getComputedStyle(n).height==="0px"||D.getComputedStyle(n).width==="0px")}function i(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(ue.documentElement.clientWidth||D.innerWidth)||a.y<0||a.y>(ue.documentElement.clientHeight||D.innerHeight))return!1;let o=ue.elementFromPoint(a.x,a.y);for(;o;){if(o===n)return!0;if(o.parentNode)o=o.parentNode;else return!1}}return e||(e=this.el()),!!(i(e)&&r(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const r=Fi.getComponent("Tech"),i=r&&r.isTech(t),n=Fi===t||Fi.prototype.isPrototypeOf(t.prototype);if(i||!n){let o;throw i?o="techs must be registered using Tech.registerTech()":o="must be a Component subclass",new Error(`Illegal component, "${e}"; ${o}.`)}e=qt(e),Fi.components_||(Fi.components_={});const a=Fi.getComponent("Player");if(e==="Player"&&a&&a.players){const o=a.players,l=Object.keys(o);if(o&&l.length>0&&l.map(u=>o[u]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return Fi.components_[e]=t,Fi.components_[Nl(e)]=t,t}static getComponent(e){if(!(!e||!Fi.components_))return Fi.components_[e]}};_e.registerComponent("Component",_e);function $P(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${s}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function xy(s,e,t,r){return $P(s,r,t.length-1),t[r][e]}function yf(s){let e;return s===void 0||s.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:s.length,start:xy.bind(null,"start",0,s),end:xy.bind(null,"end",1,s)},D.Symbol&&D.Symbol.iterator&&(e[D.Symbol.iterator]=()=>(s||[]).values()),e}function Pr(s,e){return Array.isArray(s)?yf(s):s===void 0||e===void 0?yf():yf([[s,e]])}const _S=function(s,e){s=s<0?0:s;let t=Math.floor(s%60),r=Math.floor(s/60%60),i=Math.floor(s/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(i=r=t="-"),i=i>0||a>0?i+":":"",r=((i||n>=10)&&r<10?"0"+r:r)+":",t=t<10?"0"+t:t,i+r+t};let Jm=_S;function TS(s){Jm=s}function bS(){Jm=_S}function na(s,e=s){return Jm(s,e)}var jP=Object.freeze({__proto__:null,createTimeRanges:Pr,createTimeRange:Pr,setFormatTime:TS,resetFormatTime:bS,formatTime:na});function SS(s,e){let t=0,r,i;if(!e)return 0;(!s||!s.length)&&(s=Pr(0,0));for(let n=0;n<s.length;n++)r=s.start(n),i=s.end(n),i>e&&(i=e),t+=i-r;return t/e}function Bt(s){if(s instanceof Bt)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:en(s)&&(typeof s.code=="number"&&(this.code=s.code),Object.assign(this,s)),this.message||(this.message=Bt.defaultMessages[this.code]||"")}Bt.prototype.code=0;Bt.prototype.message="";Bt.prototype.status=null;Bt.prototype.metadata=null;Bt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Bt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};Bt.MEDIA_ERR_CUSTOM=0;Bt.prototype.MEDIA_ERR_CUSTOM=0;Bt.MEDIA_ERR_ABORTED=1;Bt.prototype.MEDIA_ERR_ABORTED=1;Bt.MEDIA_ERR_NETWORK=2;Bt.prototype.MEDIA_ERR_NETWORK=2;Bt.MEDIA_ERR_DECODE=3;Bt.prototype.MEDIA_ERR_DECODE=3;Bt.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Bt.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Bt.MEDIA_ERR_ENCRYPTED=5;Bt.prototype.MEDIA_ERR_ENCRYPTED=5;function Ll(s){return s!=null&&typeof s.then=="function"}function Gr(s){Ll(s)&&s.then(null,e=>{})}const Fp=function(s){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,r,i)=>(s[r]&&(t[r]=s[r]),t),{cues:s.cues&&Array.prototype.map.call(s.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},VP=function(s){const e=s.$$("track"),t=Array.prototype.map.call(e,i=>i.track);return Array.prototype.map.call(e,function(i){const n=Fp(i.track);return i.src&&(n.src=i.src),n}).concat(Array.prototype.filter.call(s.textTracks(),function(i){return t.indexOf(i)===-1}).map(Fp))},HP=function(s,e){return s.forEach(function(t){const r=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(i=>r.addCue(i))}),e.textTracks()};var Ay={textTracksToJson:VP,jsonToTextTracks:HP,trackToJson_:Fp};const _f="vjs-modal-dialog";let Lo=class extends _e{constructor(e,t){super(e,t),this.handleKeyDown_=r=>this.handleKeyDown(r),this.close_=r=>this.close(r),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=qe("div",{className:`${_f}-content`},{role:"document"}),this.descEl_=qe("p",{className:`${_f}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),us(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${_f} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let r=this.getChild("closeButton");if(t&&!r){const i=this.contentEl_;this.contentEl_=this.el_,r=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=i,this.on(r,"close",this.close_)}!t&&r&&(this.off(r,"close",this.close_),this.removeChild(r),r.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),r=t.parentNode,i=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,r.removeChild(t),this.empty(),oS(t,e),this.trigger("modalfill"),i?r.insertBefore(t,i):r.appendChild(t);const n=this.getChild("closeButton");n&&r.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),Uh(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=ue.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),r=this.el_.querySelector(":focus");let i;for(let n=0;n<t.length;n++)if(r===t[n]){i=n;break}ue.activeElement===this.el_&&(i=0),e.shiftKey&&i===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&i===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof D.HTMLAnchorElement||t instanceof D.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof D.HTMLInputElement||t instanceof D.HTMLSelectElement||t instanceof D.HTMLTextAreaElement||t instanceof D.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof D.HTMLIFrameElement||t instanceof D.HTMLObjectElement||t instanceof D.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}};Lo.prototype.options_={pauseOnOpen:!0,temporary:!0};_e.registerComponent("ModalDialog",Lo);let yo=class extends ir{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},wn(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let r=0,i=this.length;r<i;r++)if(this[r]===e){t=this[r],t.off&&t.off(),this.tracks_.splice(r,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let r=0,i=this.length;r<i;r++){const n=this[r];if(n.id===e){t=n;break}}return t}};yo.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const s in yo.prototype.allowedEvents_)yo.prototype["on"+s]=null;const Tf=function(s,e){for(let t=0;t<s.length;t++)!Object.keys(s[t]).length||e.id===s[t].id||(s[t].enabled=!1)};let qP=class extends yo{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Tf(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Tf(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Tf(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}};const bf=function(s,e){for(let t=0;t<s.length;t++)!Object.keys(s[t]).length||e.id===s[t].id||(s[t].selected=!1)};let zP=class extends yo{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){bf(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set(){}})}addTrack(e){e.selected&&bf(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,bf(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}},CS=class extends yo{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}},WP=class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,r=e.length;t<r;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),this.trackElements_.indexOf(e)===-1&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let r=0,i=this.trackElements_.length;r<i;r++)if(e===this.trackElements_[r].track){t=this.trackElements_[r];break}return t}removeTrackElement_(e){for(let t=0,r=this.trackElements_.length;t<r;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&typeof this.trackElements_[t].track.off=="function"&&this.trackElements_[t].track.off(),typeof this.trackElements_[t].off=="function"&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},Iy=class ES{constructor(e){ES.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let r=0;const i=e.length;this.cues_=e,this.length_=e.length;const n=function(a){""+a in this||Object.defineProperty(this,""+a,{get(){return this.cues_[a]}})};if(t<i)for(r=t;r<i;r++)n.call(this,r)}getCueById(e){let t=null;for(let r=0,i=this.length;r<i;r++){const n=this[r];if(n.id===e){t=n;break}}return t}};const GP={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},KP={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},XP={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Py={disabled:"disabled",hidden:"hidden",showing:"showing"};let Zm=class extends ir{constructor(e={}){super();const t={id:e.id||"vjs_track_"+mr(),kind:e.kind||"",language:e.language||""};let r=e.label||"";for(const i in t)Object.defineProperty(this,i,{get(){return t[i]},set(){}});Object.defineProperty(this,"label",{get(){return r},set(i){i!==r&&(r=i,this.trigger("labelchange"))}})}};const eg=function(s){return new URL(s,ue.baseURI)},wS=function(s){return new URL(s,ue.baseURI).href},tg=function(s){if(typeof s=="string"){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(s);if(t)return t.pop().toLowerCase()}return""},Hh=function(s,e=D.location){return eg(s).origin!==e.origin};var YP=Object.freeze({__proto__:null,parseUrl:eg,getAbsoluteURL:wS,getFileExtension:tg,isCrossOrigin:Hh});const Dy=function(s,e){const t=new D.WebVTT.Parser(D,D.vttjs,D.WebVTT.StringDecoder()),r=[];t.oncue=function(i){e.addCue(i)},t.onparsingerror=function(i){r.push(i)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(s),r.length>0&&(D.console&&D.console.groupCollapsed&&D.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),r.forEach(i=>et.error(i)),D.console&&D.console.groupEnd&&D.console.groupEnd()),t.flush()},Ny=function(s,e){const t={uri:s},r=Hh(s);r&&(t.cors=r);const i=e.tech_.crossOrigin()==="use-credentials";i&&(t.withCredentials=i),k0(t,kt(this,function(n,a,o){if(n)return et.error(n,a);e.loaded_=!0,typeof D.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],l=>{if(l.type==="vttjserror"){et.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return Dy(o,e)}):Dy(o,e)}))};let tu=class extends Zm{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=St(e,{kind:XP[e.kind]||"subtitles",language:e.language||e.srclang||""});let r=Py[t.mode]||"disabled";const i=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(r="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new Iy(this.cues_),a=new Iy(this.activeCues_);let o=!1;this.timeupdateHandler=kt(this,function(u={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){u.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),u.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const l=()=>{this.stopTracking()};this.tech_.one("dispose",l),r!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return i},set(){}},mode:{get(){return r},set(u){Py[u]&&r!==u&&(r=u,!this.preload_&&r!=="disabled"&&this.cues.length===0&&Ny(this.src,this),this.stopTracking(),r!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const u=this.tech_.currentTime(),c=[];for(let h=0,f=this.cues.length;h<f;h++){const g=this.cues[h];g.startTime<=u&&g.endTime>=u&&c.push(g)}if(o=!1,c.length!==this.activeCues_.length)o=!0;else for(let h=0;h<c.length;h++)this.activeCues_.indexOf(c[h])===-1&&(o=!0);return this.activeCues_=c,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions")&&Ny(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new D.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const i in e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}const r=this.tech_.textTracks();for(let i=0;i<r.length;i++)r[i]!==this&&r[i].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){const r=this.cues_[t];if(r===e||r.originalCue_&&r.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}};tu.prototype.allowedEvents_={cuechange:"cuechange"};let kS=class extends Zm{constructor(e={}){const t=St(e,{kind:KP[e.kind]||""});super(t);let r=!1;Object.defineProperty(this,"enabled",{get(){return r},set(i){typeof i!="boolean"||i===r||(r=i,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}},xS=class extends Zm{constructor(e={}){const t=St(e,{kind:GP[e.kind]||""});super(t);let r=!1;Object.defineProperty(this,"selected",{get(){return r},set(i){typeof i!="boolean"||i===r||(r=i,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}},Oo=class Up extends ir{constructor(e={}){super();let t;const r=new tu(e);this.kind=r.kind,this.src=r.src,this.srclang=r.language,this.label=r.label,this.default=r.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return r}}}),t=Up.NONE,r.addEventListener("loadeddata",()=>{t=Up.LOADED,this.trigger({type:"load",target:this})})}};Oo.prototype.allowedEvents_={load:"load"};Oo.NONE=0;Oo.LOADING=1;Oo.LOADED=2;Oo.ERROR=3;const fr={audio:{ListClass:qP,TrackClass:kS,capitalName:"Audio"},video:{ListClass:zP,TrackClass:xS,capitalName:"Video"},text:{ListClass:CS,TrackClass:tu,capitalName:"Text"}};Object.keys(fr).forEach(function(s){fr[s].getterName=`${s}Tracks`,fr[s].privateName=`${s}Tracks_`});const _o={remoteText:{ListClass:CS,TrackClass:tu,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:WP,TrackClass:Oo,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},wi=Object.assign({},fr,_o);_o.names=Object.keys(_o);fr.names=Object.keys(fr);wi.names=[].concat(_o.names).concat(fr.names);function QP(s,e,t,r,i={}){const n=s.textTracks();i.kind=e,t&&(i.label=t),r&&(i.language=r),i.tech=s;const a=new wi.text.TrackClass(i);return n.addTrack(a),a}let Ct=class fi extends _e{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=r=>this.onDurationChange(r),this.trackProgress_=r=>this.trackProgress(r),this.trackCurrentTime_=r=>this.trackCurrentTime(r),this.stopTrackingCurrentTime_=r=>this.stopTrackingCurrentTime(r),this.disposeSourceHandler_=r=>this.disposeSourceHandler(r),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),wi.names.forEach(r=>{const i=wi[r];e&&e[i.getterName]&&(this[i.privateName]=e[i.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(r=>{e[`native${r}Tracks`]===!1&&(this[`featuresNative${r}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new wi.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(kt(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Pr(0,0)}bufferedPercent(){return SS(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(fr.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const r=this[`${t}Tracks`]()||[];let i=r.length;for(;i--;){const n=r[i];t==="text"&&this.removeRemoteTextTrack(n),r.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const r=e[t];this.removeRemoteTextTrack(r)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Bt(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Pr(0,0):Pr()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){fr.names.forEach(e=>{const t=fr[e],r=()=>{this.trigger(`${e}trackchange`)},i=this[t.getterName]();i.addEventListener("removetrack",r),i.addEventListener("addtrack",r),this.on("dispose",()=>{i.removeEventListener("removetrack",r),i.removeEventListener("addtrack",r)})})}addWebVttScript_(){if(!D.WebVTT)if(ue.body.contains(this.el())){if(!this.options_["vtt.js"]&&po(lo)&&Object.keys(lo).length>0){this.trigger("vttjsloaded");return}const e=ue.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),D.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),r=o=>e.addTrack(o.track),i=o=>e.removeTrack(o.track);t.on("addtrack",r),t.on("removetrack",i),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let o=0;o<e.length;o++){const l=e[o];l.removeEventListener("cuechange",n),l.mode==="showing"&&l.addEventListener("cuechange",n)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",r),t.off("removetrack",i),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let o=0;o<e.length;o++)e[o].removeEventListener("cuechange",n)})}addTextTrack(e,t,r){if(!e)throw new Error("TextTrack kind is required but was not provided");return QP(this,e,t,r)}createRemoteTextTrack(e){const t=St(e,{tech:this});return new _o.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const r=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(r),this.remoteTextTracks().addTrack(r.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(r.track)),r}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=mr();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return fi.canPlayType(e.type)}static isTech(e){return e.prototype instanceof fi||e instanceof fi||e===fi}static registerTech(e,t){if(fi.techs_||(fi.techs_={}),!fi.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!fi.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!fi.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=qt(e),fi.techs_[e]=t,fi.techs_[Nl(e)]=t,e!=="Tech"&&fi.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(fi.techs_&&fi.techs_[e])return fi.techs_[e];if(e=qt(e),D&&D.videojs&&D.videojs[e])return et.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),D.videojs[e]}}};wi.names.forEach(function(s){const e=wi[s];Ct.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});Ct.prototype.featuresVolumeControl=!0;Ct.prototype.featuresMuteControl=!0;Ct.prototype.featuresFullscreenResize=!1;Ct.prototype.featuresPlaybackRate=!1;Ct.prototype.featuresProgressEvents=!1;Ct.prototype.featuresSourceset=!1;Ct.prototype.featuresTimeupdateEvents=!1;Ct.prototype.featuresNativeTextTracks=!1;Ct.prototype.featuresVideoFrameCallback=!1;Ct.withSourceHandlers=function(s){s.registerSourceHandler=function(t,r){let i=s.sourceHandlers;i||(i=s.sourceHandlers=[]),r===void 0&&(r=i.length),i.splice(r,0,t)},s.canPlayType=function(t){const r=s.sourceHandlers||[];let i;for(let n=0;n<r.length;n++)if(i=r[n].canPlayType(t),i)return i;return""},s.selectSourceHandler=function(t,r){const i=s.sourceHandlers||[];let n;for(let a=0;a<i.length;a++)if(n=i[a].canHandleSource(t,r),n)return i[a];return null},s.canPlaySource=function(t,r){const i=s.selectSourceHandler(t,r);return i?i.canHandleSource(t,r):""},["seekable","seeking","duration"].forEach(function(t){const r=this[t];typeof r=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):r.apply(this,arguments)})},s.prototype),s.prototype.setSource=function(t){let r=s.selectSourceHandler(t,this.options_);r||(s.nativeSourceHandler?r=s.nativeSourceHandler:et.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),r!==s.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=r.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},s.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};_e.registerComponent("Tech",Ct);Ct.registerTech("Tech",Ct);Ct.defaultTechOrder_=[];const Gs={},Uc={},$c={};function JP(s,e){Gs[s]=Gs[s]||[],Gs[s].push(e)}function ZP(s,e,t){s.setTimeout(()=>Ns(e,Gs[e.type],t,s),1)}function eD(s,e){s.forEach(t=>t.setTech&&t.setTech(e))}function tD(s,e,t){return s.reduceRight(ig(t),e[t]())}function iD(s,e,t,r){return e[t](s.reduce(ig(t),r))}function Ly(s,e,t,r=null){const i="call"+qt(t),n=s.reduce(ig(i),r),a=n===$c,o=a?null:e[t](n);return sD(s,t,o,a),o}const rD={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},nD={setCurrentTime:1,setMuted:1,setVolume:1},Oy={play:1,pause:1};function ig(s){return(e,t)=>e===$c?$c:t[s]?t[s](e):e}function sD(s,e,t,r){for(let i=s.length-1;i>=0;i--){const n=s[i];n[e]&&n[e](r,t)}}function aD(s){Uc.hasOwnProperty(s.id())&&delete Uc[s.id()]}function oD(s,e){const t=Uc[s.id()];let r=null;if(t==null)return r=e(s),Uc[s.id()]=[[e,r]],r;for(let i=0;i<t.length;i++){const[n,a]=t[i];n===e&&(r=a)}return r===null&&(r=e(s),t.push([e,r])),r}function Ns(s={},e=[],t,r,i=[],n=!1){const[a,...o]=e;if(typeof a=="string")Ns(s,Gs[a],t,r,i,n);else if(a){const l=oD(r,a);if(!l.setSource)return i.push(l),Ns(s,o,t,r,i,n);l.setSource(Object.assign({},s),function(u,c){if(u)return Ns(s,o,t,r,i,n);i.push(l),Ns(c,s.type===c.type?o:Gs[c.type],t,r,i,n)})}else o.length?Ns(s,o,t,r,i,n):n?t(s,i):Ns(s,Gs["*"],t,r,i,!0)}const lD={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},jc=function(s=""){const e=tg(s);return lD[e.toLowerCase()]||""},uD=(s,e)=>{if(!e)return"";if(s.cache_.source.src===e&&s.cache_.source.type)return s.cache_.source.type;const t=s.cache_.sources.filter(i=>i.src===e);if(t.length)return t[0].type;const r=s.$$("source");for(let i=0;i<r.length;i++){const n=r[i];if(n.type&&n.src&&n.src===e)return n.type}return jc(e)},AS=function(s){if(Array.isArray(s)){let e=[];s.forEach(function(t){t=AS(t),Array.isArray(t)?e=e.concat(t):en(t)&&e.push(t)}),s=e}else typeof s=="string"&&s.trim()?s=[My({src:s})]:en(s)&&typeof s.src=="string"&&s.src&&s.src.trim()?s=[My(s)]:s=[];return s};function My(s){if(!s.type){const e=jc(s.src);e&&(s.type=e)}return s}var cD=`<svg xmlns="http://www.w3.org/2000/svg">
|
|
34
|
-
<defs>
|
|
35
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-play">
|
|
36
|
-
<path d="M16 10v28l22-14z"></path>
|
|
37
|
-
</symbol>
|
|
38
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-pause">
|
|
39
|
-
<path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>
|
|
40
|
-
</symbol>
|
|
41
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-audio">
|
|
42
|
-
<path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>
|
|
43
|
-
</symbol>
|
|
44
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-captions">
|
|
45
|
-
<path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>
|
|
46
|
-
</symbol>
|
|
47
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">
|
|
48
|
-
<path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>
|
|
49
|
-
</symbol>
|
|
50
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">
|
|
51
|
-
<path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>
|
|
52
|
-
</symbol>
|
|
53
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">
|
|
54
|
-
<path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>
|
|
55
|
-
</symbol>
|
|
56
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">
|
|
57
|
-
<path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
|
|
58
|
-
</symbol>
|
|
59
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">
|
|
60
|
-
<path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>
|
|
61
|
-
</symbol>
|
|
62
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">
|
|
63
|
-
<path d="M14 18v12h8l10 10V8L22 18h-8z"></path>
|
|
64
|
-
</symbol>
|
|
65
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">
|
|
66
|
-
<path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>
|
|
67
|
-
</symbol>
|
|
68
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">
|
|
69
|
-
<path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>
|
|
70
|
-
</symbol>
|
|
71
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-spinner">
|
|
72
|
-
<path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>
|
|
73
|
-
</symbol>
|
|
74
|
-
<symbol viewBox="0 0 24 24" id="vjs-icon-hd">
|
|
75
|
-
<path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>
|
|
76
|
-
</symbol>
|
|
77
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-chapters">
|
|
78
|
-
<path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>
|
|
79
|
-
</symbol>
|
|
80
|
-
<symbol viewBox="0 0 40 40" id="vjs-icon-downloading">
|
|
81
|
-
<path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>
|
|
82
|
-
</symbol>
|
|
83
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download">
|
|
84
|
-
<path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>
|
|
85
|
-
</symbol>
|
|
86
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">
|
|
87
|
-
<path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>
|
|
88
|
-
</symbol>
|
|
89
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">
|
|
90
|
-
<path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>
|
|
91
|
-
</symbol>
|
|
92
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-share">
|
|
93
|
-
<path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>
|
|
94
|
-
</symbol>
|
|
95
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-cog">
|
|
96
|
-
<path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>
|
|
97
|
-
</symbol>
|
|
98
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-square">
|
|
99
|
-
<path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>
|
|
100
|
-
</symbol>
|
|
101
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-circle">
|
|
102
|
-
<circle cx="24" cy="24" r="20"></circle>
|
|
103
|
-
</symbol>
|
|
104
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">
|
|
105
|
-
<path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
|
|
106
|
-
</symbol>
|
|
107
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">
|
|
108
|
-
<path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>
|
|
109
|
-
</symbol>
|
|
110
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-cancel">
|
|
111
|
-
<path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>
|
|
112
|
-
</symbol>
|
|
113
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-replay">
|
|
114
|
-
<path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>
|
|
115
|
-
</symbol>
|
|
116
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-repeat">
|
|
117
|
-
<path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>
|
|
118
|
-
</symbol>
|
|
119
|
-
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">
|
|
120
|
-
<path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>
|
|
121
|
-
</symbol>
|
|
122
|
-
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">
|
|
123
|
-
<path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>
|
|
124
|
-
</symbol>
|
|
125
|
-
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">
|
|
126
|
-
<path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>
|
|
127
|
-
</symbol>
|
|
128
|
-
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">
|
|
129
|
-
<path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>
|
|
130
|
-
</symbol>
|
|
131
|
-
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">
|
|
132
|
-
<path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>
|
|
133
|
-
</symbol>
|
|
134
|
-
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">
|
|
135
|
-
<path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>
|
|
136
|
-
</symbol>
|
|
137
|
-
<symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">
|
|
138
|
-
<g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>
|
|
139
|
-
</symbol>
|
|
140
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-next-item">
|
|
141
|
-
<path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>
|
|
142
|
-
</symbol>
|
|
143
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">
|
|
144
|
-
<path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>
|
|
145
|
-
</symbol>
|
|
146
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">
|
|
147
|
-
<path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>
|
|
148
|
-
</symbol>
|
|
149
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-cast">
|
|
150
|
-
<path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>
|
|
151
|
-
</symbol>
|
|
152
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">
|
|
153
|
-
<path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>
|
|
154
|
-
</symbol>
|
|
155
|
-
<symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">
|
|
156
|
-
<path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>
|
|
157
|
-
<path fill="none" d="M-1-3h24v24H-1z"></path>
|
|
158
|
-
</symbol>
|
|
159
|
-
<symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">
|
|
160
|
-
<path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>
|
|
161
|
-
</symbol>
|
|
162
|
-
<symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">
|
|
163
|
-
<path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>
|
|
164
|
-
</symbol>
|
|
165
|
-
<symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">
|
|
166
|
-
<path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>
|
|
167
|
-
</symbol>
|
|
168
|
-
<symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">
|
|
169
|
-
<path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>
|
|
170
|
-
</symbol>
|
|
171
|
-
<symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">
|
|
172
|
-
<path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>
|
|
173
|
-
</symbol>
|
|
174
|
-
</defs>
|
|
175
|
-
</svg>`;const Ry=Mc?10009:Rc?461:8,Na={codes:{play:415,pause:19,ff:417,rw:412,back:Ry},names:{415:"play",19:"pause",417:"ff",412:"rw",[Ry]:"back"},isEventKey(s,e){return e=e.toLowerCase(),!!(this.names[s.keyCode]&&this.names[s.keyCode]===e)},getEventName(s){if(this.names[s.keyCode])return this.names[s.keyCode];if(this.codes[s.code]){const e=this.codes[s.code];return this.names[e]}return null}},By=5;class hD extends ir{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const r=t.key.substring(5).toLowerCase();this.move(r)}else if(Na.isEventKey(t,"play")||Na.isEventKey(t,"pause")||Na.isEventKey(t,"ff")||Na.isEventKey(t,"rw")){t.preventDefault();const r=Na.getEventName(t);this.performMediaAction_(r)}else Na.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+By);break;case"rw":this.userSeek_(this.player_.currentTime()-By);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let r=null;const i=this.getCurrentComponent(e.target);t&&(r=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!r||!t)&&(i&&i.name()==="CloseButton"?this.refocusComponent():(this.pause(),i&&i.el()&&(this.lastFocusedComponent_=i)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function r(i){for(const n of i)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&r(n.children_)}return e.children_.forEach(i=>{if(i.hasOwnProperty("el_"))if(i.getIsFocusable&&i.getIsAvailableToBeFocused&&i.getIsFocusable()&&i.getIsAvailableToBeFocused(i.el())){t.push(i);return}else i.hasOwnProperty("children_")&&i.children_.length>0?r(i.children_):i.hasOwnProperty("items")&&i.items.length>0?r(i.items):this.findSuitableDOMChild(i)&&t.push(i);if(i.name_==="ErrorDisplay"&&i.opened_){const n=i.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((o,l)=>{t.push({name:()=>"ModalButton"+(l+1),el:()=>o,getPositions:()=>{const u=o.getBoundingClientRect(),c={x:u.x,y:u.y,width:u.width,height:u.height,top:u.top,right:u.right,bottom:u.bottom,left:u.left},h={x:u.left+u.width/2,y:u.top+u.height/2,width:0,height:0,top:u.top+u.height/2,right:u.left+u.width/2,bottom:u.top+u.height/2,left:u.left+u.width/2};return{boundingClientRect:c,center:h}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:u=>!0,focus:()=>o.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(r){if(e.getIsFocusable(r)&&e.getIsAvailableToBeFocused(r))return r;for(let i=0;i<r.children.length;i++){const n=r.children[i],a=t(n);if(a)return a}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length){for(const r of this.focusableComponents)if(r.el()===t)return r}}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const r=t.getPositions(),i=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(r.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(r.center,i,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,r){let i=1/0,n=null;for(const a of t){const o=a.getPositions().center,l=this.calculateDistance_(e,o,r);l<i&&(i=l,n=a)}return n}isInDirection_(e,t,r){switch(r){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(e){typeof e=="object"&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,r){const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);let a;switch(r){case"right":case"left":a=i+n*100;break;case"up":a=n*2+i*.5;break;case"down":a=n*5+i;break;default:a=i+n}return a}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}}let dD=class extends _e{constructor(e,t,r){const i=St({createEl:!1},t);if(super(e,i,r),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;n<a.length;n++){const o=qt(a[n]);let l=Ct.getTech(o);if(o||(l=_e.getComponent(o)),l&&l.isSupported()){e.loadTech_(o);break}}else e.src(t.playerOptions.sources)}};_e.registerComponent("MediaLoader",dD);let qh=class extends _e{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=r=>this.handleMouseOver(r),this.handleMouseOut_=r=>this.handleMouseOut(r),this.handleClick_=r=>this.handleClick(r),this.handleKeyDown_=r=>this.handleKeyDown(r),this.emitTapEvents(),this.enable()}createEl(e="div",t={},r={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&et.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),r=Object.assign({role:"button"},r),this.tabIndex_=t.tabIndex;const i=qe(e,t,r);return this.player_.options_.experimentalSvgIcons||i.appendChild(qe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(i),i}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=qe("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const r=this.localize(e);this.controlText_=e,us(this.controlTextEl_,r),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",r)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}};_e.registerComponent("ClickableComponent",qh);let $p=class extends qh{constructor(e,t){super(e,t),this.update(),this.update_=r=>this.update(r),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return qe("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(qe("picture",{className:"vjs-poster",tabIndex:-1},{},qe("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Gr(this.player_.play()):this.player_.pause())}};$p.prototype.crossorigin=$p.prototype.crossOrigin;_e.registerComponent("PosterImage",$p);const cr="#222",Fy="#ccc",fD={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Sf(s,e){let t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else if(s.length===7)t=s.slice(1);else throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function jr(s,e,t){try{s.style[e]=t}catch{return}}function Uy(s){return s?`${s}px`:""}let pD=class extends _e{constructor(e,t,r){super(e,t,r);const i=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",i),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(kt(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=D.screen.orientation||D,o=D.screen.orientation?"change":"orientationchange";a.addEventListener(o,n),e.on("dispose",()=>a.removeEventListener(o,n));const l=this.options_.playerOptions.tracks||[];for(let u=0;u<l.length;u++)this.player_.addRemoteTextTrack(l[u],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),r=this.player_.cache_.selectedLanguage;let i,n,a;for(let o=0;o<t.length;o++){const l=t[o];r&&r.enabled&&r.language&&r.language===l.language&&l.kind in e?l.kind===r.kind?a=l:a||(a=l):r&&!r.enabled?(a=null,i=null,n=null):l.default&&(l.kind==="descriptions"&&!i?i=l:l.kind in e&&!n&&(n=l))}a?a.mode="showing":n?n.mode="showing":i&&(i.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){typeof D.WebVTT=="function"&&D.WebVTT.processCues(D,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const a=[];for(let o=0;o<e.length;++o){const l=e[o];l.mode==="showing"&&a.push(l)}this.updateForTrack(a);return}let r=null,i=null,n=e.length;for(;n--;){const a=e[n];a.mode==="showing"&&(a.kind==="descriptions"?r=a:i=a)}if(i?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(i)):r&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(r)),!D.CSS.supports("inset","10px")){const a=this.el_,o=a.querySelectorAll(".vjs-text-track-cue"),l=this.player_.controlBar.el_.getBoundingClientRect().height,u=this.player_.el_.getBoundingClientRect().height;a.style="",jr(a,"position","relative"),jr(a,"height",u-l+"px"),jr(a,"top","unset"),Bc?jr(a,"bottom",u+"px"):jr(a,"bottom","0px"),o.length>0&&o.forEach(c=>{if(c.style.inset){const h=c.style.inset.split(" ");h.length===3&&Object.assign(c.style,{top:h[0],right:h[1],bottom:h[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!D.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),r=e/t,i=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(r-i)>.1&&(r>i?n=Math.round((e-t*i)/2):a=Math.round((t-e/i)/2)),jr(this.el_,"insetInline",Uy(n)),jr(this.el_,"insetBlock",Uy(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),r=e.activeCues;let i=r.length;for(;i--;){const n=r[i];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&jr(a.firstChild,"color",Sf(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&jr(a.firstChild,"backgroundColor",Sf(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?jr(a,"backgroundColor",Sf(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${cr}, 2px 2px 4px ${cr}, 2px 2px 5px ${cr}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${cr}, 2px 2px ${cr}, 3px 3px ${cr}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Fy}, 0 1px ${Fy}, -1px -1px ${cr}, 0 -1px ${cr}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${cr}, 0 0 4px ${cr}, 0 0 4px ${cr}, 0 0 4px ${cr}`)),t.fontPercent&&t.fontPercent!==1){const o=D.parseFloat(a.style.fontSize);a.style.fontSize=o*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=fD[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof D.WebVTT!="function"||e.every(r=>!r.activeCues))return;const t=[];for(let r=0;r<e.length;++r){const i=e[r];for(let n=0;n<i.activeCues.length;++n)t.push(i.activeCues[n])}D.WebVTT.processCues(D,t,this.el_);for(let r=0;r<e.length;++r){const i=e[r];for(let n=0;n<i.activeCues.length;++n){const a=i.activeCues[n].displayState;Ws(a,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:r)),i.language&&mo(a,"lang",i.language)}this.player_.textTrackSettings&&this.updateDisplayState(i)}}};_e.registerComponent("TextTrackDisplay",pD);let mD=class extends _e{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),r=qe("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),i=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return i.appendChild(r),i}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}};_e.registerComponent("LoadingSpinner",mD);let yi=class extends qh{createEl(e,t={},r={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),r=Object.assign({type:"button"},r);const i=qe(e,t,r);return this.player_.options_.experimentalSvgIcons||i.appendChild(qe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(i),i}addChild(e,t={}){const r=this.constructor.name;return et.warn(`Adding an actionable (user controllable) child to a Button (${r}) is not supported; use a ClickableComponent instead.`),_e.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.stopPropagation();return}super.handleKeyDown(e)}};_e.registerComponent("Button",yi);let IS=class extends yi{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",r=>this.handleMouseDown(r))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){Gr(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const r=this.player_.getChild("controlBar"),i=r&&r.getChild("playToggle");if(!i){this.player_.tech(!0).focus();return}const n=()=>i.focus();Ll(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}};IS.prototype.controlText_="Play Video";_e.registerComponent("BigPlayButton",IS);let gD=class extends yi{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}};_e.registerComponent("CloseButton",gD);let PS=class extends yi{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",r=>this.handlePlay(r)),this.on(e,"pause",r=>this.handlePause(r)),t.replay&&this.on(e,"ended",r=>this.handleEnded(r))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Gr(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}};PS.prototype.controlText_="Play";_e.registerComponent("PlayToggle",PS);let Mo=class extends _e{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],r=>this.update(r)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),r=qe("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(r),this.contentEl_=qe("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=na(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,et.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=ue.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}};Mo.prototype.labelText_="Time";Mo.prototype.controlText_="Time";_e.registerComponent("TimeDisplay",Mo);let rg=class extends Mo{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}};rg.prototype.labelText_="Current Time";rg.prototype.controlText_="Current Time";_e.registerComponent("CurrentTimeDisplay",rg);let ng=class extends Mo{constructor(e,t){super(e,t);const r=i=>this.updateContent(i);this.on(e,"durationchange",r),this.on(e,"loadstart",r),this.on(e,"loadedmetadata",r)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}};ng.prototype.labelText_="Duration";ng.prototype.controlText_="Duration";_e.registerComponent("DurationDisplay",ng);let vD=class extends _e{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),r=super.createEl("span",{textContent:"/"});return t.appendChild(r),e.appendChild(t),e}};_e.registerComponent("TimeDivider",vD);let sg=class extends Mo{constructor(e,t){super(e,t),this.on(e,"durationchange",r=>this.updateContent(r))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(qe("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}};sg.prototype.labelText_="Remaining Time";sg.prototype.controlText_="Remaining Time";_e.registerComponent("RemainingTimeDisplay",sg);let yD=class extends _e{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",r=>this.updateShowing(r))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=qe("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(qe("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(ue.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}};_e.registerComponent("LiveDisplay",yD);let DS=class extends yi{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=r=>this.updateLiveEdgeStatus(r),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=qe("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}};DS.prototype.controlText_="Seek to live, currently playing live";_e.registerComponent("SeekToLive",DS);function iu(s,e,t){return s=Number(s),Math.min(t,Math.max(e,isNaN(s)?e:s))}var _D=Object.freeze({__proto__:null,clamp:iu});let ag=class extends _e{constructor(e,t){super(e,t),this.handleMouseDown_=r=>this.handleMouseDown(r),this.handleMouseUp_=r=>this.handleMouseUp(r),this.handleKeyDown_=r=>this.handleKeyDown(r),this.handleClick_=r=>this.handleClick(r),this.handleMouseMove_=r=>this.handleMouseMove(r),this.update_=r=>this.update(r),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},r={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),r=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},r),super.createEl(e,t,r)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!rn&&e.preventDefault(),rS(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;nS(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(iu(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Fh(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,r=t&&t.enabled,i=t&&t.horizontalSeek;r?i&&e.key==="ArrowLeft"||!i&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):i&&e.key==="ArrowRight"||!i&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}};_e.registerComponent("Slider",ag);const Cf=(s,e)=>iu(s/e*100,0,100).toFixed(2)+"%";let TD=class extends _e{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",r=>this.update(r))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=qe("span",{className:"vjs-control-text"}),r=qe("span",{textContent:this.localize("Loaded")}),i=ue.createTextNode(": ");return this.percentageEl_=qe("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(r),t.appendChild(i),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,r=this.player_.buffered(),i=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,o=Cf(n,i);this.percent_!==o&&(this.el_.style.width=o,us(this.percentageEl_,o),this.percent_=o);for(let l=0;l<r.length;l++){const u=r.start(l),c=r.end(l);let h=a[l];h||(h=this.el_.appendChild(qe()),a[l]=h),!(h.dataset.start===u&&h.dataset.end===c)&&(h.dataset.start=u,h.dataset.end=c,h.style.left=Cf(u,n),h.style.width=Cf(c-u,n))}for(let l=a.length;l>r.length;l--)this.el_.removeChild(a[l-1]);a.length=r.length})}};_e.registerComponent("LoadProgressBar",TD);let bD=class extends _e{constructor(e,t){super(e,t),this.update=nn(kt(this,this.update),gr)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,r){const i=Hl(this.el_),n=go(this.player_.el()),a=e.width*t;if(!n||!i)return;let o=e.left-n.left+a,l=e.width-a+(n.right-e.right);l||(l=e.width-a,o=a);let u=i.width/2;o<u?u+=u-o:l<u&&(u=l),u<0?u=0:u>i.width&&(u=i.width),u=Math.round(u),this.el_.style.right=`-${u}px`,this.write(r)}write(e){us(this.el_,e)}updateTime(e,t,r,i){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const o=this.player_.liveTracker.liveWindow(),l=o-t*o;n=(l<1?"":"-")+na(l,o)}else n=na(r,a);this.update(e,t,n),i&&i()})}};_e.registerComponent("TimeTooltip",bD);let og=class extends _e{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=nn(kt(this,this.update),gr)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const r=this.getChild("timeTooltip");if(!r)return;const i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,i)}};og.prototype.options_={children:[]};!Ni&&!tn&&og.prototype.options_.children.push("timeTooltip");_e.registerComponent("PlayProgressBar",og);let NS=class extends _e{constructor(e,t){super(e,t),this.update=nn(kt(this,this.update),gr)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const r=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,r,()=>{this.el_.style.left=`${e.width*t}px`})}};NS.prototype.options_={children:["timeTooltip"]};_e.registerComponent("MouseTimeDisplay",NS);const Zu=5,$y=12;let lg=class extends ag{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=kt(this,this.update),this.update=nn(this.update_,gr),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in ue&&"visibilityState"in ue&&this.on(ue,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){ue.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,gr))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(ue.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const r=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),i=this.player_.liveTracker;let n=this.player_.duration();i&&i.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==r||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[na(r,n),na(n,n)],"{1} of {2}")),this.currentTime_=r,this.duration_=n),this.bar&&this.bar.update(go(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const r=this.player_.liveTracker;return r&&r.isLive()?(t=(e-r.seekableStart())/r.liveWindow(),r.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){ql(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!ql(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let r;const i=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())r=i*this.player_.duration(),r===this.player_.duration()&&(r=r-.1);else{if(i>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),o=n.liveCurrentTime();if(r=a+i*n.liveWindow(),r>=o&&(r=o),r<=a&&(r=a+.1),r===1/0)return}this.userSeek_(r),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Gr(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+Zu)}stepBack(){this.userSeek_(this.player_.currentTime()-Zu)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const r=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*r):this.userSeek_(this.player_.duration()*r)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Zu*$y)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Zu*$y)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in ue&&"visibilityState"in ue&&this.off(ue,"visibilitychange",this.toggleVisibility_),super.dispose()}};lg.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!Ni&&!tn&&lg.prototype.options_.children.splice(1,0,"mouseTimeDisplay");_e.registerComponent("SeekBar",lg);let LS=class extends _e{constructor(e,t){super(e,t),this.handleMouseMove=nn(kt(this,this.handleMouseMove),gr),this.throttledHandleMouseSeek=nn(kt(this,this.handleMouseSeek),gr),this.handleMouseUpHandler_=r=>this.handleMouseUp(r),this.handleMouseDownHandler_=r=>this.handleMouseDown(r),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const r=t.getChild("playProgressBar"),i=t.getChild("mouseTimeDisplay");if(!r&&!i)return;const n=t.el(),a=Hl(n);let o=Fh(n,e).x;o=iu(o,0,1),i&&i.update(a,o),r&&r.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Gr(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,r=this.getChild("seekBar");r&&r.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}};LS.prototype.options_={children:["seekBar"]};_e.registerComponent("ProgressControl",LS);let OS=class extends yi{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],r=>this.handlePictureInPictureChange(r)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],r=>this.handlePictureInPictureEnabledChange(r)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){ue.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in D?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof ue.exitPictureInPicture=="function"&&super.show()}};OS.prototype.controlText_="Picture-in-Picture";_e.registerComponent("PictureInPictureToggle",OS);let MS=class extends yi{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",r=>this.handleFullscreenChange(r)),ue[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}};MS.prototype.controlText_="Fullscreen";_e.registerComponent("FullscreenToggle",MS);const SD=function(s,e){e.tech_&&!e.tech_.featuresVolumeControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};let CD=class extends _e{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}};_e.registerComponent("VolumeLevel",CD);let ED=class extends _e{constructor(e,t){super(e,t),this.update=nn(kt(this,this.update),gr)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,r,i){if(!r){const n=go(this.el_),a=go(this.player_.el()),o=e.width*t;if(!a||!n)return;const l=e.left-a.left+o,u=e.width-o+(a.right-e.right);let c=n.width/2;l<c?c+=c-l:u<c&&(c=u),c<0?c=0:c>n.width&&(c=n.width),this.el_.style.right=`-${c}px`}this.write(`${i}%`)}write(e){us(this.el_,e)}updateVolume(e,t,r,i,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,r,i.toFixed(0)),n&&n()})}};_e.registerComponent("VolumeLevelTooltip",ED);let RS=class extends _e{constructor(e,t){super(e,t),this.update=nn(kt(this,this.update),gr)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,r){const i=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,r,i,()=>{r?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}};RS.prototype.options_={children:["volumeLevelTooltip"]};_e.registerComponent("MouseVolumeLevelDisplay",RS);let zh=class extends ag{constructor(e,t){super(e,t),this.on("slideractive",r=>this.updateLastVolume_(r)),this.on(e,"volumechange",r=>this.updateARIAAttributes(r)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){ql(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const r=this.el(),i=go(r),n=this.vertical();let a=Fh(r,e);a=n?a.y:a.x,a=iu(a,0,1),t.update(i,a,n)}ql(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}};zh.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Ni&&!tn&&zh.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");zh.prototype.playerEvent="volumechange";_e.registerComponent("VolumeBar",zh);let BS=class extends _e{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||po(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),SD(this,e),this.throttledHandleMouseMove=nn(kt(this,this.handleMouseMove),gr),this.handleMouseUpHandler_=r=>this.handleMouseUp(r),this.on("mousedown",r=>this.handleMouseDown(r)),this.on("touchstart",r=>this.handleMouseDown(r)),this.on("mousemove",r=>this.handleMouseMove(r)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}};BS.prototype.options_={children:["volumeBar"]};_e.registerComponent("VolumeControl",BS);const wD=function(s,e){e.tech_&&!e.tech_.featuresMuteControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresMuteControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};let FS=class extends yi{constructor(e,t){super(e,t),wD(this,e),this.on(e,["loadstart","volumechange"],r=>this.update(r))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),r=this.player_.lastVolume_();if(t===0){const i=r<.1?.1:r;this.player_.volume(i),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),Ni&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Rh(this.el_,[0,1,2,3].reduce((r,i)=>r+`${i?" ":""}vjs-vol-${i}`,"")),Ws(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}};FS.prototype.controlText_="Mute";_e.registerComponent("MuteToggle",FS);let US=class extends _e{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||po(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=r=>this.handleKeyPress(r),this.on(e,["loadstart"],r=>this.volumePanelState_(r)),this.on(this.muteToggle,"keyup",r=>this.handleKeyPress(r)),this.on(this.volumeControl,"keyup",r=>this.handleVolumeControlKeyUp(r)),this.on("keydown",r=>this.handleKeyPress(r)),this.on("mouseover",r=>this.handleMouseOver(r)),this.on("mouseout",r=>this.handleMouseOut(r)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),tr(ue,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),vi(ue,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}};US.prototype.options_={children:["muteToggle","volumeControl"]};_e.registerComponent("VolumePanel",US);class $S extends yi{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),r=this.player_.liveTracker,i=r&&r.isLive()?r.seekableEnd():this.player_.duration();let n;t+this.skipTime<=i?n=t+this.skipTime:n=i,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}$S.prototype.controlText_="Skip Forward";_e.registerComponent("SkipForward",$S);class jS extends yi{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),r=this.player_.liveTracker,i=r&&r.isLive()&&r.seekableStart();let n;i&&t-this.skipTime<=i?n=i:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}jS.prototype.controlText_="Skip Backward";_e.registerComponent("SkipBackward",jS);let VS=class extends _e{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",r=>this.handleKeyDown(r)),this.boundHandleBlur_=r=>this.handleBlur(r),this.boundHandleTapClick_=r=>this.handleTapClick(r)}addEventListenerForItem(e){e instanceof _e&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof _e&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=qe(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),tr(t,"click",function(r){r.preventDefault(),r.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||ue.activeElement;if(!this.children().some(r=>r.el()===t)){const r=this.menuButton_;r&&r.buttonPressed_&&t!==r.el().firstChild&&r.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const r=t.filter(i=>i.el()===e.target)[0];if(!r)return;r.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}};_e.registerComponent("Menu",VS);let ug=class extends _e{constructor(e,t={}){super(e,t),this.menuButton_=new yi(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const r=yi.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+r,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const i=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",i),this.on(this.menuButton_,"click",i),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),tr(ue,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new VS(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=qe("li",{className:"vjs-menu-title",textContent:qt(this.options_.title),tabIndex:-1}),r=new _e(this.player_,{el:t});e.addItem(r)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=yi.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),vi(ue,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){e.key==="Escape"||e.key==="Tab"?(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus())):(e.key==="Up"||e.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(e.key==="Escape"||e.key==="Tab")&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(e.key==="Escape"||e.key==="Tab")&&(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Ni&&J0())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}};_e.registerComponent("MenuButton",ug);let cg=class extends ug{constructor(e,t){const r=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!r)return;const i=kt(this,this.update);r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),r.addEventListener("labelchange",i),this.player_.on("ready",i),this.player_.on("dispose",function(){r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i),r.removeEventListener("labelchange",i)})}};_e.registerComponent("TrackButton",cg);let ru=class extends qh{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,r){this.nonIconControl=!0;const i=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),r),n=qe("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?i.appendChild(n):i.replaceChild(n,i.querySelector(".vjs-icon-placeholder")),i}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}};_e.registerComponent("MenuItem",ru);let nu=class extends ru{constructor(e,t){const r=t.track,i=e.textTracks();t.label=r.label||r.language||"Unknown",t.selected=r.mode==="showing",super(e,t),this.track=r,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...o)=>{this.handleTracksChange.apply(this,o)},a=(...o)=>{this.handleSelectedLanguageChange.apply(this,o)};if(e.on(["loadstart","texttrackchange"],n),i.addEventListener("change",n),i.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),i.removeEventListener("change",n),i.removeEventListener("selectedlanguagechange",a)}),i.onchange===void 0){let o;this.on(["tap","click"],function(){if(typeof D.Event!="object")try{o=new D.Event("change")}catch{}o||(o=ue.createEvent("Event"),o.initEvent("change",!0,!0)),i.dispatchEvent(o)})}this.handleTracksChange()}handleClick(e){const t=this.track,r=this.player_.textTracks();if(super.handleClick(e),!!r)for(let i=0;i<r.length;i++){const n=r[i];this.kinds.indexOf(n.kind)!==-1&&(n===t?n.mode!=="showing"&&(n.mode="showing"):n.mode!=="disabled"&&(n.mode="disabled"))}}handleTracksChange(e){const t=this.track.mode==="showing";t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){const t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}};_e.registerComponent("TextTrackMenuItem",nu);let HS=class extends nu{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let r=!0;for(let i=0,n=t.length;i<n;i++){const a=t[i];if(this.options_.kinds.indexOf(a.kind)>-1&&a.mode==="showing"){r=!1;break}}r!==this.isSelected_&&this.selected(r)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let r=!0;for(let i=0,n=t.length;i<n;i++){const a=t[i];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&a.mode==="showing"){r=!1;break}}r&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}};_e.registerComponent("OffTextTrackMenuItem",HS);let Ro=class extends cg{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=nu){let r;this.label_&&(r=`${this.label_} off`),e.push(new HS(this.player_,{kinds:this.kinds_,kind:this.kind_,label:r})),this.hideThreshold_+=1;const i=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<i.length;n++){const a=i[n];if(this.kinds_.indexOf(a.kind)>-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return e}};_e.registerComponent("TextTrackButton",Ro);let qS=class extends ru{constructor(e,t){const r=t.track,i=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=i.text,t.selected=i.startTime<=n&&n<i.endTime,super(e,t),this.track=r,this.cue=i}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}};_e.registerComponent("ChaptersTrackMenuItem",qS);let hg=class extends Ro{constructor(e,t,r){super(e,t,r),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(i=>{i.selected(this.track_.activeCues[0]===i.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const r=e[t];if(r.kind===this.kind_)return r}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(qt(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let r=0,i=t.length;r<i;r++){const n=t[r],a=new qS(this.player_,{track:this.track_,cue:n});e.push(a)}return e}};hg.prototype.kind_="chapters";hg.prototype.controlText_="Chapters";_e.registerComponent("ChaptersButton",hg);let dg=class extends Ro{constructor(e,t,r){super(e,t,r),this.setIcon("audio-description");const i=e.textTracks(),n=kt(this,this.handleTracksChange);i.addEventListener("change",n),this.on("dispose",function(){i.removeEventListener("change",n)})}handleTracksChange(e){const t=this.player().textTracks();let r=!1;for(let i=0,n=t.length;i<n;i++){const a=t[i];if(a.kind!==this.kind_&&a.mode==="showing"){r=!0;break}}r?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}};dg.prototype.kind_="descriptions";dg.prototype.controlText_="Descriptions";_e.registerComponent("DescriptionsButton",dg);let fg=class extends Ro{constructor(e,t,r){super(e,t,r),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}};fg.prototype.kind_="subtitles";fg.prototype.controlText_="Subtitles";_e.registerComponent("SubtitlesButton",fg);let pg=class extends nu{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}};_e.registerComponent("CaptionSettingsMenuItem",pg);let mg=class extends Ro{constructor(e,t,r){super(e,t,r),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new pg(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}};mg.prototype.kind_="captions";mg.prototype.controlText_="Captions";_e.registerComponent("CaptionsButton",mg);let zS=class extends nu{createEl(e,t,r){const i=super.createEl(e,t,r),n=i.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",i):n.appendChild(qe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(qe("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),i}};_e.registerComponent("SubsCapsMenuItem",zS);let gg=class extends Ro{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(qt(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new pg(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,zS),e}};gg.prototype.kinds_=["captions","subtitles"];gg.prototype.controlText_="Subtitles";_e.registerComponent("SubsCapsButton",gg);let WS=class extends ru{constructor(e,t){const r=t.track,i=e.audioTracks();t.label=r.label||r.language||"Unknown",t.selected=r.enabled,super(e,t),this.track=r,this.addClass(`vjs-${r.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};i.addEventListener("change",n),this.on("dispose",()=>{i.removeEventListener("change",n)})}createEl(e,t,r){const i=super.createEl(e,t,r),n=i.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(qe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(qe("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),i}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let r=0;r<t.length;r++){const i=t[r];i!==this.track&&(i.enabled=i===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}};_e.registerComponent("AudioTrackMenuItem",WS);let GS=class extends cg{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let r=0;r<t.length;r++){const i=t[r];e.push(new WS(this.player_,{track:i,selectable:!0,multiSelectable:!1}))}return e}};GS.prototype.controlText_="Audio Track";_e.registerComponent("AudioTrackButton",GS);let vg=class extends ru{constructor(e,t){const r=t.rate,i=parseFloat(r,10);t.label=r,t.selected=i===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=r,this.rate=i,this.on(e,"ratechange",n=>this.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}};vg.prototype.contentElType="button";_e.registerComponent("PlaybackRateMenuItem",vg);let KS=class extends ug{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",r=>this.updateVisibility(r)),this.on(e,"ratechange",r=>this.updateLabel(r)),this.on(e,"playbackrateschange",r=>this.handlePlaybackRateschange(r))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=qe("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let r=e.length-1;r>=0;r--)t.push(new vg(this.player(),{rate:e[r]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}};KS.prototype.controlText_="Playback Rate";_e.registerComponent("PlaybackRateMenuButton",KS);let XS=class extends _e{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},r={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,r)}};_e.registerComponent("Spacer",XS);let kD=class extends XS{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}};_e.registerComponent("CustomControlSpacer",kD);let YS=class extends _e{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}};YS.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};_e.registerComponent("ControlBar",YS);let QS=class extends Lo{constructor(e,t){super(e,t),this.on(e,"error",r=>{this.open(r)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}};QS.prototype.options_=Object.assign({},Lo.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});_e.registerComponent("ErrorDisplay",QS);class JS extends _e{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),qe("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const r=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${mr()}`)+"-"+t[1].replace(/\W+/g,""),i=qe("option",{id:r,value:this.localize(t[0]),textContent:this.localize(t[1])});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${r}`),i}))}}_e.registerComponent("TextTrackSelect",JS);class Ks extends _e{constructor(e,t={}){super(e,t);const r=qe("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(r);const i=this.options_.selects;for(const n of i){const a=this.options_.selectConfigs[n],o=a.className,l=a.id.replace("%s",this.options_.id_);let u=null;const c=`vjs_select_${mr()}`;if(this.options_.type==="colors"){u=qe("span",{className:o});const f=qe("label",{id:l,className:"vjs-label",textContent:this.localize(a.label)});f.setAttribute("for",c),u.appendChild(f)}const h=new JS(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:c,labelId:l});this.addChild(h),this.options_.type==="colors"&&(u.appendChild(h.el()),this.el().appendChild(u))}}createEl(){return qe("fieldset",{className:this.options_.className})}}_e.registerComponent("TextTrackFieldset",Ks);class ZS extends _e{constructor(e,t={}){super(e,t);const r=this.options_.textTrackComponentid,i=new Ks(e,{id_:r,legendId:`captions-text-legend-${r}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(i);const n=new Ks(e,{id_:r,legendId:`captions-background-${r}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new Ks(e,{id_:r,legendId:`captions-window-${r}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return qe("div",{className:"vjs-track-settings-colors"})}}_e.registerComponent("TextTrackSettingsColors",ZS);class eC extends _e{constructor(e,t={}){super(e,t);const r=this.options_.textTrackComponentid,i=new Ks(e,{id_:r,legendId:`captions-font-size-${r}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(i);const n=new Ks(e,{id_:r,legendId:`captions-edge-style-${r}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new Ks(e,{id_:r,legendId:`captions-font-family-${r}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return qe("div",{className:"vjs-track-settings-font"})}}_e.registerComponent("TextTrackSettingsFont",eC);class tC extends _e{constructor(e,t={}){super(e,t);const r=this.localize("restore all settings to the default values"),i=new yi(e,{controlText:r,className:"vjs-default-button"});i.el().classList.remove("vjs-control","vjs-button"),i.el().textContent=this.localize("Reset"),this.addChild(i);const n=new yi(e,{controlText:r,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Done"),this.addChild(n)}createEl(){return qe("div",{className:"vjs-track-settings-controls"})}}_e.registerComponent("TrackSettingsControls",tC);const Ef="vjs-text-track-settings",jy=["#000","Black"],Vy=["#00F","Blue"],Hy=["#0FF","Cyan"],qy=["#0F0","Green"],zy=["#F0F","Magenta"],Wy=["#F00","Red"],Gy=["#FFF","White"],Ky=["#FF0","Yellow"],wf=["1","Opaque"],kf=["0.5","Semi-Transparent"],Xy=["0","Transparent"],is={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[jy,Gy,Wy,qy,Vy,Ky,zy,Hy],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[wf,kf,Xy],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Gy,jy,Wy,qy,Vy,Ky,zy,Hy],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:s=>s==="1.00"?null:Number(s)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[wf,kf],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Xy,kf,wf],className:"vjs-window-opacity vjs-opacity"}};is.windowColor.options=is.backgroundColor.options;function iC(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function xD(s,e){const t=s.options[s.options.selectedIndex].value;return iC(t,e)}function AD(s,e,t){if(e){for(let r=0;r<s.options.length;r++)if(iC(s.options[r].value,t)===e){s.selectedIndex=r;break}}}let ID=class extends Lo{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=qe("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),t.persistTextTrackSettings===void 0&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new ZS(e,{textTrackComponentid:this.id_,selectConfigs:is,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const r=new eC(e,{textTrackComponentid:this.id_,selectConfigs:is,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(r);const i=new tC(e);this.addChild(i)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),Qa(is,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return z0(is,(e,t,r)=>{const i=xD(this.$(t.selector),t.parser);return i!==void 0&&(e[r]=i),e},{})}setValues(e){Qa(is,(t,r)=>{AD(this.$(t.selector),e[r],t.parser)})}setDefaults(){Qa(is,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(D.localStorage.getItem(Ef))}catch(t){et.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?D.localStorage.setItem(Ef,JSON.stringify(e)):D.localStorage.removeItem(Ef)}catch(t){et.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}};_e.registerComponent("TextTrackSettings",ID);let PD=class extends _e{constructor(e,t){let r=t.ResizeObserver||D.ResizeObserver;t.ResizeObserver===null&&(r=!1);const i=St({createEl:!r,reportTouchActivity:!1},t);super(e,i),this.ResizeObserver=t.ResizeObserver||D.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=pS(()=>{this.resizeHandler()},100,!1,this),r?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){vi(this,"resize",n),vi(this,"unload",a),a=null};tr(this.el_.contentWindow,"unload",a),tr(this.el_.contentWindow,"resize",n)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}};_e.registerComponent("ResizeManager",PD);const DD={trackingThreshold:20,liveTolerance:15};let ND=class extends _e{constructor(e,t){const r=St(DD,t,{createEl:!1});super(e,r),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=i=>this.handlePlay(i),this.handleFirstTimeupdate_=i=>this.handleFirstTimeupdate(i),this.handleSeeked_=i=>this.handleSeeked(i),this.seekToLiveEdge_=i=>this.seekToLiveEdge(i),this.reset_(),this.on(this.player_,"durationchange",i=>this.handleDurationchange(i)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(D.performance.now().toFixed(4)),r=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+r;const i=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(i-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||i===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,gr),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let r=e?e.length:0;for(;r--;)t.push(e.end(r));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let r=e?e.length:0;for(;r--;)t.push(e.start(r));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}};_e.registerComponent("LiveTracker",ND);class LD extends _e{constructor(e,t){super(e,t),this.on("statechanged",r=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:qe("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${mr()}`}),description:qe("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${mr()}`})},qe("div",{className:"vjs-title-bar"},{},W0(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,r={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(i=>{const n=this.state[i],a=this.els[i],o=r[i];Uh(a),n&&us(a,n),t&&(t.removeAttribute(o),n&&t.setAttribute(o,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}_e.registerComponent("TitleBar",LD);const OD={initialDisplay:4e3,position:[],takeFocus:!1};class MD extends yi{constructor(e,t){t=St(OD,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],r=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=qe("button",{},{type:"button",class:this.buildCSSClass()},qe("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}_e.registerComponent("TransientButton",MD);const jp=s=>{const e=s.el();if(e.hasAttribute("src"))return s.triggerSourceset(e.src),!0;const t=s.$$("source"),r=[];let i="";if(!t.length)return!1;for(let n=0;n<t.length;n++){const a=t[n].src;a&&r.indexOf(a)===-1&&r.push(a)}return r.length?(r.length===1&&(i=r[0]),s.triggerSourceset(i),!0):!1},RD=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(s){const e=ue.createElement(this.nodeName.toLowerCase());e.innerHTML=s;const t=ue.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",D.Element.prototype.appendChild.call(this,t),this.innerHTML}}),rC=(s,e)=>{let t={};for(let r=0;r<s.length&&(t=Object.getOwnPropertyDescriptor(s[r],e),!(t&&t.set&&t.get));r++);return t.enumerable=!0,t.configurable=!0,t},BD=s=>rC([s.el(),D.HTMLMediaElement.prototype,D.Element.prototype,RD],"innerHTML"),Yy=function(s){const e=s.el();if(e.resetSourceWatch_)return;const t={},r=BD(s),i=n=>(...a)=>{const o=n.apply(e,a);return jp(s),o};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=i(t[n]))}),Object.defineProperty(e,"innerHTML",St(r,{set:i(r.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",r)},s.one("sourceset",e.resetSourceWatch_)},FD=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?wS(D.Element.prototype.getAttribute.call(this,"src")):""},set(s){return D.Element.prototype.setAttribute.call(this,"src",s),s}}),UD=s=>rC([s.el(),D.HTMLMediaElement.prototype,FD],"src"),$D=function(s){if(!s.featuresSourceset)return;const e=s.el();if(e.resetSourceset_)return;const t=UD(s),r=e.setAttribute,i=e.load;Object.defineProperty(e,"src",St(t,{set:n=>{const a=t.set.call(e,n);return s.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const o=r.call(e,n,a);return/src/i.test(n)&&s.triggerSourceset(e.src),o},e.load=()=>{const n=i.call(e);return jp(s)||(s.triggerSourceset(""),Yy(s)),n},e.currentSrc?s.triggerSourceset(e.currentSrc):jp(s)||Yy(s),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=i,e.setAttribute=r,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};let Le=class _c extends Ct{constructor(e,t){super(e,t);const r=e.source;let i=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",r&&(this.el_.currentSrc!==r.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(r):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const o=[];for(;a--;){const l=n[a];l.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(l),this.remoteTextTracks().addTrack(l.track),this.textTracks().addTrack(l.track),!i&&!this.el_.hasAttribute("crossorigin")&&Hh(l.src)&&(i=!0)):o.push(l))}for(let l=0;l<o.length;l++)this.el_.removeChild(o[l])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&i&&et.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
|
|
176
|
-
This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(Vl||Oh)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),_c.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){$D(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const r=()=>{t=[];for(let n=0;n<e.length;n++){const a=e[n];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};r(),e.addEventListener("change",r),this.on("dispose",()=>e.removeEventListener("change",r));const i=()=>{for(let n=0;n<t.length;n++){const a=t[n];a.track.mode==="disabled"&&a.track.mode!==a.storedMode&&(a.track.mode=a.storedMode)}e.removeEventListener("change",i)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",r),e.removeEventListener("change",i),e.addEventListener("change",i)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",r),e.addEventListener("change",r),e.removeEventListener("change",i)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const r=e.toLowerCase();this[`${r}TracksListeners_`]&&Object.keys(this[`${r}TracksListeners_`]).forEach(i=>{this.el()[`${r}Tracks`].removeEventListener(i,this[`${r}TracksListeners_`][i])}),this[`featuresNative${e}Tracks`]=!t,this[`${r}TracksListeners_`]=null,this.proxyNativeTracksForType_(r)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=fr[e],r=this.el()[t.getterName],i=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!r||!r.addEventListener)return;const n={change:o=>{const l={type:"change",target:i,currentTarget:i,srcElement:i};i.trigger(l),e==="text"&&this[_o.remoteText.getterName]().trigger(l)},addtrack(o){i.addTrack(o.track)},removetrack(o){i.removeTrack(o.track)}},a=function(){const o=[];for(let l=0;l<i.length;l++){let u=!1;for(let c=0;c<r.length;c++)if(r[c]===i[l]){u=!0;break}u||o.push(i[l])}for(;o.length;)i.removeTrack(o.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(o=>{const l=n[o];r.addEventListener(o,l),this.on("dispose",u=>r.removeEventListener(o,l))}),this.on("loadstart",a),this.on("dispose",o=>this.off("loadstart",a))}proxyNativeTracks_(){fr.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const r=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(r,e),_c.disposeMediaElement(e),e=r}else{e=ue.createElement("video");const r=this.options_.tag&&ts(this.options_.tag),i=St({},r);(!Vl||this.options_.nativeControlsForTouch!==!0)&&delete i.controls,tS(e,Object.assign(i,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&mo(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let r=0;r<t.length;r++){const i=t[r],n=this.options_[i];typeof n<"u"&&(n?mo(e,i,i):Bh(e,i),e[i]=n)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let r=!1;const i=function(){r=!0};this.on("loadstart",i);const n=function(){r||this.trigger("loadstart")};this.on("loadedmetadata",n),this.ready(function(){this.off("loadstart",i),this.off("loadedmetadata",n),r||this.trigger("loadstart")});return}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(r){this.trigger(r)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Mh?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){et(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&tn&&rn&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Gr(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return et.error("Invalid source URL."),!1;const r={src:e};t&&(r.type=t);const i=qe("source",{},r);return this.el_.appendChild(i),!0}removeSourceElement(e){if(!e)return et.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const r of t)if(r.src===e)return this.el_.removeChild(r),!0;return et.warn(`No matching source element found with src: ${e}`),!1}reset(){_c.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,r){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,r):super.addTextTrack(e,t,r)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=ue.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const r=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(r),r}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let r=t.length;for(;r--;)(e===t[r]||e===t[r].track)&&this.el().removeChild(t[r])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),D.performance&&(e.creationTime=D.performance.now()),e}};Dh(Le,"TEST_VID",function(){if(!Po())return;const s=ue.createElement("video"),e=ue.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s});Le.isSupported=function(){try{Le.TEST_VID.volume=.5}catch{return!1}return!!(Le.TEST_VID&&Le.TEST_VID.canPlayType)};Le.canPlayType=function(s){return Le.TEST_VID.canPlayType(s)};Le.canPlaySource=function(s,e){return Le.canPlayType(s.type)};Le.canControlVolume=function(){try{const s=Le.TEST_VID.volume;Le.TEST_VID.volume=s/2+.1;const e=s!==Le.TEST_VID.volume;return e&&Ni?(D.setTimeout(()=>{Le&&Le.prototype&&(Le.prototype.featuresVolumeControl=s!==Le.TEST_VID.volume)}),!1):e}catch{return!1}};Le.canMuteVolume=function(){try{const s=Le.TEST_VID.muted;return Le.TEST_VID.muted=!s,Le.TEST_VID.muted?mo(Le.TEST_VID,"muted","muted"):Bh(Le.TEST_VID,"muted","muted"),s!==Le.TEST_VID.muted}catch{return!1}};Le.canControlPlaybackRate=function(){if(tn&&rn&&Nh<58)return!1;try{const s=Le.TEST_VID.playbackRate;return Le.TEST_VID.playbackRate=s/2+.1,s!==Le.TEST_VID.playbackRate}catch{return!1}};Le.canOverrideAttributes=function(){try{const s=()=>{};Object.defineProperty(ue.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(ue.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(ue.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(ue.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0};Le.supportsNativeTextTracks=function(){return Mh||Ni&&rn};Le.supportsNativeVideoTracks=function(){return!!(Le.TEST_VID&&Le.TEST_VID.videoTracks)};Le.supportsNativeAudioTracks=function(){return!!(Le.TEST_VID&&Le.TEST_VID.audioTracks)};Le.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([s,e]){Dh(Le.prototype,s,()=>Le[e](),!0)});Le.prototype.featuresVolumeControl=Le.canControlVolume();Le.prototype.movingMediaElementInDOM=!Ni;Le.prototype.featuresFullscreenResize=!0;Le.prototype.featuresProgressEvents=!0;Le.prototype.featuresTimeupdateEvents=!0;Le.prototype.featuresVideoFrameCallback=!!(Le.TEST_VID&&Le.TEST_VID.requestVideoFrameCallback);Le.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()}};Le.resetMediaElement=function(s){if(!s)return;const e=s.querySelectorAll("source");let t=e.length;for(;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){Le.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){Le.prototype["set"+qt(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){Le.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){Le.prototype["set"+qt(s)]=function(e){this.el_[s]=e}});["pause","load","play"].forEach(function(s){Le.prototype[s]=function(){return this.el_[s]()}});Ct.withSourceHandlers(Le);Le.nativeSourceHandler={};Le.nativeSourceHandler.canPlayType=function(s){try{return Le.TEST_VID.canPlayType(s)}catch{return""}};Le.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return Le.nativeSourceHandler.canPlayType(s.type);if(s.src){const t=tg(s.src);return Le.nativeSourceHandler.canPlayType(`video/${t}`)}return""};Le.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)};Le.nativeSourceHandler.dispose=function(){};Le.registerSourceHandler(Le.nativeSourceHandler);Ct.registerTech("Html5",Le);const nC=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],xf={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Vp=["tiny","xsmall","small","medium","large","xlarge","huge"],Tc={};Vp.forEach(s=>{const e=s.charAt(0)==="x"?`x-${s.substring(1)}`:s;Tc[s]=`vjs-layout-${e}`});const jD={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};let Qt=class Ua extends _e{constructor(e,t,r){if(e.id=e.id||t.id||`vjs_video_${mr()}`,t=Object.assign(Ua.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,r),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=H0(this.id_),this.fsApi_=Nc,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&ts(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(o){a[o.toLowerCase()]=t.languages[o]}),this.languages_=a}else this.languages_=Ua.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),Qm(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(tr(ue,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const i=St(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=i,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const o=new D.DOMParser().parseFromString(cD,"image/svg+xml");if(o.querySelector("parsererror"))et.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const u=o.documentElement;u.style.display="none",this.el_.appendChild(u),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new hD(this),this.addClass("vjs-spatial-navigation-enabled")),Vl&&this.addClass("vjs-touch-enabled"),Ni||this.addClass("vjs-workinghover"),Ua.players[this.id_]=this;const n=Dp.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),vi(ue,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),vi(ue,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Ua.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),aD(this),wi.names.forEach(e=>{const t=wi[e],r=this[t.getterName]();r&&r.off&&r.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,r=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const i=this.tag.tagName.toLowerCase()==="video-js";r?t=this.el_=e.parentNode:i||(t=this.el_=super.createEl("div"));const n=ts(e);if(i){for(t=this.el_=e,e=this.tag=ue.createElement("video");t.children.length;)e.appendChild(t.firstChild);Dl(t,"video-js")||Ws(t,"video-js"),t.appendChild(e),r=this.playerElIngest_=t,Object.keys(t).forEach(l=>{try{e[l]=t[l]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",rn&&Lh&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(l){i&&l==="class"||t.setAttribute(l,n[l]),i&&e.setAttribute(l,n[l])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(l=>Q0[l]).map(l=>"vjs-device-"+l.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),D.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=dS("vjs-styles-dimensions");const l=ss(".vjs-styles-defaults"),u=ss("head");u.insertBefore(this.styleEl_,l?l.nextSibling:u.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=e.getElementsByTagName("a");for(let l=0;l<o.length;l++){const u=o.item(l);Ws(u,"vjs-hidden"),u.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!r&&e.parentNode.insertBefore(t,e),Lp(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t}crossOrigin(e){if(typeof e>"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){et.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const r=e+"_";if(t===void 0)return this[r]||0;if(t===""||t==="auto"){this[r]=void 0,this.updateStyleEl_();return}const i=parseFloat(t);if(isNaN(i)){et.error(`Improper value "${t}" supplied for for ${e}`);return}this[r]=i,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,wn(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),RP(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(D.VIDEOJS_NO_DYNAMIC_STYLE===!0){const o=typeof this.width_=="number"?this.width_:this.options_.width,l=typeof this.height_=="number"?this.height_:this.options_.height,u=this.tech_&&this.tech_.el();u&&(o>=0&&(u.width=o),l>=0&&(u.height=l));return}let e,t,r,i;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?r=this.aspectRatio_:this.videoWidth()>0?r=this.videoWidth()+":"+this.videoHeight():r="16:9";const n=r.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?i="dimensions-"+this.id():i=this.id()+"-dimensions",this.addClass(i),fS(this.styleEl_,`
|
|
177
|
-
.${i} {
|
|
178
|
-
width: ${e}px;
|
|
179
|
-
height: ${t}px;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.${i}.vjs-fluid:not(.vjs-audio-only-mode) {
|
|
183
|
-
padding-top: ${a*100}%;
|
|
184
|
-
}
|
|
185
|
-
`)}loadTech_(e,t){this.tech_&&this.unloadTech_();const r=qt(e),i=e.charAt(0).toLowerCase()+e.slice(1);r!=="Html5"&&this.tag&&(Ct.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=r,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${i}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};wi.names.forEach(l=>{const u=wi[l];a[u.getterName]=this[u.privateName]}),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[i]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const o=Ct.getTech(e);if(!o)throw new Error(`No Tech named '${r}' exists! '${r}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(kt(this,this.handleTechReady_),!0),Ay.jsonToTextTracks(this.textTracksJson_||[],this.tech_),nC.forEach(l=>{this.on(this.tech_,l,u=>this[`handleTech${qt(l)}_`](u))}),Object.keys(xf).forEach(l=>{this.on(this.tech_,l,u=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${xf[l]}_`].bind(this),event:u});return}this[`handleTech${xf[l]}_`](u)})}),this.on(this.tech_,"loadstart",l=>this.handleTechLoadStart_(l)),this.on(this.tech_,"sourceset",l=>this.handleTechSourceset_(l)),this.on(this.tech_,"waiting",l=>this.handleTechWaiting_(l)),this.on(this.tech_,"ended",l=>this.handleTechEnded_(l)),this.on(this.tech_,"seeking",l=>this.handleTechSeeking_(l)),this.on(this.tech_,"play",l=>this.handleTechPlay_(l)),this.on(this.tech_,"pause",l=>this.handleTechPause_(l)),this.on(this.tech_,"durationchange",l=>this.handleTechDurationChange_(l)),this.on(this.tech_,"fullscreenchange",(l,u)=>this.handleTechFullscreenChange_(l,u)),this.on(this.tech_,"fullscreenerror",(l,u)=>this.handleTechFullscreenError_(l,u)),this.on(this.tech_,"enterpictureinpicture",l=>this.handleTechEnterPictureInPicture_(l)),this.on(this.tech_,"leavepictureinpicture",l=>this.handleTechLeavePictureInPicture_(l)),this.on(this.tech_,"error",l=>this.handleTechError_(l)),this.on(this.tech_,"posterchange",l=>this.handleTechPosterChange_(l)),this.on(this.tech_,"textdata",l=>this.handleTechTextData_(l)),this.on(this.tech_,"ratechange",l=>this.handleTechRateChange_(l)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(r!=="Html5"||!this.tag)&&Lp(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){wi.names.forEach(e=>{const t=wi[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=Ay.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&et.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
|
|
186
|
-
See https://github.com/videojs/video.js/issues/2617 for more info.
|
|
187
|
-
`),this.tech_}version(){return{"video.js":Dp}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const i=this.muted();this.muted(!0);const n=()=>{this.muted(i)};this.playTerminatedQueue_.push(n);const a=this.play();if(Ll(a))return a.catch(o=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${o||""}`)})};let r;if(e==="any"&&!this.muted()?(r=this.play(),Ll(r)&&(r=r.catch(t))):e==="muted"&&!this.muted()?r=t():r=this.play(),!!Ll(r))return r.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,r="";typeof t!="string"&&(t=e.src,r=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!r&&(r=uD(this,t)),this.cache_.source=St({},e,{src:t,type:r});const i=this.cache_.sources.filter(l=>l.src&&l.src===t),n=[],a=this.$$("source"),o=[];for(let l=0;l<a.length;l++){const u=ts(a[l]);n.push(u),u.src&&u.src===t&&o.push(u.src)}o.length&&!i.length?this.cache_.sources=n:i.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=n=>this.updateSourceCaches_(n);const r=this.currentSource().src,i=e.src;r&&!/^blob:/.test(r)&&/^blob:/.test(i)&&(!this.lastSource_||this.lastSource_.tech!==i&&this.lastSource_.player!==r)&&(t=()=>{}),t(i),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?Gr(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),r=>r.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!ue.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const r=this.el();let i=ue[this.fsApi_.fullscreenElement]===r;!i&&r.matches&&(i=r.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(i)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in nD)return iD(this.middleware_,this.tech_,e,t);if(e in Oy)return Ly(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(r){throw et(r),r}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in rD)return tD(this.middleware_,this.tech_,e);if(e in Oy)return Ly(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(et(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(et(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(et(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Gr){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),r=!!(Mh||Ni);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&r&&this.load();return}const i=this.techGet_("play");r&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),i===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(i)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(r){r(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Pr(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=Pr(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=Pr(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return SS(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let r=e.end(e.length-1);return r>t&&(r=t),r}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((r,i)=>{function n(){t.off("fullscreenerror",o),t.off("fullscreenchange",a)}function a(){n(),r()}function o(u,c){n(),i(c)}t.one("fullscreenchange",a),t.one("fullscreenerror",o);const l=t.requestFullscreenHelper_(e);l&&(l.then(n,n),l.then(r,i))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const r=this.el_[this.fsApi_.requestFullscreen](t);return r&&r.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),r}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,r)=>{function i(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){i(),t()}function a(l,u){i(),r(u)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const o=e.exitFullscreenHelper_();o&&(o.then(i,i),o.then(t,r))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=ue[this.fsApi_.exitFullscreen]();return e&&Gr(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=ue.documentElement.style.overflow,tr(ue,"keydown",this.boundFullWindowOnEscKey_),ue.documentElement.style.overflow="hidden",Ws(ue.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,vi(ue,"keydown",this.boundFullWindowOnEscKey_),ue.documentElement.style.overflow=this.docOrigOverflow,Rh(ue.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&D.documentPictureInPicture){const e=ue.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(qe("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),D.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(uS(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",r=>{const i=r.target.querySelector(".video-js");e.parentNode.replaceChild(i,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in ue&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(D.documentPictureInPicture&&D.documentPictureInPicture.window)return D.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in ue)return ue.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(i=>{const n=i.tagName.toLowerCase();if(i.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(i.type)===-1:["textarea"].indexOf(n)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:r=a=>e.key.toLowerCase()==="f",muteKey:i=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(r.call(this,e)){e.preventDefault(),e.stopPropagation();const a=_e.getComponent("FullscreenToggle");ue[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else i.call(this,e)?(e.preventDefault(),e.stopPropagation(),_e.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),_e.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let r=0,i=this.options_.techOrder;r<i.length;r++){const n=i[r];let a=Ct.getTech(n);if(a||(a=_e.getComponent(n)),!a){et.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return""}selectSource(e){const t=this.options_.techOrder.map(o=>[o,Ct.getTech(o)]).filter(([o,l])=>l?l.isSupported():(et.error(`The "${o}" tech is undefined. Skipped browser support check for that tech.`),!1)),r=function(o,l,u){let c;return o.some(h=>l.some(f=>{if(c=u(h,f),c)return!0})),c};let i;const n=o=>(l,u)=>o(u,l),a=([o,l],u)=>{if(l.canPlaySource(u,this.options_[o.toLowerCase()]))return{source:u,tech:o}};return this.options_.sourceOrder?i=r(e,t,n(a)):i=r(t,e,a),i||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const r=AS(e);if(!r.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=r),this.updateSourceCaches_(r[0]),ZP(this,r[0],(i,n)=>{if(this.middleware_=n,t||(this.cache_.sources=r),this.updateSourceCaches_(i),this.src_(i)){if(r.length>1)return this.handleSrc_(r.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}eD(n,this.tech_)}),r.length>1){const i=()=>{this.error(null),this.handleSrc_(r.slice(1),!0)},n=()=>{this.off("error",i)};this.one("error",i),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",i),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?yS(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();Gr(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),wn(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:r,remainingTimeDisplay:i}=this.controlBar||{},{seekBar:n}=r||{};e&&e.updateContent(),t&&t.updateContent(),i&&i.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(ns("beforeerror").forEach(t=>{const r=t(this,e);if(!(en(r)&&!Array.isArray(r)||typeof r=="string"||typeof r=="number"||r===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=r}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new Bt(e),this.addClass("vjs-error"),et.error(`(CODE:${this.error_.code} ${Bt.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),ns("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,r;const i=kt(this,this.reportUserActivity),n=function(h){(h.screenX!==t||h.screenY!==r)&&(t=h.screenX,r=h.screenY,i())},a=function(){i(),this.clearInterval(e),e=this.setInterval(i,250)},o=function(h){i(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",o),this.on("mouseleave",o);const l=this.getChild("controlBar");l&&!Ni&&!tn&&(l.on("mouseenter",function(h){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),l.on("mouseleave",function(h){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",i),this.on("keyup",i);let u;const c=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(u);const h=this.options_.inactivityTimeout;h<=0||(u=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},h))};this.setInterval(c,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),r=t&&t.currentHeight();e.forEach(i=>{i!==t&&i.el_&&!i.hasClass("vjs-hidden")&&(i.hide(),this.audioOnlyCache_.hiddenChildren.push(i))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=r,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(r),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,r){if(this.tech_)return this.tech_.addTextTrack(e,t,r)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),wn(this)&&this.trigger("languagechange"))}languages(){return St(Ua.prototype.options_.languages,this.languages_)}toJSON(){const e=St(this.options_),t=e.tracks;e.tracks=[];for(let r=0;r<t.length;r++){let i=t[r];i=St(i),i.player=void 0,e.tracks[r]=i}return e}createModal(e,t){t=t||{},t.content=e||"";const r=new Lo(this,t);return this.addChild(r),r.on("dispose",()=>{this.removeChild(r)}),r.open(),r}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let r=0;r<Vp.length;r++){const i=Vp[r],n=this.breakpoints_[i];if(t<=n){if(e===i)return;e&&this.removeClass(Tc[e]),this.addClass(Tc[i]),this.breakpoint_=i;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Object.assign({},jD,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;const t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Tc[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const r=this.crossOrigin();this.reset(),this.cache_.media=St(e);const{artist:i,artwork:n,description:a,poster:o,src:l,textTracks:u,title:c}=this.cache_.media;!n&&o&&(this.cache_.media.artwork=[{src:o,type:jc(o)}]),r&&this.crossOrigin(r),l&&this.src(l),o&&this.poster(o),Array.isArray(u)&&u.forEach(h=>this.addRemoteTextTrack(h,!1)),this.titleBar&&this.titleBar.update({title:c,description:a||i||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),r=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),i={src:t,textTracks:r};return e&&(i.poster=e,i.artwork=[{src:i.poster,type:jc(i.poster)}]),i}return St(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},r=ts(e),i=r["data-setup"];if(Dl(e,"vjs-fill")&&(r.fill=!0),Dl(e,"vjs-fluid")&&(r.fluid=!0),i!==null)try{Object.assign(r,JSON.parse(i||"{}"))}catch(n){et.error("data-setup",n)}if(Object.assign(t,r),e.hasChildNodes()){const n=e.childNodes;for(let a=0,o=n.length;a<o;a++){const l=n[a],u=l.nodeName.toLowerCase();u==="source"?t.sources.push(ts(l)):u==="track"&&t.tracks.push(ts(l))}}return t}debug(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(t=>typeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}};wi.names.forEach(function(s){const e=wi[s];Qt.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Qt.prototype.crossorigin=Qt.prototype.crossOrigin;Qt.players={};const cl=D.navigator;Qt.prototype.options_={techOrder:Ct.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:cl&&(cl.languages&&cl.languages[0]||cl.userLanguage||cl.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1};nC.forEach(function(s){Qt.prototype[`handleTech${qt(s)}_`]=function(){return this.trigger(s)}});_e.registerComponent("Player",Qt);const Vc="plugin",eo="activePlugins_",ja={},Hc=s=>ja.hasOwnProperty(s),bc=s=>Hc(s)?ja[s]:void 0,sC=(s,e)=>{s[eo]=s[eo]||{},s[eo][e]=!0},qc=(s,e,t)=>{const r=(t?"before":"")+"pluginsetup";s.trigger(r,e),s.trigger(r+":"+e.name,e)},VD=function(s,e){const t=function(){qc(this,{name:s,plugin:e,instance:null},!0);const r=e.apply(this,arguments);return sC(this,s),qc(this,{name:s,plugin:e,instance:r}),r};return Object.keys(e).forEach(function(r){t[r]=e[r]}),t},Qy=(s,e)=>(e.prototype.name=s,function(...t){qc(this,{name:s,plugin:e,instance:null},!0);const r=new e(this,...t);return this[s]=()=>r,qc(this,r.getEventHash()),r});let sn=class Sc{constructor(e){if(this.constructor===Sc)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Qm(this),delete this.trigger,vS(this,this.constructor.defaultState),sC(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return No(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[eo][e]=!1,this.player=this.state=null,t[e]=Qy(e,ja[e])}static isBasic(e){const t=typeof e=="string"?bc(e):e;return typeof t=="function"&&!Sc.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(Hc(e))et.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Qt.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return ja[e]=t,e!==Vc&&(Sc.isBasic(t)?Qt.prototype[e]=VD(e,t):Qt.prototype[e]=Qy(e,t)),t}static deregisterPlugin(e){if(e===Vc)throw new Error("Cannot de-register base plugin.");Hc(e)&&(delete ja[e],delete Qt.prototype[e])}static getPlugins(e=Object.keys(ja)){let t;return e.forEach(r=>{const i=bc(r);i&&(t=t||{},t[r]=i)}),t}static getPluginVersion(e){const t=bc(e);return t&&t.VERSION||""}};sn.getPlugin=bc;sn.BASE_PLUGIN_NAME=Vc;sn.registerPlugin(Vc,sn);Qt.prototype.usingPlugin=function(s){return!!this[eo]&&this[eo][s]===!0};Qt.prototype.hasPlugin=function(s){return!!Hc(s)};function HD(s,e){let t=!1;return function(...r){return t||et.warn(s),t=!0,e.apply(this,r)}}function Lr(s,e,t,r){return HD(`${e} is deprecated and will be removed in ${s}.0; please use ${t} instead.`,r)}var qD={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const aC=s=>s.indexOf("#")===0?s.slice(1):s;function B(s,e,t){let r=B.getPlayer(s);if(r)return e&&et.warn(`Player "${s}" is already initialised. Options will not be applied.`),t&&r.ready(t),r;const i=typeof s=="string"?ss("#"+aC(s)):s;if(!Do(i))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in i?i.getRootNode()instanceof D.ShadowRoot:!1)?i.getRootNode():i.ownerDocument.body;(!i.ownerDocument.defaultView||!a.contains(i))&&et.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player")?i.parentNode:i).cloneNode(!0)),ns("beforesetup").forEach(l=>{const u=l(i,St(e));if(!en(u)||Array.isArray(u)){et.error("please return an object in beforesetup hooks");return}e=St(e,u)});const o=_e.getComponent("Player");return r=new o(i,e,t),ns("setup").forEach(l=>l(r)),r}B.hooks_=Tn;B.hooks=ns;B.hook=SP;B.hookOnce=CP;B.removeHook=V0;if(D.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Po()){let s=ss(".vjs-styles-defaults");if(!s){s=dS("vjs-styles-defaults");const e=ss("head");e&&e.insertBefore(s,e.firstChild),fS(s,`
|
|
188
|
-
.video-js {
|
|
189
|
-
width: 300px;
|
|
190
|
-
height: 150px;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.vjs-fluid:not(.vjs-audio-only-mode) {
|
|
194
|
-
padding-top: 56.25%
|
|
195
|
-
}
|
|
196
|
-
`)}}Mp(1,B);B.VERSION=Dp;B.options=Qt.prototype.options_;B.getPlayers=()=>Qt.players;B.getPlayer=s=>{const e=Qt.players;let t;if(typeof s=="string"){const r=aC(s),i=e[r];if(i)return i;t=ss("#"+r)}else t=s;if(Do(t)){const{player:r,playerId:i}=t;if(r||e[i])return r||e[i]}};B.getAllPlayers=()=>Object.keys(Qt.players).map(s=>Qt.players[s]).filter(Boolean);B.players=Qt.players;B.getComponent=_e.getComponent;B.registerComponent=(s,e)=>(Ct.isTech(e)&&et.warn(`The ${s} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),_e.registerComponent.call(_e,s,e));B.getTech=Ct.getTech;B.registerTech=Ct.registerTech;B.use=JP;Object.defineProperty(B,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(B.middleware,"TERMINATOR",{value:$c,writeable:!1,enumerable:!0});B.browser=Q0;B.obj=kP;B.mergeOptions=Lr(9,"videojs.mergeOptions","videojs.obj.merge",St);B.defineLazyProperty=Lr(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Dh);B.bind=Lr(9,"videojs.bind","native Function.prototype.bind",kt);B.registerPlugin=sn.registerPlugin;B.deregisterPlugin=sn.deregisterPlugin;B.plugin=(s,e)=>(et.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),sn.registerPlugin(s,e));B.getPlugins=sn.getPlugins;B.getPlugin=sn.getPlugin;B.getPluginVersion=sn.getPluginVersion;B.addLanguage=function(s,e){return s=(""+s).toLowerCase(),B.options.languages=St(B.options.languages,{[s]:e}),B.options.languages[s]};B.log=et;B.createLogger=H0;B.time=jP;B.createTimeRange=Lr(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Pr);B.createTimeRanges=Lr(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Pr);B.formatTime=Lr(9,"videojs.formatTime","videojs.time.formatTime",na);B.setFormatTime=Lr(9,"videojs.setFormatTime","videojs.time.setFormatTime",TS);B.resetFormatTime=Lr(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",bS);B.parseUrl=Lr(9,"videojs.parseUrl","videojs.url.parseUrl",eg);B.isCrossOrigin=Lr(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Hh);B.EventTarget=ir;B.any=Ym;B.on=tr;B.one=jh;B.off=vi;B.trigger=No;B.xhr=k0;B.TextTrack=tu;B.AudioTrack=kS;B.VideoTrack=xS;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{B[s]=function(){return et.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),cS[s].apply(null,arguments)}});B.computedStyle=Lr(9,"videojs.computedStyle","videojs.dom.computedStyle",vo);B.dom=cS;B.fn=MP;B.num=_D;B.str=UP;B.url=YP;B.Error=qD;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */let zD=class{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(r){t.enabled_(r)}}),t}},zc=class extends B.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const r=this.levels_.length;return t=new zD(e),""+r in this||Object.defineProperty(this,r,{get(){return this.levels_[r]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let r=0,i=this.length;r<i;r++)if(this[r]===e){t=this.levels_.splice(r,1)[0],this.selectedIndex_===r?this.selectedIndex_=-1:this.selectedIndex_>r&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,r=this.length;t<r;t++){const i=this[t];if(i.id===e)return i}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}};zc.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const s in zc.prototype.allowedEvents_)zc.prototype["on"+s]=null;var oC="4.1.0";const WD=function(s,e){const t=s.qualityLevels,r=new zc,i=function(){r.dispose(),s.qualityLevels=t,s.off("dispose",i)};return s.on("dispose",i),s.qualityLevels=()=>r,s.qualityLevels.VERSION=oC,r},lC=function(s){return WD(this,B.obj.merge({},s))};B.registerPlugin("qualityLevels",lC);lC.VERSION=oC;/*! @name @videojs/http-streaming @version 3.16.0 @license Apache-2.0 */const ji=xh,Wc=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,vr=s=>B.log.debug?B.log.debug.bind(B,"VHS:",`${s} >`):function(){};function ct(...s){const e=B.obj||B;return(e.merge||e.mergeOptions).apply(e,s)}function si(...s){const e=B.time||B;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}function GD(s){if(s.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges:
|
|
197
|
-
`;for(let t=0;t<s.length;t++){const r=s.start(t),i=s.end(t);e+=`${r} --> ${i}. Duration (${i-r})
|
|
198
|
-
`}return e}const Kr=1/30,Xr=Kr*3,uC=function(s,e){const t=[];let r;if(s&&s.length)for(r=0;r<s.length;r++)e(s.start(r),s.end(r))&&t.push([s.start(r),s.end(r)]);return si(t)},Va=function(s,e){return uC(s,function(t,r){return t-Xr<=e&&r+Xr>=e})},ec=function(s,e){return uC(s,function(t){return t-Kr>=e})},KD=function(s){if(s.length<2)return si();const e=[];for(let t=1;t<s.length;t++){const r=s.end(t-1),i=s.start(t);e.push([r,i])}return si(e)},XD=function(s,e){let t=null,r=null,i=0;const n=[],a=[];if(!s||!s.length||!e||!e.length)return si();let o=s.length;for(;o--;)n.push({time:s.start(o),type:"start"}),n.push({time:s.end(o),type:"end"});for(o=e.length;o--;)n.push({time:e.start(o),type:"start"}),n.push({time:e.end(o),type:"end"});for(n.sort(function(l,u){return l.time-u.time}),o=0;o<n.length;o++)n[o].type==="start"?(i++,i===2&&(t=n[o].time)):n[o].type==="end"&&(i--,i===1&&(r=n[o].time)),t!==null&&r!==null&&(a.push([t,r]),t=null,r=null);return si(a)},cC=s=>{const e=[];if(!s||!s.length)return"";for(let t=0;t<s.length;t++)e.push(s.start(t)+" => "+s.end(t));return e.join(", ")},YD=function(s,e,t=1){return((s.length?s.end(s.length-1):0)-e)/t},Us=s=>{const e=[];for(let t=0;t<s.length;t++)e.push({start:s.start(t),end:s.end(t)});return e},QD=function(s,e){if(s===e)return!1;if(!s&&e||!e&&s||s.length!==e.length)return!0;for(let t=0;t<s.length;t++)if(s.start(t)!==e.start(t)||s.end(t)!==e.end(t))return!0;return!1},Af=function(s){if(!(!s||!s.length||!s.end))return s.end(s.length-1)},yg=function(s,e){let t=0;if(!s||!s.length)return t;for(let r=0;r<s.length;r++){const i=s.start(r),n=s.end(r);if(!(e>n)){if(e>i&&e<=n){t+=n-e;continue}t+=n-i}}return t},_g=(s,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(r){t+=r.duration}),(e.preloadHints||[]).forEach(function(r){r.type==="PART"&&(t+=s.partTargetDuration)}),t},Hp=s=>(s.segments||[]).reduce((e,t,r)=>(t.parts?t.parts.forEach(function(i,n){e.push({duration:i.duration,segmentIndex:r,partIndex:n,part:i,segment:t})}):e.push({duration:t.duration,segmentIndex:r,partIndex:null,segment:t,part:null}),e),[]),hC=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},dC=({preloadSegment:s})=>{if(!s)return;const{parts:e,preloadHints:t}=s;let r=(t||[]).reduce((i,n)=>i+(n.type==="PART"?1:0),0);return r+=e&&e.length?e.length:0,r},fC=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const t=hC(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},JD=function(s,e){let t=0,r=e-s.mediaSequence,i=s.segments[r];if(i){if(typeof i.start<"u")return{result:i.start,precise:!0};if(typeof i.end<"u")return{result:i.end-i.duration,precise:!0}}for(;r--;){if(i=s.segments[r],typeof i.end<"u")return{result:t+i.end,precise:!0};if(t+=_g(s,i),typeof i.start<"u")return{result:t+i.start,precise:!0}}return{result:t,precise:!1}},ZD=function(s,e){let t=0,r,i=e-s.mediaSequence;for(;i<s.segments.length;i++){if(r=s.segments[i],typeof r.start<"u")return{result:r.start-t,precise:!0};if(t+=_g(s,r),typeof r.end<"u")return{result:r.end-t,precise:!0}}return{result:-1,precise:!1}},pC=function(s,e,t){if(typeof e>"u"&&(e=s.mediaSequence+s.segments.length),e<s.mediaSequence)return 0;const r=JD(s,e);if(r.precise)return r.result;const i=ZD(s,e);return i.precise?i.result:r.result+t},mC=function(s,e,t){if(!s)return 0;if(typeof t!="number"&&(t=0),typeof e>"u"){if(s.totalDuration)return s.totalDuration;if(!s.endList)return D.Infinity}return pC(s,e,t)},Ol=function({defaultDuration:s,durationList:e,startIndex:t,endIndex:r}){let i=0;if(t>r&&([t,r]=[r,t]),t<0){for(let n=t;n<Math.min(0,r);n++)i+=s;t=0}for(let n=t;n<r;n++)i+=e[n].duration;return i},gC=function(s,e,t,r){if(!s||!s.segments)return null;if(s.endList)return mC(s);if(e===null)return null;e=e||0;let i=pC(s,s.mediaSequence+s.segments.length,e);return t&&(r=typeof r=="number"?r:fC(null,s),i-=r),Math.max(0,i)},eN=function(s,e,t){const i=e||0;let n=gC(s,e,!0,t);return n===null?si():(n<i&&(n=i),si(i,n))},tN=function({playlist:s,currentTime:e,startingSegmentIndex:t,startingPartIndex:r,startTime:i,exactManifestTimings:n}){let a=e-i;const o=Hp(s);let l=0;for(let u=0;u<o.length;u++){const c=o[u];if(t===c.segmentIndex&&!(typeof r=="number"&&typeof c.partIndex=="number"&&r!==c.partIndex)){l=u;break}}if(a<0){if(l>0)for(let u=l-1;u>=0;u--){const c=o[u];if(a+=c.duration,n){if(a<0)continue}else if(a+Kr<=0)continue;return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:i-Ol({defaultDuration:s.targetDuration,durationList:o,startIndex:l,endIndex:u})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e}}if(l<0){for(let u=l;u<0;u++)if(a-=s.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e};l=0}for(let u=l;u<o.length;u++){const c=o[u];a-=c.duration;const h=c.duration>Kr,f=a===0,g=h&&a+Kr>=0;if(!((f||g)&&u!==o.length-1)){if(n){if(a>0)continue}else if(a-Kr>=0)continue;return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:i+Ol({defaultDuration:s.targetDuration,durationList:o,startIndex:l,endIndex:u})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},vC=function(s){return s.excludeUntil&&s.excludeUntil>Date.now()},Tg=function(s){return s.excludeUntil&&s.excludeUntil===1/0},Wh=function(s){const e=vC(s);return!s.disabled&&!e},iN=function(s){return s.disabled},rN=function(s){for(let e=0;e<s.segments.length;e++)if(s.segments[e].key)return!0;return!1},yC=function(s,e){return e.attributes&&e.attributes[s]},nN=function(s,e,t,r=0){return yC("BANDWIDTH",t)?(s*t.attributes.BANDWIDTH-r*8)/e:NaN},qp=(s,e)=>{if(s.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(r=>Wh(r)?(r.attributes.BANDWIDTH||0)<t:!1).length===0},bg=(s,e)=>!s&&!e||!s&&e||s&&!e?!1:!!(s===e||s.id&&e.id&&s.id===e.id||s.resolvedUri&&e.resolvedUri&&s.resolvedUri===e.resolvedUri||s.uri&&e.uri&&s.uri===e.uri),Jy=function(s,e){const t=s&&s.mediaGroups&&s.mediaGroups.AUDIO||{};let r=!1;for(const i in t){for(const n in t[i])if(r=e(t[i][n]),r)break;if(r)break}return!!r},su=s=>{if(!s||!s.playlists||!s.playlists.length)return Jy(s,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<s.playlists.length;e++){const t=s.playlists[e],r=t.attributes&&t.attributes.CODECS;if(!(r&&r.split(",").every(n=>I0(n))||Jy(s,n=>bg(t,n))))return!1}return!0};var Vi={liveEdgeDelay:fC,duration:mC,seekable:eN,getMediaInfoForTime:tN,isEnabled:Wh,isDisabled:iN,isExcluded:vC,isIncompatible:Tg,playlistEnd:gC,isAes:rN,hasAttribute:yC,estimateSegmentRequestTime:nN,isLowestEnabledRendition:qp,isAudioOnly:su,playlistMatch:bg,segmentDurationWithParts:_g};const{log:_C}=B,to=(s,e)=>`${s}-${e}`,TC=(s,e,t)=>`placeholder-uri-${s}-${e}-${t}`,sN=({onwarn:s,oninfo:e,manifestString:t,customTagParsers:r=[],customTagMappers:i=[],llhls:n})=>{const a=new zA;s&&a.on("warn",s),e&&a.on("info",e),r.forEach(u=>a.addParser(u)),i.forEach(u=>a.addTagMapper(u)),a.push(t),a.end();const o=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(u){o.hasOwnProperty(u)&&delete o[u]}),o.segments&&o.segments.forEach(function(u){["parts","preloadHints"].forEach(function(c){u.hasOwnProperty(c)&&delete u[c]})})),!o.targetDuration){let u=10;o.segments&&o.segments.length&&(u=o.segments.reduce((c,h)=>Math.max(c,h.duration),0)),s&&s({message:`manifest has no targetDuration defaulting to ${u}`}),o.targetDuration=u}const l=hC(o);if(l.length&&!o.partTargetDuration){const u=l.reduce((c,h)=>Math.max(c,h.duration),0);s&&(s({message:`manifest has no partTargetDuration defaulting to ${u}`}),_C.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=u}return o},Bo=(s,e)=>{s.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(s.mediaGroups[t])for(const r in s.mediaGroups[t])for(const i in s.mediaGroups[t][r]){const n=s.mediaGroups[t][r][i];e(n,t,r,i)}})},bC=({playlist:s,uri:e,id:t})=>{s.id=t,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},aN=s=>{let e=s.playlists.length;for(;e--;){const t=s.playlists[e];bC({playlist:t,id:to(e,t.uri)}),t.resolvedUri=ji(s.uri,t.uri),s.playlists[t.id]=t,s.playlists[t.uri]=t,t.attributes.BANDWIDTH||_C.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},oN=s=>{Bo(s,e=>{e.uri&&(e.resolvedUri=ji(s.uri,e.uri))})},lN=(s,e)=>{const t=to(0,e),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:D.location.href,resolvedUri:D.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return r.playlists[t]=r.playlists[0],r.playlists[e]=r.playlists[0],r},SC=(s,e,t=TC)=>{s.uri=e;for(let i=0;i<s.playlists.length;i++)if(!s.playlists[i].uri){const n=`placeholder-uri-${i}`;s.playlists[i].uri=n}const r=su(s);Bo(s,(i,n,a,o)=>{if(!i.playlists||!i.playlists.length){if(r&&n==="AUDIO"&&!i.uri)for(let l=0;l<s.playlists.length;l++){const u=s.playlists[l];if(u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===a)return}i.playlists=[vt({},i)]}i.playlists.forEach(function(l,u){const c=t(n,a,o,l),h=to(u,c);l.uri?l.resolvedUri=l.resolvedUri||ji(s.uri,l.uri):(l.uri=u===0?c:h,l.resolvedUri=l.uri),l.id=l.id||h,l.attributes=l.attributes||{},s.playlists[l.id]=l,s.playlists[l.uri]=l})}),aN(s),oN(s)};class Zy{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;const[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,r=t.startDate.getTime();this.trimProcessedDateRanges_(r),this.pendingDateRanges_=e.reduce((i,n)=>(i.set(n.id,n),i),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((r,i)=>{if(!this.processedDateRanges_.has(i)&&(r.startTime=r.startDate.getTime()/1e3-this.offset_,r.processDateRange=()=>this.processDateRange(r),t.push(r),!!r.class))if(e[r.class]){const n=e[r.class].push(r);r.classListIndex=n-1}else e[r.class]=[r],r.classListIndex=0});for(const r of t){const i=e[r.class]||[];r.endDate?r.endTime=r.endDate.getTime()/1e3-this.offset_:r.endOnNext&&i[r.classListIndex+1]?r.endTime=i[r.classListIndex+1].startTime:r.duration?r.endTime=r.startTime+r.duration:r.plannedDuration?r.endTime=r.startTime+r.plannedDuration:r.endTime=r.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((r,i)=>{r.startDate.getTime()<e&&this.processedDateRanges_.delete(i)})}}const CC=22,Xs=({requestType:s,request:e,error:t,parseFailure:r})=>{const i=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:s},o=i&&!n||r;if(t&&n)a.error=vt({},t),a.errorType=B.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=B.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=B.Error.NetworkRequestTimeout;else if(o){const l=r?B.Error.NetworkBodyParserFailed:B.Error.NetworkBadStatus;a.errorType=l,a.status=e.status,a.headers=e.headers}return a},{EventTarget:uN}=B,cN=(s,e)=>{if(e.endList||!e.serverControl)return s;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:r}=e;let i=e.mediaSequence+e.segments.length;if(r){const n=r.parts||[],a=dC(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&i--}t._HLS_msn=i}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const r=new D.URL(s);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(i){t.hasOwnProperty(i)&&r.searchParams.set(i,t[i])}),s=r.toString()}return s},hN=(s,e)=>{if(!s)return e;const t=ct(s,e);if(s.preloadHints&&!e.preloadHints&&delete t.preloadHints,s.parts&&!e.parts)delete t.parts;else if(s.parts&&e.parts)for(let r=0;r<e.parts.length;r++)s.parts&&s.parts[r]&&(t.parts[r]=ct(s.parts[r],e.parts[r]));return!s.skipped&&e.skipped&&(t.skipped=!1),s.preload&&!e.preload&&(t.preload=!1),t},dN=(s,e,t)=>{const r=s.slice(),i=e.slice();t=t||0;const n=[];let a;for(let o=0;o<i.length;o++){const l=r[o+t],u=i[o];l?(a=l.map||a,n.push(hN(l,u))):(a&&!u.map&&(u.map=a),n.push(u))}return n},EC=(s,e)=>{!s.resolvedUri&&s.uri&&(s.resolvedUri=ji(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=ji(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=ji(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=ji(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=ji(e,t.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=ji(e,t.uri))})},wC=function(s){const e=s.segments||[],t=s.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let r=0;r<t.preloadHints.length;r++)if(t.preloadHints[r].type==="MAP")return e}t.duration=s.targetDuration,t.preload=!0,e.push(t)}return e},kC=(s,e)=>s===e||s.segments&&e.segments&&s.segments.length===e.segments.length&&s.endList===e.endList&&s.mediaSequence===e.mediaSequence&&s.preloadSegment===e.preloadSegment,zp=(s,e,t=kC)=>{const r=ct(s,{}),i=r.playlists[e.id];if(!i||t(i,e))return null;e.segments=wC(e);const n=ct(i,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,i.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a<e.skip.skippedSegments;a++)e.segments.unshift({skipped:!0})}n.segments=dN(i.segments,e.segments,e.mediaSequence-i.mediaSequence)}n.segments.forEach(a=>{EC(a,n.resolvedUri)});for(let a=0;a<r.playlists.length;a++)r.playlists[a].id===e.id&&(r.playlists[a]=n);return r.playlists[e.id]=n,r.playlists[e.uri]=n,Bo(s,(a,o,l,u)=>{if(a.playlists)for(let c=0;c<a.playlists.length;c++)e.id===a.playlists[c].id&&(a.playlists[c]=n)}),r},Wp=(s,e)=>{const t=s.segments||[],r=t[t.length-1],i=r&&r.parts&&r.parts[r.parts.length-1],n=i&&i.duration||r&&r.duration;return e&&n?n*1e3:(s.partTargetDuration||s.targetDuration||10)*500},e_=(s,e,t)=>{if(!s)return;const r=[];return s.forEach(i=>{if(!i.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:o}=i.attributes;r.push({id:i.id,bandwidth:n,resolution:a,codecs:o})}),{type:e,isLive:t,renditions:r}};let Ha=class extends uN{constructor(e,t,r={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=vr("PlaylistLoader");const{withCredentials:i=!1}=r;this.src=e,this.vhs_=t,this.withCredentials=i,this.addDateRangesToTextTrack_=r.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new Zy,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=ji(this.main.uri,e.uri);this.llhls&&(t=cN(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(r,i)=>{if(this.request){if(r)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,r){const{uri:i,id:n}=t;this.request=null,r&&(this.state=r),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${i}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Xs({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return sN({onwarn:({message:r})=>this.logger_(`m3u8-parser warn for ${e}: ${r}`),oninfo:({message:r})=>this.logger_(`m3u8-parser info for ${e}: ${r}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(r){this.error=r,this.error.metadata={errorType:B.Error.StreamingHlsPlaylistParserError,error:r}}}haveMetadata({playlistString:e,playlistObject:t,url:r,id:i}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:r}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:r,manifestString:e});a.lastRequest=Date.now(),bC({playlist:a,uri:r,id:i});const o=zp(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[i]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Wp(this.media(),!!o)),n.parsedPlaylist=e_(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),D.clearTimeout(this.mediaUpdateTimeout),D.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Zy,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(D.clearTimeout(this.finalRenditionTimeout),t){const o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=D.setTimeout(this.media.bind(this,e,!1),o);return}const r=this.state,i=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),r==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Wp(e,!0)),!i)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(o,l)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Wc(e.resolvedUri,l),o)return this.playlistRequestError(this.request,e,r);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:l.responseText,url:e.uri,id:e.id}),r==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const r=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=D.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},r);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=D.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=D.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,r)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:r.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:r.responseText,code:2,metadata:Xs({requestType:r.requestType,request:r,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=Wc(this.src,r),this.trigger({type:"playlistparsestart",metadata:e});const i=this.parseManifest_({manifestString:r.responseText,url:this.src});e.parsedPlaylist=e_(i.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(i)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,SC(this.main,this.srcUri()),e.playlists.forEach(r=>{r.segments=wC(r),r.segments.forEach(i=>{EC(i,r.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||D.location.href;this.main=lN(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const r=this.main,i=e.ID;let n=r.playlists.length;for(;n--;){const a=r.playlists[n];if(a.attributes["PATHWAY-ID"]===i){const o=a.resolvedUri,l=a.id;if(t){const u=this.createCloneURI_(a.resolvedUri,e),c=to(i,u),h=this.createCloneAttributes_(i,a.attributes),f=this.createClonePlaylist_(a,c,e,h);r.playlists[n]=f,r.playlists[c]=f,r.playlists[u]=f}else r.playlists.splice(n,1);delete r.playlists[l],delete r.playlists[o]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const r=this.main,i=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||!r.mediaGroups[n][i])){for(const a in r.mediaGroups[n])if(a===i){for(const o in r.mediaGroups[n][a])r.mediaGroups[n][a][o].playlists.forEach((u,c)=>{const h=r.playlists[u.id],f=h.id,g=h.resolvedUri;delete r.playlists[f],delete r.playlists[g]});delete r.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const r=this.main,i=r.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=to(e.ID,n),o=this.createCloneAttributes_(e.ID,t.attributes),l=this.createClonePlaylist_(t,a,e,o);r.playlists[i]=l,r.playlists[a]=l,r.playlists[n]=l,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,r=e["BASE-ID"],i=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!i.mediaGroups[n]||i.mediaGroups[n][t]))for(const a in i.mediaGroups[n]){if(a===r)i.mediaGroups[n][t]={};else continue;for(const o in i.mediaGroups[n][a]){const l=i.mediaGroups[n][a][o];i.mediaGroups[n][t][o]=vt({},l);const u=i.mediaGroups[n][t][o],c=this.createCloneURI_(l.resolvedUri,e);u.resolvedUri=c,u.uri=c,u.playlists=[],l.playlists.forEach((h,f)=>{const g=i.playlists[h.id],C=TC(n,t,o),p=to(t,C);if(g&&!i.playlists[p]){const T=this.createClonePlaylist_(g,p,e),A=T.resolvedUri;i.playlists[p]=T,i.playlists[A]=T}u.playlists[f]=this.createClonePlaylist_(h,p,e)})}}})}createClonePlaylist_(e,t,r,i){const n=this.createCloneURI_(e.resolvedUri,r),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),i&&(a.attributes=i),ct(e,a)}createCloneURI_(e,t){const r=new URL(e);r.hostname=t["URI-REPLACEMENT"].HOST;const i=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(i))r.searchParams.set(n,i[n]);return r.href}createCloneAttributes_(e,t){const r={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(i=>{t[i]&&(r[i]=e)}),r}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const r in e.contentProtection){const i=e.contentProtection[r].attributes.keyId;i&&t.add(i.toLowerCase())}return t}}};const Gp=function(s,e,t,r){const i=s.responseType==="arraybuffer"?s.response:s.responseText;!e&&i&&(s.responseTime=Date.now(),s.roundTripTime=s.responseTime-s.requestTime,s.bytesReceived=i.byteLength||i.length,s.bandwidth||(s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3))),t.headers&&(s.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(s.timedout=!0),!e&&!s.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(s&&(i||s.responseText)))),r(e,s)},fN=(s,e)=>{if(!s||!s.size)return;let t=e;return s.forEach(r=>{t=r(t)}),t},pN=(s,e,t,r)=>{!s||!s.size||s.forEach(i=>{i(e,t,r)})},xC=function(){const s=function e(t,r){t=ct({timeout:45e3},t);const i=e.beforeRequest||B.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||B.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||B.Vhs.xhr._responseCallbackSet;i&&typeof i=="function"&&(B.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(i));const o=B.Vhs.xhr.original===!0?B.xhr:B.Vhs.xhr,l=fN(n,t);n.delete(i);const u=o(l||t,function(h,f){return pN(a,u,h,f),Gp(u,h,f,r)}),c=u.abort;return u.abort=function(){return u.aborted=!0,c.apply(u,arguments)},u.uri=t.uri,u.requestType=t.requestType,u.requestTime=Date.now(),u};return s.original=!0,s},mN=function(s){let e;const t=s.offset;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=D.BigInt(s.offset)+D.BigInt(s.length)-D.BigInt(1):e=s.offset+s.length-1,"bytes="+t+"-"+e},Kp=function(s){const e={};return s.byterange&&(e.Range=mN(s.byterange)),e},gN=function(s,e){return s.start(e)+"-"+s.end(e)},vN=function(s,e){const t=s.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},yN=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},AC=function(s){const e={};return Object.keys(s).forEach(t=>{const r=s[t];D0(r)?e[t]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:e[t]=r}),e},Gc=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},IC=function(s){return s.resolvedUri},PC=s=>{const e=Array.prototype.slice.call(s),t=16;let r="",i,n;for(let a=0;a<e.length/t;a++)i=e.slice(a*t,a*t+t).map(vN).join(""),n=e.slice(a*t,a*t+t).map(yN).join(""),r+=i+" "+n+`
|
|
199
|
-
`;return r},_N=({bytes:s})=>PC(s),TN=s=>{let e="",t;for(t=0;t<s.length;t++)e+=gN(s,t)+" ";return e};var bN=Object.freeze({__proto__:null,createTransferableMessage:AC,initSegmentId:Gc,segmentKeyId:IC,hexDump:PC,tagDump:_N,textRanges:TN});const DC=.25,SN=(s,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,i=e.videoTimingInfo.transmuxedPresentationStart+t,n=s-i;return new Date(e.dateTimeObject.getTime()+n*1e3)},CN=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,EN=(s,e)=>{let t;try{t=new Date(s)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let r=e.segments[0];if(t<new Date(r.dateTimeObject))return null;for(let l=0;l<e.segments.length-1;l++){r=e.segments[l];const u=new Date(e.segments[l+1].dateTimeObject);if(t<u)break}const i=e.segments[e.segments.length-1],n=i.dateTimeObject,a=i.videoTimingInfo?CN(i.videoTimingInfo):i.duration+i.duration*DC,o=new Date(n.getTime()+a*1e3);return t>o?null:(t>new Date(n)&&(r=i),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Vi.duration(e,e.mediaSequence+e.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})},wN=(s,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,r;for(let n=0;n<e.segments.length&&(r=e.segments[n],t=r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationEnd:t+r.duration,!(s<=t));n++);const i=e.segments[e.segments.length-1];if(i.videoTimingInfo&&i.videoTimingInfo.transmuxedPresentationEnd<s)return null;if(s>t){if(s>t+i.duration*DC)return null;r=i}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:t-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}},kN=(s,e)=>{let t,r;try{t=new Date(s),r=new Date(e)}catch{}const i=t.getTime();return(r.getTime()-i)/1e3},xN=s=>{if(!s.segments||s.segments.length===0)return!1;for(let e=0;e<s.segments.length;e++)if(!s.segments[e].dateTimeObject)return!1;return!0},AN=({playlist:s,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!s||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const r=wN(e,s);if(!r)return t({message:"valid programTime was not found"});if(r.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:r.estimatedStart});const i={mediaSeconds:e},n=SN(e,r.segment);return n&&(i.programDateTime=n.toISOString()),t(null,i)},NC=({programTime:s,playlist:e,retryCount:t=2,seekTo:r,pauseAfterSeek:i=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof s>"u"||!e||!r)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!xN(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=EN(s,e);if(!o)return a({message:`${s} was not found in the stream`});const l=o.segment,u=kN(l.dateTimeObject,s);if(o.type==="estimate"){if(t===0)return a({message:`${s} is not buffered yet. Try again`});r(o.estimatedStart+u),n.one("seeked",()=>{NC({programTime:s,playlist:e,retryCount:t-1,seekTo:r,pauseAfterSeek:i,tech:n,callback:a})});return}const c=l.start+u,h=()=>a(null,n.currentTime());n.one("seeked",h),i&&n.pause(),r(c)},If=(s,e)=>{if(s.readyState===4)return e()},IN=(s,e,t,r)=>{let i=[],n,a=!1;const o=function(h,f,g,C){return f.abort(),a=!0,t(h,f,g,C)},l=function(h,f){if(a)return;if(h)return h.metadata=Xs({requestType:r,request:f,error:h}),o(h,f,"",i);const g=f.responseText.substring(i&&i.byteLength||0,f.responseText.length);if(i=rI(i,N0(g,!0)),n=n||Tl(i),i.length<10||n&&i.length<n+2)return If(f,()=>o(h,f,"",i));const C=zm(i);return C==="ts"&&i.length<188?If(f,()=>o(h,f,"",i)):!C&&i.length<376?If(f,()=>o(h,f,"",i)):o(null,f,C,i)},c=e({uri:s,beforeSend(h){h.overrideMimeType("text/plain; charset=x-user-defined"),h.addEventListener("progress",function({total:f,loaded:g}){return Gp(h,null,{statusCode:h.status},l)})}},function(h,f){return Gp(c,h,f,l)});return c},{EventTarget:PN}=B,t_=function(s,e){if(!kC(s,e)||s.sidx&&e.sidx&&(s.sidx.offset!==e.sidx.offset||s.sidx.length!==e.sidx.length))return!1;if(!s.sidx&&e.sidx||s.sidx&&!e.sidx||s.segments&&!e.segments||!s.segments&&e.segments)return!1;if(!s.segments&&!e.segments)return!0;for(let t=0;t<s.segments.length;t++){const r=s.segments[t],i=e.segments[t];if(r.uri!==i.uri)return!1;if(!r.byterange&&!i.byterange)continue;const n=r.byterange,a=i.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},DN=(s,e,t,r)=>{const i=r.attributes.NAME||t;return`placeholder-uri-${s}-${e}-${i}`},NN=({mainXml:s,srcUrl:e,clientOffset:t,sidxMapping:r,previousManifest:i})=>{const n=eP(s,{manifestUri:e,clientOffset:t,sidxMapping:r,previousManifest:i});return SC(n,e,DN),n},LN=(s,e)=>{Bo(s,(t,r,i,n)=>{(!e.mediaGroups[r][i]||!(n in e.mediaGroups[r][i]))&&delete s.mediaGroups[r][i][n]})},ON=(s,e,t)=>{let r=!0,i=ct(s,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n<e.playlists.length;n++){const a=e.playlists[n];if(a.sidx){const l=Ih(a.sidx);t&&t[l]&&t[l].sidx&&Vm(a,t[l].sidx,a.sidx.resolvedUri)}const o=zp(i,a,t_);o&&(i=o,r=!1)}return Bo(e,(n,a,o,l)=>{if(n.playlists&&n.playlists.length){const u=n.playlists[0].id,c=zp(i,n.playlists[0],t_);c&&(i=c,l in i.mediaGroups[a][o]||(i.mediaGroups[a][o][l]=n),i.mediaGroups[a][o][l].playlists[0]=i.playlists[u],r=!1)}}),LN(i,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(r=!1),r?null:i},MN=(s,e)=>(!s.map&&!e.map||!!(s.map&&e.map&&s.map.byterange.offset===e.map.byterange.offset&&s.map.byterange.length===e.map.byterange.length))&&s.uri===e.uri&&s.byterange.offset===e.byterange.offset&&s.byterange.length===e.byterange.length,i_=(s,e)=>{const t={};for(const r in s){const n=s[r].sidx;if(n){const a=Ih(n);if(!e[a])break;const o=e[a].sidxInfo;MN(o,n)&&(t[a]=e[a])}}return t},RN=(s,e)=>{let r=i_(s.playlists,e);return Bo(s,(i,n,a,o)=>{if(i.playlists&&i.playlists.length){const l=i.playlists;r=ct(r,i_(l,e))}}),r};let Xp=class extends PN{constructor(e,t,r={},i){super(),this.mainPlaylistLoader_=i||this,i||(this.isMain_=!0);const{withCredentials:n=!1}=r;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=r.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=vr("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,r){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},r&&(this.state=r),this.trigger("error"),!0}addSidxSegments_(e,t,r){const i=e.sidx&&Ih(e.sidx);if(!e.sidx||!i||this.mainPlaylistLoader_.sidxMapping_[i]){this.mediaRequest_=D.setTimeout(()=>r(!1),0);return}const n=Wc(e.sidx.resolvedUri),a=(l,u)=>{if(this.requestErrored_(l,u,t))return;const c=this.mainPlaylistLoader_.sidxMapping_,{requestType:h}=u;let f;try{f=sP($e(u.response).subarray(8))}catch(g){g.metadata=Xs({requestType:h,request:u,parseFailure:!0}),this.requestErrored_(g,u,t);return}return c[i]={sidxInfo:e.sidx,sidx:f},Vm(e,f,e.sidx.resolvedUri),r(!0)},o="dash-sidx";this.request=IN(n,this.vhs_.xhr,(l,u,c,h)=>{if(l)return a(l,u);if(!c||c!=="mp4"){const C=c||"unknown";return a({status:u.status,message:`Unsupported ${C} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},u)}const{offset:f,length:g}=e.sidx.byterange;if(h.length>=g+f)return a(l,{response:h.subarray(f,f+g),status:u.status,uri:u.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:Kp({byterange:e.sidx.byterange})},a)},o)}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},D.clearTimeout(this.minimumUpdatePeriodTimeout_),D.clearTimeout(this.mediaRequest_),D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const r=!this.media_||e.id!==this.media_.id;if(r&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}r&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,i=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(D.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const r=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=D.setTimeout(()=>this.load(),r);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){this.mediaRequest_=D.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(r,i)=>{if(r){const{requestType:a}=i;r.metadata=Xs({requestType:a,request:i,error:r})}if(this.requestErrored_(r,i)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const n=i.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?this.mainLoaded_=Date.parse(i.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Wc(this.mainPlaylistLoader_.srcUrl,i),n){this.handleMain_(),this.syncClientServerClock_(()=>e(i,n));return}return e(i,n)})}syncClientServerClock_(e){const t=tP(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:ji(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(r,i)=>{if(!this.request)return;if(r){const{requestType:a}=i;return this.error.metadata=Xs({requestType:a,request:i,error:r}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;t.method==="HEAD"?!i.responseHeaders||!i.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(i.responseHeaders.date):n=Date.parse(i.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let r;try{r=NN({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:B.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(r=ON(e,r,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=r||e;const i=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(i&&i!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=i),(!e||r&&r.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(r),r){const{duration:n,endList:a}=r,o=[];r.playlists.forEach(u=>{o.push({id:u.id,bandwidth:u.attributes.BANDWIDTH,resolution:u.attributes.RESOLUTION,codecs:u.attributes.CODECS})});const l={duration:n,isLive:!a,renditions:o};t.parsedManifest=l,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!r}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(D.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=D.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=RN(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,r=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,r=!this.media_||this.media_!==t[e];if(r?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const i=()=>{this.media().endList||(this.mediaUpdateTimeout=D.setTimeout(()=>{this.trigger("mediaupdatetimeout"),i()},Wp(this.media(),!!r)))};i()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(r=>({cueTime:r.start,frames:[{data:r.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const r in e.contentProtection){const i=e.contentProtection[r].attributes["cenc:default_KID"];i&&t.add(i.replace(/-/g,"").toLowerCase())}return t}}};var ii={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const BN=s=>{const e=new Uint8Array(new ArrayBuffer(s.length));for(let t=0;t<s.length;t++)e[t]=s.charCodeAt(t);return e.buffer},LC=function(s){return s.on=s.addEventListener,s.off=s.removeEventListener,s},FN=function(s){try{return URL.createObjectURL(new Blob([s],{type:"application/javascript"}))}catch{const t=new BlobBuilder;return t.append(s),URL.createObjectURL(t.getBlob())}},OC=function(s){return function(){const e=FN(s),t=LC(new Worker(e));t.objURL=e;const r=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),r.call(this)},t}},MC=function(s){return`var browserWorkerPolyFill = ${LC.toString()};
|
|
200
|
-
browserWorkerPolyFill(self);
|
|
201
|
-
`+s},RC=function(s){return s.toString().replace(/^function.+?{/,"").slice(0,-1)},UN=MC(RC(function(){var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=function(){this.init=function(){var d={};this.on=function(v,b){d[v]||(d[v]=[]),d[v]=d[v].concat(b)},this.off=function(v,b){var _;return d[v]?(_=d[v].indexOf(b),d[v]=d[v].slice(),d[v].splice(_,1),_>-1):!1},this.trigger=function(v){var b,_,k,I;if(b=d[v],!!b)if(arguments.length===2)for(k=b.length,_=0;_<k;++_)b[_].call(this,arguments[1]);else{for(I=[],_=arguments.length,_=1;_<arguments.length;++_)I.push(arguments[_]);for(k=b.length,_=0;_<k;++_)b[_].apply(this,I)}},this.dispose=function(){d={}}}};e.prototype.pipe=function(d){return this.on("data",function(v){d.push(v)}),this.on("done",function(v){d.flush(v)}),this.on("partialdone",function(v){d.partialFlush(v)}),this.on("endedtimeline",function(v){d.endTimeline(v)}),this.on("reset",function(v){d.reset(v)}),d},e.prototype.push=function(d){this.trigger("data",d)},e.prototype.flush=function(d){this.trigger("done",d)},e.prototype.partialFlush=function(d){this.trigger("partialdone",d)},e.prototype.endTimeline=function(d){this.trigger("endedtimeline",d)},e.prototype.reset=function(d){this.trigger("reset",d)};var t=e,r=Math.pow(2,32),i=function(d){var v=new DataView(d.buffer,d.byteOffset,d.byteLength),b;return v.getBigUint64?(b=v.getBigUint64(0),b<Number.MAX_SAFE_INTEGER?Number(b):b):v.getUint32(0)*r+v.getUint32(4)},n={getUint64:i,MAX_UINT32:r},a=n.MAX_UINT32,o,l,u,c,h,f,g,C,p,T,A,N,F,V,R,O,M,U,E,P,Y,G,K,le,de,pe,se,ae,ce,he,ve,Ae,De,Me,Ne,Je;(function(){var d;if(K={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for(d in K)K.hasOwnProperty(d)&&(K[d]=[d.charCodeAt(0),d.charCodeAt(1),d.charCodeAt(2),d.charCodeAt(3)]);le=new Uint8Array([105,115,111,109]),pe=new Uint8Array([97,118,99,49]),de=new Uint8Array([0,0,0,1]),se=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),ae=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),ce={video:se,audio:ae},Ae=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ve=new Uint8Array([0,0,0,0,0,0,0,0]),De=new Uint8Array([0,0,0,0,0,0,0,0]),Me=De,Ne=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Je=De,he=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(d){var v=[],b=0,_,k,I;for(_=1;_<arguments.length;_++)v.push(arguments[_]);for(_=v.length;_--;)b+=v[_].byteLength;for(k=new Uint8Array(b+8),I=new DataView(k.buffer,k.byteOffset,k.byteLength),I.setUint32(0,k.byteLength),k.set(d,4),_=0,b=8;_<v.length;_++)k.set(v[_],b),b+=v[_].byteLength;return k},l=function(){return o(K.dinf,o(K.dref,Ae))},u=function(d){return o(K.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,d.audioobjecttype<<3|d.samplingfrequencyindex>>>1,d.samplingfrequencyindex<<7|d.channelcount<<3,6,1,2]))},c=function(){return o(K.ftyp,le,de,le,pe)},O=function(d){return o(K.hdlr,ce[d])},h=function(d){return o(K.mdat,d)},R=function(d){var v=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,d.duration>>>24&255,d.duration>>>16&255,d.duration>>>8&255,d.duration&255,85,196,0,0]);return d.samplerate&&(v[12]=d.samplerate>>>24&255,v[13]=d.samplerate>>>16&255,v[14]=d.samplerate>>>8&255,v[15]=d.samplerate&255),o(K.mdhd,v)},V=function(d){return o(K.mdia,R(d),O(d.type),g(d))},f=function(d){return o(K.mfhd,new Uint8Array([0,0,0,0,(d&4278190080)>>24,(d&16711680)>>16,(d&65280)>>8,d&255]))},g=function(d){return o(K.minf,d.type==="video"?o(K.vmhd,he):o(K.smhd,ve),l(),U(d))},C=function(d,v){for(var b=[],_=v.length;_--;)b[_]=P(v[_]);return o.apply(null,[K.moof,f(d)].concat(b))},p=function(d){for(var v=d.length,b=[];v--;)b[v]=N(d[v]);return o.apply(null,[K.moov,A(4294967295)].concat(b).concat(T(d)))},T=function(d){for(var v=d.length,b=[];v--;)b[v]=Y(d[v]);return o.apply(null,[K.mvex].concat(b))},A=function(d){var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(d&4278190080)>>24,(d&16711680)>>16,(d&65280)>>8,d&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return o(K.mvhd,v)},M=function(d){var v=d.samples||[],b=new Uint8Array(4+v.length),_,k;for(k=0;k<v.length;k++)_=v[k].flags,b[k+4]=_.dependsOn<<4|_.isDependedOn<<2|_.hasRedundancy;return o(K.sdtp,b)},U=function(d){return o(K.stbl,E(d),o(K.stts,Je),o(K.stsc,Me),o(K.stsz,Ne),o(K.stco,De))},(function(){var d,v;E=function(b){return o(K.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),b.type==="video"?d(b):v(b))},d=function(b){var _=b.sps||[],k=b.pps||[],I=[],z=[],W,Q;for(W=0;W<_.length;W++)I.push((_[W].byteLength&65280)>>>8),I.push(_[W].byteLength&255),I=I.concat(Array.prototype.slice.call(_[W]));for(W=0;W<k.length;W++)z.push((k[W].byteLength&65280)>>>8),z.push(k[W].byteLength&255),z=z.concat(Array.prototype.slice.call(k[W]));if(Q=[K.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(b.width&65280)>>8,b.width&255,(b.height&65280)>>8,b.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o(K.avcC,new Uint8Array([1,b.profileIdc,b.profileCompatibility,b.levelIdc,255].concat([_.length],I,[k.length],z))),o(K.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],b.sarRatio){var J=b.sarRatio[0],oe=b.sarRatio[1];Q.push(o(K.pasp,new Uint8Array([(J&4278190080)>>24,(J&16711680)>>16,(J&65280)>>8,J&255,(oe&4278190080)>>24,(oe&16711680)>>16,(oe&65280)>>8,oe&255])))}return o.apply(null,Q)},v=function(b){return o(K.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(b.channelcount&65280)>>8,b.channelcount&255,(b.samplesize&65280)>>8,b.samplesize&255,0,0,0,0,(b.samplerate&65280)>>8,b.samplerate&255,0,0]),u(b))}})(),F=function(d){var v=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,0,(d.duration&4278190080)>>24,(d.duration&16711680)>>16,(d.duration&65280)>>8,d.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(d.width&65280)>>8,d.width&255,0,0,(d.height&65280)>>8,d.height&255,0,0]);return o(K.tkhd,v)},P=function(d){var v,b,_,k,I,z,W;return v=o(K.tfhd,new Uint8Array([0,0,0,58,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),z=Math.floor(d.baseMediaDecodeTime/a),W=Math.floor(d.baseMediaDecodeTime%a),b=o(K.tfdt,new Uint8Array([1,0,0,0,z>>>24&255,z>>>16&255,z>>>8&255,z&255,W>>>24&255,W>>>16&255,W>>>8&255,W&255])),I=92,d.type==="audio"?(_=G(d,I),o(K.traf,v,b,_)):(k=M(d),_=G(d,k.length+I),o(K.traf,v,b,_,k))},N=function(d){return d.duration=d.duration||4294967295,o(K.trak,F(d),V(d))},Y=function(d){var v=new Uint8Array([0,0,0,0,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return d.type!=="video"&&(v[v.length-1]=0),o(K.trex,v)},(function(){var d,v,b;b=function(_,k){var I=0,z=0,W=0,Q=0;return _.length&&(_[0].duration!==void 0&&(I=1),_[0].size!==void 0&&(z=2),_[0].flags!==void 0&&(W=4),_[0].compositionTimeOffset!==void 0&&(Q=8)),[0,0,I|z|W|Q,1,(_.length&4278190080)>>>24,(_.length&16711680)>>>16,(_.length&65280)>>>8,_.length&255,(k&4278190080)>>>24,(k&16711680)>>>16,(k&65280)>>>8,k&255]},v=function(_,k){var I,z,W,Q,J,oe;for(Q=_.samples||[],k+=20+16*Q.length,W=b(Q,k),z=new Uint8Array(W.length+Q.length*16),z.set(W),I=W.length,oe=0;oe<Q.length;oe++)J=Q[oe],z[I++]=(J.duration&4278190080)>>>24,z[I++]=(J.duration&16711680)>>>16,z[I++]=(J.duration&65280)>>>8,z[I++]=J.duration&255,z[I++]=(J.size&4278190080)>>>24,z[I++]=(J.size&16711680)>>>16,z[I++]=(J.size&65280)>>>8,z[I++]=J.size&255,z[I++]=J.flags.isLeading<<2|J.flags.dependsOn,z[I++]=J.flags.isDependedOn<<6|J.flags.hasRedundancy<<4|J.flags.paddingValue<<1|J.flags.isNonSyncSample,z[I++]=J.flags.degradationPriority&61440,z[I++]=J.flags.degradationPriority&15,z[I++]=(J.compositionTimeOffset&4278190080)>>>24,z[I++]=(J.compositionTimeOffset&16711680)>>>16,z[I++]=(J.compositionTimeOffset&65280)>>>8,z[I++]=J.compositionTimeOffset&255;return o(K.trun,z)},d=function(_,k){var I,z,W,Q,J,oe;for(Q=_.samples||[],k+=20+8*Q.length,W=b(Q,k),I=new Uint8Array(W.length+Q.length*8),I.set(W),z=W.length,oe=0;oe<Q.length;oe++)J=Q[oe],I[z++]=(J.duration&4278190080)>>>24,I[z++]=(J.duration&16711680)>>>16,I[z++]=(J.duration&65280)>>>8,I[z++]=J.duration&255,I[z++]=(J.size&4278190080)>>>24,I[z++]=(J.size&16711680)>>>16,I[z++]=(J.size&65280)>>>8,I[z++]=J.size&255;return o(K.trun,I)},G=function(_,k){return _.type==="audio"?d(_,k):v(_,k)}})();var Re={ftyp:c,mdat:h,moof:C,moov:p,initSegment:function(d){var v=c(),b=p(d),_;return _=new Uint8Array(v.byteLength+b.byteLength),_.set(v),_.set(b,v.byteLength),_}},Oe=function(d){var v,b,_=[],k=[];for(k.byteLength=0,k.nalCount=0,k.duration=0,_.byteLength=0,v=0;v<d.length;v++)b=d[v],b.nalUnitType==="access_unit_delimiter_rbsp"?(_.length&&(_.duration=b.dts-_.dts,k.byteLength+=_.byteLength,k.nalCount+=_.length,k.duration+=_.duration,k.push(_)),_=[b],_.byteLength=b.data.byteLength,_.pts=b.pts,_.dts=b.dts):(b.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(_.keyFrame=!0),_.duration=b.dts-_.dts,_.byteLength+=b.data.byteLength,_.push(b));return k.length&&(!_.duration||_.duration<=0)&&(_.duration=k[k.length-1].duration),k.byteLength+=_.byteLength,k.nalCount+=_.length,k.duration+=_.duration,k.push(_),k},He=function(d){var v,b,_=[],k=[];for(_.byteLength=0,_.nalCount=0,_.duration=0,_.pts=d[0].pts,_.dts=d[0].dts,k.byteLength=0,k.nalCount=0,k.duration=0,k.pts=d[0].pts,k.dts=d[0].dts,v=0;v<d.length;v++)b=d[v],b.keyFrame?(_.length&&(k.push(_),k.byteLength+=_.byteLength,k.nalCount+=_.nalCount,k.duration+=_.duration),_=[b],_.nalCount=b.length,_.byteLength=b.byteLength,_.pts=b.pts,_.dts=b.dts,_.duration=b.duration):(_.duration+=b.duration,_.nalCount+=b.length,_.byteLength+=b.byteLength,_.push(b));return k.length&&_.duration<=0&&(_.duration=k[k.length-1].duration),k.byteLength+=_.byteLength,k.nalCount+=_.nalCount,k.duration+=_.duration,k.push(_),k},ot=function(d){var v;return!d[0][0].keyFrame&&d.length>1&&(v=d.shift(),d.byteLength-=v.byteLength,d.nalCount-=v.nalCount,d[0][0].dts=v.dts,d[0][0].pts=v.pts,d[0][0].duration+=v.duration),d},wt=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Lt=function(d,v){var b=wt();return b.dataOffset=v,b.compositionTimeOffset=d.pts-d.dts,b.duration=d.duration,b.size=4*d.length,b.size+=d.byteLength,d.keyFrame&&(b.flags.dependsOn=2,b.flags.isNonSyncSample=0),b},Oi=function(d,v){var b,_,k,I,z,W=v||0,Q=[];for(b=0;b<d.length;b++)for(I=d[b],_=0;_<I.length;_++)z=I[_],k=Lt(z,W),W+=k.size,Q.push(k);return Q},Ft=function(d){var v,b,_,k,I,z,W=0,Q=d.byteLength,J=d.nalCount,oe=Q+4*J,me=new Uint8Array(oe),xe=new DataView(me.buffer);for(v=0;v<d.length;v++)for(k=d[v],b=0;b<k.length;b++)for(I=k[b],_=0;_<I.length;_++)z=I[_],xe.setUint32(W,z.data.byteLength),W+=4,me.set(z.data,W),W+=z.data.byteLength;return me},zi=function(d,v){var b,_=v||0,k=[];return b=Lt(d,_),k.push(b),k},Te=function(d){var v,b,_=0,k=d.byteLength,I=d.length,z=k+4*I,W=new Uint8Array(z),Q=new DataView(W.buffer);for(v=0;v<d.length;v++)b=d[v],Q.setUint32(_,b.data.byteLength),_+=4,W.set(b.data,_),_+=b.data.byteLength;return W},ke={groupNalsIntoFrames:Oe,groupFramesIntoGops:He,extendFirstKeyFrame:ot,generateSampleTable:Oi,concatenateNalData:Ft,generateSampleTableForFrame:zi,concatenateNalDataForFrame:Te},Fe=[33,16,5,32,164,27],Be=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Ke=function(d){for(var v=[];d--;)v.push(0);return v},nt=function(d){return Object.keys(d).reduce(function(v,b){return v[b]=new Uint8Array(d[b].reduce(function(_,k){return _.concat(k)},[])),v},{})},ht,sr=function(){if(!ht){var d={96e3:[Fe,[227,64],Ke(154),[56]],88200:[Fe,[231],Ke(170),[56]],64e3:[Fe,[248,192],Ke(240),[56]],48e3:[Fe,[255,192],Ke(268),[55,148,128],Ke(54),[112]],44100:[Fe,[255,192],Ke(268),[55,163,128],Ke(84),[112]],32e3:[Fe,[255,192],Ke(268),[55,234],Ke(226),[112]],24e3:[Fe,[255,192],Ke(268),[55,255,128],Ke(268),[111,112],Ke(126),[224]],16e3:[Fe,[255,192],Ke(268),[55,255,128],Ke(268),[111,255],Ke(269),[223,108],Ke(195),[1,192]],12e3:[Be,Ke(268),[3,127,248],Ke(268),[6,255,240],Ke(268),[13,255,224],Ke(268),[27,253,128],Ke(259),[56]],11025:[Be,Ke(268),[3,127,248],Ke(268),[6,255,240],Ke(268),[13,255,224],Ke(268),[27,255,192],Ke(268),[55,175,128],Ke(108),[112]],8e3:[Be,Ke(268),[3,121,16],Ke(47),[7]]};ht=nt(d)}return ht},Wi=9e4,yr,ar,or,_r,Ln,On,tt;yr=function(d){return d*Wi},ar=function(d,v){return d*v},or=function(d){return d/Wi},_r=function(d,v){return d/v},Ln=function(d,v){return yr(_r(d,v))},On=function(d,v){return ar(or(d),v)},tt=function(d,v,b){return or(b?d:d-v)};var st={ONE_SECOND_IN_TS:Wi,secondsToVideoTs:yr,secondsToAudioTs:ar,videoTsToSeconds:or,audioTsToSeconds:_r,audioTsToVideoTs:Ln,videoTsToAudioTs:On,metadataTsToSeconds:tt},cs=sr,on=st,la=function(d){var v,b,_=0;for(v=0;v<d.length;v++)b=d[v],_+=b.data.byteLength;return _},ua=function(d,v,b,_){var k,I=0,z=0,W=0,Q=0,J,oe,me;if(v.length&&(k=on.audioTsToVideoTs(d.baseMediaDecodeTime,d.samplerate),I=Math.ceil(on.ONE_SECOND_IN_TS/(d.samplerate/1024)),b&&_&&(z=k-Math.max(b,_),W=Math.floor(z/I),Q=W*I),!(W<1||Q>on.ONE_SECOND_IN_TS/2))){for(J=cs()[d.samplerate],J||(J=v[0].data),oe=0;oe<W;oe++)me=v[0],v.splice(0,0,{data:J,dts:me.dts-I,pts:me.pts-I});return d.baseMediaDecodeTime-=Math.floor(on.videoTsToAudioTs(Q,d.samplerate)),Q}},Mr=function(d,v,b){return v.minSegmentDts>=b?d:(v.minSegmentDts=1/0,d.filter(function(_){return _.dts>=b?(v.minSegmentDts=Math.min(v.minSegmentDts,_.dts),v.minSegmentPts=v.minSegmentDts,!0):!1}))},Rr=function(d){var v,b,_=[];for(v=0;v<d.length;v++)b=d[v],_.push({size:b.data.byteLength,duration:1024});return _},ca=function(d){var v,b,_=0,k=new Uint8Array(la(d));for(v=0;v<d.length;v++)b=d[v],k.set(b.data,_),_+=b.data.byteLength;return k},hs={prefixWithSilence:ua,trimAdtsFramesByEarliestDts:Mr,generateSampleTable:Rr,concatenateFrameData:ca},ha=st.ONE_SECOND_IN_TS,j=function(d,v){typeof v.pts=="number"&&(d.timelineStartInfo.pts===void 0&&(d.timelineStartInfo.pts=v.pts),d.minSegmentPts===void 0?d.minSegmentPts=v.pts:d.minSegmentPts=Math.min(d.minSegmentPts,v.pts),d.maxSegmentPts===void 0?d.maxSegmentPts=v.pts:d.maxSegmentPts=Math.max(d.maxSegmentPts,v.pts)),typeof v.dts=="number"&&(d.timelineStartInfo.dts===void 0&&(d.timelineStartInfo.dts=v.dts),d.minSegmentDts===void 0?d.minSegmentDts=v.dts:d.minSegmentDts=Math.min(d.minSegmentDts,v.dts),d.maxSegmentDts===void 0?d.maxSegmentDts=v.dts:d.maxSegmentDts=Math.max(d.maxSegmentDts,v.dts))},H=function(d){delete d.minSegmentDts,delete d.maxSegmentDts,delete d.minSegmentPts,delete d.maxSegmentPts},ee=function(d,v){var b,_,k=d.minSegmentDts;return v||(k-=d.timelineStartInfo.dts),b=d.timelineStartInfo.baseMediaDecodeTime,b+=k,b=Math.max(0,b),d.type==="audio"&&(_=d.samplerate/ha,b*=_,b=Math.floor(b)),b},fe={clearDtsInfo:H,calculateTrackBaseMediaDecodeTime:ee,collectDtsInfo:j},Ce=4,Ve=128,dt=function(d){for(var v=0,b={payloadType:-1,payloadSize:0},_=0,k=0;v<d.byteLength&&d[v]!==Ve;){for(;d[v]===255;)_+=255,v++;for(_+=d[v++];d[v]===255;)k+=255,v++;if(k+=d[v++],!b.payload&&_===Ce){var I=String.fromCharCode(d[v+3],d[v+4],d[v+5],d[v+6]);if(I==="GA94"){b.payloadType=_,b.payloadSize=k,b.payload=d.subarray(v,v+k);break}else b.payload=void 0}v+=k,_=0,k=0}return b},Ut=function(d){return d.payload[0]!==181||(d.payload[1]<<8|d.payload[2])!==49||String.fromCharCode(d.payload[3],d.payload[4],d.payload[5],d.payload[6])!=="GA94"||d.payload[7]!==3?null:d.payload.subarray(8,d.payload.length-1)},yt=function(d,v){var b=[],_,k,I,z;if(!(v[0]&64))return b;for(k=v[0]&31,_=0;_<k;_++)I=_*3,z={type:v[I+2]&3,pts:d},v[I+2]&4&&(z.ccData=v[I+3]<<8|v[I+4],b.push(z));return b},lr=function(d){for(var v=d.byteLength,b=[],_=1,k,I;_<v-2;)d[_]===0&&d[_+1]===0&&d[_+2]===3?(b.push(_+2),_+=2):_++;if(b.length===0)return d;k=v-b.length,I=new Uint8Array(k);var z=0;for(_=0;_<k;z++,_++)z===b[0]&&(z++,b.shift()),I[_]=d[z];return I},Mi={parseSei:dt,parseUserData:Ut,parseCaptionPackets:yt,discardEmulationPreventionBytes:lr,USER_DATA_REGISTERED_ITU_T_T35:Ce},di=t,$t=Mi,_t=function(d){d=d||{},_t.prototype.init.call(this),this.parse708captions_=typeof d.parse708captions=="boolean"?d.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new Tt(0,0),new Tt(0,1),new Tt(1,0),new Tt(1,1)],this.parse708captions_&&(this.cc708Stream_=new Xe({captionServices:d.captionServices})),this.reset(),this.ccStreams_.forEach(function(v){v.on("data",this.trigger.bind(this,"data")),v.on("partialdone",this.trigger.bind(this,"partialdone")),v.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};_t.prototype=new di,_t.prototype.push=function(d){var v,b,_;if(d.nalUnitType==="sei_rbsp"&&(v=$t.parseSei(d.escapedRBSP),!!v.payload&&v.payloadType===$t.USER_DATA_REGISTERED_ITU_T_T35&&(b=$t.parseUserData(v),!!b))){if(d.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(d.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}_=$t.parseCaptionPackets(d.pts,b),this.captionPackets_=this.captionPackets_.concat(_),this.latestDts_!==d.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=d.dts}},_t.prototype.flushCCStreams=function(d){this.ccStreams_.forEach(function(v){return d==="flush"?v.flush():v.partialFlush()},this)},_t.prototype.flushStream=function(d){if(!this.captionPackets_.length){this.flushCCStreams(d);return}this.captionPackets_.forEach(function(v,b){v.presortIndex=b}),this.captionPackets_.sort(function(v,b){return v.pts===b.pts?v.presortIndex-b.presortIndex:v.pts-b.pts}),this.captionPackets_.forEach(function(v){v.type<2?this.dispatchCea608Packet(v):this.dispatchCea708Packet(v)},this),this.captionPackets_.length=0,this.flushCCStreams(d)},_t.prototype.flush=function(){return this.flushStream("flush")},_t.prototype.partialFlush=function(){return this.flushStream("partialFlush")},_t.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(d){d.reset()})},_t.prototype.dispatchCea608Packet=function(d){this.setsTextOrXDSActive(d)?this.activeCea608Channel_[d.type]=null:this.setsChannel1Active(d)?this.activeCea608Channel_[d.type]=0:this.setsChannel2Active(d)&&(this.activeCea608Channel_[d.type]=1),this.activeCea608Channel_[d.type]!==null&&this.ccStreams_[(d.type<<1)+this.activeCea608Channel_[d.type]].push(d)},_t.prototype.setsChannel1Active=function(d){return(d.ccData&30720)===4096},_t.prototype.setsChannel2Active=function(d){return(d.ccData&30720)===6144},_t.prototype.setsTextOrXDSActive=function(d){return(d.ccData&28928)===256||(d.ccData&30974)===4138||(d.ccData&30974)===6186},_t.prototype.dispatchCea708Packet=function(d){this.parse708captions_&&this.cc708Stream_.push(d)};var Ze={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},Tr=function(d){var v=Ze[d]||d;return d&4096&&d===v?"":String.fromCharCode(v)},Ti=function(d){return 32<=d&&d<=127||160<=d&&d<=255},lt=function(d){this.windowNum=d,this.reset()};lt.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},lt.prototype.getText=function(){return this.rows.join(`
|
|
202
|
-
`)},lt.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},lt.prototype.newLine=function(d){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(d),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},lt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},lt.prototype.addText=function(d){this.rows[this.rowIdx]+=d},lt.prototype.backspace=function(){if(!this.isEmpty()){var d=this.rows[this.rowIdx];this.rows[this.rowIdx]=d.substr(0,d.length-1)}};var ln=function(d,v,b){this.serviceNum=d,this.text="",this.currentWindow=new lt(-1),this.windows=[],this.stream=b,typeof v=="string"&&this.createTextDecoder(v)};ln.prototype.init=function(d,v){this.startPts=d;for(var b=0;b<8;b++)this.windows[b]=new lt(b),typeof v=="function"&&(this.windows[b].beforeRowOverflow=v)},ln.prototype.setCurrentWindow=function(d){this.currentWindow=this.windows[d]},ln.prototype.createTextDecoder=function(d){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(d)}catch(v){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+d+" encoding. "+v})}};var Xe=function(d){d=d||{},Xe.prototype.init.call(this);var v=this,b=d.captionServices||{},_={},k;Object.keys(b).forEach(I=>{k=b[I],/^SERVICE/.test(I)&&(_[I]=k.encoding)}),this.serviceEncodings=_,this.current708Packet=null,this.services={},this.push=function(I){I.type===3?(v.new708Packet(),v.add708Bytes(I)):(v.current708Packet===null&&v.new708Packet(),v.add708Bytes(I))}};Xe.prototype=new di,Xe.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Xe.prototype.add708Bytes=function(d){var v=d.ccData,b=v>>>8,_=v&255;this.current708Packet.ptsVals.push(d.pts),this.current708Packet.data.push(b),this.current708Packet.data.push(_)},Xe.prototype.push708Packet=function(){var d=this.current708Packet,v=d.data,b=null,_=null,k=0,I=v[k++];for(d.seq=I>>6,d.sizeCode=I&63;k<v.length;k++)I=v[k++],b=I>>5,_=I&31,b===7&&_>0&&(I=v[k++],b=I),this.pushServiceBlock(b,k,_),_>0&&(k+=_-1)},Xe.prototype.pushServiceBlock=function(d,v,b){var _,k=v,I=this.current708Packet.data,z=this.services[d];for(z||(z=this.initService(d,k));k<v+b&&k<I.length;k++)_=I[k],Ti(_)?k=this.handleText(k,z):_===24?k=this.multiByteCharacter(k,z):_===16?k=this.extendedCommands(k,z):128<=_&&_<=135?k=this.setCurrentWindow(k,z):152<=_&&_<=159?k=this.defineWindow(k,z):_===136?k=this.clearWindows(k,z):_===140?k=this.deleteWindows(k,z):_===137?k=this.displayWindows(k,z):_===138?k=this.hideWindows(k,z):_===139?k=this.toggleWindows(k,z):_===151?k=this.setWindowAttributes(k,z):_===144?k=this.setPenAttributes(k,z):_===145?k=this.setPenColor(k,z):_===146?k=this.setPenLocation(k,z):_===143?z=this.reset(k,z):_===8?z.currentWindow.backspace():_===12?z.currentWindow.clearText():_===13?z.currentWindow.pendingNewLine=!0:_===14?z.currentWindow.clearText():_===141&&k++},Xe.prototype.extendedCommands=function(d,v){var b=this.current708Packet.data,_=b[++d];return Ti(_)&&(d=this.handleText(d,v,{isExtended:!0})),d},Xe.prototype.getPts=function(d){return this.current708Packet.ptsVals[Math.floor(d/2)]},Xe.prototype.initService=function(d,v){var _="SERVICE"+d,b=this,_,k;return _ in this.serviceEncodings&&(k=this.serviceEncodings[_]),this.services[d]=new ln(d,k,b),this.services[d].init(this.getPts(v),function(I){b.flushDisplayed(I,b.services[d])}),this.services[d]},Xe.prototype.handleText=function(d,v,b){var _=b&&b.isExtended,k=b&&b.isMultiByte,I=this.current708Packet.data,z=_?4096:0,W=I[d],Q=I[d+1],J=v.currentWindow,oe,me;function xe(ye){return ye.map(Ue=>("0"+(Ue&255).toString(16)).slice(-2)).join("")}if(k?(me=[W,Q],d++):me=[W],v.textDecoder_&&!_)oe=v.textDecoder_.decode(new Uint8Array(me));else if(k){const ye=xe(me);oe=String.fromCharCode(parseInt(ye,16))}else oe=Tr(z|W);return J.pendingNewLine&&!J.isEmpty()&&J.newLine(this.getPts(d)),J.pendingNewLine=!1,J.addText(oe),d},Xe.prototype.multiByteCharacter=function(d,v){var b=this.current708Packet.data,_=b[d+1],k=b[d+2];return Ti(_)&&Ti(k)&&(d=this.handleText(++d,v,{isMultiByte:!0})),d},Xe.prototype.setCurrentWindow=function(d,v){var b=this.current708Packet.data,_=b[d],k=_&7;return v.setCurrentWindow(k),d},Xe.prototype.defineWindow=function(d,v){var b=this.current708Packet.data,_=b[d],k=_&7;v.setCurrentWindow(k);var I=v.currentWindow;return _=b[++d],I.visible=(_&32)>>5,I.rowLock=(_&16)>>4,I.columnLock=(_&8)>>3,I.priority=_&7,_=b[++d],I.relativePositioning=(_&128)>>7,I.anchorVertical=_&127,_=b[++d],I.anchorHorizontal=_,_=b[++d],I.anchorPoint=(_&240)>>4,I.rowCount=_&15,_=b[++d],I.columnCount=_&63,_=b[++d],I.windowStyle=(_&56)>>3,I.penStyle=_&7,I.virtualRowCount=I.rowCount+1,d},Xe.prototype.setWindowAttributes=function(d,v){var b=this.current708Packet.data,_=b[d],k=v.currentWindow.winAttr;return _=b[++d],k.fillOpacity=(_&192)>>6,k.fillRed=(_&48)>>4,k.fillGreen=(_&12)>>2,k.fillBlue=_&3,_=b[++d],k.borderType=(_&192)>>6,k.borderRed=(_&48)>>4,k.borderGreen=(_&12)>>2,k.borderBlue=_&3,_=b[++d],k.borderType+=(_&128)>>5,k.wordWrap=(_&64)>>6,k.printDirection=(_&48)>>4,k.scrollDirection=(_&12)>>2,k.justify=_&3,_=b[++d],k.effectSpeed=(_&240)>>4,k.effectDirection=(_&12)>>2,k.displayEffect=_&3,d},Xe.prototype.flushDisplayed=function(d,v){for(var b=[],_=0;_<8;_++)v.windows[_].visible&&!v.windows[_].isEmpty()&&b.push(v.windows[_].getText());v.endPts=d,v.text=b.join(`
|
|
203
|
-
|
|
204
|
-
`),this.pushCaption(v),v.startPts=d},Xe.prototype.pushCaption=function(d){d.text!==""&&(this.trigger("data",{startPts:d.startPts,endPts:d.endPts,text:d.text,stream:"cc708_"+d.serviceNum}),d.text="",d.startPts=d.endPts)},Xe.prototype.displayWindows=function(d,v){var b=this.current708Packet.data,_=b[++d],k=this.getPts(d);this.flushDisplayed(k,v);for(var I=0;I<8;I++)_&1<<I&&(v.windows[I].visible=1);return d},Xe.prototype.hideWindows=function(d,v){var b=this.current708Packet.data,_=b[++d],k=this.getPts(d);this.flushDisplayed(k,v);for(var I=0;I<8;I++)_&1<<I&&(v.windows[I].visible=0);return d},Xe.prototype.toggleWindows=function(d,v){var b=this.current708Packet.data,_=b[++d],k=this.getPts(d);this.flushDisplayed(k,v);for(var I=0;I<8;I++)_&1<<I&&(v.windows[I].visible^=1);return d},Xe.prototype.clearWindows=function(d,v){var b=this.current708Packet.data,_=b[++d],k=this.getPts(d);this.flushDisplayed(k,v);for(var I=0;I<8;I++)_&1<<I&&v.windows[I].clearText();return d},Xe.prototype.deleteWindows=function(d,v){var b=this.current708Packet.data,_=b[++d],k=this.getPts(d);this.flushDisplayed(k,v);for(var I=0;I<8;I++)_&1<<I&&v.windows[I].reset();return d},Xe.prototype.setPenAttributes=function(d,v){var b=this.current708Packet.data,_=b[d],k=v.currentWindow.penAttr;return _=b[++d],k.textTag=(_&240)>>4,k.offset=(_&12)>>2,k.penSize=_&3,_=b[++d],k.italics=(_&128)>>7,k.underline=(_&64)>>6,k.edgeType=(_&56)>>3,k.fontStyle=_&7,d},Xe.prototype.setPenColor=function(d,v){var b=this.current708Packet.data,_=b[d],k=v.currentWindow.penColor;return _=b[++d],k.fgOpacity=(_&192)>>6,k.fgRed=(_&48)>>4,k.fgGreen=(_&12)>>2,k.fgBlue=_&3,_=b[++d],k.bgOpacity=(_&192)>>6,k.bgRed=(_&48)>>4,k.bgGreen=(_&12)>>2,k.bgBlue=_&3,_=b[++d],k.edgeRed=(_&48)>>4,k.edgeGreen=(_&12)>>2,k.edgeBlue=_&3,d},Xe.prototype.setPenLocation=function(d,v){var b=this.current708Packet.data,_=b[d],k=v.currentWindow.penLoc;return v.currentWindow.pendingNewLine=!0,_=b[++d],k.row=_&15,_=b[++d],k.column=_&63,d},Xe.prototype.reset=function(d,v){var b=this.getPts(d);return this.flushDisplayed(b,v),this.initService(v.serviceNum,d)};var mt={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},un=function(d){return d===null?"":(d=mt[d]||d,String.fromCharCode(d))},jt=14,cd=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],cn=function(){for(var d=[],v=jt+1;v--;)d.push({text:"",indent:0,offset:0});return d},Tt=function(d,v){Tt.prototype.init.call(this),this.field_=d||0,this.dataChannel_=v||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(b){var _,k,I,z,W;if(_=b.ccData&32639,_===this.lastControlCode_){this.lastControlCode_=null;return}if((_&61440)===4096?this.lastControlCode_=_:_!==this.PADDING_&&(this.lastControlCode_=null),I=_>>>8,z=_&255,_!==this.PADDING_)if(_===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(_===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(b.pts),this.flushDisplayed(b.pts),k=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=k,this.startPts_=b.pts;else if(_===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(b.pts);else if(_===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(b.pts);else if(_===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(b.pts);else if(_===this.CARRIAGE_RETURN_)this.clearFormatting(b.pts),this.flushDisplayed(b.pts),this.shiftRowsUp_(),this.startPts_=b.pts;else if(_===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(_===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(b.pts),this.displayed_=cn();else if(_===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=cn();else if(_===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(b.pts),this.displayed_=cn()),this.mode_="paintOn",this.startPts_=b.pts;else if(this.isSpecialCharacter(I,z))I=(I&3)<<8,W=un(I|z),this[this.mode_](b.pts,W),this.column_++;else if(this.isExtCharacter(I,z))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),I=(I&3)<<8,W=un(I|z),this[this.mode_](b.pts,W),this.column_++;else if(this.isMidRowCode(I,z))this.clearFormatting(b.pts),this[this.mode_](b.pts," "),this.column_++,(z&14)===14&&this.addFormatting(b.pts,["i"]),(z&1)===1&&this.addFormatting(b.pts,["u"]);else if(this.isOffsetControlCode(I,z)){const J=z&3;this.nonDisplayed_[this.row_].offset=J,this.column_+=J}else if(this.isPAC(I,z)){var Q=cd.indexOf(_&7968);if(this.mode_==="rollUp"&&(Q-this.rollUpRows_+1<0&&(Q=this.rollUpRows_-1),this.setRollUp(b.pts,Q)),Q!==this.row_&&Q>=0&&Q<=14&&(this.clearFormatting(b.pts),this.row_=Q),z&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(b.pts,["u"]),(_&16)===16){const J=(_&14)>>1;this.column_=J*4,this.nonDisplayed_[this.row_].indent+=J}this.isColorPAC(z)&&(z&14)===14&&this.addFormatting(b.pts,["i"])}else this.isNormalChar(I)&&(z===0&&(z=null),W=un(I),W+=un(z),this[this.mode_](b.pts,W),this.column_+=W.length)}};Tt.prototype=new di,Tt.prototype.flushDisplayed=function(d){const v=_=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+_+"."})},b=[];this.displayed_.forEach((_,k)=>{if(_&&_.text&&_.text.length){try{_.text=_.text.trim()}catch{v(k)}_.text.length&&b.push({text:_.text,line:k+1,position:10+Math.min(70,_.indent*10)+_.offset*2.5})}else _==null&&v(k)}),b.length&&this.trigger("data",{startPts:this.startPts_,endPts:d,content:b,stream:this.name_})},Tt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=cn(),this.nonDisplayed_=cn(),this.lastControlCode_=null,this.column_=0,this.row_=jt,this.rollUpRows_=2,this.formatting_=[]},Tt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},Tt.prototype.isSpecialCharacter=function(d,v){return d===this.EXT_&&v>=48&&v<=63},Tt.prototype.isExtCharacter=function(d,v){return(d===this.EXT_+1||d===this.EXT_+2)&&v>=32&&v<=63},Tt.prototype.isMidRowCode=function(d,v){return d===this.EXT_&&v>=32&&v<=47},Tt.prototype.isOffsetControlCode=function(d,v){return d===this.OFFSET_&&v>=33&&v<=35},Tt.prototype.isPAC=function(d,v){return d>=this.BASE_&&d<this.BASE_+8&&v>=64&&v<=127},Tt.prototype.isColorPAC=function(d){return d>=64&&d<=79||d>=96&&d<=127},Tt.prototype.isNormalChar=function(d){return d>=32&&d<=127},Tt.prototype.setRollUp=function(d,v){if(this.mode_!=="rollUp"&&(this.row_=jt,this.mode_="rollUp",this.flushDisplayed(d),this.nonDisplayed_=cn(),this.displayed_=cn()),v!==void 0&&v!==this.row_)for(var b=0;b<this.rollUpRows_;b++)this.displayed_[v-b]=this.displayed_[this.row_-b],this.displayed_[this.row_-b]={text:"",indent:0,offset:0};v===void 0&&(v=this.row_),this.topRow_=v-this.rollUpRows_+1},Tt.prototype.addFormatting=function(d,v){this.formatting_=this.formatting_.concat(v);var b=v.reduce(function(_,k){return _+"<"+k+">"},"");this[this.mode_](d,b)},Tt.prototype.clearFormatting=function(d){if(this.formatting_.length){var v=this.formatting_.reverse().reduce(function(b,_){return b+"</"+_+">"},"");this.formatting_=[],this[this.mode_](d,v)}},Tt.prototype.popOn=function(d,v){var b=this.nonDisplayed_[this.row_].text;b+=v,this.nonDisplayed_[this.row_].text=b},Tt.prototype.rollUp=function(d,v){var b=this.displayed_[this.row_].text;b+=v,this.displayed_[this.row_].text=b},Tt.prototype.shiftRowsUp_=function(){var d;for(d=0;d<this.topRow_;d++)this.displayed_[d]={text:"",indent:0,offset:0};for(d=this.row_+1;d<jt+1;d++)this.displayed_[d]={text:"",indent:0,offset:0};for(d=this.topRow_;d<this.row_;d++)this.displayed_[d]=this.displayed_[d+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},Tt.prototype.paintOn=function(d,v){var b=this.displayed_[this.row_].text;b+=v,this.displayed_[this.row_].text=b};var da={CaptionStream:_t,Cea608Stream:Tt,Cea708Stream:Xe},ds={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},mu=t,gu=8589934592,fa=4294967296,vu="shared",Mn=function(d,v){var b=1;for(d>v&&(b=-1);Math.abs(v-d)>fa;)d+=b*gu;return d},pa=function(d){var v,b;pa.prototype.init.call(this),this.type_=d||vu,this.push=function(_){if(_.type==="metadata"){this.trigger("data",_);return}this.type_!==vu&&_.type!==this.type_||(b===void 0&&(b=_.dts),_.dts=Mn(_.dts,b),_.pts=Mn(_.pts,b),v=_.dts,this.trigger("data",_))},this.flush=function(){b=v,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){b=void 0,v=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};pa.prototype=new mu;var fs={TimestampRolloverStream:pa,handleRollover:Mn},hd=(d,v,b)=>{if(!d)return-1;for(var _=b;_<d.length;_++)if(d[_]===v)return _;return-1},dd={typedArrayIndexOf:hd},hn=dd.typedArrayIndexOf,Br={Utf8:3},ps=function(d,v,b){var _,k="";for(_=v;_<b;_++)k+="%"+("00"+d[_].toString(16)).slice(-2);return k},ur=function(d,v,b){return decodeURIComponent(ps(d,v,b))},dn=function(d,v,b){return unescape(ps(d,v,b))},Rn=function(d){return d[0]<<21|d[1]<<14|d[2]<<7|d[3]},fn={APIC:function(d){var v=1,b,_,k="-->";d.data[0]===Br.Utf8&&(b=hn(d.data,0,v),!(b<0)&&(d.mimeType=dn(d.data,v,b),v=b+1,d.pictureType=d.data[v],v++,_=hn(d.data,0,v),!(_<0)&&(d.description=ur(d.data,v,_),v=_+1,d.mimeType===k?d.url=dn(d.data,v,d.data.length):d.pictureData=d.data.subarray(v,d.data.length))))},"T*":function(d){d.data[0]===Br.Utf8&&(d.value=ur(d.data,1,d.data.length).replace(/\0*$/,""),d.values=d.value.split("\0"))},TXXX:function(d){var v;d.data[0]===Br.Utf8&&(v=hn(d.data,0,1),v!==-1&&(d.description=ur(d.data,1,v),d.value=ur(d.data,v+1,d.data.length).replace(/\0*$/,""),d.data=d.value))},"W*":function(d){d.url=dn(d.data,0,d.data.length).replace(/\0.*$/,"")},WXXX:function(d){var v;d.data[0]===Br.Utf8&&(v=hn(d.data,0,1),v!==-1&&(d.description=ur(d.data,1,v),d.url=dn(d.data,v+1,d.data.length).replace(/\0.*$/,"")))},PRIV:function(d){var v;for(v=0;v<d.data.length;v++)if(d.data[v]===0){d.owner=dn(d.data,0,v);break}d.privateData=d.data.subarray(v+1),d.data=d.privateData}},br=function(d){var v,b,_=10,k=0,I=[];if(!(d.length<10||d[0]!==73||d[1]!==68||d[2]!==51)){k=Rn(d.subarray(6,10)),k+=10;var z=d[5]&64;z&&(_+=4,_+=Rn(d.subarray(10,14)),k-=Rn(d.subarray(16,20)));do{if(v=Rn(d.subarray(_+4,_+8)),v<1)break;b=String.fromCharCode(d[_],d[_+1],d[_+2],d[_+3]);var W={id:b,data:d.subarray(_+10,_+v+10)};W.key=W.id,fn[W.id]?fn[W.id](W):W.id[0]==="T"?fn["T*"](W):W.id[0]==="W"&&fn["W*"](W),I.push(W),_+=10,_+=v}while(_<k);return I}},yu={parseId3Frames:br,parseSyncSafeInteger:Rn,frameParsers:fn},ma=t,_u=ds,Sr=yu,ms;ms=function(d){var v={descriptor:d&&d.descriptor},b=0,_=[],k=0,I;if(ms.prototype.init.call(this),this.dispatchType=_u.METADATA_STREAM_TYPE.toString(16),v.descriptor)for(I=0;I<v.descriptor.length;I++)this.dispatchType+=("00"+v.descriptor[I].toString(16)).slice(-2);this.push=function(z){var W,Q,J,oe,me,xe;if(z.type==="timed-metadata"){if(z.dataAlignmentIndicator&&(k=0,_.length=0),_.length===0&&(z.data.length<10||z.data[0]!==73||z.data[1]!==68||z.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(_.push(z),k+=z.data.byteLength,_.length===1&&(b=Sr.parseSyncSafeInteger(z.data.subarray(6,10)),b+=10),!(k<b)){for(W={data:new Uint8Array(b),frames:[],pts:_[0].pts,dts:_[0].dts},me=0;me<b;)W.data.set(_[0].data.subarray(0,b-me),me),me+=_[0].data.byteLength,k-=_[0].data.byteLength,_.shift();Q=10,W.data[5]&64&&(Q+=4,Q+=Sr.parseSyncSafeInteger(W.data.subarray(10,14)),b-=Sr.parseSyncSafeInteger(W.data.subarray(16,20)));do{if(J=Sr.parseSyncSafeInteger(W.data.subarray(Q+4,Q+8)),J<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(xe=String.fromCharCode(W.data[Q],W.data[Q+1],W.data[Q+2],W.data[Q+3]),oe={id:xe,data:W.data.subarray(Q+10,Q+J+10)},oe.key=oe.id,Sr.frameParsers[oe.id]?Sr.frameParsers[oe.id](oe):oe.id[0]==="T"?Sr.frameParsers["T*"](oe):oe.id[0]==="W"&&Sr.frameParsers["W*"](oe),oe.owner==="com.apple.streaming.transportStreamTimestamp"){var ye=oe.data,Ue=(ye[3]&1)<<30|ye[4]<<22|ye[5]<<14|ye[6]<<6|ye[7]>>>2;Ue*=4,Ue+=ye[7]&3,oe.timeStamp=Ue,W.pts===void 0&&W.dts===void 0&&(W.pts=oe.timeStamp,W.dts=oe.timeStamp),this.trigger("timestamp",oe)}W.frames.push(oe),Q+=10,Q+=J}while(Q<b);this.trigger("data",W)}}}},ms.prototype=new ma;var fd=ms,Bn=t,Fn=da,Ri=ds,pd=fs.TimestampRolloverStream,ga,Un,va,$n=188,ya=71;ga=function(){var d=new Uint8Array($n),v=0;ga.prototype.init.call(this),this.push=function(b){var _=0,k=$n,I;for(v?(I=new Uint8Array(b.byteLength+v),I.set(d.subarray(0,v)),I.set(b,v),v=0):I=b;k<I.byteLength;){if(I[_]===ya&&I[k]===ya){this.trigger("data",I.subarray(_,k)),_+=$n,k+=$n;continue}_++,k++}_<I.byteLength&&(d.set(I.subarray(_),0),v=I.byteLength-_)},this.flush=function(){v===$n&&d[0]===ya&&(this.trigger("data",d),v=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){v=0,this.trigger("reset")}},ga.prototype=new Bn,Un=function(){var d,v,b,_;Un.prototype.init.call(this),_=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,d=function(k,I){var z=0;I.payloadUnitStartIndicator&&(z+=k[z]+1),I.type==="pat"?v(k.subarray(z),I):b(k.subarray(z),I)},v=function(k,I){I.section_number=k[7],I.last_section_number=k[8],_.pmtPid=(k[10]&31)<<8|k[11],I.pmtPid=_.pmtPid},b=function(k,I){var z,W,Q,J;if(k[5]&1){for(_.programMapTable={video:null,audio:null,"timed-metadata":{}},z=(k[1]&15)<<8|k[2],W=3+z-4,Q=(k[10]&15)<<8|k[11],J=12+Q;J<W;){var oe=k[J],me=(k[J+1]&31)<<8|k[J+2];oe===Ri.H264_STREAM_TYPE&&_.programMapTable.video===null?_.programMapTable.video=me:oe===Ri.ADTS_STREAM_TYPE&&_.programMapTable.audio===null?_.programMapTable.audio=me:oe===Ri.METADATA_STREAM_TYPE&&(_.programMapTable["timed-metadata"][me]=oe),J+=((k[J+3]&15)<<8|k[J+4])+5}I.programMapTable=_.programMapTable}},this.push=function(k){var I={},z=4;if(I.payloadUnitStartIndicator=!!(k[1]&64),I.pid=k[1]&31,I.pid<<=8,I.pid|=k[2],(k[3]&48)>>>4>1&&(z+=k[z]+1),I.pid===0)I.type="pat",d(k.subarray(z),I),this.trigger("data",I);else if(I.pid===this.pmtPid)for(I.type="pmt",d(k.subarray(z),I),this.trigger("data",I);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([k,z,I]):this.processPes_(k,z,I)},this.processPes_=function(k,I,z){z.pid===this.programMapTable.video?z.streamType=Ri.H264_STREAM_TYPE:z.pid===this.programMapTable.audio?z.streamType=Ri.ADTS_STREAM_TYPE:z.streamType=this.programMapTable["timed-metadata"][z.pid],z.type="pes",z.data=k.subarray(I),this.trigger("data",z)}},Un.prototype=new Bn,Un.STREAM_TYPES={h264:27,adts:15},va=function(){var d=this,v=!1,b={data:[],size:0},_={data:[],size:0},k={data:[],size:0},I,z=function(Q,J){var oe;const me=Q[0]<<16|Q[1]<<8|Q[2];J.data=new Uint8Array,me===1&&(J.packetLength=6+(Q[4]<<8|Q[5]),J.dataAlignmentIndicator=(Q[6]&4)!==0,oe=Q[7],oe&192&&(J.pts=(Q[9]&14)<<27|(Q[10]&255)<<20|(Q[11]&254)<<12|(Q[12]&255)<<5|(Q[13]&254)>>>3,J.pts*=4,J.pts+=(Q[13]&6)>>>1,J.dts=J.pts,oe&64&&(J.dts=(Q[14]&14)<<27|(Q[15]&255)<<20|(Q[16]&254)<<12|(Q[17]&255)<<5|(Q[18]&254)>>>3,J.dts*=4,J.dts+=(Q[18]&6)>>>1)),J.data=Q.subarray(9+Q[8]))},W=function(Q,J,oe){var me=new Uint8Array(Q.size),xe={type:J},ye=0,Ue=0,Ye=!1,ti;if(!(!Q.data.length||Q.size<9)){for(xe.trackId=Q.data[0].pid,ye=0;ye<Q.data.length;ye++)ti=Q.data[ye],me.set(ti.data,Ue),Ue+=ti.data.byteLength;z(me,xe),Ye=J==="video"||xe.packetLength<=Q.size,(oe||Ye)&&(Q.size=0,Q.data.length=0),Ye&&d.trigger("data",xe)}};va.prototype.init.call(this),this.push=function(Q){({pat:function(){},pes:function(){var J,oe;switch(Q.streamType){case Ri.H264_STREAM_TYPE:J=b,oe="video";break;case Ri.ADTS_STREAM_TYPE:J=_,oe="audio";break;case Ri.METADATA_STREAM_TYPE:J=k,oe="timed-metadata";break;default:return}Q.payloadUnitStartIndicator&&W(J,oe,!0),J.data.push(Q),J.size+=Q.data.byteLength},pmt:function(){var J={type:"metadata",tracks:[]};I=Q.programMapTable,I.video!==null&&J.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+I.video,codec:"avc",type:"video"}),I.audio!==null&&J.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+I.audio,codec:"adts",type:"audio"}),v=!0,d.trigger("data",J)}})[Q.type]()},this.reset=function(){b.size=0,b.data.length=0,_.size=0,_.data.length=0,this.trigger("reset")},this.flushStreams_=function(){W(b,"video"),W(_,"audio"),W(k,"timed-metadata")},this.flush=function(){if(!v&&I){var Q={type:"metadata",tracks:[]};I.video!==null&&Q.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+I.video,codec:"avc",type:"video"}),I.audio!==null&&Q.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+I.audio,codec:"adts",type:"audio"}),d.trigger("data",Q)}v=!1,this.flushStreams_(),this.trigger("done")}},va.prototype=new Bn;var Tu={PAT_PID:0,MP2T_PACKET_LENGTH:$n,TransportPacketStream:ga,TransportParseStream:Un,ElementaryStream:va,TimestampRolloverStream:pd,CaptionStream:Fn.CaptionStream,Cea608Stream:Fn.Cea608Stream,Cea708Stream:Fn.Cea708Stream,MetadataStream:fd};for(var Go in Ri)Ri.hasOwnProperty(Go)&&(Tu[Go]=Ri[Go]);var md=Tu,gd=t,vd=st.ONE_SECOND_IN_TS,_a,gs=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];_a=function(d){var v,b=0;_a.prototype.init.call(this),this.skipWarn_=function(_,k){this.trigger("log",{level:"warn",message:`adts skiping bytes ${_} to ${k} in frame ${b} outside syncword`})},this.push=function(_){var k=0,I,z,W,Q,J;if(d||(b=0),_.type==="audio"){v&&v.length?(W=v,v=new Uint8Array(W.byteLength+_.data.byteLength),v.set(W),v.set(_.data,W.byteLength)):v=_.data;for(var oe;k+7<v.length;){if(v[k]!==255||(v[k+1]&246)!==240){typeof oe!="number"&&(oe=k),k++;continue}if(typeof oe=="number"&&(this.skipWarn_(oe,k),oe=null),z=(~v[k+1]&1)*2,I=(v[k+3]&3)<<11|v[k+4]<<3|(v[k+5]&224)>>5,Q=((v[k+6]&3)+1)*1024,J=Q*vd/gs[(v[k+2]&60)>>>2],v.byteLength-k<I)break;this.trigger("data",{pts:_.pts+b*J,dts:_.dts+b*J,sampleCount:Q,audioobjecttype:(v[k+2]>>>6&3)+1,channelcount:(v[k+2]&1)<<2|(v[k+3]&192)>>>6,samplerate:gs[(v[k+2]&60)>>>2],samplingfrequencyindex:(v[k+2]&60)>>>2,samplesize:16,data:v.subarray(k+7+z,k+I)}),b++,k+=I}typeof oe=="number"&&(this.skipWarn_(oe,k),oe=null),v=v.subarray(k)}},this.flush=function(){b=0,this.trigger("done")},this.reset=function(){v=void 0,this.trigger("reset")},this.endTimeline=function(){v=void 0,this.trigger("endedtimeline")}},_a.prototype=new gd;var Ta=_a,bu;bu=function(d){var v=d.byteLength,b=0,_=0;this.length=function(){return 8*v},this.bitsAvailable=function(){return 8*v+_},this.loadWord=function(){var k=d.byteLength-v,I=new Uint8Array(4),z=Math.min(4,v);if(z===0)throw new Error("no bytes available");I.set(d.subarray(k,k+z)),b=new DataView(I.buffer).getUint32(0),_=z*8,v-=z},this.skipBits=function(k){var I;_>k?(b<<=k,_-=k):(k-=_,I=Math.floor(k/8),k-=I*8,v-=I,this.loadWord(),b<<=k,_-=k)},this.readBits=function(k){var I=Math.min(_,k),z=b>>>32-I;return _-=I,_>0?b<<=I:v>0&&this.loadWord(),I=k-I,I>0?z<<I|this.readBits(I):z},this.skipLeadingZeros=function(){var k;for(k=0;k<_;++k)if((b&2147483648>>>k)!==0)return b<<=k,_-=k,k;return this.loadWord(),k+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var k=this.skipLeadingZeros();return this.readBits(k+1)-1},this.readExpGolomb=function(){var k=this.readUnsignedExpGolomb();return 1&k?1+k>>>1:-1*(k>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var yd=bu,Ko=t,_d=yd,vs,ba,Su;ba=function(){var d=0,v,b;ba.prototype.init.call(this),this.push=function(_){var k;b?(k=new Uint8Array(b.byteLength+_.data.byteLength),k.set(b),k.set(_.data,b.byteLength),b=k):b=_.data;for(var I=b.byteLength;d<I-3;d++)if(b[d+2]===1){v=d+5;break}for(;v<I;)switch(b[v]){case 0:if(b[v-1]!==0){v+=2;break}else if(b[v-2]!==0){v++;break}d+3!==v-2&&this.trigger("data",b.subarray(d+3,v-2));do v++;while(b[v]!==1&&v<I);d=v-2,v+=3;break;case 1:if(b[v-1]!==0||b[v-2]!==0){v+=3;break}this.trigger("data",b.subarray(d+3,v-2)),d=v-2,v+=3;break;default:v+=3;break}b=b.subarray(d),v-=d,d=0},this.reset=function(){b=null,d=0,this.trigger("reset")},this.flush=function(){b&&b.byteLength>3&&this.trigger("data",b.subarray(d+3)),b=null,d=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},ba.prototype=new Ko,Su={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},vs=function(){var d=new ba,v,b,_,k,I,z,W;vs.prototype.init.call(this),v=this,this.push=function(Q){Q.type==="video"&&(b=Q.trackId,_=Q.pts,k=Q.dts,d.push(Q))},d.on("data",function(Q){var J={trackId:b,pts:_,dts:k,data:Q,nalUnitTypeCode:Q[0]&31};switch(J.nalUnitTypeCode){case 5:J.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:J.nalUnitType="sei_rbsp",J.escapedRBSP=I(Q.subarray(1));break;case 7:J.nalUnitType="seq_parameter_set_rbsp",J.escapedRBSP=I(Q.subarray(1)),J.config=z(J.escapedRBSP);break;case 8:J.nalUnitType="pic_parameter_set_rbsp";break;case 9:J.nalUnitType="access_unit_delimiter_rbsp";break}v.trigger("data",J)}),d.on("done",function(){v.trigger("done")}),d.on("partialdone",function(){v.trigger("partialdone")}),d.on("reset",function(){v.trigger("reset")}),d.on("endedtimeline",function(){v.trigger("endedtimeline")}),this.flush=function(){d.flush()},this.partialFlush=function(){d.partialFlush()},this.reset=function(){d.reset()},this.endTimeline=function(){d.endTimeline()},W=function(Q,J){var oe=8,me=8,xe,ye;for(xe=0;xe<Q;xe++)me!==0&&(ye=J.readExpGolomb(),me=(oe+ye+256)%256),oe=me===0?oe:me},I=function(Q){for(var J=Q.byteLength,oe=[],me=1,xe,ye;me<J-2;)Q[me]===0&&Q[me+1]===0&&Q[me+2]===3?(oe.push(me+2),me+=2):me++;if(oe.length===0)return Q;xe=J-oe.length,ye=new Uint8Array(xe);var Ue=0;for(me=0;me<xe;Ue++,me++)Ue===oe[0]&&(Ue++,oe.shift()),ye[me]=Q[Ue];return ye},z=function(Q){var J=0,oe=0,me=0,xe=0,ye,Ue,Ye,ti,Xi,Kn,il,rl,nl,sl,Vu,xt=[1,1],al,wr;if(ye=new _d(Q),Ue=ye.readUnsignedByte(),ti=ye.readUnsignedByte(),Ye=ye.readUnsignedByte(),ye.skipUnsignedExpGolomb(),Su[Ue]&&(Xi=ye.readUnsignedExpGolomb(),Xi===3&&ye.skipBits(1),ye.skipUnsignedExpGolomb(),ye.skipUnsignedExpGolomb(),ye.skipBits(1),ye.readBoolean()))for(Vu=Xi!==3?8:12,wr=0;wr<Vu;wr++)ye.readBoolean()&&(wr<6?W(16,ye):W(64,ye));if(ye.skipUnsignedExpGolomb(),Kn=ye.readUnsignedExpGolomb(),Kn===0)ye.readUnsignedExpGolomb();else if(Kn===1)for(ye.skipBits(1),ye.skipExpGolomb(),ye.skipExpGolomb(),il=ye.readUnsignedExpGolomb(),wr=0;wr<il;wr++)ye.skipExpGolomb();if(ye.skipUnsignedExpGolomb(),ye.skipBits(1),rl=ye.readUnsignedExpGolomb(),nl=ye.readUnsignedExpGolomb(),sl=ye.readBits(1),sl===0&&ye.skipBits(1),ye.skipBits(1),ye.readBoolean()&&(J=ye.readUnsignedExpGolomb(),oe=ye.readUnsignedExpGolomb(),me=ye.readUnsignedExpGolomb(),xe=ye.readUnsignedExpGolomb()),ye.readBoolean()&&ye.readBoolean()){switch(al=ye.readUnsignedByte(),al){case 1:xt=[1,1];break;case 2:xt=[12,11];break;case 3:xt=[10,11];break;case 4:xt=[16,11];break;case 5:xt=[40,33];break;case 6:xt=[24,11];break;case 7:xt=[20,11];break;case 8:xt=[32,11];break;case 9:xt=[80,33];break;case 10:xt=[18,11];break;case 11:xt=[15,11];break;case 12:xt=[64,33];break;case 13:xt=[160,99];break;case 14:xt=[4,3];break;case 15:xt=[3,2];break;case 16:xt=[2,1];break;case 255:{xt=[ye.readUnsignedByte()<<8|ye.readUnsignedByte(),ye.readUnsignedByte()<<8|ye.readUnsignedByte()];break}}xt&&xt[0]/xt[1]}return{profileIdc:Ue,levelIdc:Ye,profileCompatibility:ti,width:(rl+1)*16-J*2-oe*2,height:(2-sl)*(nl+1)*16-me*2-xe*2,sarRatio:xt}}},vs.prototype=new Ko;var Td={H264Stream:vs},Sa=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],jn=function(d,v){var b=d[v+6]<<21|d[v+7]<<14|d[v+8]<<7|d[v+9],_=d[v+5],k=(_&16)>>4;return b=b>=0?b:0,k?b+20:b+10},ys=function(d,v){return d.length-v<10||d[v]!==73||d[v+1]!==68||d[v+2]!==51?v:(v+=jn(d,v),ys(d,v))},pn=function(d){var v=ys(d,0);return d.length>=v+2&&(d[v]&255)===255&&(d[v+1]&240)===240&&(d[v+1]&22)===16},Cu=function(d){return d[0]<<21|d[1]<<14|d[2]<<7|d[3]},Eu=function(d,v,b){var _,k="";for(_=v;_<b;_++)k+="%"+("00"+d[_].toString(16)).slice(-2);return k},wu=function(d,v,b){return unescape(Eu(d,v,b))},ku=function(d,v){var b=(d[v+5]&224)>>5,_=d[v+4]<<3,k=d[v+3]&6144;return k|_|b},bd=function(d,v){return d[v]===73&&d[v+1]===68&&d[v+2]===51?"timed-metadata":d[v]&!0&&(d[v+1]&240)===240?"audio":null},Sd=function(d){for(var v=0;v+5<d.length;){if(d[v]!==255||(d[v+1]&246)!==240){v++;continue}return Sa[(d[v+2]&60)>>>2]}return null},Cd=function(d){var v,b,_,k;v=10,d[5]&64&&(v+=4,v+=Cu(d.subarray(10,14)));do{if(b=Cu(d.subarray(v+4,v+8)),b<1)return null;if(k=String.fromCharCode(d[v],d[v+1],d[v+2],d[v+3]),k==="PRIV"){_=d.subarray(v+10,v+b+10);for(var I=0;I<_.byteLength;I++)if(_[I]===0){var z=wu(_,0,I);if(z==="com.apple.streaming.transportStreamTimestamp"){var W=_.subarray(I+1),Q=(W[3]&1)<<30|W[4]<<22|W[5]<<14|W[6]<<6|W[7]>>>2;return Q*=4,Q+=W[7]&3,Q}break}}v+=10,v+=b}while(v<d.byteLength);return null},Vn={isLikelyAacData:pn,parseId3TagSize:jn,parseAdtsSize:ku,parseType:bd,parseSampleRate:Sd,parseAacTimestamp:Cd},Ed=t,Fr=Vn,Ca;Ca=function(){var d=new Uint8Array,v=0;Ca.prototype.init.call(this),this.setTimestamp=function(b){v=b},this.push=function(b){var _=0,k=0,I,z,W,Q;for(d.length?(Q=d.length,d=new Uint8Array(b.byteLength+Q),d.set(d.subarray(0,Q)),d.set(b,Q)):d=b;d.length-k>=3;){if(d[k]===73&&d[k+1]===68&&d[k+2]===51){if(d.length-k<10||(_=Fr.parseId3TagSize(d,k),k+_>d.length))break;z={type:"timed-metadata",data:d.subarray(k,k+_)},this.trigger("data",z),k+=_;continue}else if((d[k]&255)===255&&(d[k+1]&240)===240){if(d.length-k<7||(_=Fr.parseAdtsSize(d,k),k+_>d.length))break;W={type:"audio",data:d.subarray(k,k+_),pts:v,dts:v},this.trigger("data",W),k+=_;continue}k++}I=d.length-k,I>0?d=d.subarray(k):d=new Uint8Array},this.reset=function(){d=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){d=new Uint8Array,this.trigger("endedtimeline")}},Ca.prototype=new Ed;var wd=Ca,bt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],kd=bt,xd=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Ad=xd,_s=t,Ts=Re,Hn=ke,Ea=hs,Bi=fe,Cr=md,bs=st,Xo=Ta,Ss=Td.H264Stream,Cs=wd,Id=Vn.isLikelyAacData,Pd=st.ONE_SECOND_IN_TS,xu=kd,Au=Ad,wa,Es,ka,mn,Dd=function(d,v){v.stream=d,this.trigger("log",v)},ws=function(d,v){for(var b=Object.keys(v),_=0;_<b.length;_++){var k=b[_];k==="headOfPipeline"||!v[k].on||v[k].on("log",Dd.bind(d,k))}},qn=function(d,v){var b;if(d.length!==v.length)return!1;for(b=0;b<d.length;b++)if(d[b]!==v[b])return!1;return!0},Iu=function(d,v,b,_,k,I){var z=b-v,W=_-v,Q=k-b;return{start:{dts:d,pts:d+z},end:{dts:d+W,pts:d+Q},prependedContentDuration:I,baseMediaDecodeTime:d}};Es=function(d,v){var b=[],_,k=0,I=0,z=1/0;v=v||{},_=v.firstSequenceNumber||0,Es.prototype.init.call(this),this.push=function(W){Bi.collectDtsInfo(d,W),d&&xu.forEach(function(Q){d[Q]=W[Q]}),b.push(W)},this.setEarliestDts=function(W){k=W},this.setVideoBaseMediaDecodeTime=function(W){z=W},this.setAudioAppendStart=function(W){I=W},this.flush=function(){var W,Q,J,oe,me,xe,ye;if(b.length===0){this.trigger("done","AudioSegmentStream");return}W=Ea.trimAdtsFramesByEarliestDts(b,d,k),d.baseMediaDecodeTime=Bi.calculateTrackBaseMediaDecodeTime(d,v.keepOriginalTimestamps),ye=Ea.prefixWithSilence(d,W,I,z),d.samples=Ea.generateSampleTable(W),J=Ts.mdat(Ea.concatenateFrameData(W)),b=[],Q=Ts.moof(_,[d]),oe=new Uint8Array(Q.byteLength+J.byteLength),_++,oe.set(Q),oe.set(J,Q.byteLength),Bi.clearDtsInfo(d),me=Math.ceil(Pd*1024/d.samplerate),W.length&&(xe=W.length*me,this.trigger("segmentTimingInfo",Iu(bs.audioTsToVideoTs(d.baseMediaDecodeTime,d.samplerate),W[0].dts,W[0].pts,W[0].dts+xe,W[0].pts+xe,ye||0)),this.trigger("timingInfo",{start:W[0].pts,end:W[0].pts+xe})),this.trigger("data",{track:d,boxes:oe}),this.trigger("done","AudioSegmentStream")},this.reset=function(){Bi.clearDtsInfo(d),b=[],this.trigger("reset")}},Es.prototype=new _s,wa=function(d,v){var b,_=[],k=[],I,z;v=v||{},b=v.firstSequenceNumber||0,wa.prototype.init.call(this),delete d.minPTS,this.gopCache_=[],this.push=function(W){Bi.collectDtsInfo(d,W),W.nalUnitType==="seq_parameter_set_rbsp"&&!I&&(I=W.config,d.sps=[W.data],Au.forEach(function(Q){d[Q]=I[Q]},this)),W.nalUnitType==="pic_parameter_set_rbsp"&&!z&&(z=W.data,d.pps=[W.data]),_.push(W)},this.flush=function(){for(var W,Q,J,oe,me,xe,ye=0,Ue,Ye;_.length&&_[0].nalUnitType!=="access_unit_delimiter_rbsp";)_.shift();if(_.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(W=Hn.groupNalsIntoFrames(_),J=Hn.groupFramesIntoGops(W),J[0][0].keyFrame||(Q=this.getGopForFusion_(_[0],d),Q?(ye=Q.duration,J.unshift(Q),J.byteLength+=Q.byteLength,J.nalCount+=Q.nalCount,J.pts=Q.pts,J.dts=Q.dts,J.duration+=Q.duration):J=Hn.extendFirstKeyFrame(J)),k.length){var ti;if(v.alignGopsAtEnd?ti=this.alignGopsAtEnd_(J):ti=this.alignGopsAtStart_(J),!ti){this.gopCache_.unshift({gop:J.pop(),pps:d.pps,sps:d.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),_=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}Bi.clearDtsInfo(d),J=ti}Bi.collectDtsInfo(d,J),d.samples=Hn.generateSampleTable(J),me=Ts.mdat(Hn.concatenateNalData(J)),d.baseMediaDecodeTime=Bi.calculateTrackBaseMediaDecodeTime(d,v.keepOriginalTimestamps),this.trigger("processedGopsInfo",J.map(function(Xi){return{pts:Xi.pts,dts:Xi.dts,byteLength:Xi.byteLength}})),Ue=J[0],Ye=J[J.length-1],this.trigger("segmentTimingInfo",Iu(d.baseMediaDecodeTime,Ue.dts,Ue.pts,Ye.dts+Ye.duration,Ye.pts+Ye.duration,ye)),this.trigger("timingInfo",{start:J[0].pts,end:J[J.length-1].pts+J[J.length-1].duration}),this.gopCache_.unshift({gop:J.pop(),pps:d.pps,sps:d.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),_=[],this.trigger("baseMediaDecodeTime",d.baseMediaDecodeTime),this.trigger("timelineStartInfo",d.timelineStartInfo),oe=Ts.moof(b,[d]),xe=new Uint8Array(oe.byteLength+me.byteLength),b++,xe.set(oe),xe.set(me,oe.byteLength),this.trigger("data",{track:d,boxes:xe}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),_=[],this.gopCache_.length=0,k.length=0,this.trigger("reset")},this.resetStream_=function(){Bi.clearDtsInfo(d),I=void 0,z=void 0},this.getGopForFusion_=function(W){var Q=45e3,J=1/0,oe,me,xe,ye,Ue;for(Ue=0;Ue<this.gopCache_.length;Ue++)ye=this.gopCache_[Ue],xe=ye.gop,!(!(d.pps&&qn(d.pps[0],ye.pps[0]))||!(d.sps&&qn(d.sps[0],ye.sps[0])))&&(xe.dts<d.timelineStartInfo.dts||(oe=W.dts-xe.dts-xe.duration,oe>=-1e4&&oe<=Q&&(!me||J>oe)&&(me=ye,J=oe)));return me?me.gop:null},this.alignGopsAtStart_=function(W){var Q,J,oe,me,xe,ye,Ue,Ye;for(xe=W.byteLength,ye=W.nalCount,Ue=W.duration,Q=J=0;Q<k.length&&J<W.length&&(oe=k[Q],me=W[J],oe.pts!==me.pts);){if(me.pts>oe.pts){Q++;continue}J++,xe-=me.byteLength,ye-=me.nalCount,Ue-=me.duration}return J===0?W:J===W.length?null:(Ye=W.slice(J),Ye.byteLength=xe,Ye.duration=Ue,Ye.nalCount=ye,Ye.pts=Ye[0].pts,Ye.dts=Ye[0].dts,Ye)},this.alignGopsAtEnd_=function(W){var Q,J,oe,me,xe,ye;for(Q=k.length-1,J=W.length-1,xe=null,ye=!1;Q>=0&&J>=0;){if(oe=k[Q],me=W[J],oe.pts===me.pts){ye=!0;break}if(oe.pts>me.pts){Q--;continue}Q===k.length-1&&(xe=J),J--}if(!ye&&xe===null)return null;var Ue;if(ye?Ue=J:Ue=xe,Ue===0)return W;var Ye=W.slice(Ue),ti=Ye.reduce(function(Xi,Kn){return Xi.byteLength+=Kn.byteLength,Xi.duration+=Kn.duration,Xi.nalCount+=Kn.nalCount,Xi},{byteLength:0,duration:0,nalCount:0});return Ye.byteLength=ti.byteLength,Ye.duration=ti.duration,Ye.nalCount=ti.nalCount,Ye.pts=Ye[0].pts,Ye.dts=Ye[0].dts,Ye},this.alignGopsWith=function(W){k=W}},wa.prototype=new _s,mn=function(d,v){this.numberOfTracks=0,this.metadataStream=v,d=d||{},typeof d.remux<"u"?this.remuxTracks=!!d.remux:this.remuxTracks=!0,typeof d.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=d.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,mn.prototype.init.call(this),this.push=function(b){if(b.content||b.text)return this.pendingCaptions.push(b);if(b.frames)return this.pendingMetadata.push(b);this.pendingTracks.push(b.track),this.pendingBytes+=b.boxes.byteLength,b.track.type==="video"&&(this.videoTrack=b.track,this.pendingBoxes.push(b.boxes)),b.track.type==="audio"&&(this.audioTrack=b.track,this.pendingBoxes.unshift(b.boxes))}},mn.prototype=new _s,mn.prototype.flush=function(d){var v=0,b={captions:[],captionStreams:{},metadata:[],info:{}},_,k,I,z=0,W;if(this.pendingTracks.length<this.numberOfTracks){if(d!=="VideoSegmentStream"&&d!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(z=this.videoTrack.timelineStartInfo.pts,Au.forEach(function(Q){b.info[Q]=this.videoTrack[Q]},this)):this.audioTrack&&(z=this.audioTrack.timelineStartInfo.pts,xu.forEach(function(Q){b.info[Q]=this.audioTrack[Q]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?b.type=this.pendingTracks[0].type:b.type="combined",this.emittedTracks+=this.pendingTracks.length,I=Ts.initSegment(this.pendingTracks),b.initSegment=new Uint8Array(I.byteLength),b.initSegment.set(I),b.data=new Uint8Array(this.pendingBytes),W=0;W<this.pendingBoxes.length;W++)b.data.set(this.pendingBoxes[W],v),v+=this.pendingBoxes[W].byteLength;for(W=0;W<this.pendingCaptions.length;W++)_=this.pendingCaptions[W],_.startTime=bs.metadataTsToSeconds(_.startPts,z,this.keepOriginalTimestamps),_.endTime=bs.metadataTsToSeconds(_.endPts,z,this.keepOriginalTimestamps),b.captionStreams[_.stream]=!0,b.captions.push(_);for(W=0;W<this.pendingMetadata.length;W++)k=this.pendingMetadata[W],k.cueTime=bs.metadataTsToSeconds(k.pts,z,this.keepOriginalTimestamps),b.metadata.push(k);for(b.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",b),W=0;W<b.captions.length;W++)_=b.captions[W],this.trigger("caption",_);for(W=0;W<b.metadata.length;W++)k=b.metadata[W],this.trigger("id3Frame",k)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},mn.prototype.setRemux=function(d){this.remuxTracks=d},ka=function(d){var v=this,b=!0,_,k;ka.prototype.init.call(this),d=d||{},this.baseMediaDecodeTime=d.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var I={};this.transmuxPipeline_=I,I.type="aac",I.metadataStream=new Cr.MetadataStream,I.aacStream=new Cs,I.audioTimestampRolloverStream=new Cr.TimestampRolloverStream("audio"),I.timedMetadataTimestampRolloverStream=new Cr.TimestampRolloverStream("timed-metadata"),I.adtsStream=new Xo,I.coalesceStream=new mn(d,I.metadataStream),I.headOfPipeline=I.aacStream,I.aacStream.pipe(I.audioTimestampRolloverStream).pipe(I.adtsStream),I.aacStream.pipe(I.timedMetadataTimestampRolloverStream).pipe(I.metadataStream).pipe(I.coalesceStream),I.metadataStream.on("timestamp",function(z){I.aacStream.setTimestamp(z.timeStamp)}),I.aacStream.on("data",function(z){z.type!=="timed-metadata"&&z.type!=="audio"||I.audioSegmentStream||(k=k||{timelineStartInfo:{baseMediaDecodeTime:v.baseMediaDecodeTime},codec:"adts",type:"audio"},I.coalesceStream.numberOfTracks++,I.audioSegmentStream=new Es(k,d),I.audioSegmentStream.on("log",v.getLogTrigger_("audioSegmentStream")),I.audioSegmentStream.on("timingInfo",v.trigger.bind(v,"audioTimingInfo")),I.adtsStream.pipe(I.audioSegmentStream).pipe(I.coalesceStream),v.trigger("trackinfo",{hasAudio:!!k,hasVideo:!!_}))}),I.coalesceStream.on("data",this.trigger.bind(this,"data")),I.coalesceStream.on("done",this.trigger.bind(this,"done")),ws(this,I)},this.setupTsPipeline=function(){var I={};this.transmuxPipeline_=I,I.type="ts",I.metadataStream=new Cr.MetadataStream,I.packetStream=new Cr.TransportPacketStream,I.parseStream=new Cr.TransportParseStream,I.elementaryStream=new Cr.ElementaryStream,I.timestampRolloverStream=new Cr.TimestampRolloverStream,I.adtsStream=new Xo,I.h264Stream=new Ss,I.captionStream=new Cr.CaptionStream(d),I.coalesceStream=new mn(d,I.metadataStream),I.headOfPipeline=I.packetStream,I.packetStream.pipe(I.parseStream).pipe(I.elementaryStream).pipe(I.timestampRolloverStream),I.timestampRolloverStream.pipe(I.h264Stream),I.timestampRolloverStream.pipe(I.adtsStream),I.timestampRolloverStream.pipe(I.metadataStream).pipe(I.coalesceStream),I.h264Stream.pipe(I.captionStream).pipe(I.coalesceStream),I.elementaryStream.on("data",function(z){var W;if(z.type==="metadata"){for(W=z.tracks.length;W--;)!_&&z.tracks[W].type==="video"?(_=z.tracks[W],_.timelineStartInfo.baseMediaDecodeTime=v.baseMediaDecodeTime):!k&&z.tracks[W].type==="audio"&&(k=z.tracks[W],k.timelineStartInfo.baseMediaDecodeTime=v.baseMediaDecodeTime);_&&!I.videoSegmentStream&&(I.coalesceStream.numberOfTracks++,I.videoSegmentStream=new wa(_,d),I.videoSegmentStream.on("log",v.getLogTrigger_("videoSegmentStream")),I.videoSegmentStream.on("timelineStartInfo",function(Q){k&&!d.keepOriginalTimestamps&&(k.timelineStartInfo=Q,I.audioSegmentStream.setEarliestDts(Q.dts-v.baseMediaDecodeTime))}),I.videoSegmentStream.on("processedGopsInfo",v.trigger.bind(v,"gopInfo")),I.videoSegmentStream.on("segmentTimingInfo",v.trigger.bind(v,"videoSegmentTimingInfo")),I.videoSegmentStream.on("baseMediaDecodeTime",function(Q){k&&I.audioSegmentStream.setVideoBaseMediaDecodeTime(Q)}),I.videoSegmentStream.on("timingInfo",v.trigger.bind(v,"videoTimingInfo")),I.h264Stream.pipe(I.videoSegmentStream).pipe(I.coalesceStream)),k&&!I.audioSegmentStream&&(I.coalesceStream.numberOfTracks++,I.audioSegmentStream=new Es(k,d),I.audioSegmentStream.on("log",v.getLogTrigger_("audioSegmentStream")),I.audioSegmentStream.on("timingInfo",v.trigger.bind(v,"audioTimingInfo")),I.audioSegmentStream.on("segmentTimingInfo",v.trigger.bind(v,"audioSegmentTimingInfo")),I.adtsStream.pipe(I.audioSegmentStream).pipe(I.coalesceStream)),v.trigger("trackinfo",{hasAudio:!!k,hasVideo:!!_})}}),I.coalesceStream.on("data",this.trigger.bind(this,"data")),I.coalesceStream.on("id3Frame",function(z){z.dispatchType=I.metadataStream.dispatchType,v.trigger("id3Frame",z)}),I.coalesceStream.on("caption",this.trigger.bind(this,"caption")),I.coalesceStream.on("done",this.trigger.bind(this,"done")),ws(this,I)},this.setBaseMediaDecodeTime=function(I){var z=this.transmuxPipeline_;d.keepOriginalTimestamps||(this.baseMediaDecodeTime=I),k&&(k.timelineStartInfo.dts=void 0,k.timelineStartInfo.pts=void 0,Bi.clearDtsInfo(k),z.audioTimestampRolloverStream&&z.audioTimestampRolloverStream.discontinuity()),_&&(z.videoSegmentStream&&(z.videoSegmentStream.gopCache_=[]),_.timelineStartInfo.dts=void 0,_.timelineStartInfo.pts=void 0,Bi.clearDtsInfo(_),z.captionStream.reset()),z.timestampRolloverStream&&z.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(I){k&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(I)},this.setRemux=function(I){var z=this.transmuxPipeline_;d.remux=I,z&&z.coalesceStream&&z.coalesceStream.setRemux(I)},this.alignGopsWith=function(I){_&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(I)},this.getLogTrigger_=function(I){var z=this;return function(W){W.stream=I,z.trigger("log",W)}},this.push=function(I){if(b){var z=Id(I);z&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!z&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),b=!1}this.transmuxPipeline_.headOfPipeline.push(I)},this.flush=function(){b=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},ka.prototype=new _s;var Pu={Transmuxer:ka},Du=function(d){return d>>>0},Nu=function(d){return("00"+d.toString(16)).slice(-2)},ks={toUnsigned:Du,toHexString:Nu},Lu=function(d){var v="";return v+=String.fromCharCode(d[0]),v+=String.fromCharCode(d[1]),v+=String.fromCharCode(d[2]),v+=String.fromCharCode(d[3]),v},xa=Lu,Ou=ks.toUnsigned,Mu=xa,xs=function(d,v){var b=[],_,k,I,z,W;if(!v.length)return null;for(_=0;_<d.byteLength;)k=Ou(d[_]<<24|d[_+1]<<16|d[_+2]<<8|d[_+3]),I=Mu(d.subarray(_+4,_+8)),z=k>1?_+k:d.byteLength,I===v[0]&&(v.length===1?b.push(d.subarray(_+8,z)):(W=xs(d.subarray(_+8,z),v.slice(1)),W.length&&(b=b.concat(W)))),_=z;return b},zn=xs,Nd=ks.toUnsigned,Ld=n.getUint64,Od=function(d){var v={version:d[0],flags:new Uint8Array(d.subarray(1,4))};return v.version===1?v.baseMediaDecodeTime=Ld(d.subarray(4)):v.baseMediaDecodeTime=Nd(d[4]<<24|d[5]<<16|d[6]<<8|d[7]),v},Yo=Od,Md=function(d){var v=new DataView(d.buffer,d.byteOffset,d.byteLength),b={version:d[0],flags:new Uint8Array(d.subarray(1,4)),trackId:v.getUint32(4)},_=b.flags[2]&1,k=b.flags[2]&2,I=b.flags[2]&8,z=b.flags[2]&16,W=b.flags[2]&32,Q=b.flags[0]&65536,J=b.flags[0]&131072,oe;return oe=8,_&&(oe+=4,b.baseDataOffset=v.getUint32(12),oe+=4),k&&(b.sampleDescriptionIndex=v.getUint32(oe),oe+=4),I&&(b.defaultSampleDuration=v.getUint32(oe),oe+=4),z&&(b.defaultSampleSize=v.getUint32(oe),oe+=4),W&&(b.defaultSampleFlags=v.getUint32(oe)),Q&&(b.durationIsEmpty=!0),!_&&J&&(b.baseDataOffsetIsMoof=!0),b},Aa=Md,Rd=function(d){return{isLeading:(d[0]&12)>>>2,dependsOn:d[0]&3,isDependedOn:(d[1]&192)>>>6,hasRedundancy:(d[1]&48)>>>4,paddingValue:(d[1]&14)>>>1,isNonSyncSample:d[1]&1,degradationPriority:d[2]<<8|d[3]}},Bd=Rd,gn=Bd,ut=function(d){var v={version:d[0],flags:new Uint8Array(d.subarray(1,4)),samples:[]},b=new DataView(d.buffer,d.byteOffset,d.byteLength),_=v.flags[2]&1,k=v.flags[2]&4,I=v.flags[1]&1,z=v.flags[1]&2,W=v.flags[1]&4,Q=v.flags[1]&8,J=b.getUint32(4),oe=8,me;for(_&&(v.dataOffset=b.getInt32(oe),oe+=4),k&&J&&(me={flags:gn(d.subarray(oe,oe+4))},oe+=4,I&&(me.duration=b.getUint32(oe),oe+=4),z&&(me.size=b.getUint32(oe),oe+=4),Q&&(v.version===1?me.compositionTimeOffset=b.getInt32(oe):me.compositionTimeOffset=b.getUint32(oe),oe+=4),v.samples.push(me),J--);J--;)me={},I&&(me.duration=b.getUint32(oe),oe+=4),z&&(me.size=b.getUint32(oe),oe+=4),W&&(me.flags=gn(d.subarray(oe,oe+4)),oe+=4),Q&&(v.version===1?me.compositionTimeOffset=b.getInt32(oe):me.compositionTimeOffset=b.getUint32(oe),oe+=4),v.samples.push(me);return v},Ur=ut,ei={tfdt:Yo,trun:Ur},Gi={parseTfdt:ei.tfdt,parseTrun:ei.trun},Fd=function(d){for(var v=0,b=String.fromCharCode(d[v]),_="";b!=="\0";)_+=b,v++,b=String.fromCharCode(d[v]);return _+=b,_},Ru={uint8ToCString:Fd},Ia=Ru.uint8ToCString,Ud=n.getUint64,$d=function(d){var v=4,b=d[0],_,k,I,z,W,Q,J,oe;if(b===0){_=Ia(d.subarray(v)),v+=_.length,k=Ia(d.subarray(v)),v+=k.length;var me=new DataView(d.buffer);I=me.getUint32(v),v+=4,W=me.getUint32(v),v+=4,Q=me.getUint32(v),v+=4,J=me.getUint32(v),v+=4}else if(b===1){var me=new DataView(d.buffer);I=me.getUint32(v),v+=4,z=Ud(d.subarray(v)),v+=8,Q=me.getUint32(v),v+=4,J=me.getUint32(v),v+=4,_=Ia(d.subarray(v)),v+=_.length,k=Ia(d.subarray(v)),v+=k.length}oe=new Uint8Array(d.subarray(v,d.byteLength));var xe={scheme_id_uri:_,value:k,timescale:I||1,presentation_time:z,presentation_time_delta:W,event_duration:Q,id:J,message_data:oe};return Vd(b,xe)?xe:void 0},jd=function(d,v,b,_){return d||d===0?d/v:_+b/v},Vd=function(d,v){var b=v.scheme_id_uri!=="\0",_=d===0&&Bu(v.presentation_time_delta)&&b,k=d===1&&Bu(v.presentation_time)&&b;return!(d>1)&&_||k},Bu=function(d){return d!==void 0||d!==null},Hd={parseEmsgBox:$d,scaleTime:jd},Wn;typeof window<"u"?Wn=window:typeof s<"u"?Wn=s:typeof self<"u"?Wn=self:Wn={};var $=Wn,m=ks.toUnsigned,S=ks.toHexString,y=zn,w=xa,x=Hd,L=Aa,q=Ur,X=Yo,ie=n.getUint64,Z,re,ge,Ee,Pe,Se,ze,Ot=$,li=yu.parseId3Frames;Z=function(d){var v={},b=y(d,["moov","trak"]);return b.reduce(function(_,k){var I,z,W,Q,J;return I=y(k,["tkhd"])[0],!I||(z=I[0],W=z===0?12:20,Q=m(I[W]<<24|I[W+1]<<16|I[W+2]<<8|I[W+3]),J=y(k,["mdia","mdhd"])[0],!J)?null:(z=J[0],W=z===0?12:20,_[Q]=m(J[W]<<24|J[W+1]<<16|J[W+2]<<8|J[W+3]),_)},v)},re=function(d,v){var b;b=y(v,["moof","traf"]);var _=b.reduce(function(k,I){var z=y(I,["tfhd"])[0],W=m(z[4]<<24|z[5]<<16|z[6]<<8|z[7]),Q=d[W]||9e4,J=y(I,["tfdt"])[0],oe=new DataView(J.buffer,J.byteOffset,J.byteLength),me;J[0]===1?me=ie(J.subarray(4,12)):me=oe.getUint32(4);let xe;return typeof me=="bigint"?xe=me/Ot.BigInt(Q):typeof me=="number"&&!isNaN(me)&&(xe=me/Q),xe<Number.MAX_SAFE_INTEGER&&(xe=Number(xe)),xe<k&&(k=xe),k},1/0);return typeof _=="bigint"||isFinite(_)?_:0},ge=function(d,v){var b=y(v,["moof","traf"]),_=0,k=0,I;if(b&&b.length){var z=y(b[0],["tfhd"])[0],W=y(b[0],["trun"])[0],Q=y(b[0],["tfdt"])[0];if(z){var J=L(z);I=J.trackId}if(Q){var oe=X(Q);_=oe.baseMediaDecodeTime}if(W){var me=q(W);me.samples&&me.samples.length&&(k=me.samples[0].compositionTimeOffset||0)}}var xe=d[I]||9e4;typeof _=="bigint"&&(k=Ot.BigInt(k),xe=Ot.BigInt(xe));var ye=(_+k)/xe;return typeof ye=="bigint"&&ye<Number.MAX_SAFE_INTEGER&&(ye=Number(ye)),ye},Ee=function(d){var v=y(d,["moov","trak"]),b=[];return v.forEach(function(_){var k=y(_,["mdia","hdlr"]),I=y(_,["tkhd"]);k.forEach(function(z,W){var Q=w(z.subarray(8,12)),J=I[W],oe,me,xe;Q==="vide"&&(oe=new DataView(J.buffer,J.byteOffset,J.byteLength),me=oe.getUint8(0),xe=me===0?oe.getUint32(12):oe.getUint32(20),b.push(xe))})}),b},Se=function(d){var v=d[0],b=v===0?12:20;return m(d[b]<<24|d[b+1]<<16|d[b+2]<<8|d[b+3])},Pe=function(d){var v=y(d,["moov","trak"]),b=[];return v.forEach(function(_){var k={},I=y(_,["tkhd"])[0],z,W;I&&(z=new DataView(I.buffer,I.byteOffset,I.byteLength),W=z.getUint8(0),k.id=W===0?z.getUint32(12):z.getUint32(20));var Q=y(_,["mdia","hdlr"])[0];if(Q){var J=w(Q.subarray(8,12));J==="vide"?k.type="video":J==="soun"?k.type="audio":k.type=J}var oe=y(_,["mdia","minf","stbl","stsd"])[0];if(oe){var me=oe.subarray(8);k.codec=w(me.subarray(4,8));var xe=y(me,[k.codec])[0],ye,Ue;xe&&(/^[asm]vc[1-9]$/i.test(k.codec)?(ye=xe.subarray(78),Ue=w(ye.subarray(4,8)),Ue==="avcC"&&ye.length>11?(k.codec+=".",k.codec+=S(ye[9]),k.codec+=S(ye[10]),k.codec+=S(ye[11])):k.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(k.codec)?(ye=xe.subarray(28),Ue=w(ye.subarray(4,8)),Ue==="esds"&&ye.length>20&&ye[19]!==0?(k.codec+="."+S(ye[19]),k.codec+="."+S(ye[20]>>>2&63).replace(/^0/,"")):k.codec="mp4a.40.2"):k.codec=k.codec.toLowerCase())}var Ye=y(_,["mdia","mdhd"])[0];Ye&&(k.timescale=Se(Ye)),b.push(k)}),b},ze=function(d,v=0){var b=y(d,["emsg"]);return b.map(_=>{var k=x.parseEmsgBox(new Uint8Array(_)),I=li(k.message_data);return{cueTime:x.scaleTime(k.presentation_time,k.timescale,k.presentation_time_delta,v),duration:x.scaleTime(k.event_duration,k.timescale),frames:I}})};var Ki={findBox:y,parseType:w,timescale:Z,startTime:re,compositionStartTime:ge,videoTrackIds:Ee,tracks:Pe,getTimescaleFromMediaHeader:Se,getEmsgID3:ze};const{parseTrun:Qo}=Gi,{findBox:Jo}=Ki;var Zo=$,Fu=function(d){var v=Jo(d,["moof","traf"]),b=Jo(d,["mdat"]),_=[];return b.forEach(function(k,I){var z=v[I];_.push({mdat:k,traf:z})}),_},el=function(d,v,b){var _=v,k=b.defaultSampleDuration||0,I=b.defaultSampleSize||0,z=b.trackId,W=[];return d.forEach(function(Q){var J=Qo(Q),oe=J.samples;oe.forEach(function(me){me.duration===void 0&&(me.duration=k),me.size===void 0&&(me.size=I),me.trackId=z,me.dts=_,me.compositionTimeOffset===void 0&&(me.compositionTimeOffset=0),typeof _=="bigint"?(me.pts=_+Zo.BigInt(me.compositionTimeOffset),_+=Zo.BigInt(me.duration)):(me.pts=_+me.compositionTimeOffset,_+=me.duration)}),W=W.concat(oe)}),W},tl={getMdatTrafPairs:Fu,parseSamples:el},Mt=Mi.discardEmulationPreventionBytes,Uu=da.CaptionStream,Er=zn,vw=Yo,yw=Aa,{getMdatTrafPairs:_w,parseSamples:Tw}=tl,bw=function(d,v){for(var b=d,_=0;_<v.length;_++){var k=v[_];if(b<k.size)return k;b-=k.size}return null},Sw=function(d,v,b){var _=new DataView(d.buffer,d.byteOffset,d.byteLength),k={logs:[],seiNals:[]},I,z,W,Q;for(z=0;z+4<d.length;z+=W)if(W=_.getUint32(z),z+=4,!(W<=0))switch(d[z]&31){case 6:var J=d.subarray(z+1,z+1+W),oe=bw(z,v);if(I={nalUnitType:"sei_rbsp",size:W,data:J,escapedRBSP:Mt(J),trackId:b},oe)I.pts=oe.pts,I.dts=oe.dts,Q=oe;else if(Q)I.pts=Q.pts,I.dts=Q.dts;else{k.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+z+" for trackId "+b+". See mux.js#223."});break}k.seiNals.push(I);break}return k},Cw=function(d,v){var b={},_=_w(d);return _.forEach(function(k){var I=k.mdat,z=k.traf,W=Er(z,["tfhd"]),Q=yw(W[0]),J=Q.trackId,oe=Er(z,["tfdt"]),me=oe.length>0?vw(oe[0]).baseMediaDecodeTime:0,xe=Er(z,["trun"]),ye,Ue;v===J&&xe.length>0&&(ye=Tw(xe,me,Q),Ue=Sw(I,ye,J),b[J]||(b[J]={seiNals:[],logs:[]}),b[J].seiNals=b[J].seiNals.concat(Ue.seiNals),b[J].logs=b[J].logs.concat(Ue.logs))}),b},Ew=function(d,v,b){var _;if(v===null)return null;_=Cw(d,v);var k=_[v]||{};return{seiNals:k.seiNals,logs:k.logs,timescale:b}},ww=function(){var d=!1,v,b,_,k,I,z;this.isInitialized=function(){return d},this.init=function(W){v=new Uu,d=!0,z=W?W.isPartial:!1,v.on("data",function(Q){Q.startTime=Q.startPts/k,Q.endTime=Q.endPts/k,I.captions.push(Q),I.captionStreams[Q.stream]=!0}),v.on("log",function(Q){I.logs.push(Q)})},this.isNewInit=function(W,Q){return W&&W.length===0||Q&&typeof Q=="object"&&Object.keys(Q).length===0?!1:_!==W[0]||k!==Q[_]},this.parse=function(W,Q,J){var oe;if(this.isInitialized()){if(!Q||!J)return null;if(this.isNewInit(Q,J))_=Q[0],k=J[_];else if(_===null||!k)return b.push(W),null}else return null;for(;b.length>0;){var me=b.shift();this.parse(me,Q,J)}return oe=Ew(W,_,k),oe&&oe.logs&&(I.logs=I.logs.concat(oe.logs)),oe===null||!oe.seiNals?I.logs.length?{logs:I.logs,captions:[],captionStreams:[]}:null:(this.pushNals(oe.seiNals),this.flushStream(),I)},this.pushNals=function(W){if(!this.isInitialized()||!W||W.length===0)return null;W.forEach(function(Q){v.push(Q)})},this.flushStream=function(){if(!this.isInitialized())return null;z?v.partialFlush():v.flush()},this.clearParsedCaptions=function(){I.captions=[],I.captionStreams={},I.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;v.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){b=[],_=null,k=null,I?this.clearParsedCaptions():I={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},kw=ww;const{parseTfdt:xw}=Gi,Gn=zn,{getTimescaleFromMediaHeader:Aw}=Ki,{parseSamples:Iw,getMdatTrafPairs:Pw}=tl;var Cv=function(){let d=9e4;this.init=function(v){const b=Gn(v,["moov","trak","mdia","mdhd"])[0];b&&(d=Aw(b))},this.parseSegment=function(v){const b=[],_=Pw(v);let k=0;return _.forEach(function(I){const z=I.mdat,W=I.traf,Q=Gn(W,["tfdt"])[0],J=Gn(W,["tfhd"])[0],oe=Gn(W,["trun"]);if(Q&&(k=xw(Q).baseMediaDecodeTime),oe.length&&J){const me=Iw(oe,k,J);let xe=0;me.forEach(function(ye){const Ue="utf-8",Ye=new TextDecoder(Ue),ti=z.slice(xe,xe+ye.size);if(Gn(ti,["vtte"])[0]){xe+=ye.size;return}Gn(ti,["vttc"]).forEach(function(il){const rl=Gn(il,["payl"])[0],nl=Gn(il,["sttg"])[0],sl=ye.pts/d,Vu=(ye.pts+ye.duration)/d;let xt,al;if(rl)try{xt=Ye.decode(rl)}catch(wr){console.error(wr)}if(nl)try{al=Ye.decode(nl)}catch(wr){console.error(wr)}ye.duration&&xt&&b.push({cueText:xt,start:sl,end:Vu,settings:al})}),xe+=ye.size})}}),b}},qd=ds,Ev=function(d){var v=d[1]&31;return v<<=8,v|=d[2],v},$u=function(d){return!!(d[1]&64)},ju=function(d){var v=0;return(d[3]&48)>>>4>1&&(v+=d[4]+1),v},Dw=function(d,v){var b=Ev(d);return b===0?"pat":b===v?"pmt":v?"pes":null},Nw=function(d){var v=$u(d),b=4+ju(d);return v&&(b+=d[b]+1),(d[b+10]&31)<<8|d[b+11]},Lw=function(d){var v={},b=$u(d),_=4+ju(d);if(b&&(_+=d[_]+1),!!(d[_+5]&1)){var k,I,z;k=(d[_+1]&15)<<8|d[_+2],I=3+k-4,z=(d[_+10]&15)<<8|d[_+11];for(var W=12+z;W<I;){var Q=_+W;v[(d[Q+1]&31)<<8|d[Q+2]]=d[Q],W+=((d[Q+3]&15)<<8|d[Q+4])+5}return v}},Ow=function(d,v){var b=Ev(d),_=v[b];switch(_){case qd.H264_STREAM_TYPE:return"video";case qd.ADTS_STREAM_TYPE:return"audio";case qd.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Mw=function(d){var v=$u(d);if(!v)return null;var b=4+ju(d);if(b>=d.byteLength)return null;var _=null,k;return k=d[b+7],k&192&&(_={},_.pts=(d[b+9]&14)<<27|(d[b+10]&255)<<20|(d[b+11]&254)<<12|(d[b+12]&255)<<5|(d[b+13]&254)>>>3,_.pts*=4,_.pts+=(d[b+13]&6)>>>1,_.dts=_.pts,k&64&&(_.dts=(d[b+14]&14)<<27|(d[b+15]&255)<<20|(d[b+16]&254)<<12|(d[b+17]&255)<<5|(d[b+18]&254)>>>3,_.dts*=4,_.dts+=(d[b+18]&6)>>>1)),_},zd=function(d){switch(d){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Rw=function(d){for(var v=4+ju(d),b=d.subarray(v),_=0,k=0,I=!1,z;k<b.byteLength-3;k++)if(b[k+2]===1){_=k+5;break}for(;_<b.byteLength;)switch(b[_]){case 0:if(b[_-1]!==0){_+=2;break}else if(b[_-2]!==0){_++;break}k+3!==_-2&&(z=zd(b[k+3]&31),z==="slice_layer_without_partitioning_rbsp_idr"&&(I=!0));do _++;while(b[_]!==1&&_<b.length);k=_-2,_+=3;break;case 1:if(b[_-1]!==0||b[_-2]!==0){_+=3;break}z=zd(b[k+3]&31),z==="slice_layer_without_partitioning_rbsp_idr"&&(I=!0),k=_-2,_+=3;break;default:_+=3;break}return b=b.subarray(k),_-=k,k=0,b&&b.byteLength>3&&(z=zd(b[k+3]&31),z==="slice_layer_without_partitioning_rbsp_idr"&&(I=!0)),I},Bw={parseType:Dw,parsePat:Nw,parsePmt:Lw,parsePayloadUnitStartIndicator:$u,parsePesType:Ow,parsePesTime:Mw,videoPacketContainsKeyFrame:Rw},wv=ds,Pa=fs.handleRollover,ft={};ft.ts=Bw,ft.aac=Vn;var As=st.ONE_SECOND_IN_TS,bi=188,$r=71,Fw=function(d,v){for(var b=0,_=bi,k,I;_<d.byteLength;){if(d[b]===$r&&d[_]===$r){switch(k=d.subarray(b,_),I=ft.ts.parseType(k,v.pid),I){case"pat":v.pid=ft.ts.parsePat(k);break;case"pmt":var z=ft.ts.parsePmt(k);v.table=v.table||{},Object.keys(z).forEach(function(W){v.table[W]=z[W]});break}b+=bi,_+=bi;continue}b++,_++}},kv=function(d,v,b){for(var _=0,k=bi,I,z,W,Q,J,oe=!1;k<=d.byteLength;){if(d[_]===$r&&(d[k]===$r||k===d.byteLength)){switch(I=d.subarray(_,k),z=ft.ts.parseType(I,v.pid),z){case"pes":W=ft.ts.parsePesType(I,v.table),Q=ft.ts.parsePayloadUnitStartIndicator(I),W==="audio"&&Q&&(J=ft.ts.parsePesTime(I),J&&(J.type="audio",b.audio.push(J),oe=!0));break}if(oe)break;_+=bi,k+=bi;continue}_++,k++}for(k=d.byteLength,_=k-bi,oe=!1;_>=0;){if(d[_]===$r&&(d[k]===$r||k===d.byteLength)){switch(I=d.subarray(_,k),z=ft.ts.parseType(I,v.pid),z){case"pes":W=ft.ts.parsePesType(I,v.table),Q=ft.ts.parsePayloadUnitStartIndicator(I),W==="audio"&&Q&&(J=ft.ts.parsePesTime(I),J&&(J.type="audio",b.audio.push(J),oe=!0));break}if(oe)break;_-=bi,k-=bi;continue}_--,k--}},Uw=function(d,v,b){for(var _=0,k=bi,I,z,W,Q,J,oe,me,xe,ye=!1,Ue={data:[],size:0};k<d.byteLength;){if(d[_]===$r&&d[k]===$r){switch(I=d.subarray(_,k),z=ft.ts.parseType(I,v.pid),z){case"pes":if(W=ft.ts.parsePesType(I,v.table),Q=ft.ts.parsePayloadUnitStartIndicator(I),W==="video"&&(Q&&!ye&&(J=ft.ts.parsePesTime(I),J&&(J.type="video",b.video.push(J),ye=!0)),!b.firstKeyFrame)){if(Q&&Ue.size!==0){for(oe=new Uint8Array(Ue.size),me=0;Ue.data.length;)xe=Ue.data.shift(),oe.set(xe,me),me+=xe.byteLength;if(ft.ts.videoPacketContainsKeyFrame(oe)){var Ye=ft.ts.parsePesTime(oe);Ye?(b.firstKeyFrame=Ye,b.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}Ue.size=0}Ue.data.push(I),Ue.size+=I.byteLength}break}if(ye&&b.firstKeyFrame)break;_+=bi,k+=bi;continue}_++,k++}for(k=d.byteLength,_=k-bi,ye=!1;_>=0;){if(d[_]===$r&&d[k]===$r){switch(I=d.subarray(_,k),z=ft.ts.parseType(I,v.pid),z){case"pes":W=ft.ts.parsePesType(I,v.table),Q=ft.ts.parsePayloadUnitStartIndicator(I),W==="video"&&Q&&(J=ft.ts.parsePesTime(I),J&&(J.type="video",b.video.push(J),ye=!0));break}if(ye)break;_-=bi,k-=bi;continue}_--,k--}},$w=function(d,v){if(d.audio&&d.audio.length){var b=v;(typeof b>"u"||isNaN(b))&&(b=d.audio[0].dts),d.audio.forEach(function(I){I.dts=Pa(I.dts,b),I.pts=Pa(I.pts,b),I.dtsTime=I.dts/As,I.ptsTime=I.pts/As})}if(d.video&&d.video.length){var _=v;if((typeof _>"u"||isNaN(_))&&(_=d.video[0].dts),d.video.forEach(function(I){I.dts=Pa(I.dts,_),I.pts=Pa(I.pts,_),I.dtsTime=I.dts/As,I.ptsTime=I.pts/As}),d.firstKeyFrame){var k=d.firstKeyFrame;k.dts=Pa(k.dts,_),k.pts=Pa(k.pts,_),k.dtsTime=k.dts/As,k.ptsTime=k.pts/As}}},jw=function(d){for(var v=!1,b=0,_=null,k=null,I=0,z=0,W;d.length-z>=3;){var Q=ft.aac.parseType(d,z);switch(Q){case"timed-metadata":if(d.length-z<10){v=!0;break}if(I=ft.aac.parseId3TagSize(d,z),I>d.length){v=!0;break}k===null&&(W=d.subarray(z,z+I),k=ft.aac.parseAacTimestamp(W)),z+=I;break;case"audio":if(d.length-z<7){v=!0;break}if(I=ft.aac.parseAdtsSize(d,z),I>d.length){v=!0;break}_===null&&(W=d.subarray(z,z+I),_=ft.aac.parseSampleRate(W)),b++,z+=I;break;default:z++;break}if(v)return null}if(_===null||k===null)return null;var J=As/_,oe={audio:[{type:"audio",dts:k,pts:k},{type:"audio",dts:k+b*1024*J,pts:k+b*1024*J}]};return oe},Vw=function(d){var v={pid:null,table:null},b={};Fw(d,v);for(var _ in v.table)if(v.table.hasOwnProperty(_)){var k=v.table[_];switch(k){case wv.H264_STREAM_TYPE:b.video=[],Uw(d,v,b),b.video.length===0&&delete b.video;break;case wv.ADTS_STREAM_TYPE:b.audio=[],kv(d,v,b),b.audio.length===0&&delete b.audio;break}}return b},Hw=function(d,v){var b=ft.aac.isLikelyAacData(d),_;return b?_=jw(d):_=Vw(d),!_||!_.audio&&!_.video?null:($w(_,v),_)},qw={inspect:Hw,parseAudioPes_:kv};const zw=function(d,v){v.on("data",function(b){const _=b.initSegment;b.initSegment={data:_.buffer,byteOffset:_.byteOffset,byteLength:_.byteLength};const k=b.data;b.data=k.buffer,d.postMessage({action:"data",segment:b,byteOffset:k.byteOffset,byteLength:k.byteLength},[b.data])}),v.on("done",function(b){d.postMessage({action:"done"})}),v.on("gopInfo",function(b){d.postMessage({action:"gopInfo",gopInfo:b})}),v.on("videoSegmentTimingInfo",function(b){const _={start:{decode:st.videoTsToSeconds(b.start.dts),presentation:st.videoTsToSeconds(b.start.pts)},end:{decode:st.videoTsToSeconds(b.end.dts),presentation:st.videoTsToSeconds(b.end.pts)},baseMediaDecodeTime:st.videoTsToSeconds(b.baseMediaDecodeTime)};b.prependedContentDuration&&(_.prependedContentDuration=st.videoTsToSeconds(b.prependedContentDuration)),d.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:_})}),v.on("audioSegmentTimingInfo",function(b){const _={start:{decode:st.videoTsToSeconds(b.start.dts),presentation:st.videoTsToSeconds(b.start.pts)},end:{decode:st.videoTsToSeconds(b.end.dts),presentation:st.videoTsToSeconds(b.end.pts)},baseMediaDecodeTime:st.videoTsToSeconds(b.baseMediaDecodeTime)};b.prependedContentDuration&&(_.prependedContentDuration=st.videoTsToSeconds(b.prependedContentDuration)),d.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:_})}),v.on("id3Frame",function(b){d.postMessage({action:"id3Frame",id3Frame:b})}),v.on("caption",function(b){d.postMessage({action:"caption",caption:b})}),v.on("trackinfo",function(b){d.postMessage({action:"trackinfo",trackInfo:b})}),v.on("audioTimingInfo",function(b){d.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:st.videoTsToSeconds(b.start),end:st.videoTsToSeconds(b.end)}})}),v.on("videoTimingInfo",function(b){d.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:st.videoTsToSeconds(b.start),end:st.videoTsToSeconds(b.end)}})}),v.on("log",function(b){d.postMessage({action:"log",log:b})})};class xv{constructor(v,b){this.options=b||{},this.self=v,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Pu.Transmuxer(this.options),zw(this.self,this.transmuxer)}pushMp4Captions(v){this.captionParser||(this.captionParser=new kw,this.captionParser.init());const b=new Uint8Array(v.data,v.byteOffset,v.byteLength),_=this.captionParser.parse(b,v.trackIds,v.timescales);this.self.postMessage({action:"mp4Captions",captions:_&&_.captions||[],logs:_&&_.logs||[],data:b.buffer},[b.buffer])}initMp4WebVttParser(v){this.webVttParser||(this.webVttParser=new Cv);const b=new Uint8Array(v.data,v.byteOffset,v.byteLength);this.webVttParser.init(b)}getMp4WebVttText(v){this.webVttParser||(this.webVttParser=new Cv);const b=new Uint8Array(v.data,v.byteOffset,v.byteLength),_=this.webVttParser.parseSegment(b);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:_||[],data:b.buffer},[b.buffer])}probeMp4StartTime({timescales:v,data:b}){const _=Ki.startTime(v,b);this.self.postMessage({action:"probeMp4StartTime",startTime:_,data:b},[b.buffer])}probeMp4Tracks({data:v}){const b=Ki.tracks(v);this.self.postMessage({action:"probeMp4Tracks",tracks:b,data:v},[v.buffer])}probeEmsgID3({data:v,offset:b}){const _=Ki.getEmsgID3(v,b);this.self.postMessage({action:"probeEmsgID3",id3Frames:_,emsgData:v},[v.buffer])}probeTs({data:v,baseStartTime:b}){const _=typeof b=="number"&&!isNaN(b)?b*st.ONE_SECOND_IN_TS:void 0,k=qw.inspect(v,_);let I=null;k&&(I={hasVideo:k.video&&k.video.length===2||!1,hasAudio:k.audio&&k.audio.length===2||!1},I.hasVideo&&(I.videoStart=k.video[0].ptsTime),I.hasAudio&&(I.audioStart=k.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:I,data:v},[v.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(v){const b=new Uint8Array(v.data,v.byteOffset,v.byteLength);this.transmuxer.push(b)}reset(){this.transmuxer.reset()}setTimestampOffset(v){const b=v.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(st.secondsToVideoTs(b)))}setAudioAppendStart(v){this.transmuxer.setAudioAppendStart(Math.ceil(st.secondsToVideoTs(v.appendStart)))}setRemux(v){this.transmuxer.setRemux(v.remux)}flush(v){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(v){this.transmuxer.alignGopsWith(v.gopsToAlignWith.slice())}}self.onmessage=function(d){if(d.data.action==="init"&&d.data.options){this.messageHandlers=new xv(self,d.data.options);return}this.messageHandlers||(this.messageHandlers=new xv(self)),d.data&&d.data.action&&d.data.action!=="init"&&this.messageHandlers[d.data.action]&&this.messageHandlers[d.data.action](d.data)}}));var $N=OC(UN);const jN=(s,e,t)=>{const{type:r,initSegment:i,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:u}=s.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:o});const c=s.data.segment.boxes||{data:s.data.segment.data},h={type:r,data:new Uint8Array(c.data,c.data.byteOffset,c.data.byteLength),initSegment:new Uint8Array(i.data,i.byteOffset,i.byteLength)};typeof l<"u"&&(h.videoFrameDtsTime=l),typeof u<"u"&&(h.videoFramePtsTime=u),t(h)},VN=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},HN=(s,e)=>{e.gopInfo=s.data.gopInfo},BC=s=>{const{transmuxer:e,bytes:t,audioAppendStart:r,gopsToAlignWith:i,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:u,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:h,onId3:f,onCaptions:g,onDone:C,onEndedTimeline:p,onTransmuxerLog:T,isEndOfTimeline:A,segment:N,triggerSegmentEventFn:F}=s,V={buffer:[]};let R=A;const O=U=>{e.currentTransmux===s&&(U.data.action==="data"&&jN(U,V,a),U.data.action==="trackinfo"&&o(U.data.trackInfo),U.data.action==="gopInfo"&&HN(U,V),U.data.action==="audioTimingInfo"&&l(U.data.audioTimingInfo),U.data.action==="videoTimingInfo"&&u(U.data.videoTimingInfo),U.data.action==="videoSegmentTimingInfo"&&c(U.data.videoSegmentTimingInfo),U.data.action==="audioSegmentTimingInfo"&&h(U.data.audioSegmentTimingInfo),U.data.action==="id3Frame"&&f([U.data.id3Frame],U.data.id3Frame.dispatchType),U.data.action==="caption"&&g(U.data.caption),U.data.action==="endedtimeline"&&(R=!1,p()),U.data.action==="log"&&T(U.data.log),U.data.type==="transmuxed"&&(R||(e.onmessage=null,VN({transmuxedData:V,callback:C}),FC(e))))},M=()=>{const U={message:"Received an error message from the transmuxer worker",metadata:{errorType:B.Error.StreamingFailedToTransmuxSegment,segmentInfo:Rs({segment:N})}};C(null,U)};if(e.onmessage=O,e.onerror=M,r&&e.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(i)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:i}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const U=t instanceof ArrayBuffer?t:t.buffer,E=t instanceof ArrayBuffer?0:t.byteOffset;F({type:"segmenttransmuxingstart",segment:N}),e.postMessage({action:"push",data:U,byteOffset:E,byteLength:t.byteLength},[U])}A&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},FC=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():BC(s.currentTransmux))},r_=(s,e)=>{s.postMessage({action:e}),FC(s)},UC=(s,e)=>{if(!e.currentTransmux){e.currentTransmux=s,r_(e,s);return}e.transmuxQueue.push(r_.bind(null,e,s))},qN=s=>{UC("reset",s)},zN=s=>{UC("endTimeline",s)},$C=s=>{if(!s.transmuxer.currentTransmux){s.transmuxer.currentTransmux=s,BC(s);return}s.transmuxer.transmuxQueue.push(s)},WN=s=>{const e=new $N;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:s}),e};var Pf={reset:qN,endTimeline:zN,transmux:$C,createTransmuxer:WN};const io=function(s){const e=s.transmuxer,t=s.endAction||s.action,r=s.callback,i=vt({},s,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,s.byteOffset||0,s.byteLength||a.data.data.byteLength),s.data&&(s.data=a.data.data)),r(a.data))};if(e.addEventListener("message",n),s.data){const a=s.data instanceof ArrayBuffer;i.byteOffset=a?0:s.data.byteOffset,i.byteLength=s.data.byteLength;const o=[a?s.data:s.data.buffer];e.postMessage(i,o)}else e.postMessage(i)},Yr={FAILURE:2,TIMEOUT:-101,ABORTED:-102},jC="wvtt",Yp=s=>{s.forEach(e=>{e.abort()})},GN=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),KN=s=>{const e=s.target,r={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return r.bytesReceived=s.loaded,r.bandwidth=Math.floor(r.bytesReceived/r.roundTripTime*8*1e3),r},Sg=(s,e)=>{const{requestType:t}=e,r=Xs({requestType:t,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Yr.TIMEOUT,xhr:e,metadata:r}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Yr.ABORTED,xhr:e,metadata:r}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Yr.FAILURE,xhr:e,metadata:r}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Yr.FAILURE,xhr:e,metadata:r}:null},n_=(s,e,t,r)=>(i,n)=>{const a=n.response,o=Sg(i,n);if(o)return t(o,s);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Yr.FAILURE,xhr:n},s);const l=new DataView(a),u=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let h=0;h<e.length;h++)e[h].bytes=u;const c={uri:n.uri};return r({type:"segmentkeyloadcomplete",segment:s,keyInfo:c}),t(null,s)},XN=(s,e)=>{e===jC&&s.transmuxer.postMessage({action:"initMp4WebVttParser",data:s.map.bytes})},YN=(s,e,t)=>{e===jC&&io({action:"getMp4WebVttText",data:s.bytes,transmuxer:s.transmuxer,callback:({data:r,mp4VttCues:i})=>{s.bytes=r,t(null,s,{mp4VttCues:i})}})},VC=(s,e)=>{const t=zm(s.map.bytes);if(t!=="mp4"){const r=s.map.resolvedUri||s.map.uri,i=t||"unknown";return e({internal:!0,message:`Found unsupported ${i} container for initialization segment at URL: ${r}`,code:Yr.FAILURE,metadata:{mediaType:i}})}io({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:r,data:i})=>(s.map.bytes=i,r.forEach(function(n){s.map.tracks=s.map.tracks||{},!s.map.tracks[n.type]&&(s.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(s.map.timescales=s.map.timescales||{},s.map.timescales[n.id]=n.timescale),n.type==="text"&&XN(s,n.codec))}),e(null))})},QN=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:t})=>(r,i)=>{const n=Sg(r,i);if(n)return e(n,s);const a=new Uint8Array(i.response);if(t({type:"segmentloaded",segment:s}),s.map.key)return s.map.encryptedBytes=a,e(null,s);s.map.bytes=a,VC(s,function(o){if(o)return o.xhr=i,o.status=i.status,e(o,s);e(null,s)})},JN=({segment:s,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:r})=>(i,n)=>{const a=Sg(i,n);if(a)return e(a,s);r({type:"segmentloaded",segment:s});const o=t==="arraybuffer"||!n.responseText?n.response:BN(n.responseText.substring(s.lastReachedChar||0));return s.stats=GN(n),s.key?s.encryptedBytes=new Uint8Array(o):s.bytes=new Uint8Array(o),e(null,s)},ZN=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g})=>{const C=s.map&&s.map.tracks||{},p=!!(C.audio&&C.video);let T=r.bind(null,s,"audio","start");const A=r.bind(null,s,"audio","end");let N=r.bind(null,s,"video","start");const F=r.bind(null,s,"video","end"),V=()=>$C({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:p,onData:R=>{R.type=R.type==="combined"?"video":R.type,c(s,R)},onTrackInfo:R=>{t&&(p&&(R.isMuxed=!0),t(s,R))},onAudioTimingInfo:R=>{T&&typeof R.start<"u"&&(T(R.start),T=null),A&&typeof R.end<"u"&&A(R.end)},onVideoTimingInfo:R=>{N&&typeof R.start<"u"&&(N(R.start),N=null),F&&typeof R.end<"u"&&F(R.end)},onVideoSegmentTimingInfo:R=>{const O={pts:{start:R.start.presentation,end:R.end.presentation},dts:{start:R.start.decode,end:R.end.decode}};g({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:O}),i(R)},onAudioSegmentTimingInfo:R=>{const O={pts:{start:R.start.pts,end:R.end.pts},dts:{start:R.start.dts,end:R.end.dts}};g({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:O}),n(R)},onId3:(R,O)=>{a(s,R,O)},onCaptions:R=>{o(s,[R])},isEndOfTimeline:l,onEndedTimeline:()=>{u()},onTransmuxerLog:f,onDone:(R,O)=>{h&&(R.type=R.type==="combined"?"video":R.type,g({type:"segmenttransmuxingcomplete",segment:s}),h(O,s,R))},segment:s,triggerSegmentEventFn:g});io({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:R=>{s.bytes=e=R.data;const O=R.result;O&&(t(s,{hasAudio:O.hasAudio,hasVideo:O.hasVideo,isMuxed:p}),t=null),V()}})},HC=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g})=>{let C=new Uint8Array(e);if(TP(C)){s.isFmp4=!0;const{tracks:p}=s.map;if(p.text&&(!p.audio||!p.video)){c(s,{data:C,type:"text"}),YN(s,p.text.codec,h);return}const A={isFmp4:!0,hasVideo:!!p.video,hasAudio:!!p.audio};p.audio&&p.audio.codec&&p.audio.codec!=="enca"&&(A.audioCodec=p.audio.codec),p.video&&p.video.codec&&p.video.codec!=="encv"&&(A.videoCodec=p.video.codec),p.video&&p.audio&&(A.isMuxed=!0),t(s,A);const N=(F,V)=>{c(s,{data:C,type:A.hasAudio&&!A.isMuxed?"audio":"video"}),V&&V.length&&a(s,V),F&&F.length&&o(s,F),h(null,s,{})};io({action:"probeMp4StartTime",timescales:s.map.timescales,data:C,transmuxer:s.transmuxer,callback:({data:F,startTime:V})=>{e=F.buffer,s.bytes=C=F,A.hasAudio&&!A.isMuxed&&r(s,"audio","start",V),A.hasVideo&&r(s,"video","start",V),io({action:"probeEmsgID3",data:C,transmuxer:s.transmuxer,offset:V,callback:({emsgData:R,id3Frames:O})=>{if(e=R.buffer,s.bytes=C=R,!p.video||!R.byteLength||!s.transmuxer){N(void 0,O);return}io({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:C,timescales:s.map.timescales,trackIds:[p.video.id],callback:M=>{e=M.data.buffer,s.bytes=C=M.data,M.logs.forEach(function(U){f(ct(U,{stream:"mp4CaptionParser"}))}),N(M.captions,O)}})}})}});return}if(!s.transmuxer){h(null,s,{});return}if(typeof s.container>"u"&&(s.container=zm(C)),s.container!=="ts"&&s.container!=="aac"){t(s,{hasAudio:!1,hasVideo:!1}),h(null,s,{});return}ZN({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g})},qC=function({id:s,key:e,encryptedBytes:t,decryptionWorker:r,segment:i,doneFn:n},a){const o=u=>{if(u.data.source===s){r.removeEventListener("message",o);const c=u.data.decrypted;a(new Uint8Array(c.bytes,c.byteOffset,c.byteLength))}};r.onerror=()=>{const u="An error occurred in the decryption worker",c=Rs({segment:i}),h={message:u,metadata:{error:new Error(u),errorType:B.Error.StreamingFailedToDecryptSegment,segmentInfo:c,keyInfo:{uri:i.key.resolvedUri||i.map.key.resolvedUri}}};n(h,i)},r.addEventListener("message",o);let l;e.bytes.slice?l=e.bytes.slice():l=new Uint32Array(Array.prototype.slice.call(e.bytes)),r.postMessage(AC({source:s,encrypted:t,key:l,iv:e.iv}),[t.buffer,l.buffer])},eL=({decryptionWorker:s,segment:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g})=>{g({type:"segmentdecryptionstart"}),qC({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:h},C=>{e.bytes=C,g({type:"segmentdecryptioncomplete",segment:e}),HC({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g})})},tL=({activeXhrs:s,decryptionWorker:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g})=>{let C=0,p=!1;return(T,A)=>{if(!p){if(T)return p=!0,Yp(s),h(T,A);if(C+=1,C===s.length){const N=function(){if(A.encryptedBytes)return eL({decryptionWorker:e,segment:A,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g});HC({segment:A,bytes:A.bytes,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g})};if(A.endOfAllRequests=Date.now(),A.map&&A.map.encryptedBytes&&!A.map.bytes)return g({type:"segmentdecryptionstart",segment:A}),qC({decryptionWorker:e,id:A.requestId+"-init",encryptedBytes:A.map.encryptedBytes,key:A.map.key,segment:A,doneFn:h},F=>{A.map.bytes=F,g({type:"segmentdecryptioncomplete",segment:A}),VC(A,V=>{if(V)return Yp(s),h(V,A);N()})});N()}}}},iL=({loadendState:s,abortFn:e})=>t=>{t.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},rL=({segment:s,progressFn:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c})=>h=>{if(!h.target.aborted)return s.stats=ct(s.stats,KN(h)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(h,s)},nL=({xhr:s,xhrOptions:e,decryptionWorker:t,segment:r,abortFn:i,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:C,doneFn:p,onTransmuxerLog:T,triggerSegmentEventFn:A})=>{const N=[],F=tL({activeXhrs:N,decryptionWorker:t,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:C,doneFn:p,onTransmuxerLog:T,triggerSegmentEventFn:A});if(r.key&&!r.key.bytes){const U=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&U.push(r.map.key);const E=ct(e,{uri:r.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),P=n_(r,U,F,A),Y={uri:r.key.resolvedUri};A({type:"segmentkeyloadstart",segment:r,keyInfo:Y});const G=s(E,P);N.push(G)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){const G=ct(e,{uri:r.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),K=n_(r,[r.map.key],F,A),le={uri:r.map.key.resolvedUri};A({type:"segmentkeyloadstart",segment:r,keyInfo:le});const de=s(G,K);N.push(de)}const E=ct(e,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Kp(r.map),requestType:"segment-media-initialization"}),P=QN({segment:r,finishProcessingFn:F,triggerSegmentEventFn:A});A({type:"segmentloadstart",segment:r});const Y=s(E,P);N.push(Y)}const V=ct(e,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:Kp(r),requestType:"segment"}),R=JN({segment:r,finishProcessingFn:F,responseType:V.responseType,triggerSegmentEventFn:A});A({type:"segmentloadstart",segment:r});const O=s(V,R);O.addEventListener("progress",rL({segment:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:C})),N.push(O);const M={};return N.forEach(U=>{U.addEventListener("loadend",iL({loadendState:M,abortFn:i}))}),()=>Yp(N)},sL=vr("CodecUtils"),aL=function(s){const e=s.attributes||{};if(e.CODECS)return Hr(e.CODECS)},zC=(s,e)=>{const t=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&t.AUDIO&&s.mediaGroups.AUDIO[t.AUDIO]},oL=(s,e)=>{if(!zC(s,e))return!0;const t=e.attributes||{},r=s.mediaGroups.AUDIO[t.AUDIO];for(const i in r)if(!r[i].uri&&!r[i].playlists)return!0;return!1},Kc=function(s){const e={};return s.forEach(({mediaType:t,type:r,details:i})=>{e[t]=e[t]||[],e[t].push(A0(`${r}${i}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){sL(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},s_=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},Ml=function(s,e){const t=e.attributes||{},r=Kc(aL(e)||[]);if(zC(s,e)&&!r.audio&&!oL(s,e)){const i=Kc(GA(s,t.AUDIO)||[]);i.audio&&(r.audio=i.audio)}return r},tc=vr("PlaylistSelector"),a_=function(s){if(!s||!s.playlist)return;const e=s.playlist;return JSON.stringify({id:e.id,bandwidth:s.bandwidth,width:s.width,height:s.height,codecs:e.attributes&&e.attributes.CODECS||""})},Xc=function(s,e){if(!s)return"";const t=D.getComputedStyle(s);return t?t[e]:""},ro=function(s,e){const t=s.slice();s.sort(function(r,i){const n=e(r,i);return n===0?t.indexOf(r)-t.indexOf(i):n})},Cg=function(s,e){let t,r;return s.attributes.BANDWIDTH&&(t=s.attributes.BANDWIDTH),t=t||D.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(r=e.attributes.BANDWIDTH),r=r||D.Number.MAX_VALUE,t-r},lL=function(s,e){let t,r;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(t=s.attributes.RESOLUTION.width),t=t||D.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(r=e.attributes.RESOLUTION.width),r=r||D.Number.MAX_VALUE,t===r&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-r};let WC=function(s,e,t,r,i,n){if(!s)return;const a={bandwidth:e,width:t,height:r,limitRenditionByPlayerDimensions:i};let o=s.playlists;Vi.isAudioOnly(s)&&(o=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let l=o.map(R=>{let O;const M=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.width,U=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.height;return O=R.attributes&&R.attributes.BANDWIDTH,O=O||D.Number.MAX_VALUE,{bandwidth:O,width:M,height:U,playlist:R}});ro(l,(R,O)=>R.bandwidth-O.bandwidth),l=l.filter(R=>!Vi.isIncompatible(R.playlist));let u=l.filter(R=>Vi.isEnabled(R.playlist));u.length||(u=l.filter(R=>!Vi.isDisabled(R.playlist)));const c=u.filter(R=>R.bandwidth*ii.BANDWIDTH_VARIANCE<e);let h=c[c.length-1];const f=c.filter(R=>R.bandwidth===h.bandwidth)[0];if(i===!1){const R=f||u[0]||l[0];if(R&&R.playlist){let O="sortedPlaylistReps";return f&&(O="bandwidthBestRep"),u[0]&&(O="enabledPlaylistReps"),tc(`choosing ${a_(R)} using ${O} with options`,a),R.playlist}return tc("could not choose a playlist with options",a),null}const g=c.filter(R=>R.width&&R.height);ro(g,(R,O)=>R.width-O.width);const C=g.filter(R=>R.width===t&&R.height===r);h=C[C.length-1];const p=C.filter(R=>R.bandwidth===h.bandwidth)[0];let T,A,N;p||(T=g.filter(R=>R.width>t||R.height>r),A=T.filter(R=>R.width===T[0].width&&R.height===T[0].height),h=A[A.length-1],N=A.filter(R=>R.bandwidth===h.bandwidth)[0]);let F;if(n.leastPixelDiffSelector){const R=g.map(O=>(O.pixelDiff=Math.abs(O.width-t)+Math.abs(O.height-r),O));ro(R,(O,M)=>O.pixelDiff===M.pixelDiff?M.bandwidth-O.bandwidth:O.pixelDiff-M.pixelDiff),F=R[0]}const V=F||N||p||f||u[0]||l[0];if(V&&V.playlist){let R="sortedPlaylistReps";return F?R="leastPixelDiffRep":N?R="resolutionPlusOneRep":p?R="resolutionBestRep":f?R="bandwidthBestRep":u[0]&&(R="enabledPlaylistReps"),tc(`choosing ${a_(V)} using ${R} with options`,a),V.playlist}return tc("could not choose a playlist with options",a),null};const o_=function(){let s=this.useDevicePixelRatio&&D.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),WC(this.playlists.main,this.systemBandwidth,parseInt(Xc(this.tech_.el(),"width"),10)*s,parseInt(Xc(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)},uL=function(s){let e=-1,t=-1;if(s<0||s>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let r=this.useDevicePixelRatio&&D.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(r=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=s*this.systemBandwidth+(1-s)*e,t=this.systemBandwidth),WC(this.playlists.main,e,parseInt(Xc(this.tech_.el(),"width"),10)*r,parseInt(Xc(this.tech_.el(),"height"),10)*r,this.limitRenditionByPlayerDimensions,this.playlistController_)}},cL=function(s){const{main:e,currentTime:t,bandwidth:r,duration:i,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=s,u=e.playlists.filter(C=>!Vi.isIncompatible(C));let c=u.filter(Vi.isEnabled);c.length||(c=u.filter(C=>!Vi.isDisabled(C)));const f=c.filter(Vi.hasAttribute.bind(null,"BANDWIDTH")).map(C=>{const T=l.getSyncPoint(C,i,o,t)?1:2,N=Vi.estimateSegmentRequestTime(n,r,C)*T-a;return{playlist:C,rebufferingImpact:N}}),g=f.filter(C=>C.rebufferingImpact<=0);return ro(g,(C,p)=>Cg(p.playlist,C.playlist)),g.length?g[0]:(ro(f,(C,p)=>C.rebufferingImpact-p.rebufferingImpact),f[0]||null)},hL=function(){const s=this.playlists.main.playlists.filter(Vi.isEnabled);return ro(s,(t,r)=>Cg(t,r)),s.filter(t=>!!Ml(this.playlists.main,t).video)[0]||null},dL=s=>{let e=0,t;return s.bytes&&(t=new Uint8Array(s.bytes),s.segments.forEach(r=>{t.set(r,e),e+=r.byteLength})),t};function GC(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const fL=function(s,e,t){if(!s[t]){e.trigger({type:"usage",name:"vhs-608"});let r=t;/^cc708_/.test(t)&&(r="SERVICE"+t.split("_")[1]);const i=e.textTracks().getTrackById(r);if(i)s[t]=i;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,o=t,l=!1;const u=n[r];u&&(a=u.label,o=u.language,l=u.default),s[t]=e.addRemoteTextTrack({kind:"captions",id:r,default:l,label:a,language:o},!1).track}}},pL=function({inbandTextTracks:s,captionArray:e,timestampOffset:t}){if(!e)return;const r=D.WebKitDataCue||D.VTTCue;e.forEach(i=>{const n=i.stream;i.content?i.content.forEach(a=>{const o=new r(i.startTime+t,i.endTime+t,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",s[n].addCue(o)}):s[n].addCue(new r(i.startTime+t,i.endTime+t,i.text))})},mL=function(s){Object.defineProperties(s.frame,{id:{get(){return B.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key}},value:{get(){return B.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data}},privateData:{get(){return B.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data}}})},gL=({inbandTextTracks:s,metadataArray:e,timestampOffset:t,videoDuration:r})=>{if(!e)return;const i=D.WebKitDataCue||D.VTTCue,n=s.metadataTrack_;if(!n||(e.forEach(c=>{const h=c.cueTime+t;typeof h!="number"||D.isNaN(h)||h<0||!(h<1/0)||!c.frames||!c.frames.length||c.frames.forEach(f=>{const g=new i(h,h,f.value||f.url||f.data||"");g.frame=f,g.value=f,mL(g),n.addCue(g)})}),!n.cues||!n.cues.length))return;const a=n.cues,o=[];for(let c=0;c<a.length;c++)a[c]&&o.push(a[c]);const l=o.reduce((c,h)=>{const f=c[h.startTime]||[];return f.push(h),c[h.startTime]=f,c},{}),u=Object.keys(l).sort((c,h)=>Number(c)-Number(h));u.forEach((c,h)=>{const f=l[c],g=isFinite(r)?r:c,C=Number(u[h+1])||g;f.forEach(p=>{p.endTime=C})})},vL={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},yL=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),_L=({inbandTextTracks:s,dateRanges:e})=>{const t=s.metadataTrack_;if(!t)return;const r=D.WebKitDataCue||D.VTTCue;e.forEach(i=>{for(const n of Object.keys(i)){if(yL.has(n))continue;const a=new r(i.startTime,i.endTime,"");a.id=i.id,a.type="com.apple.quicktime.HLS",a.value={key:vL[n],data:i[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}i.processDateRange()})},l_=(s,e,t)=>{s.metadataTrack_||(s.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,B.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},Sl=function(s,e,t){let r,i;if(t&&t.cues)for(r=t.cues.length;r--;)i=t.cues[r],i.startTime>=s&&i.endTime<=e&&t.removeCue(i)},TL=function(s){const e=s.cues;if(!e)return;const t={};for(let r=e.length-1;r>=0;r--){const i=e[r],n=`${i.startTime}-${i.endTime}-${i.text}`;t[n]?s.removeCue(i):t[n]=i}},bL=(s,e,t)=>{if(typeof e>"u"||e===null||!s.length)return[];const r=Math.ceil((e-t+3)*Fs.ONE_SECOND_IN_TS);let i;for(i=0;i<s.length&&!(s[i].pts>r);i++);return s.slice(i)},SL=(s,e,t)=>{if(!e.length)return s;if(t)return e.slice();const r=e[0].pts;let i=0;for(i;i<s.length&&!(s[i].pts>=r);i++);return s.slice(0,i).concat(e)},CL=(s,e,t,r)=>{const i=Math.ceil((e-r)*Fs.ONE_SECOND_IN_TS),n=Math.ceil((t-r)*Fs.ONE_SECOND_IN_TS),a=s.slice();let o=s.length;for(;o--&&!(s[o].pts<=n););if(o===-1)return a;let l=o+1;for(;l--&&!(s[l].pts<=i););return l=Math.max(l,0),a.splice(l,o-l+1),a},EL=function(s,e){if(!s&&!e||!s&&e||s&&!e)return!1;if(s===e)return!0;const t=Object.keys(s).sort(),r=Object.keys(e).sort();if(t.length!==r.length)return!1;for(let i=0;i<t.length;i++){const n=t[i];if(n!==r[i]||s[n]!==e[n])return!1}return!0},wL=function(s,e,t){e=e||[];const r=[];let i=0;for(let n=0;n<e.length;n++){const a=e[n];if(s===a.timeline&&(r.push(n),i+=a.duration,i>t))return n}return r.length===0?0:r[r.length-1]},hl=1,kL=500,u_=s=>typeof s=="number"&&isFinite(s),ic=1/60,xL=(s,e,t)=>s!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,AL=(s,e,t)=>{let r=e-ii.BACK_BUFFER_LENGTH;s.length&&(r=Math.max(r,s.start(0)));const i=e-t;return Math.min(i,r)},La=s=>{const{startOfSegment:e,duration:t,segment:r,part:i,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:u,timeline:c}=s,h=o.length-1;let f="mediaIndex/partIndex increment";s.getMediaInfoForTime?f=`getMediaInfoForTime (${s.getMediaInfoForTime})`:s.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),s.independent&&(f+=` with independent ${s.independent}`);const g=typeof u=="number",C=s.segment.uri?"segment":"pre-segment",p=g?dC({preloadSegment:r})-1:0;return`${C} [${n+l}/${n+h}]`+(g?` part [${u}/${p}]`:"")+` segment start/end [${r.start} => ${r.end}]`+(g?` part start/end [${i.start} => ${i.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${c}] selected by [${f}] playlist [${a}]`},c_=s=>`${s}TimingInfo`,IL=({segmentTimeline:s,currentTimeline:e,startOfSegment:t,buffered:r,overrideCheck:i})=>!i&&s===e?null:s<e?t:r.length?r.end(r.length-1):t,Qp=({timelineChangeController:s,currentTimeline:e,segmentTimeline:t,loaderType:r,audioDisabled:i})=>{if(e===t)return!1;if(r==="audio"){const n=s.lastTimelineChange({type:"main"});return!n||n.to!==t}if(r==="main"&&i){const n=s.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},PL=s=>{if(!s)return!1;const e=s.pendingTimelineChange({type:"audio"}),t=s.pendingTimelineChange({type:"main"}),r=e&&t,i=r&&e.to!==t.to;return!!(r&&e.from!==-1&&t.from!==-1&&i)},DL=s=>{s&&(s.pause(),s.resetEverything(),s.load())},NL=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},Qn=s=>{const e=s.pendingSegment_;if(!e)return;if(Qp({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&PL(s.timelineChangeController_)){if(NL(s)){s.timelineChangeController_.trigger("audioTimelineBehind");return}DL(s)}},LL=s=>{let e=0;return["video","audio"].forEach(function(t){const r=s[`${t}TimingInfo`];if(!r)return;const{start:i,end:n}=r;let a;typeof i=="bigint"||typeof n=="bigint"?a=D.BigInt(n)-D.BigInt(i):typeof i=="number"&&typeof n=="number"&&(a=n-i),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},h_=({segmentDuration:s,maxDuration:e})=>s?Math.round(s)>e+Kr:!1,OL=(s,e)=>{if(e!=="hls")return null;const t=LL({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!t)return null;const r=s.playlist.targetDuration,i=h_({segmentDuration:t,maxDuration:r*2}),n=h_({segmentDuration:t,maxDuration:r}),a=`Segment with index ${s.mediaIndex} from playlist ${s.playlist.id} has a duration of ${t} when the reported duration is ${s.duration} and the target duration is ${r}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return i||n?{severity:i?"warn":"info",message:a}:null},Rs=({type:s,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),r=!!(e.map&&!e.map.bytes),i=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:s||e.type,uri:e.resolvedUri||e.uri,start:i,duration:e.duration,isEncrypted:t,isMediaInitialization:r}};let Jp=class extends B.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=vr(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(r){r!==this.state_&&(this.logger_(`${this.state_} -> ${r}`),this.state_=r,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Qn(this)}),this.sourceUpdater_.on("codecschange",r=>{this.trigger(vt({type:"codecschange"},r))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Qn(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",r=>{this.trigger(vt({type:"timelinechange"},r)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Qn(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Qn(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Pf.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,D.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Pf.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return si();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:r,isMuxed:i}=e;if(r&&t&&!this.audioDisabled_&&!i)return this.sourceUpdater_.buffered();if(r)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const r=Gc(e);let i=this.initSegments_[r];return t&&!i&&e.bytes&&(this.initSegments_[r]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),i||e}segmentKey(e,t=!1){if(!e)return null;const r=IC(e);let i=this.keyCache_[r];this.cacheEncryptionKeys_&&t&&!i&&e.bytes&&(this.keyCache_[r]=i={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(i||e).resolvedUri};return i&&(n.bytes=i.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const r=this.playlist_,i=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(r&&(r.id?n=r.id:r.uri&&(n=r.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
|
|
205
|
-
currentTime: ${this.currentTime_()}
|
|
206
|
-
bufferedEnd: ${Af(this.buffered_())}
|
|
207
|
-
`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!r||r.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-r.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=l}}i&&(i.mediaIndex-=a,i.mediaIndex<0?(i.mediaIndex=null,i.partIndex=null):(i.mediaIndex>=0&&(i.segment=e.segments[i.mediaIndex]),i.partIndex>=0&&i.segment.parts&&(i.part=i.segment.parts[i.partIndex]))),this.syncController_.saveExpiredSegmentInfo(r,e)}pause(){this.checkBufferTimeout_&&(D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Pf.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,r=()=>{},i=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&r()};(i||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(i||this.loaderType_==="main")&&(this.gopBuffer_=CL(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)Sl(e,t,this.inbandTextTracks_[o]);Sl(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),kL)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:Rs({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,r=this.partIndex){if(!t||!this.mediaSource_)return!1;const i=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!i||!i.parts||r+1===i.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Af(e)||0,r=yg(e,this.currentTime_()),i=!this.hasPlayed_()&&r>=1,n=r>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||i||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=wL(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const f=a[this.mediaIndex],g=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=f.end?f.end:t,f.parts&&f.parts[g+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=g+1):o.mediaIndex=this.mediaIndex+1}else{let f,g,C;const p=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
|
|
208
|
-
For TargetTime: ${p}.
|
|
209
|
-
CurrentTime: ${this.currentTime_()}
|
|
210
|
-
BufferedEnd: ${t}
|
|
211
|
-
Fetch At Buffer: ${this.fetchAtBuffer_}
|
|
212
|
-
`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const T=this.getSyncInfoFromMediaSequenceSync_(p);if(!T){const A="No sync info found while using media sequence sync";return this.error({message:A,metadata:{errorType:B.Error.StreamingFailedToSelectNextSegment,error:new Error(A)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${T.start} --> ${T.end})`),f=T.segmentIndex,g=T.partIndex,C=T.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const T=Vi.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:p,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});f=T.segmentIndex,g=T.partIndex,C=T.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${p}`:`currentTime ${p}`,o.mediaIndex=f,o.startOfSegment=C,o.partIndex=g,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const l=a[o.mediaIndex];let u=l&&typeof o.partIndex=="number"&&l.parts&&l.parts[o.partIndex];if(!l||typeof o.partIndex=="number"&&!u)return null;typeof o.partIndex!="number"&&l.parts&&(o.partIndex=0,u=l.parts[0]);const c=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!r&&u&&!c&&!u.independent)if(o.partIndex===0){const f=a[o.mediaIndex-1],g=f.parts&&f.parts.length&&f.parts[f.parts.length-1];g&&g.independent&&(o.mediaIndex-=1,o.partIndex=f.parts.length-1,o.independent="previous segment")}else l.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const h=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&h&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const r=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!r)return null;if(!r.isAppended)return r;const i=this.mediaSequenceSync_.getSyncInfoForTime(r.end);return i?(i.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),i):null}generateSegmentInfo_(e){const{independent:t,playlist:r,mediaIndex:i,startOfSegment:n,isSyncRequest:a,partIndex:o,forceTimestampOffset:l,getMediaInfoForTime:u}=e,c=r.segments[i],h=typeof o=="number"&&c.parts[o],f={requestId:"segment-loader-"+Math.random(),uri:h&&h.resolvedUri||c.resolvedUri,mediaIndex:i,partIndex:h?o:null,isSyncRequest:a,startOfSegment:n,playlist:r,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:c.timeline,duration:h&&h.duration||c.duration,segment:c,part:h,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},g=typeof l<"u"?l:this.isPendingTimestampOffset_;f.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:c.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:g});const C=Af(this.sourceUpdater_.audioBuffered());return typeof C=="number"&&(f.audioAppendStart=C-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(f.gopsToAlignWith=bL(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),f}timestampOffsetForSegment_(e){return IL(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),r=e.bandwidth,i=this.pendingSegment_.duration,n=Vi.estimateSegmentRequestTime(i,r,this.playlist_,e.bytesReceived),a=YD(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const o=cL({main:this.vhs_.playlists.main,currentTime:t,bandwidth:r,duration:this.duration_(),segmentDuration:i,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const u=n-a-o.rebufferingImpact;let c=.5;a<=Kr&&(c=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||u<c)&&(this.bandwidth=o.playlist.attributes.BANDWIDTH*ii.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${La(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:r,hasVideo:i}=t,n={segmentInfo:Rs({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:r,hasVideo:i}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},EL(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():Qn(this))))}handleTimingInfo_(e,t,r,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=c_(t);n[a]=n[a]||{},n[a][r]=i,this.logger_(`timinginfo: ${t} - ${r} - ${i}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Qn(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const i=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach(a=>{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const o=n[a.stream];o.startTime=Math.min(o.startTime,a.startTime+i),o.endTime=Math.max(o.endTime,a.endTime+i),o.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:o,endTime:l,captions:u}=n[a],c=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${l} for ${a}`),fL(c,this.vhs_.tech_,a),Sl(o,l,c[a]),pL({captionArray:u,inbandTextTracks:c,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,r));return}this.addMetadataToTextTrack(r,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Qp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:r,hasVideo:i,isMuxed:n}=t;return!(i&&!e.videoTimingInfo||r&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Qp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){Qn(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const r=this.pendingSegment_;if(this.setTimeMapping_(r.timeline),this.updateMediaSecondsLoaded_(r.part||r.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),r.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),r.isFmp4=e.isFmp4,r.timingInfo=r.timingInfo||{},r.isFmp4)this.trigger("fmp4"),r.timingInfo.start=r[c_(t.type)].start;else{const i=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&i&&i.hasVideo;let a;n&&(a=r.videoTimingInfo.start),r.timingInfo.start=this.trueSegmentStart_({currentStart:r.timingInfo.start,playlist:r.playlist,mediaIndex:r.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:r.videoTimingInfo,audioTimingInfo:r.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(r,t.type),this.updateSourceBufferTimestampOffset_(r),r.isSyncRequest){this.updateTimingInfoEnd_(r),this.syncController_.saveSegmentTimingInfo({segmentInfo:r,shouldSaveTimelineMapping:this.loaderType_==="main"});const i=this.chooseNextRequest_();if(i.mediaIndex!==r.mediaIndex||i.partIndex!==r.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}r.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(r,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:r,playlist:i}){if(r){const n=Gc(r);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(r,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=i,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:r},i){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Us(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Us(a).join(", "));const o=n.length?n.start(0):0,l=n.length?n.end(n.length-1):0,u=a.length?a.start(0):0,c=a.length?a.end(a.length-1):0;if(l-o<=hl&&c-u<=hl){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${r.byteLength}, audio buffer: ${Us(n).join(", ")}, video buffer: ${Us(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:r}));const f=this.currentTime_()-hl;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${f}`),this.remove(0,f,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${hl}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=D.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},hl*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:r},i){if(i){if(i.code===CC){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:r});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",i),this.error({message:`${t} append of ${r.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:B.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:r,data:i,bytes:n}){if(!n){const o=[i];let l=i.byteLength;r&&(o.unshift(r),l+=r.byteLength),n=dL({bytes:l,segments:o})}const a={segmentInfo:Rs({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,r){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const i=this.pendingSegment_.segment,n=`${e}TimingInfo`;i[n]||(i[n]={}),i[n].transmuxerPrependedSeconds=r.prependedContentDuration||0,i[n].transmuxedPresentationStart=r.start.presentation,i[n].transmuxedDecodeStart=r.start.decode,i[n].transmuxedPresentationEnd=r.end.presentation,i[n].transmuxedDecodeEnd=r.end.decode,i[n].baseMediaDecodeTime=r.baseMediaDecodeTime}appendData_(e,t){const{type:r,data:i}=t;if(!i||!i.byteLength||r==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:r,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:r,initSegment:n,data:i})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){Qn(this),this.loadQueue_.push(()=>{const t=vt({},e,{forceTimestampOffset:!0});vt(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),r=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),i=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=r||i&&n;this.logger_(`Requesting
|
|
213
|
-
${GC(e.uri)}
|
|
214
|
-
${La(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=nL({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:l,stream:u})=>{this.logger_(`${La(e)} logged from transmuxer stream ${u} as a ${l}: ${o}`)},triggerSegmentEventFn:({type:o,segment:l,keyInfo:u,trackInfo:c,timingInfo:h})=>{const g={segmentInfo:Rs({segment:l})};u&&(g.keyInfo=u),c&&(g.trackInfo=c),h&&(g.timingInfo=h),this.trigger({type:o,metadata:g})}})}trimBackBuffer_(e){const t=AL(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,r=e.part,i=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:r?r.resolvedUri:t.resolvedUri,byterange:r?r.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:i,isMediaInitialization:n},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===t.timeline&&(o.videoTimingInfo?a.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(a.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),t.key){const l=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=l}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<ic){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${ic}`);return}const r={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:r}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,r){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,r));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Yr.ABORTED)return;if(this.pause(),e.code===Yr.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const i=this.pendingSegment_;this.saveBandwidthRelatedStats_(i.duration,t.stats),i.endOfAllRequests=t.endOfAllRequests,r.gopInfo&&(this.gopBuffer_=SL(this.gopBuffer_,r.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(i)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:r,firstVideoFrameTimeForData:i,currentVideoTimestampOffset:n,useVideoTimingInfo:a,videoTimingInfo:o,audioTimingInfo:l}){if(typeof e<"u")return e;if(!a)return l.start;const u=t.segments[r-1];return r===0||!u||typeof u.start>"u"||u.end!==i+n?i:o.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:r,hasVideo:i,isMuxed:n}=t,a=this.loaderType_==="main"&&i,o=!this.audioDisabled_&&r&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=xL(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:r}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:r.start:r.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),i=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end=typeof i.end=="number"?i.end:i.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const l={segmentInfo:Rs({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:l})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=OL(e,this.sourceType_);if(t&&(t.severity==="warn"?B.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${La(e)}`);return}this.logger_(`Appended ${La(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const r=e.segment,i=e.part,n=r.end&&this.currentTime_()-r.end>e.playlist.targetDuration*3,a=i&&i.end&&this.currentTime_()-i.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${La(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<ic){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${ic}`);return}const t=this.throughput.rate,r=Date.now()-e.endOfAllRequests+1,i=Math.floor(e.byteLength/r*8*1e3);this.throughput.rate+=(i-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,r=t.start,i=t.end;if(!u_(r)||!u_(i))return;Sl(r,i,this.segmentMetadataTrack_);const n=D.WebKitDataCue||D.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:r,end:i},o=JSON.stringify(a),l=new n(r,i,o);l.value=a,this.segmentMetadataTrack_.addCue(l)}};function bn(){}const KC=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},ML=["video","audio"],Zp=(s,e)=>{const t=e[`${s}Buffer`];return t&&t.updating||e.queuePending[s]},RL=(s,e)=>{for(let t=0;t<e.length;t++){const r=e[t];if(r.type==="mediaSource")return null;if(r.type===s)return t}return null},no=(s,e)=>{if(e.queue.length===0)return;let t=0,r=e.queue[t];if(r.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),r.action(e),r.doneFn&&r.doneFn(),no("audio",e),no("video",e));return}if(s!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Zp(s,e))){if(r.type!==s){if(t=RL(s,e.queue),t===null)return;r=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[s]=r,r.action(s,e),!r.doneFn){e.queuePending[s]=null,no(s,e);return}}},XC=(s,e)=>{const t=e[`${s}Buffer`],r=KC(s);t&&(t.removeEventListener("updateend",e[`on${r}UpdateEnd_`]),t.removeEventListener("error",e[`on${r}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},zr=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,Yi={appendBuffer:(s,e,t)=>(r,i)=>{const n=i[`${r}Buffer`];if(zr(i.mediaSource,n)){i.logger_(`Appending segment ${e.mediaIndex}'s ${s.length} bytes to ${r}Buffer`);try{n.appendBuffer(s)}catch(a){i.logger_(`Error with code ${a.code} `+(a.code===CC?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${r}Buffer`),i.queuePending[r]=null,t(a)}}},remove:(s,e)=>(t,r)=>{const i=r[`${t}Buffer`];if(zr(r.mediaSource,i)){r.logger_(`Removing ${s} to ${e} from ${t}Buffer`);try{i.remove(s,e)}catch{r.logger_(`Remove ${s} to ${e} from ${t}Buffer failed`)}}},timestampOffset:s=>(e,t)=>{const r=t[`${e}Buffer`];zr(t.mediaSource,r)&&(t.logger_(`Setting ${e}timestampOffset to ${s}`),r.timestampOffset=s)},callback:s=>(e,t)=>{s()},endOfStream:s=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${s||""})`);try{e.mediaSource.endOfStream(s)}catch(t){B.log.warn("Failed to call media source endOfStream",t)}}},duration:s=>e=>{e.logger_(`Setting mediaSource duration to ${s}`);try{e.mediaSource.duration=s}catch(t){B.log.warn("Failed to set media source duration",t)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${s}Buffer`];if(zr(e.mediaSource,t)){e.logger_(`calling abort on ${s}Buffer`);try{t.abort()}catch(r){B.log.warn(`Failed to abort on ${s}Buffer`,r)}}},addSourceBuffer:(s,e)=>t=>{const r=KC(s),i=uo(e);t.logger_(`Adding ${s}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(i);n.addEventListener("updateend",t[`on${r}UpdateEnd_`]),n.addEventListener("error",t[`on${r}Error_`]),t.codecs[s]=e,t[`${s}Buffer`]=n},removeSourceBuffer:s=>e=>{const t=e[`${s}Buffer`];if(XC(s,e),!!zr(e.mediaSource,t)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(r){B.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,r)}}},changeType:s=>(e,t)=>{const r=t[`${e}Buffer`],i=uo(s);if(!zr(t.mediaSource,r))return;const n=s.substring(0,s.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const l={codecsChangeInfo:{from:a,to:s}};t.trigger({type:"codecschange",metadata:l}),t.logger_(`changing ${e}Buffer codec from ${a} to ${s}`);try{r.changeType(i),t.codecs[e]=s}catch(u){l.errorType=B.Error.StreamingCodecsChangeError,l.error=u,u.metadata=l,t.error_=u,t.trigger("error"),B.log.warn(`Failed to changeType on ${e}Buffer`,u)}}},Qi=({type:s,sourceUpdater:e,action:t,doneFn:r,name:i})=>{e.queue.push({type:s,action:t,doneFn:r,name:i}),no(s,e)},d_=(s,e)=>t=>{const r=e[`${s}Buffered`](),i=GD(r);if(e.logger_(`received "updateend" event for ${s} Source Buffer: `,i),e.queuePending[s]){const n=e.queuePending[s].doneFn;e.queuePending[s]=null,n&&n(e[`${s}Error_`])}no(s,e)};let YC=class extends B.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>no("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=vr("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=d_("video",this),this.onAudioUpdateEnd_=d_("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){Qi({type:"mediaSource",sourceUpdater:this,action:Yi.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){Qi({type:e,sourceUpdater:this,action:Yi.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){B.log.error("removeSourceBuffer is not supported!");return}Qi({type:"mediaSource",sourceUpdater:this,action:Yi.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!B.browser.IS_FIREFOX&&D.MediaSource&&D.MediaSource.prototype&&typeof D.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return D.SourceBuffer&&D.SourceBuffer.prototype&&typeof D.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){B.log.error("changeType is not supported!");return}Qi({type:e,sourceUpdater:this,action:Yi.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const r=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,r);this.canChangeType()&&this.changeType(t,r)})}appendBuffer(e,t){const{segmentInfo:r,type:i,bytes:n}=e;if(this.processedAppend_=!0,i==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(Qi({type:i,sourceUpdater:this,action:Yi.appendBuffer(n,r||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),i==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(l=>{this.appendBuffer.apply(this,l)})}}audioBuffered(){return zr(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:si()}videoBuffered(){return zr(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:si()}buffered(){const e=zr(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=zr(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():XD(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=bn){Qi({type:"mediaSource",sourceUpdater:this,action:Yi.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=bn){typeof e!="string"&&(e=void 0),Qi({type:"mediaSource",sourceUpdater:this,action:Yi.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,r=bn){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){r();return}Qi({type:"audio",sourceUpdater:this,action:Yi.remove(e,t),doneFn:r,name:"remove"})}removeVideo(e,t,r=bn){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){r();return}Qi({type:"video",sourceUpdater:this,action:Yi.remove(e,t),doneFn:r,name:"remove"})}updating(){return!!(Zp("audio",this)||Zp("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Qi({type:"audio",sourceUpdater:this,action:Yi.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Qi({type:"video",sourceUpdater:this,action:Yi.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Qi({type:"audio",sourceUpdater:this,action:Yi.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Qi({type:"video",sourceUpdater:this,action:Yi.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),ML.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>XC(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}};const f_=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),BL=s=>{const e=new Uint8Array(s);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},p_=new Uint8Array(`
|
|
215
|
-
|
|
216
|
-
`.split("").map(s=>s.charCodeAt(0)));let FL=class extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}},UL=class extends Jp{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return si();const e=this.subtitlesTrack_.cues,t=e[0].startTime,r=e[e.length-1].startTime;return si([[t,r]])}initSegmentForMap(e,t=!1){if(!e)return null;const r=Gc(e);let i=this.initSegments_[r];if(t&&!i&&e.bytes){const n=p_.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(p_,e.bytes.byteLength),this.initSegments_[r]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return i||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){Sl(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,r){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===Yr.TIMEOUT&&this.handleTimeout_(),e.code===Yr.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const i=this.pendingSegment_,n=r.mp4VttCues&&r.mp4VttCues.length;n&&(i.mp4VttCues=r.mp4VttCues),this.saveBandwidthRelatedStats_(i.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const a=i.segment;if(a.map&&(a.map.bytes=t.map.bytes),i.bytes=t.bytes,typeof D.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,r),()=>this.stopForError({message:"Error loading vtt.js"}));return}a.requested=!0;try{this.parseVTTCues_(i)}catch(o){this.stopForError({message:o.message,metadata:{errorType:B.Error.StreamingVttParserError,error:o}});return}if(n||this.updateTimeMapping_(i,this.syncController_.timelines[i.timeline],this.playlist_),i.cues.length?i.timingInfo={start:i.cues[0].startTime,end:i.cues[i.cues.length-1].endTime}:i.timingInfo={start:i.startOfSegment,end:i.startOfSegment+i.duration},i.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}i.byteLength=i.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,i.cues.forEach(o=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new D.VTTCue(o.startTime,o.endTime,o.text):o)}),TL(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const r=e&&e.type==="vtt",i=t&&t.type==="text";r&&i&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(r=>{const i=r.start+t,n=r.end+t,a=new D.VTTCue(i,n,r.cueText);r.settings&&r.settings.split(" ").forEach(o=>{const l=o.split(":"),u=l[0],c=l[1];a[u]=isNaN(c)?c:Number(c)}),e.cues.push(a)})}parseVTTCues_(e){let t,r=!1;if(typeof D.WebVTT!="function")throw new FL;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof D.TextDecoder=="function"?t=new D.TextDecoder("utf8"):(t=D.WebVTT.StringDecoder(),r=!0);const i=new D.WebVTT.Parser(D,D.vttjs,t);if(i.oncue=e.cues.push.bind(e.cues),i.ontimestampmap=a=>{e.timestampmap=a},i.onparsingerror=a=>{B.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;r&&(a=f_(a)),i.parse(a)}let n=e.bytes;r&&(n=f_(n)),i.parse(n),i.flush()}updateTimeMapping_(e,t,r){const i=e.segment;if(!t)return;if(!e.cues.length){i.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,l=n/Fs.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(u=>{const c=u.endTime-u.startTime,h=this.handleRollover_(u.startTime+l,t.time);u.startTime=Math.max(h,0),u.endTime=Math.max(h+c,0)}),!r.syncInfo){const u=e.cues[0].startTime,c=e.cues[e.cues.length-1].startTime;r.syncInfo={mediaSequence:r.mediaSequence+e.mediaIndex,time:Math.min(u,c-i.duration)}}}handleRollover_(e,t){if(t===null)return e;let r=e*Fs.ONE_SECOND_IN_TS;const i=t*Fs.ONE_SECOND_IN_TS;let n;for(i<r?n=-8589934592:n=8589934592;Math.abs(r-i)>4294967296;)r+=n;return r/Fs.ONE_SECOND_IN_TS}};const $L=function(s,e){const t=s.cues;for(let r=0;r<t.length;r++){const i=t[r];if(e>=i.adStartTime&&e<=i.adEndTime)return i}return null},jL=function(s,e,t=0){if(!s.segments)return;let r=t,i;for(let n=0;n<s.segments.length;n++){const a=s.segments[n];if(i||(i=$L(e,r+a.duration/2)),i){if("cueIn"in a){i.endTime=r,i.adEndTime=r,r+=a.duration,i=null;continue}if(r<i.endTime){r+=a.duration;continue}i.endTime+=a.duration}else if("cueOut"in a&&(i=new D.VTTCue(r,r+a.duration,a.cueOut),i.adStartTime=r,i.adEndTime=r+parseFloat(a.cueOut),e.addCue(i)),"cueOutCont"in a){const[o,l]=a.cueOutCont.split("/").map(parseFloat);i=new D.VTTCue(r,r+a.duration,""),i.adStartTime=r-o,i.adEndTime=i.adStartTime+l,e.addCue(i)}r+=a.duration}};class m_{constructor({start:e,end:t,segmentIndex:r,partIndex:i=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=r,this.partIndex_=i,this.appended_=n}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class VL{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class QC{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:r,segments:i}=e;if(this.isReliable_=this.isReliablePlaylist_(r,i),!!this.isReliable_)return this.updateStorage_(i,r,this.calculateBaseTime_(r,i,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:r}of this.storage_.values())if(r.length){for(const i of r)if(i.isInRange(e))return i}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,r){const i=new Map;let n=`
|
|
217
|
-
`,a=r,o=t;this.start_=a,e.forEach((l,u)=>{const c=this.storage_.get(o),h=a,f=h+l.duration,g=!!(c&&c.segmentSyncInfo&&c.segmentSyncInfo.isAppended),C=new m_({start:h,end:f,appended:g,segmentIndex:u});l.syncInfo=C;let p=a;const T=(l.parts||[]).map((A,N)=>{const F=p,V=p+A.duration,R=!!(c&&c.partsSyncInfo&&c.partsSyncInfo[N]&&c.partsSyncInfo[N].isAppended),O=new m_({start:F,end:V,appended:R,segmentIndex:u,partIndex:N});return p=V,n+=`Media Sequence: ${o}.${N} | Range: ${F} --> ${V} | Appended: ${R}
|
|
218
|
-
`,A.syncInfo=O,O});i.set(o,new VL(C,T)),n+=`${GC(l.resolvedUri)} | Media Sequence: ${o} | Range: ${h} --> ${f} | Appended: ${g}
|
|
219
|
-
`,o++,a=f}),this.end_=a,this.storage_=i,this.diagnostics_=n}calculateBaseTime_(e,t,r){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const i=Math.min(...this.storage_.keys());if(e<i){const n=i-e;let a=this.storage_.get(i).segmentSyncInfo.start;for(let o=0;o<n;o++){const l=t[o];a-=l.duration}return a}return r}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class g_ extends QC{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,r){if(!this.storage_.size){const i=this.parent_.getSyncInfoForMediaSequence(e);return i?i.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,r)}}const HL=86400,Df=[{name:"VOD",run:(s,e,t,r,i)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(s,e,t,r,i,n)=>{const a=s.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const o=a.getSyncInfoForTime(i);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(s,e,t,r,i)=>{if(!Object.keys(s.timelineToDatetimeMappings).length)return null;let n=null,a=null;const o=Hp(e);i=i||0;for(let l=0;l<o.length;l++){const u=e.endList||i===0?l:o.length-(l+1),c=o[u],h=c.segment,f=s.timelineToDatetimeMappings[h.timeline];if(!f||!h.dateTimeObject)continue;let C=h.dateTimeObject.getTime()/1e3+f;if(h.parts&&typeof c.partIndex=="number")for(let T=0;T<c.partIndex;T++)C+=h.parts[T].duration;const p=Math.abs(i-C);if(a!==null&&(p===0||a<p))break;a=p,n={time:C,segmentIndex:c.segmentIndex,partIndex:c.partIndex}}return n}},{name:"Segment",run:(s,e,t,r,i)=>{let n=null,a=null;i=i||0;const o=Hp(e);for(let l=0;l<o.length;l++){const u=e.endList||i===0?l:o.length-(l+1),c=o[u],h=c.segment,f=c.part&&c.part.start||h&&h.start;if(h.timeline===r&&typeof f<"u"){const g=Math.abs(i-f);if(a!==null&&a<g)break;(!n||a===null||a>=g)&&(a=g,n={time:f,segmentIndex:c.segmentIndex,partIndex:c.partIndex})}}return n}},{name:"Discontinuity",run:(s,e,t,r,i)=>{let n=null;if(i=i||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o<e.discontinuityStarts.length;o++){const l=e.discontinuityStarts[o],u=e.discontinuitySequence+o+1,c=s.discontinuities[u];if(c){const h=Math.abs(i-c.time);if(a!==null&&a<h)break;(!n||a===null||a>=h)&&(a=h,n={time:c.time,segmentIndex:l,partIndex:null})}}}return n}},{name:"Playlist",run:(s,e,t,r,i)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];let qL=class extends B.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new QC,r=new g_(t),i=new g_(t);this.mediaSequenceStorage_={main:t,audio:r,vtt:i},this.logger_=vr("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,r,i,n){if(t!==1/0)return Df.find(({name:l})=>l==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,r,i,n);if(!a.length)return null;for(const o of a){const{syncPoint:l,strategy:u}=o,{segmentIndex:c,time:h}=l;if(c<0)continue;const f=e.segments[c],g=h,C=g+f.duration;if(this.logger_(`Strategy: ${u}. Current time: ${i}. selected segment: ${c}. Time: [${g} -> ${C}]}`),i>=g&&i<C)return this.logger_("Found sync point with exact match: ",l),l}return this.selectSyncPoint_(a,{key:"time",value:i})}getExpiredTime(e,t){if(!e||!e.segments)return null;const r=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!r.length)return null;const i=this.selectSyncPoint_(r,{key:"segmentIndex",value:0});return i.segmentIndex>0&&(i.time*=-1),Math.abs(i.time+Ol({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:i.segmentIndex,endIndex:0}))}runStrategies_(e,t,r,i,n){const a=[];for(let o=0;o<Df.length;o++){const l=Df[o],u=l.run(this,e,t,r,i,n);u&&(u.strategy=l.name,a.push({strategy:l.name,syncPoint:u}))}return a}selectSyncPoint_(e,t){let r=e[0].syncPoint,i=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let a=1;a<e.length;a++){const o=Math.abs(e[a].syncPoint[t.key]-t.value);o<i&&(i=o,r=e[a].syncPoint,n=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${r.time}, segmentIndex:${r.segmentIndex}`+(typeof r.partIndex=="number"?`,partIndex:${r.partIndex}`:"")+"]"),r}saveExpiredSegmentInfo(e,t){const r=t.mediaSequence-e.mediaSequence;if(r>HL){B.log.warn(`Not saving expired segment info. Media sequence gap ${r} is too large.`);return}for(let i=r-1;i>=0;i--){const n=e.segments[i];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+i,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],r=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-r}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const r=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),i=e.segment;r&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:i.start}));const n=i.dateTimeObject;i.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[i.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,r){const i=e.segment,n=e.part;let a=this.timelines[e.timeline],o,l;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},r&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,l=t.end+a.mapping;else if(a)o=t.start+a.mapping,l=t.end+a.mapping;else return!1;return n&&(n.start=o,n.end=l),(!i.start||o<i.start)&&(i.start=o),i.end=l,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,r=e.segment;if(r.discontinuity)this.discontinuities[r.timeline]={time:r.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let i=0;i<t.discontinuityStarts.length;i++){const n=t.discontinuityStarts[i],a=t.discontinuitySequence+i+1,o=n-e.mediaIndex,l=Math.abs(o);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>l){let u;o<0?u=r.start-Ol({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):u=r.end+Ol({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:u,accuracy:l}}}}dispose(){this.trigger("dispose"),this.off()}},zL=class extends B.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:r}){return typeof t=="number"&&typeof r=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:r},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:r}){if(typeof t=="number"&&typeof r=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:r},delete this.pendingTimelineChanges_[e];const i={timelineChangeInfo:{from:t,to:r}};this.trigger({type:"timelinechange",metadata:i})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}};const WL=MC(RC(function(){var s=(function(){function p(){this.listeners={}}var T=p.prototype;return T.on=function(N,F){this.listeners[N]||(this.listeners[N]=[]),this.listeners[N].push(F)},T.off=function(N,F){if(!this.listeners[N])return!1;var V=this.listeners[N].indexOf(F);return this.listeners[N]=this.listeners[N].slice(0),this.listeners[N].splice(V,1),V>-1},T.trigger=function(N){var F=this.listeners[N];if(F)if(arguments.length===2)for(var V=F.length,R=0;R<V;++R)F[R].call(this,arguments[1]);else for(var O=Array.prototype.slice.call(arguments,1),M=F.length,U=0;U<M;++U)F[U].apply(this,O)},T.dispose=function(){this.listeners={}},T.pipe=function(N){this.on("data",function(F){N.push(F)})},p})();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(p){return p.subarray(0,p.byteLength-p[p.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const t=function(){const p=[[[],[],[],[],[]],[[],[],[],[],[]]],T=p[0],A=p[1],N=T[4],F=A[4];let V,R,O;const M=[],U=[];let E,P,Y,G,K,le;for(V=0;V<256;V++)U[(M[V]=V<<1^(V>>7)*283)^V]=V;for(R=O=0;!N[R];R^=E||1,O=U[O]||1)for(G=O^O<<1^O<<2^O<<3^O<<4,G=G>>8^G&255^99,N[R]=G,F[G]=R,Y=M[P=M[E=M[R]]],le=Y*16843009^P*65537^E*257^R*16843008,K=M[G]*257^G*16843008,V=0;V<4;V++)T[V][R]=K=K<<24^K>>>8,A[V][G]=le=le<<24^le>>>8;for(V=0;V<5;V++)T[V]=T[V].slice(0),A[V]=A[V].slice(0);return p};let r=null;class i{constructor(T){r||(r=t()),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];let A,N,F;const V=this._tables[0][4],R=this._tables[1],O=T.length;let M=1;if(O!==4&&O!==6&&O!==8)throw new Error("Invalid aes key size");const U=T.slice(0),E=[];for(this._key=[U,E],A=O;A<4*O+28;A++)F=U[A-1],(A%O===0||O===8&&A%O===4)&&(F=V[F>>>24]<<24^V[F>>16&255]<<16^V[F>>8&255]<<8^V[F&255],A%O===0&&(F=F<<8^F>>>24^M<<24,M=M<<1^(M>>7)*283)),U[A]=U[A-O]^F;for(N=0;A;N++,A--)F=U[N&3?A:A-4],A<=4||N<4?E[N]=F:E[N]=R[0][V[F>>>24]]^R[1][V[F>>16&255]]^R[2][V[F>>8&255]]^R[3][V[F&255]]}decrypt(T,A,N,F,V,R){const O=this._key[1];let M=T^O[0],U=F^O[1],E=N^O[2],P=A^O[3],Y,G,K;const le=O.length/4-2;let de,pe=4;const se=this._tables[1],ae=se[0],ce=se[1],he=se[2],ve=se[3],Ae=se[4];for(de=0;de<le;de++)Y=ae[M>>>24]^ce[U>>16&255]^he[E>>8&255]^ve[P&255]^O[pe],G=ae[U>>>24]^ce[E>>16&255]^he[P>>8&255]^ve[M&255]^O[pe+1],K=ae[E>>>24]^ce[P>>16&255]^he[M>>8&255]^ve[U&255]^O[pe+2],P=ae[P>>>24]^ce[M>>16&255]^he[U>>8&255]^ve[E&255]^O[pe+3],pe+=4,M=Y,U=G,E=K;for(de=0;de<4;de++)V[(3&-de)+R]=Ae[M>>>24]<<24^Ae[U>>16&255]<<16^Ae[E>>8&255]<<8^Ae[P&255]^O[pe++],Y=M,M=U,U=E,E=P,P=Y}}class n extends s{constructor(){super(s),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(T){this.jobs.push(T),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(p){return p<<24|(p&65280)<<8|(p&16711680)>>8|p>>>24},o=function(p,T,A){const N=new Int32Array(p.buffer,p.byteOffset,p.byteLength>>2),F=new i(Array.prototype.slice.call(T)),V=new Uint8Array(p.byteLength),R=new Int32Array(V.buffer);let O,M,U,E,P,Y,G,K,le;for(O=A[0],M=A[1],U=A[2],E=A[3],le=0;le<N.length;le+=4)P=a(N[le]),Y=a(N[le+1]),G=a(N[le+2]),K=a(N[le+3]),F.decrypt(P,Y,G,K,R,le),R[le]=a(R[le]^O),R[le+1]=a(R[le+1]^M),R[le+2]=a(R[le+2]^U),R[le+3]=a(R[le+3]^E),O=P,M=Y,U=G,E=K;return V};class l{constructor(T,A,N,F){const V=l.STEP,R=new Int32Array(T.buffer),O=new Uint8Array(T.byteLength);let M=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(R.subarray(M,M+V),A,N,O)),M=V;M<R.length;M+=V)N=new Uint32Array([a(R[M-4]),a(R[M-3]),a(R[M-2]),a(R[M-1])]),this.asyncStream_.push(this.decryptChunk_(R.subarray(M,M+V),A,N,O));this.asyncStream_.push(function(){F(null,e(O))})}static get STEP(){return 32e3}decryptChunk_(T,A,N,F){return function(){const V=o(T,A,N);F.set(V,T.byteOffset)}}}var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c;typeof window<"u"?c=window:typeof u<"u"?c=u:typeof self<"u"?c=self:c={};var h=c,f=function(T){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(T):T&&T.buffer instanceof ArrayBuffer},g=h.BigInt||Number;g("0x1"),g("0x100"),g("0x10000"),g("0x1000000"),g("0x100000000"),g("0x10000000000"),g("0x1000000000000"),g("0x100000000000000"),g("0x10000000000000000"),(function(){var p=new Uint16Array([65484]),T=new Uint8Array(p.buffer,p.byteOffset,p.byteLength);return T[0]===255?"big":T[0]===204?"little":"unknown"})();const C=function(p){const T={};return Object.keys(p).forEach(A=>{const N=p[A];f(N)?T[A]={bytes:N.buffer,byteOffset:N.byteOffset,byteLength:N.byteLength}:T[A]=N}),T};self.onmessage=function(p){const T=p.data,A=new Uint8Array(T.encrypted.bytes,T.encrypted.byteOffset,T.encrypted.byteLength),N=new Uint32Array(T.key.bytes,T.key.byteOffset,T.key.byteLength/4),F=new Uint32Array(T.iv.bytes,T.iv.byteOffset,T.iv.byteLength/4);new l(A,N,F,function(V,R){self.postMessage(C({source:T.source,decrypted:R}),[R.buffer])})}}));var GL=OC(WL);const KL=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},JC=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},em=(s,e)=>{e.activePlaylistLoader=s,s.load()},XL=(s,e)=>()=>{const{segmentLoaders:{[s]:t,main:r},mediaTypes:{[s]:i}}=e,n=i.activeTrack(),a=i.getActiveGroup(),o=i.activePlaylistLoader,l=i.lastGroup_;if(!(a&&l&&a.id===l.id)&&(i.lastGroup_=a,i.lastTrack_=n,JC(t,i),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&r.resetEverything();return}t.resyncLoader(),em(a.playlistLoader,i)}},YL=(s,e)=>()=>{const{segmentLoaders:{[s]:t},mediaTypes:{[s]:r}}=e;r.lastGroup_=null,t.abort(),t.pause()},QL=(s,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[s]:r,main:i},mediaTypes:{[s]:n}}=e,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,u=n.lastTrack_;if(!(u&&a&&u.id===a.id)&&(n.lastGroup_=o,n.lastTrack_=a,JC(r,n),!!o)){if(o.isMainPlaylist){if(!a||!u||a.id===u.id)return;const c=e.vhs.playlistController_,h=c.selectPlaylist();if(c.media()===h)return;n.logger_(`track change. Switching main audio from ${u.id} to ${a.id}`),t.pause(),i.resetEverything(),c.fastQualityChange_(h);return}if(s==="AUDIO"){if(!o.playlistLoader){i.setAudio(!0),i.resetEverything();return}r.setAudio(!0),i.setAudio(!1)}if(l===o.playlistLoader){em(o.playlistLoader,n);return}r.track&&r.track(a),r.resetEverything(),em(o.playlistLoader,n)}},Yc={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:t},excludePlaylist:r}=e,i=t.activeTrack(),n=t.activeGroup(),a=(n.filter(l=>l.default)[0]||n[0]).id,o=t.tracks[a];if(i===o){r({error:{message:"Problem encountered loading the default audio track."}});return}B.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const l in t.tracks)t.tracks[l].enabled=t.tracks[l]===o;t.onTrackChanged()},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:t}}=e;B.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const r=t.activeTrack();r&&(r.mode="disabled"),t.onTrackChanged()}},v_={AUDIO:(s,e,t)=>{if(!e)return;const{tech:r,requestOptions:i,segmentLoaders:{[s]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,i),(!r.paused()||a.endList&&r.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),i),r.paused()||n.load()}),e.on("error",Yc[s](s,t))},SUBTITLES:(s,e,t)=>{const{tech:r,requestOptions:i,segmentLoaders:{[s]:n},mediaTypes:{[s]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();n.playlist(o,i),n.track(a.activeTrack()),(!r.paused()||o.endList&&r.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),i),r.paused()||n.load()}),e.on("error",Yc[s](s,t))}},JL={AUDIO:(s,e)=>{const{vhs:t,sourceType:r,segmentLoaders:{[s]:i},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[s]:{groups:o,tracks:l,logger_:u}},mainPlaylistLoader:c}=e,h=su(c.main);(!a[s]||Object.keys(a[s]).length===0)&&(a[s]={main:{default:{default:!0}}},h&&(a[s].main.default.playlists=c.main.playlists));for(const f in a[s]){o[f]||(o[f]=[]);for(const g in a[s][f]){let C=a[s][f][g],p;if(h?(u(`AUDIO group '${f}' label '${g}' is a main playlist`),C.isMainPlaylist=!0,p=null):r==="vhs-json"&&C.playlists?p=new Ha(C.playlists[0],t,n):C.resolvedUri?p=new Ha(C.resolvedUri,t,n):C.playlists&&r==="dash"?p=new Xp(C.playlists[0],t,n,c):p=null,C=ct({id:g,playlistLoader:p},C),v_[s](s,C.playlistLoader,e),o[f].push(C),typeof l[g]>"u"){const T=new B.AudioTrack({id:g,kind:KL(C),enabled:!1,language:C.language,default:C.default,label:g});l[g]=T}}}i.on("error",Yc[s](s,e))},SUBTITLES:(s,e)=>{const{tech:t,vhs:r,sourceType:i,segmentLoaders:{[s]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[s]:{groups:l,tracks:u}},mainPlaylistLoader:c}=e;for(const h in o[s]){l[h]||(l[h]=[]);for(const f in o[s][h]){if(!r.options_.useForcedSubtitles&&o[s][h][f].forced)continue;let g=o[s][h][f],C;if(i==="hls")C=new Ha(g.resolvedUri,r,a);else if(i==="dash"){if(!g.playlists.filter(T=>T.excludeUntil!==1/0).length)return;C=new Xp(g.playlists[0],r,a,c)}else i==="vhs-json"&&(C=new Ha(g.playlists?g.playlists[0]:g.resolvedUri,r,a));if(g=ct({id:f,playlistLoader:C},g),v_[s](s,g.playlistLoader,e),l[h].push(g),typeof u[f]>"u"){const p=t.addRemoteTextTrack({id:f,kind:"subtitles",default:g.default&&g.autoselect,language:g.language,label:f},!1).track;u[f]=p}}}n.on("error",Yc[s](s,e))},"CLOSED-CAPTIONS":(s,e)=>{const{tech:t,main:{mediaGroups:r},mediaTypes:{[s]:{groups:i,tracks:n}}}=e;for(const a in r[s]){i[a]||(i[a]=[]);for(const o in r[s][a]){const l=r[s][a][o];if(!/^(?:CC|SERVICE)/.test(l.instreamId))continue;const u=t.options_.vhs&&t.options_.vhs.captionServices||{};let c={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(u[c.instreamId]&&(c=ct(c,u[c.instreamId])),c.default===void 0&&delete c.default,i[a].push(ct({id:o},l)),typeof n[o]>"u"){const h=t.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default,language:c.language,label:c.label},!1).track;n[o]=h}}}}},ZC=(s,e)=>{for(let t=0;t<s.length;t++)if(bg(e,s[t])||s[t].playlists&&ZC(s[t].playlists,e))return!0;return!1},ZL=(s,e)=>t=>{const{mainPlaylistLoader:r,mediaTypes:{[s]:{groups:i}}}=e,n=r.media();if(!n)return null;let a=null;n.attributes[s]&&(a=i[n.attributes[s]]);const o=Object.keys(i);if(!a)if(s==="AUDIO"&&o.length>1&&su(e.main))for(let l=0;l<o.length;l++){const u=i[o[l]];if(ZC(u,n)){a=u;break}}else i.main?a=i.main:o.length===1&&(a=i[o[0]]);return typeof t>"u"?a:t===null||!a?null:a.filter(l=>l.id===t.id)[0]||null},eO={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const r in t)if(t[r].enabled)return t[r];return null},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const r in t)if(t[r].mode==="showing"||t[r].mode==="hidden")return t[r];return null}},tO=(s,{mediaTypes:e})=>()=>{const t=e[s].activeTrack();return t?e[s].activeGroup(t):null},iO=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(u=>{JL[u](u,s)});const{mediaTypes:e,mainPlaylistLoader:t,tech:r,vhs:i,segmentLoaders:{["AUDIO"]:n,main:a}}=s;["AUDIO","SUBTITLES"].forEach(u=>{e[u].activeGroup=ZL(u,s),e[u].activeTrack=eO[u](u,s),e[u].onGroupChanged=XL(u,s),e[u].onGroupChanging=YL(u,s),e[u].onTrackChanged=QL(u,s),e[u].getActiveGroup=tO(u,s)});const o=e.AUDIO.activeGroup();if(o){const u=(o.filter(h=>h.default)[0]||o[0]).id;e.AUDIO.tracks[u].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanging())});const l=()=>{e.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",l),r.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),i.on("dispose",()=>{r.audioTracks().removeEventListener("change",l),r.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(const u in e.AUDIO.tracks)r.audioTracks().addTrack(e.AUDIO.tracks[u])},rO=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:bn,activeTrack:bn,getActiveGroup:bn,onGroupChanged:bn,onTrackChanged:bn,lastTrack_:null,logger_:vr(`MediaGroups[${e}]`)}}),s};class y_{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=ji(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class nO extends B.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new y_,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=vr("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const r=t.serverUri||t.serverURL;if(!r){this.logger_(`steering manifest URL is ${r}, cannot request steering manifest.`),this.trigger("error");return}if(r.startsWith("data:")){this.decodeDataUriManifest_(r.substring(r.indexOf(",")+1));return}this.steeringManifest.reloadUri=ji(e,r),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const r=e?t:this.getRequestURI(t);if(!r){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const i={contentSteeringInfo:{uri:r}};this.trigger({type:"contentsteeringloadstart",metadata:i}),this.request_=this.xhr_({uri:r,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410){this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${r} this session.`),this.excludedSteeringManifestURLs.add(r);return}if(a.status===429){const u=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${u} seconds.`),this.startTTLTimeout_(parseInt(u,10));return}this.logger_(`manifest failed to load ${n}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:i});let o;try{o=JSON.parse(this.request_.responseText)}catch(u){const c={errorType:B.Error.StreamingContentSteeringParserError,error:u};this.trigger({type:"error",metadata:c})}this.assignSteeringProperties_(o);const l={contentSteeringInfo:i.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:l}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new D.URL(e),r=new D.URL(this.proxyServerUrl_);return r.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(r.toString())}decodeDataUriManifest_(e){const t=JSON.parse(D.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new D.URL(e),r=this.getPathway(),i=this.getBandwidth_();if(r){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,r)}if(i){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,i)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const r=(i=>{for(const n of i)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==r&&(this.currentPathway=r,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=i=>this.excludedSteeringManifestURLs.has(i);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(e);if(!t(i))return i}const r=this.setSteeringParams_(e);return t(r)?null:r}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=D.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){D.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new y_}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(ji(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const sO=10;let Jn;const aO=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],oO=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},lO=function({currentPlaylist:s,buffered:e,currentTime:t,nextPlaylist:r,bufferLowWaterLine:i,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!r)return B.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${s&&s.id||"null"} -> ${r.id}`;if(!s)return l(`${u} as current playlist is not set`),!0;if(r.id===s.id)return!1;const c=!!Va(e,t).length;if(!s.endList)return!c&&typeof s.partTargetDuration=="number"?(l(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(l(`${u} as current playlist is live`),!0);const h=yg(e,t),f=o?ii.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ii.MAX_BUFFER_LOW_WATER_LINE;if(a<f)return l(`${u} as duration < max low water line (${a} < ${f})`),!0;const g=r.attributes.BANDWIDTH,C=s.attributes.BANDWIDTH;if(g<C&&(!o||h<n)){let p=`${u} as next bandwidth < current bandwidth (${g} < ${C})`;return o&&(p+=` and forwardBuffer < bufferHighWaterLine (${h} < ${n})`),l(p),!0}if((!o||g>C)&&h>=i){let p=`${u} as forwardBuffer >= bufferLowWaterLine (${h} >= ${i})`;return o&&(p+=` and next bandwidth > current bandwidth (${g} > ${C})`),l(p),!0}return l(`not ${u} as no switching criteria met`),!1};class uO extends B.EventTarget{constructor(e){super();const{src:t,withCredentials:r,tech:i,bandwidth:n,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:u,sourceType:c,cacheEncryptionKeys:h,bufferBasedABR:f,leastPixelDiffSelector:g,captionServices:C,experimentalUseMMS:p}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:T}=e;(T===null||typeof T>"u")&&(T=1/0),Jn=a,this.bufferBasedABR=!!f,this.leastPixelDiffSelector=!!g,this.withCredentials=r,this.tech_=i,this.vhs_=i.vhs,this.player_=e.player_,this.sourceType_=c,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=T,this.enableLowInitialPlaylist=u,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:r,maxPlaylistRetries:T,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=rO(),p&&D.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new D.ManagedMediaSource,B.log("Using ManagedMediaSource")):D.MediaSource&&(this.mediaSource=new D.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=si(),this.hasPlayed_=!1,this.syncController_=new qL(e),this.segmentMetadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new GL,this.sourceUpdater_=new YC(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new zL,this.keyStatusMap_=new Map;const A={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:C,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:h,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Xp(t,this.vhs_,ct(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ha(t,this.vhs_,ct(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Jp(ct(A,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Jp(ct(A,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new UL(ct(A,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((V,R)=>{function O(){i.off("vttjserror",M),V()}function M(){i.off("vttjsloaded",O),R()}i.one("vttjsloaded",O),i.one("vttjserror",M),i.addWebVttScript_()})}),e);const N=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new nO(this.vhs_.xhr,N),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),aO.forEach(V=>{this[V+"_"]=oO.bind(this,V)}),this.logger_=vr("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const F=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(F,()=>{const V=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-V,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,r){const i=this.media(),n=i&&(i.id||i.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const o={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:o}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,r)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],r=t?t.activeGroup():null,i=this.contentSteeringController_.getPathway();if(r&&i){const a=(r.length?r[0].playlists:r.playlists).filter(o=>o.attributes.serviceLocation===i);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=D.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(D.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const r=e.mediaGroups.AUDIO,i=Object.keys(r);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const o=r.main||i.length&&r[i[0]];for(const l in o)if(o[l].default){n={label:l};break}}if(!n)return t;const a=[];for(const o in r)if(r[o][n.label]){const l=r[o][n.label];if(l.playlists&&l.playlists.length)a.push.apply(a,l.playlists);else if(l.uri)a.push(l);else if(e.playlists.length)for(let u=0;u<e.playlists.length;u++){const c=e.playlists[u];c.attributes&&c.attributes.AUDIO&&c.attributes.AUDIO===o&&a.push(c)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const t=this.mainPlaylistLoader_.media(),r=t.targetDuration*1.5*1e3;qp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=r,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),iO({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let r;if(this.enableLowInitialPlaylist&&(r=this.selectInitialPlaylist()),r||(r=this.selectPlaylist()),!r||!this.shouldSwitchToMedia_(r)||(this.initialMedia_=r,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),r=t.targetDuration*1.5*1e3;qp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=r,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(t=>{this.mainPlaylistLoader_.on(t,r=>{this.player_.trigger(vt({},r))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const r=e.mediaGroups||{};let i=!0;const n=Object.keys(r.AUDIO);for(const a in r.AUDIO)for(const o in r.AUDIO[a])r.AUDIO[a][o].uri||(i=!1);i&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(r.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Jn.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(r.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,r=this.tech_.currentTime(),i=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return lO({buffered:a,currentTime:r,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:i,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const r=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:r.playlist,error:r})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const r=this.audioSegmentLoader_.pendingSegment_;if(!r||!r.segment||!r.segment.syncInfo)return;const i=r.segment.syncInfo.end+.01;this.tech_.setCurrentTime(i)}),this.mainSegmentLoader_.on("earlyabort",r=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:sO}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const r=this.getCodecsOrExclude_();r&&this.sourceUpdater_.addOrChangeSourceBuffers(r)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(r=>{this.mainSegmentLoader_.on(r,i=>{this.player_.trigger(vt({},i))}),this.audioSegmentLoader_.on(r,i=>{this.player_.trigger(vt({},i))}),this.subtitleSegmentLoader_.on(r,i=>{this.player_.trigger(vt({},i))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.mainSegmentLoader_.load()})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const r=t.end(0);let i=r;if(e.start){const n=e.start.timeOffset;n<0?i=Math.max(r+n,t.start(0)):i=Math.min(r,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(i)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,t=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const r=this.syncController_.getExpiredTime(e,this.duration());if(r===null)return!1;const i=Jn.Playlist.playlistEnd(e,r),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return i-n<=Xr;const o=a.end(a.length-1);return o-n<=Xr&&i-o<=Xr}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:r}){if(e=e||this.mainPlaylistLoader_.media(),r=r||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const i=this.mainPlaylistLoader_.main.playlists,n=i.filter(Wh),a=n.length===1&&n[0]===e;if(i.length===1&&r!==1/0)return B.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const C=this.pathwayAttribute_(e),p=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(C),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(C)},p);return}let g=!1;i.forEach(C=>{if(C===e)return;const p=C.excludeUntil;typeof p<"u"&&p!==1/0&&(g=!0,delete C.excludeUntil)}),g&&(B.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+r*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const l=this.selectPlaylist();if(!l){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const u=t.internal?this.logger_:B.log.warn,c=t.message?" "+t.message:"";u(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${c} Switching to playlist ${l.id}.`),l.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const h=l.targetDuration/2*1e3||5*1e3,f=typeof l.lastRequest=="number"&&Date.now()-l.lastRequest<=h;return this.switchMedia_(l,"exclude",a||f)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const r=[],i=e==="all";(i||e==="main")&&r.push(this.mainPlaylistLoader_);const n=[];(i||e==="audio")&&n.push("AUDIO"),(i||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&r.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&r.push(o)}),r.forEach(a=>t.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const t=Va(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Jn.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const r=e.media();if(!r)return null;const i=this.syncController_.getMediaSequenceSync(t);if(i&&i.isReliable){const o=i.start,l=i.end;if(!isFinite(o)||!isFinite(l))return null;const u=Jn.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,r),c=Math.max(0,l-u);return c<o?null:si([[o,c]])}const n=this.syncController_.getExpiredTime(r,this.duration());if(n===null)return null;const a=Jn.Playlist.seekable(r,n,Jn.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,r));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;const r=e.start(0),i=e.end(0),n=t.start(0),a=t.end(0);return n>i||r>a?e:si([[Math.max(r,n),Math.min(i,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;const r=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||r&&r.length&&this.seekable_.length&&r.start(0)===this.seekable_.start(0)&&r.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${cC(this.seekable_)}]`);const i={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:i}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const i=this.seekable();if(!i.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<i.end(i.length-1))&&this.sourceUpdater_.setDuration(i.end(i.length-1));return}const t=this.tech_.buffered();let r=Jn.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(r=Math.max(r,t.end(t.length-1))),this.mediaSource.duration!==r&&this.sourceUpdater_.setDuration(r)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const r in t)t[r].forEach(i=>{i.playlistLoader&&i.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),r=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!r)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const r=Ml(this.main(),t),i={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(i.video=r.video||e.main.videoCodec||XA),e.main.isMuxed&&(i.video+=`,${r.audio||e.main.audioCodec||ny}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(i.audio=r.audio||e.main.audioCodec||e.audio.audioCodec||ny,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!i.audio&&!i.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(u,c)=>u?Pl(c):hf(c),o={};let l;if(["video","audio"].forEach(function(u){if(i.hasOwnProperty(u)&&!a(e[u].isFmp4,i[u])){const c=e[u].isFmp4?"browser":"muxer";o[c]=o[c]||[],o[c].push(i[u]),u==="audio"&&(l=c)}}),n&&l&&t.attributes.AUDIO){const u=t.attributes.AUDIO;this.main().playlists.forEach(c=>{(c.attributes&&c.attributes.AUDIO)===u&&c!==t&&(c.excludeUntil=1/0)}),this.logger_(`excluding audio group ${u} as ${l} does not support codec(s): "${i.audio}"`)}if(Object.keys(o).length){const u=Object.keys(o).reduce((c,h)=>(c&&(c+=", "),c+=`${h} does not support codec(s): "${o[h].join(",")}"`,c),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:u},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const u=[];if(["video","audio"].forEach(c=>{const h=(Hr(this.sourceUpdater_.codecs[c]||"")[0]||{}).type,f=(Hr(i[c]||"")[0]||{}).type;h&&f&&h.toLowerCase()!==f.toLowerCase()&&u.push(`"${this.sourceUpdater_.codecs[c]}" -> "${i[c]}"`)}),u.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${u.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return i}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(r=>{const i=e[r];if(t.indexOf(i.id)!==-1)return;t.push(i.id);const n=Ml(this.main,i),a=[];n.audio&&!hf(n.audio)&&!Pl(n.audio)&&a.push(`audio codec ${n.audio}`),n.video&&!hf(n.video)&&!Pl(n.video)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(i.excludeUntil=1/0,this.logger_(`excluding ${i.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],r=this.main().playlists,i=Kc(Hr(e)),n=s_(i),a=i.video&&Hr(i.video)[0]||null,o=i.audio&&Hr(i.audio)[0]||null;Object.keys(r).forEach(l=>{const u=r[l];if(t.indexOf(u.id)!==-1||u.excludeUntil===1/0)return;t.push(u.id);const c=[],h=Ml(this.mainPlaylistLoader_.main,u),f=s_(h);if(!(!h.audio&&!h.video)){if(f!==n&&c.push(`codec count "${f}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const g=h.video&&Hr(h.video)[0]||null,C=h.audio&&Hr(h.audio)[0]||null;g&&a&&g.type.toLowerCase()!==a.type.toLowerCase()&&c.push(`video codec "${g.type}" !== "${a.type}"`),C&&o&&C.type.toLowerCase()!==o.type.toLowerCase()&&c.push(`audio codec "${C.type}" !== "${o.type}"`)}c.length&&(u.excludeUntil=1/0,this.logger_(`excluding ${u.id}: ${c.join(" && ")}`))}})}updateAdCues_(e){let t=0;const r=this.seekable();r.length&&(t=r.start(0)),jL(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=ii.GOAL_BUFFER_LENGTH,r=ii.GOAL_BUFFER_LENGTH_RATE,i=Math.max(t,ii.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*r,i)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=ii.BUFFER_LOW_WATER_LINE,r=ii.BUFFER_LOW_WATER_LINE_RATE,i=Math.max(t,ii.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,ii.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*r,this.bufferBasedABR?n:i)}bufferHighWaterLine(){return ii.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){l_(this.inbandTextTracks_,"com.apple.streaming",this.tech_),_L({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,r){const i=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();l_(this.inbandTextTracks_,e,this.tech_),gL({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:i,videoDuration:r})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.contentSteeringController_.on(t,r=>{this.trigger(vt({},r))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const n=this.contentSteeringController_.getAvailablePathways(),a=[];for(const o of t.playlists){const l=o.attributes.serviceLocation;if(l&&(a.push(l),!n.has(l)))return!0}return!!(!a.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const r=this.main().playlists,i=new Set;let n=!1;Object.keys(r).forEach(a=>{const o=r[a],l=this.pathwayAttribute_(o),u=l&&e!==l;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!u&&(delete o.excludeUntil,delete o.lastExcludeReason_,n=!0);const h=!o.excludeUntil&&o.excludeUntil!==1/0;!i.has(o.id)&&u&&h&&(i.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const o=this.mediaTypes_[a];if(o.activePlaylistLoader){const l=o.activePlaylistLoader.media_;l&&l.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,r=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(r&&r.size||i&&i.size){for(const[a,o]of r.entries())i.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(o),this.contentSteeringController_.excludePathway(a));for(const[a,o]of i.entries()){const l=r.get(a);if(!l){t.filter(c=>c.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(c=>{this.mainPlaylistLoader_.addClonePathway(o,c)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(l,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const r=e["URI-REPLACEMENT"].PARAMS,i=t["URI-REPLACEMENT"].PARAMS;for(const n in r)if(r[n]!==i[n])return!1;for(const n in i)if(r[n]!==i[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(r=>{const i=this.mainPlaylistLoader_.getKeyIdSet(r);!i||!i.size||i.forEach(n=>{const a="usable",o=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,l=r.lastExcludeReason_===t&&r.excludeUntil===1/0;o?o&&l&&(delete r.excludeUntil,delete r.lastExcludeReason_,this.logger_(`enabling playlist ${r.id} because key ID ${n} is ${a}`)):(r.excludeUntil!==1/0&&r.lastExcludeReason_!==t&&(r.excludeUntil=1/0,r.lastExcludeReason_=t,this.logger_(`excluding playlist ${r.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(r=>{const i=r&&r.attributes&&r.attributes.RESOLUTION&&r.attributes.RESOLUTION.height<720,n=r.excludeUntil===1/0&&r.lastExcludeReason_===t;i&&n&&(delete r.excludeUntil,B.log.warn(`enabling non-HD playlist ${r.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:BL(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const cO=(s,e,t)=>r=>{const i=s.main.playlists[e],n=Tg(i),a=Wh(i);if(typeof r>"u")return a;r?delete i.disabled:i.disabled=!0;const o={renditionInfo:{id:e,bandwidth:i.attributes.BANDWIDTH,resolution:i.attributes.RESOLUTION,codecs:i.attributes.CODECS},cause:"fast-quality"};return r!==a&&!n&&(t(i),r?s.trigger({type:"renditionenabled",metadata:o}):s.trigger({type:"renditiondisabled",metadata:o})),r};let hO=class{constructor(e,t,r){const{playlistController_:i}=e,n=i.fastQualityChange_.bind(i);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Ml(i.main(),t),this.playlist=t,this.id=r,this.enabled=cO(e.playlists,t.id,n)}};const dO=function(s){s.representations=()=>{const e=s.playlistController_.main(),t=su(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(r=>!Tg(r)).map((r,i)=>new hO(s,r,r.id)):[]}},__=["seeking","seeked","pause","playing","error"];let fO=class extends B.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=vr("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),r=()=>this.monitorCurrentTime_(),i=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach(c=>{l[c]={reset:()=>this.resetSegmentDownloads_(c),updateend:()=>this.checkSegmentDownloads_(c)},a[`${c}SegmentLoader_`].on("appendsdone",l[c].updateend),a[`${c}SegmentLoader_`].on("playlistupdate",l[c].reset),this.tech_.on(["seeked","seeking"],l[c].reset)});const u=c=>{["main","audio"].forEach(h=>{a[`${h}SegmentLoader_`][c]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),u("off"))},this.clearSeekingAppendCheck_=()=>u("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),u("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",i),this.tech_.on(__,n),this.tech_.on("canplay",r),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",i),this.tech_.off(__,n),this.tech_.off("canplay",r),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(c=>{a[`${c}SegmentLoader_`].off("appendsdone",l[c].updateend),a[`${c}SegmentLoader_`].off("playlistupdate",l[c].reset),this.tech_.off(["seeked","seeking"],l[c].reset)}),this.checkCurrentTimeTimeout_&&D.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&D.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=D.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,r=t[`${e}SegmentLoader_`],i=r.buffered_(),n=QD(this[`${e}Buffered_`],i);if(this[`${e}Buffered_`]=i,n){const a={bufferedRanges:i};t.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:r.playlist_&&r.playlist_.id,buffered:Us(i)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Xr>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(si([this.lastRecordedTime,e]));const r={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:r}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),r=this.tech_.currentTime(),i=this.afterSeekableWindow_(t,r,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(i&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,r)){const C=t.start(0);n=C+(C===t.end(0)?0:Xr)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${r} with seekable range ${cC(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),l=a.audioBuffer?a.audioBuffered():null,u=a.videoBuffer?a.videoBuffered():null,c=this.media(),h=c.partTargetDuration?c.partTargetDuration:(c.targetDuration-Kr)*2,f=[l,u];for(let C=0;C<f.length;C++){if(!f[C])continue;if(yg(f[C],r)<h)return!1}const g=ec(o,r);return g.length===0?!1:(n=g.start(0)+Xr,this.logger_(`Buffered region starts (${g.start(0)}) just beyond seek point (${r}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),r=Va(t,e);if(r.length&&e+3<=r.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${r.start(0)} -> ${r.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const r=this.tech_.vhs.playlistController_.sourceUpdater_,i=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:r.audioBuffered(),videoBuffered:r.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=ec(i,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,r,i=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Xr;const a=!r.endList,o=typeof r.partTargetDuration=="number";return a&&(o||i)&&(n=e.end(e.length-1)+r.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:r}){if(!e)return;let i;if(e.length&&t.length){const n=Va(e,r-3),a=Va(e,r),o=Va(t,r);o.length&&!a.length&&n.length&&(i={start:n.end(0),end:o.end(0)})}else ec(e,r).length||(i=this.gapFromVideoUnderflow_(e,r));return i?(this.logger_(`Encountered a gap in video from ${i.start} to ${i.end}. Seeking to current time ${r}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),r=this.tech_.currentTime(),i=ec(t,r);if(this.resetTimeUpdate_(),i.length===0||r!==e)return;this.logger_("skipTheGap_:","currentTime:",r,"scheduled currentTime:",e,"nextRange start:",i.start(0)),this.tech_.setCurrentTime(i.start(0)+Kr);const n={gapInfo:{from:r,to:i.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const r=KD(e);for(let i=0;i<r.length;i++){const n=r.start(i),a=r.end(i);if(t-n<4&&t-n>2)return{start:n,end:a}}return null}};const pO={errorInterval:30,getSource(s){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return s(t)}},e1=function(s,e){let t=0,r=0;const i=ct(pO,e);s.ready(()=>{s.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){r&&s.currentTime(r)},a=function(c){c!=null&&(r=s.duration()!==1/0&&s.currentTime()||0,s.one("loadedmetadata",n),s.src(c),s.trigger({type:"usage",name:"vhs-error-reload"}),s.play())},o=function(){if(Date.now()-t<i.errorInterval*1e3){s.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!i.getSource||typeof i.getSource!="function"){B.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),i.getSource.call(s,a)},l=function(){s.off("loadedmetadata",n),s.off("error",o),s.off("dispose",l)},u=function(c){l(),e1(s,c)};s.on("error",o),s.on("dispose",l),s.reloadSourceOnError=u},mO=function(s){e1(this,s)};var t1="3.16.0",gO="7.1.0",vO="1.3.1",yO="7.2.0",_O="4.0.2";const Rt={PlaylistLoader:Ha,Playlist:Vi,utils:bN,STANDARD_PLAYLIST_SELECTOR:o_,INITIAL_PLAYLIST_SELECTOR:hL,lastBandwidthSelector:o_,movingAverageBandwidthSelector:uL,comparePlaylistBandwidth:Cg,comparePlaylistResolution:lL,xhr:xC()};Object.keys(ii).forEach(s=>{Object.defineProperty(Rt,s,{get(){return B.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),ii[s]},set(e){if(B.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){B.log.warn(`value of Vhs.${s} must be greater than or equal to 0`);return}ii[s]=e}})});const i1="videojs-vhs",r1=function(s,e){const t=e.media();let r=-1;for(let i=0;i<s.length;i++)if(s[i].id===t.id){r=i;break}s.selectedIndex_=r,s.trigger({selectedIndex:r,type:"change"})},TO=function(s,e){e.representations().forEach(t=>{s.addQualityLevel(t)}),r1(s,e.playlists)};Rt.canPlaySource=function(){return B.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const bO=(s,e,t)=>{if(!s)return s;let r={};e&&e.attributes&&e.attributes.CODECS&&(r=Kc(Hr(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(r.audio=t.attributes.CODECS);const i=uo(r.video),n=uo(r.audio),a={};for(const o in s)a[o]={},n&&(a[o].audioContentType=n),i&&(a[o].videoContentType=i),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof s[o]=="string"&&(a[o].url=s[o]);return ct(s,a)},SO=(s,e)=>s.reduce((t,r)=>{if(!r.contentProtection)return t;const i=e.reduce((n,a)=>{const o=r.contentProtection[a];return o&&o.pssh&&(n[a]={pssh:o.pssh}),n},{});return Object.keys(i).length&&t.push(i),t},[]),CO=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:r})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const i=t?r.concat([t]):r,n=SO(i,Object.keys(e)),a=[],o=[];return n.forEach(l=>{o.push(new Promise((u,c)=>{s.tech_.one("keysessioncreated",u)})),a.push(new Promise((u,c)=>{s.eme.initializeMediaKeys({keySystems:l},h=>{if(h){c(h);return}u()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},EO=({player:s,sourceKeySystems:e,media:t,audioMedia:r})=>{const i=bO(e,t,r);return i?(s.currentSource().keySystems=i,i&&!s.eme?(B.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},n1=()=>{if(!D.localStorage)return null;const s=D.localStorage.getItem(i1);if(!s)return null;try{return JSON.parse(s)}catch{return null}},wO=s=>{if(!D.localStorage)return!1;let e=n1();e=e?ct(e,s):s;try{D.localStorage.setItem(i1,JSON.stringify(e))}catch{return!1}return e},kO=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,s1=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},a1=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},o1=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},l1=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};Rt.supportsNativeHls=(function(){if(!ue||!ue.createElement)return!1;const s=ue.createElement("video");return B.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(s.canPlayType(t))}):!1})();Rt.supportsNativeDash=(function(){return!ue||!ue.createElement||!B.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(ue.createElement("video").canPlayType("application/dash+xml"))})();Rt.supportsTypeNatively=s=>s==="hls"?Rt.supportsNativeHls:s==="dash"?Rt.supportsNativeDash:!1;Rt.isSupported=function(){return B.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};Rt.xhr.onRequest=function(s){s1(Rt.xhr,s)};Rt.xhr.onResponse=function(s){a1(Rt.xhr,s)};Rt.xhr.offRequest=function(s){o1(Rt.xhr,s)};Rt.xhr.offResponse=function(s){l1(Rt.xhr,s)};const xO=B.getComponent("Component");let u1=class extends xO{constructor(e,t,r){if(super(t,r.vhs),typeof r.initialBandwidth=="number"&&(this.options_.bandwidth=r.initialBandwidth),this.logger_=vr("VhsHandler"),t.options_&&t.options_.playerId){const i=B.getPlayer(t.options_.playerId);this.player_=i}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(ue,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],i=>{const n=ue.fullscreenElement||ue.webkitFullscreenElement||ue.mozFullScreenElement||ue.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=ct(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const r=n1();r&&r.bandwidth&&(this.options_.bandwidth=r.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),r&&r.throughput&&(this.options_.throughput=r.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=ii.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===ii.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(r=>{typeof this.source_[r]<"u"&&(this.options_[r]=this.source_[r])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=kO(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Rt,this.options_.sourceType=P0(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new uO(this.options_);const r=ct({liveRangeSafeTimeDelta:Xr},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new fO(r),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=B.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const i=this.options_.bufferBasedABR?Rt.movingAverageBandwidthSelector(.55):Rt.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):i.bind(this),this.playlistController_.selectInitialPlaylist=Rt.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=D.navigator.connection||D.navigator.mozConnection||D.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const l=a.downlink*1e3*1e3;l>=o&&n>=o?n=Math.max(n,l):n=l}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){B.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Us(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Us(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&wO({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{dO(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=D.URL.createObjectURL(this.playlistController_.mediaSource),(B.browser.IS_ANY_SAFARI||B.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),CO({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=EO({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",r=>{this.playlistController_.updatePlaylistByKeyStatus(r.keyId,r.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=B.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{TO(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{r1(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":t1,"mux.js":gO,"mpd-parser":vO,"m3u8-parser":yO,"aes-decrypter":_O}}version(){return this.constructor.version()}canChangeType(){return YC.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&D.URL.revokeObjectURL&&(D.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return AN({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,r=!0,i=2){return NC({programTime:e,playlist:this.playlistController_.media(),retryCount:i,pauseAfterSeek:r,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{s1(this.xhr,e)},this.xhr.onResponse=e=>{a1(this.xhr,e)},this.xhr.offRequest=e=>{o1(this.xhr,e)},this.xhr.offResponse=e=>{l1(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(r=>{this.playlistController_.on(r,i=>{this.player_.trigger(vt({},i))})}),t.forEach(r=>{this.playbackWatcher_.on(r,i=>{this.player_.trigger(vt({},i))})})}};const Qc={name:"videojs-http-streaming",VERSION:t1,canHandleSource(s,e={}){const t=ct(B.options,e);return!t.vhs.experimentalUseMMS&&!Pl("avc1.4d400d,mp4a.40.2",!1)?!1:Qc.canPlayType(s.type,t)},handleSource(s,e,t={}){const r=ct(B.options,t);return e.vhs=new u1(s,e,r),e.vhs.xhr=xC(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const t=P0(s);if(!t)return"";const r=Qc.getOverrideNative(e);return!Rt.supportsTypeNatively(t)||r?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,t=!(B.browser.IS_ANY_SAFARI||B.browser.IS_IOS),{overrideNative:r=t}=e;return r}},AO=()=>Pl("avc1.4d400d,mp4a.40.2",!0);AO()&&B.getTech("Html5").registerSourceHandler(Qc,0);B.VhsHandler=u1;B.VhsSourceHandler=Qc;B.Vhs=Rt;B.use||B.registerComponent("Vhs",Rt);B.options.vhs=B.options.vhs||{};(!B.getPlugin||!B.getPlugin("reloadSourceOnError"))&&B.registerPlugin("reloadSourceOnError",mO);const IO=B.getComponent("MenuItem");class PO extends IO{constructor(e,t){super(e,t)}handleClick(e){super.handleClick(e),this.requestAnimationFrame(()=>{this.options_.item.showCollapsibleMenu()})}createEl(e,t,r){if(!this.options_.item)return super.createEl(e,t,r);const i=this.options_.item.getCollabsibleName(),n=this.options_.item.getCollabsibleValue(),a=this.options_.item.className,o=`<span class="vjs-menu-item-text">${i}</span>`;this.valueHolder_=B.dom.createEl("span",{innerHTML:n});const l=super.createEl(e,{className:`vjs-menu-item cv-cog-menu-item ${n?"cv-has-cog-value":""} ${a||""}`.trim(),innerHTML:o},r);return l.appendChild(this.valueHolder_),l}updateCollapsibleValue(){this.valueHolder_.innerHTML=this.options_.item.getCollabsibleValue()}}const DO=B.getComponent("MenuButton"),Ul=class Ul extends DO{constructor(e,t){super(e,t),this.controlText("Settings")}buildWrapperCSSClass(){return`cv-menu-small cv-cog-menu-button ${super.buildWrapperCSSClass()}`}buildCSSClass(){return`cv-cog-button ${super.buildCSSClass()}`}pressButton(){if(this.player_.options_.deferMenus){this.player_.deferMenusPlugin().deferMenu();return}this.menu.children_.forEach(e=>{e.updateCollapsibleValue&&e.updateCollapsibleValue()}),super.pressButton()}createItems(){var t;const e=[];for(let r=0;r<this.options_.items.length;r++){const i=this.options_.items[r];i.isCollabsible&&i.showInCollabsibleMenu()&&i.isCollapsed&&e.push(new PO(this.player_,{item:i}))}return(t=this.additionalItems)!=null&&t.length&&[...this.additionalItems].sort((i,n)=>{const a=Ul.additionalItemOrder.indexOf(i.name);return Ul.additionalItemOrder.indexOf(n.name)-a}).forEach(i=>{const n=new i.ctor(this.player_,{...this.options_,...i.options??{}});e.splice(0,0,n)}),e}update(){super.update(),this.player_.trigger("resizemenus")}addItem(e){this.additionalItems||(this.additionalItems=[]),!this.additionalItems.some(t=>t.name===e.name)&&(this.additionalItems.push(e),this.update())}};Ul.additionalItemOrder=["EngagementOverlayMenuItem","PointsOfInterestMenuItem","LoopVideoMenuItem","NextVideoMenuItem"];let tm=Ul;B.registerComponent("cogButton",tm);const NO=B.getComponent("MenuItem");class aa extends NO{constructor(e,t){super(e,t)}createEl(){return B.dom.createEl("li",{className:"vjs-menu-item cv-collapsible-menu-heading cv-divider-after-menu-item",innerHTML:`<span class="vjs-menu-item-text">${this.localize(this.options_.label)}</span>`,tabIndex:-1})}handleClick(e){if(super.handleClick(e),this.options_.onClickBack){this.options_.onClickBack();return}this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("cogButton").pressButton()})}}const LO=B.getComponent("MenuItem"),T_=B.getComponent("MenuButton"),OO=["large","medium","small"];let MO=class extends LO{constructor(e,t){super(e,t)}handleClick(){this.player_.textTrackSettings.setSizeSetting(this.options_.value)}};class RO extends T_{constructor(e,t){super(e,t),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.player_.ready(()=>{this.update()})}createItems(){const e=this.player_.textTrackSettings;if(!e)return;const t=e.getSizeSetting(),r=[new aa(this.player_,{label:"Caption Text Size",onClickBack:()=>{this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("subsCapsButton").pressButton()})}})];return OO.map(i=>{r.push(new MO(this.player_,{label:i.charAt(0).toUpperCase()+i.substring(1),selectable:!0,multiSelectable:!1,selected:i===t,value:i}))}),r}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}getCollabsibleName(){return"Subtitle Size"}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!1}showCollapsibleMenu(){T_.prototype.handleClick.apply(this)}}B.registerComponent("SubtitleSizeButton",RO);function Eg(s,e,t,r){if(!s.length)return[];const i=[];for(let n=s.length-1;n>=0;n--){const a=s[n];if(a.kind===e){if(t&&a.label!==t||r&&a.language!==r)continue;i.push(a)}}return i}function Jc(s,e,t,r,i){if(s.kind===e&&!(t&&s.label!==t)&&!(i&&s.language!==i)){if(s.loaded_){r(s);return}s.one("loadeddata",()=>{r(s)})}}function b_(s){if(s!=null&&s.cues.length)for(let e=0;e<s.cues.length;e++){const t=s.cues[e];t!=null&&t.text&&(t.text=o0.sanitize(t.text))}}function S_(s,e,t,r,i){const n=s.textTracks(),a=Eg(n,e,t,i)[0];if(a){Jc(a,e,t,r);return}const o=l=>{Jc(l.track,e,t,r),n.removeEventListener("addtrack",o)};n.addEventListener("addtrack",o),s.one("dispose",()=>{n.removeEventListener("addtrack",o)})}function C_(s,e,t,r,i){const n=s.textTracks(),a=Eg(n,e,t,i);a.length&&a.forEach(l=>Jc(l,e,t,r,i));const o=l=>{Jc(l.track,e,t,r,i)};n.addEventListener("addtrack",o),s.one("dispose",()=>{n.removeEventListener("addtrack",o)})}const Zt={getTrack(s,e,t,r){const i=s.textTracks();return Eg(i,e,t,r)[0]},useChapters(s,e){S_(s,"chapters",null,e)},useMetadataTrack(s,e,t){S_(s,"metadata",e,t,null)},useMetadataTracks(s,e,t,r){C_(s,"metadata",e,t,r)},useSubtitles(s,e,t){C_(s,"subtitles",null,e,t)},getCurrentTextTrack(s){return this.findTrackByPredicate(s,e=>e.mode==="showing")},findTrackByPredicate(s,e){if(!s)return null;const t=s.textTracks();for(let r=0;r<t.length;r++){const i=t[r];if(e(i))return i}return null},forEachTrack(s,e){if(!s)return;const t=s.textTracks();for(let r=0;r<t.length;r++){const i=t[r];e(i)}},sanitizeTrack(s,e){if(!s||!e)return;if(s.loaded){b_(s);return}const t=()=>b_(s);s.addEventListener("loadeddata",t),e.one("dispose",()=>{s.removeEventListener("loadeddata",t)})}},BO=function(s,e){let t=window.performance.now();return function(...i){const n=window.performance.now();n-t>=e&&(s(...i),t=n)}},au=function(s,e,t,r=window){let i;const n=()=>{r.clearTimeout(i),i=null},a=(...o)=>{let l=!1,u=function(){i=null,u=null,s.apply(this,o)};return!i&&t&&(s.apply(this,o),l=!0),r.clearTimeout(i),i=r.setTimeout(u,e),l};return a.cancel=n,a},c1=B.getComponent("MenuItem");class wg extends c1{constructor(e,t){super(e,t),this.onChange=au(this.onChange,100,!1,this),this.bindEventListeners()}createEl(){const e=this.localize("Search");return super.createEl("li",{className:`vjs-menu-item cv-search-input-menu-item-container ${this.options_.className||""}`.trim(),innerHTML:`
|
|
220
|
-
<div class="cv-search-input-menu-item">
|
|
221
|
-
<span class="cv-search-icon">
|
|
222
|
-
<svg viewBox="0 0 24 24">
|
|
223
|
-
<path d="M15.803 14.306l3.917 3.954a1 1 0 0 1-.007 1.417l-.018.018-.018.018a.997.997 0 0 1-1.41 0l-3.918-3.953-.3.214c-1.14.713-2.323 1.07-3.549 1.07-1.796 0-3.328-.642-4.597-1.925C4.634 13.836 4 12.296 4 10.5c0-1.796.634-3.328 1.903-4.597C7.172 4.634 8.704 4 10.5 4c1.796 0 3.329.634 4.597 1.903 1.27 1.269 1.904 2.801 1.904 4.597a6.447 6.447 0 0 1-1.027 3.507l-.17.3zM10.5 5.368c-1.425 0-2.637.5-3.635 1.497-.998.998-1.497 2.21-1.497 3.635 0 1.426.5 2.637 1.497 3.635.998.998 2.21 1.497 3.635 1.497 1.426 0 2.637-.499 3.635-1.497 1.027-1.026 1.54-2.238 1.54-3.635 0-1.397-.513-2.608-1.54-3.635-.998-.998-2.21-1.497-3.635-1.497z"/>
|
|
224
|
-
</svg>
|
|
225
|
-
</span><input placeholder="${e}" type="text" autocomplete="off" spellcheck="false" aria-label="${e}" />
|
|
226
|
-
</div>
|
|
227
|
-
`})}focus(){this.$("input").focus()}handleClick(e){e.stopImmediatePropagation(),this.$("input").focus()}handleKeyDown(){this.focus()}bindEventListeners(){const e=this.$("input");this.onChange=this.onChange.bind(this),e.addEventListener("keyup",this.onChange),e.addEventListener("blur",t=>{this.options_.menuButton.menu.handleBlur(t)})}onChange(e){const t=e.target;this.options_.search(t.value)}}B.registerComponent("SearchInputMenuItem",wg);class kg extends c1{createEl(e,t,r){return super.createEl(e,{...t,className:"vjs-menu-item cv-no-results"},r)}setLabel(e){const t=this.$(".vjs-menu-item-text");t&&(t.innerHTML=e)}}B.registerComponent("NoMatchingResultsMenuItem",kg);const FO=B.getComponent("MenuItem");class UO extends FO{constructor(e,t){super(e,t)}update(e,t){if(!(e!=null&&e.length)){this.el().innerHTML=`<span class="vjs-menu-item-text">${this.options_.label}</span>`;return}const r=[];let i=0;e.forEach(n=>{const a=this.options_.label.substr(i,n);a&&r.push(a),r.push('<span class="cv-highlight">'),r.push(this.options_.label.substr(n,t)),r.push("</span>"),i=n+t}),r.push(this.options_.label.substring(i,this.options_.label.length)),this.el().innerHTML=`<span class="vjs-menu-item-text">${r.join("")}</span>`}handleClick(e){e.stopImmediatePropagation(),this.player_.currentTime(this.options_.cue.startTime)}}const E_=B.getComponent("MenuButton");class $O extends E_{constructor(e,t){super(e,t),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.update=this.update.bind(this),this.search=this.search.bind(this),this.player_.textTracks().addEventListener("selectedlanguagechange",this.update)}bindTrackEvents(e){e.removeEventListener("loadeddata",this.update),e.addEventListener("loadeddata",this.update),this.player_.one("dispose",()=>{e.removeEventListener("loadeddata",this.update)})}createItems(){var i;const e=Zt.getCurrentTextTrack(this.player_);if(!e)return;if(!((i=e.cues)!=null&&i.length)){this.bindTrackEvents(e);return}const t=[new wg(this.player_,{menuButton:this,search:this.search})];for(let n=0;n<e.cues.length;n++){const a=e.cues[n];t.push(new UO(this.player_,{cue:a,label:a.text,selected:!1,multiSelectable:!1}))}const r=new kg(this.player_,{label:"No matching results",selected:!1,selectable:!1,multiSelectable:!1});return r.hide(),t.push(r),t}search(e){var i;e=e.trim();const t=Zt.getCurrentTextTrack(this.player_);if(!((i=t==null?void 0:t.cues)!=null&&i.length))return;const r=this.findMatches(e,t);this.toggleItemVisibility(e,r),this.toggleNoResults(e,r)}findMatches(e,t){const r={};if(!e)return r;const i=new RegExp(e,"gi");for(let n=0;n<t.cues.length;n++){const o=t.cues[n].text,l=[];let u;for(;u=i.exec(o);)l.push(u.index);l.length&&(r[n]=l)}return r}toggleItemVisibility(e,t){this.menu.children_.slice(1,this.menu.children_.length-1).forEach((i,n)=>{!e||t[n]?i.show():i.hide(),i.update(t[n],e.length)})}toggleNoResults(e,t){const r=this.menu.children_[this.menu.children_.length-1];!e||Object.keys(t).length?r.hide():r.show()}buildWrapperCSSClass(){return`cv-menu-big cv-subtitle-search-button ${super.buildWrapperCSSClass()}`}update(){super.update(),this.player_.trigger("resizemenus")}pressButton(){super.pressButton();const e=this.menu.children_[0];e!=null&&e.focus&&(e==null||e.focus())}getCollabsibleName(){return"Subtitle Size"}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!1}showCollapsibleMenu(){E_.prototype.handleClick.apply(this)}}B.registerComponent("subtitleSearchButton",$O);const jO=B.getComponent("MenuItem"),w_=B.getComponent("MenuButton"),VO=[{label:"Play / Pause",type:"play-pause"},{label:"Volume",type:"volume"},{label:"Mute",type:"mute"},{label:"Toggle fullscreen",type:"fullscreen"},{label:"Exit fullscreen",type:"exit-fullscreen"},{label:"Toggle theatre mode",type:"theatre-mode"}];class HO extends jO{constructor(e,t){super(e,t)}createEl(){return B.dom.createEl("li",{className:"vjs-menu-item",tabIndex:-1,innerHTML:`
|
|
228
|
-
<span class="vjs-menu-item-text">${this.options_.label}</span>
|
|
229
|
-
<span>${this.getDisplayHtml(this.options_.type)}
|
|
230
|
-
`})}getDisplayHtml(e){switch(e){case"play-pause":return'<span class="cv-keyboard-button">Spacebar</span>';case"volume":return`<span class="cv-keyboard-button">Shift</span> +
|
|
231
|
-
<span class="cv-keyboard-button cv-single-key">⇑</span> /
|
|
232
|
-
<span class="cv-keyboard-button">Shift</span> +
|
|
233
|
-
<span class="cv-keyboard-button cv-single-key">⇓</span>`;case"mute":return'<span class="cv-keyboard-button cv-single-key">m</span>';case"fullscreen":return'<span class="cv-keyboard-button cv-single-key">f</span>';case"exit-fullscreen":return'<span class="cv-keyboard-button cv-single-key">esc</span>';case"theatre-mode":return'<span class="cv-keyboard-button cv-single-key">t</span>'}return""}}class qO extends w_{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0}createItems(){const e=[];return e.push(new aa(this.player_,{label:"Keyboard shortcuts"})),VO.forEach(t=>{e.push(new HO(this.player_,t))}),e}buildWrapperCSSClass(){return`cv-menu-small cv-keyboard-shortcuts ${super.buildWrapperCSSClass()}`}getCollabsibleName(){return"Keyboard shortcuts"}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!this.player_.options_.mobile}showCollapsibleMenu(){w_.prototype.handleClick.apply(this)}}B.registerComponent("KeyboardShortcutsButton",qO);const zO=600,WO=1200,Nf="cv-collapsed",GO=B.getComponent("Component");class KO extends GO{constructor(e,t){super(e,t),this.addChild("cogButton",{items:this.children_},this.children_.length-1),this.update=this.update.bind(this),this.player_.on("cv-updatecog",this.update),this.player_.on("playerresize",this.update),this.player_.one("play",this.update),this.player_.on("dispose",()=>{this.player_.off("cv-updatecog",this.update),this.player_.off("playerresize",this.update),this.player_.off("play",this.update)})}toggleHidden(e){for(let t=0;t<this.children_.length;t++){const r=this.children_[t];if(r.isCollabsible){if(r.alwaysCollapsed){r.isCollapsed=!0,r.addClass(Nf);continue}e?(r.isCollapsed=!0,r.addClass(Nf)):(r.isCollapsed=!1,r.removeClass(Nf))}}this.getChild("cogButton").update()}update(){const e=this.player_.isFullscreen(),t=this.player_.whiteboardModePlugin().side,r=this.player_.el().getBoundingClientRect(),i=e&&(t==="left"||t==="right")?r.height:r.width;if(!i)return;this.addClass("cv-collapsorator-ready");let a=i<(e&&(t==="left"||t==="right"||t==="top")?WO:zO);this.player_.options_.deferMenus&&(a=!0),this.toggleHidden(a)}buildCSSClass(){return`cv-collapsorator ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}}B.registerComponent("collapserator",KO);const XO=["playToggle","volumePanel","customControlSpacer","playbackRateMenuButton","chaptersButton","qualityButton","keyboardShortcutsButton","subsCapsButton","whiteboardModeButton","subtitleSizeButton","subtitleSearchButton","fullscreenToggle"];class YO{constructor(e){this.options=e,this.initialize()}logStream(){const e=`v:${this.options.videoId}`;Al.cacheExists(e)||(this.collectionApiClient.log({type:Jt.WebPlayerStream,actionContext:this.getActionContext(),data:this.getAnalyticsData(),eventVersion:qs.V3}),Al&&Al.cacheSet(e,null,300))}logVideoProgress(e){const t=this.getAnalyticsData();this.collectionApiClient.log(e.map(r=>({type:Jt.StreamProgress,actionContext:this.getActionContext(),data:{...t,progress:r},eventVersion:qs.V2})))}logUserAction(e,t){const r={...this.getAnalyticsData(),...e},i={...this.getActionContext(),...t};this.collectionApiClient.log({type:t.actionType,data:r,actionContext:i,eventVersion:t.eventVersion||qs.V2})}getAnalyticsData(){const e={video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache},...this.options.additionalAnalyticsData||{}};this.options.shareId&&(e.video.shareId=this.options.shareId);const t=this.getEntityType();return t===xi.Interactive?e.interactive={id:+this.options.mediaId}:t===xi.Clip&&(e.clip={id:+this.options.mediaId}),e}initialize(){this.setupCollectionApiClient(),Pv.lockWindowSession(),this.options.player.one("dispose",()=>Pv.unlockWindowSession())}setupCollectionApiClient(){this.collectionApiClient=new ek({productName:"player.web",productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:()=>this.getCurrentUser(),shouldLog:Dv.shouldLog,formatData:Dv.formatData})}async getCurrentUser(){return{id:this.options.userId,customerId:this.options.customerId,sessionId:this.options.authSessionId}}getActionContext(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?tk.Embedded:void 0,workflowPhase:void 0}}getEntityType(){switch(this.options.mediaType){case"MasterVideo":return xi.Video;case"MasterInteractive":return xi.Interactive;case"MasterClip":return xi.Clip}}getLocationContext(){switch(this.options.playerType){case"player":return Ir.Player;case"interactive-player":return Ir.InteractivePlayer;case"create-clip-player":return Ir.CreateClipPlayer}}}class im extends Error{constructor(e,t){super((t==null?void 0:t.title)||"Ajax error"),this.url=e,this.response=t}}class QO{constructor(){this.tokens={gateway:null}}async get(e,t){return await this.parseResponse(await fetch(e,{method:"GET",mode:"cors",headers:this.getHeaders(t)}))}async delete(e,t){await fetch(e,{method:"DELETE",headers:this.getHeaders(t)})}async post(e,t,r,i=!0){const n=await fetch(e,{method:"POST",headers:this.getHeaders(r),body:t,mode:"cors"});if(i)return await this.parseResponse(n)}async put(e,t,r,i=!0){const n=await fetch(e,{method:"PUT",headers:this.getHeaders(r),body:t,mode:"cors"});if(i)return await this.parseResponse(n)}setToken(e,t){this.tokens[e]=t}getHeaders(e={}){const t={"Content-Type":"application/json"};return this.tokens[e.tokenName]&&(t.authorization=`Bearer ${this.tokens[e.tokenName]}`),t}async parseResponse(e){if(e.status===404)return null;if(!e.ok){let r;try{r=await e.json()}catch{throw new im(e.url)}finally{throw new im(e.url,r)}}return await e.json()}}const rm=new QO;var rc={exports:{}},k_;function JO(){return k_||(k_=1,(function(s,e){function t(l){if(l&&typeof l=="object"){var u=l.which||l.keyCode||l.charCode;u&&(l=u)}if(typeof l=="number")return a[l];var c=String(l),h=r[c.toLowerCase()];if(h)return h;var h=i[c.toLowerCase()];if(h)return h;if(c.length===1)return c.charCodeAt(0)}t.isEventKey=function(u,c){if(u&&typeof u=="object"){var h=u.which||u.keyCode||u.charCode;if(h==null)return!1;if(typeof c=="string"){var f=r[c.toLowerCase()];if(f)return f===h;var f=i[c.toLowerCase()];if(f)return f===h}else if(typeof c=="number")return c===h;return!1}},e=s.exports=t;var r=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};/*!
|
|
234
|
-
* Programatically add the following
|
|
235
|
-
*/for(n=97;n<123;n++)r[String.fromCharCode(n)]=n-32;for(var n=48;n<58;n++)r[n-48]=n;for(n=1;n<13;n++)r["f"+n]=n+111;for(n=0;n<10;n++)r["numpad "+n]=n+96;var a=e.names=e.title={};for(n in r)a[r[n]]=n;for(var o in i)r[o]=i[o]})(rc,rc.exports)),rc.exports}var ZO=JO();const Ge=qi(ZO);function eM(s){document[s.fsApi_.fullscreenEnabled]&&(s.isFullscreen()?s.exitFullscreen():s.requestFullscreen())}function tM(s){const e=s.theatreModePlugin().getTheatreMode();s.theatreModePlugin().toggleTheatreMode(!e,{shouldLog:!0})}function iM(s){const e=s.volume(),t=s.lastVolume_();if(e===0){const r=t<.1?.1:t;s.volume(r),s.muted(!1)}else s.muted(!s.muted())}function x_(s){s.paused()?s.play():s.pause()}function nc(s,e){s.currentTime(s.currentTime()+e)}function A_(s,e){s.volume(s.volume()+e)}function rM(s){const e=s.target,t=["video-js","vjs-tech"];return e.tagName.toLowerCase()==="video"||!!t.find(r=>e.classList.contains(r))}const I_={f:eM,m:iM,k:x_,space:x_,t:tM,left:s=>nc(s,-5),right:s=>nc(s,5),j:s=>nc(s,-10),l:s=>nc(s,10),up:s=>A_(s,.05),down:s=>A_(s,-.05)};function nM(s,e,t){if(s.ctrlKey||s.metaKey||s.altKey||s.shiftKey)return;const r=Ge(s);if(r==="t"&&!t.allowTheatreMode||r==="f"&&!t.allowFullscreen||!I_[r])return;I_[r](e,s);const i=rM(s),n=["space"].includes(r);(i||n)&&(s.preventDefault(),s.stopPropagation())}var h1=(s=>(s.PhysicallyChapteredVideo="physically-chaptered-video",s))(h1||{});const sM="1.38.0",aM={version:sM};var Lf,P_;function oM(){if(P_)return Lf;P_=1,Lf=s;function s(e,t){var r,i=null;try{r=JSON.parse(e,t)}catch(n){i=n}return[i,r]}return Lf}var lM=oM();const uM=qi(lM);var sc={exports:{}},Of,D_;function cM(){if(D_)return Of;D_=1;var s=Io(),e=function(i,n){return n===void 0&&(n=!1),function(a,o,l){if(a){i(a);return}if(o.statusCode>=400&&o.statusCode<=599){var u=l;if(n)if(s.TextDecoder){var c=t(o.headers&&o.headers["content-type"]);try{u=new TextDecoder(c).decode(l)}catch{}}else u=String.fromCharCode.apply(null,new Uint8Array(l));i({cause:u});return}i(null,l)}};function t(r){return r===void 0&&(r=""),r.toLowerCase().split(";").reduce(function(i,n){var a=n.split("="),o=a[0],l=a[1];return o.trim()==="charset"?l.trim():i},"utf-8")}return Of=e,Of}var N_;function hM(){if(N_)return sc.exports;N_=1;var s=Io(),e=p0(),t=w0();o.httpHandler=cM();/**
|
|
236
|
-
* @license
|
|
237
|
-
* slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
|
|
238
|
-
* Copyright (c) 2014 David Björklund
|
|
239
|
-
* Available under the MIT license
|
|
240
|
-
* <https://github.com/kesla/parse-headers/blob/master/LICENCE>
|
|
241
|
-
*/var r=function(f){var g={};return f&&f.trim().split(`
|
|
242
|
-
`).forEach(function(C){var p=C.indexOf(":"),T=C.slice(0,p).trim().toLowerCase(),A=C.slice(p+1).trim();typeof g[T]>"u"?g[T]=A:Array.isArray(g[T])?g[T].push(A):g[T]=[g[T],A]}),g};sc.exports=o,sc.exports.default=o,o.XMLHttpRequest=s.XMLHttpRequest||c,o.XDomainRequest="withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:s.XDomainRequest,i(["get","put","post","patch","head","delete"],function(h){o[h==="delete"?"del":h]=function(f,g,C){return g=a(f,g,C),g.method=h.toUpperCase(),l(g)}});function i(h,f){for(var g=0;g<h.length;g++)f(h[g])}function n(h){for(var f in h)if(h.hasOwnProperty(f))return!1;return!0}function a(h,f,g){var C=h;return t(f)?(g=f,typeof h=="string"&&(C={uri:h})):C=e({},f,{uri:h}),C.callback=g,C}function o(h,f,g){return f=a(h,f,g),l(f)}function l(h){if(typeof h.callback>"u")throw new Error("callback argument missing");var f=!1,g=function(le,de,pe){f||(f=!0,h.callback(le,de,pe))};function C(){N.readyState===4&&setTimeout(A,0)}function p(){var K=void 0;if(N.response?K=N.response:K=N.responseText||u(N),P)try{K=JSON.parse(K)}catch{}return K}function T(K){return clearTimeout(Y),K instanceof Error||(K=new Error(""+(K||"Unknown XMLHttpRequest Error"))),K.statusCode=0,g(K,G)}function A(){if(!V){var K;clearTimeout(Y),h.useXDR&&N.status===void 0?K=200:K=N.status===1223?204:N.status;var le=G,de=null;return K!==0?(le={body:p(),statusCode:K,method:O,headers:{},url:R,rawRequest:N},N.getAllResponseHeaders&&(le.headers=r(N.getAllResponseHeaders()))):de=new Error("Internal XMLHttpRequest Error"),g(de,le,le.body)}}var N=h.xhr||null;N||(h.cors||h.useXDR?N=new o.XDomainRequest:N=new o.XMLHttpRequest);var F,V,R=N.url=h.uri||h.url,O=N.method=h.method||"GET",M=h.body||h.data,U=N.headers=h.headers||{},E=!!h.sync,P=!1,Y,G={body:void 0,headers:{},statusCode:0,method:O,url:R,rawRequest:N};if("json"in h&&h.json!==!1&&(P=!0,U.accept||U.Accept||(U.Accept="application/json"),O!=="GET"&&O!=="HEAD"&&(U["content-type"]||U["Content-Type"]||(U["Content-Type"]="application/json"),M=JSON.stringify(h.json===!0?M:h.json))),N.onreadystatechange=C,N.onload=A,N.onerror=T,N.onprogress=function(){},N.onabort=function(){V=!0},N.ontimeout=T,N.open(O,R,!E,h.username,h.password),E||(N.withCredentials=!!h.withCredentials),!E&&h.timeout>0&&(Y=setTimeout(function(){if(!V){V=!0,N.abort("timeout");var K=new Error("XMLHttpRequest timeout");K.code="ETIMEDOUT",T(K)}},h.timeout)),N.setRequestHeader)for(F in U)U.hasOwnProperty(F)&&N.setRequestHeader(F,U[F]);else if(h.headers&&!n(h.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in h&&(N.responseType=h.responseType),"beforeSend"in h&&typeof h.beforeSend=="function"&&h.beforeSend(N),N.send(M||null),N}function u(h){try{if(h.responseType==="document")return h.responseXML;var f=h.responseXML&&h.responseXML.documentElement.nodeName==="parsererror";if(h.responseType===""&&!f)return h.responseXML}catch{}return null}function c(){}return sc.exports}var dM=hM();const d1=qi(dM);function f1(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(f1=function(){return!!s})()}function p1(s,e,t){if(f1())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(s.bind.apply(s,r));return t&&l0(i,t.prototype),i}var Mf={exports:{}},L_;function fM(){return L_||(L_=1,(function(s,e){(function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,u,c){if(c=c||{},l=l.trim(),u=u.trim(),!u){if(!c.alwaysNormalize)return l;var h=o.parseURL(l);if(!h)throw new Error("Error trying to parse base URL.");return h.path=o.normalizePath(h.path),o.buildURLFromParts(h)}var f=o.parseURL(u);if(!f)throw new Error("Error trying to parse relative URL.");if(f.scheme)return c.alwaysNormalize?(f.path=o.normalizePath(f.path),o.buildURLFromParts(f)):u;var g=o.parseURL(l);if(!g)throw new Error("Error trying to parse base URL.");if(!g.netLoc&&g.path&&g.path[0]!=="/"){var C=i.exec(g.path);g.netLoc=C[1],g.path=C[2]}g.netLoc&&!g.path&&(g.path="/");var p={scheme:g.scheme,netLoc:f.netLoc,path:null,params:f.params,query:f.query,fragment:f.fragment};if(!f.netLoc&&(p.netLoc=g.netLoc,f.path[0]!=="/"))if(!f.path)p.path=g.path,f.params||(p.params=g.params,f.query||(p.query=g.query));else{var T=g.path,A=T.substring(0,T.lastIndexOf("/")+1)+f.path;p.path=o.normalizePath(A)}return p.path===null&&(p.path=c.alwaysNormalize?o.normalizePath(f.path):f.path),o.buildURLFromParts(p)},parseURL:function(l){var u=r.exec(l);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(n,"");l.length!==(l=l.replace(a,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};s.exports=o})()})(Mf)),Mf.exports}var pM=fM();const O_=qi(pM);var M_="http://example.com",Gh=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=D.location&&D.location.href||"");var r=typeof D.URL=="function",i=/^\/\//.test(e),n=!D.location&&!/\/\//i.test(e);if(r?e=new D.URL(e,D.location||M_):/\/\//i.test(e)||(e=O_.buildAbsoluteURL(D.location&&D.location.href||"",e)),r){var a=new URL(t,e);return n?a.href.slice(M_.length):i?a.href.slice(a.protocol.length):a.href}return O_.buildAbsoluteURL(e,t)},xg=(function(){function s(){this.listeners={}}var e=s.prototype;return e.on=function(r,i){this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push(i)},e.off=function(r,i){if(!this.listeners[r])return!1;var n=this.listeners[r].indexOf(i);return this.listeners[r]=this.listeners[r].slice(0),this.listeners[r].splice(n,1),n>-1},e.trigger=function(r){var i=this.listeners[r];if(i)if(arguments.length===2)for(var n=i.length,a=0;a<n;++a)i[a].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),l=i.length,u=0;u<l;++u)i[u].apply(this,o)},e.dispose=function(){this.listeners={}},e.pipe=function(r){this.on("data",function(i){r.push(i)})},s})(),mM=function(e){return D.atob?D.atob(e):Buffer.from(e,"base64").toString("binary")};function m1(s){for(var e=mM(s),t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}/*! @name m3u8-parser @version 4.8.0 @license Apache-2.0 */var gM=(function(s){we(e,s);function e(){var r;return r=s.call(this)||this,r.buffer="",r}var t=e.prototype;return t.push=function(i){var n;for(this.buffer+=i,n=this.buffer.indexOf(`
|
|
243
|
-
`);n>-1;n=this.buffer.indexOf(`
|
|
244
|
-
`))this.trigger("data",this.buffer.substring(0,n)),this.buffer=this.buffer.substring(n+1)},e})(xg),vM=" ",Rf=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),r={};return t[1]&&(r.length=parseInt(t[1],10)),t[2]&&(r.offset=parseInt(t[2],10)),r},yM=function(){var e="[^=]*",t='"[^"]*"|[^,]*',r="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+r+")")},kr=function(e){for(var t=e.split(yM()),r={},i=t.length,n;i--;)t[i]!==""&&(n=/([^=]*)=(.*)/.exec(t[i]).slice(1),n[0]=n[0].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^['"](.*)['"]$/g,"$1"),r[n[0]]=n[1]);return r},_M=(function(s){we(e,s);function e(){var r;return r=s.call(this)||this,r.customParsers=[],r.tagMappers=[],r}var t=e.prototype;return t.push=function(i){var n=this,a,o;if(i=i.trim(),i.length!==0){if(i[0]!=="#"){this.trigger("data",{type:"uri",uri:i});return}var l=this.tagMappers.reduce(function(u,c){var h=c(i);return h===i?u:u.concat([h])},[i]);l.forEach(function(u){for(var c=0;c<n.customParsers.length;c++)if(n.customParsers[c].call(n,u))return;if(u.indexOf("#EXT")!==0){n.trigger("data",{type:"comment",text:u.slice(1)});return}if(u=u.replace("\r",""),a=/^#EXTM3U/.exec(u),a){n.trigger("data",{type:"tag",tagType:"m3u"});return}if(a=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(u),a){o={type:"tag",tagType:"inf"},a[1]&&(o.duration=parseFloat(a[1])),a[2]&&(o.title=a[2]),n.trigger("data",o);return}if(a=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"targetduration"},a[1]&&(o.duration=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"version"},a[1]&&(o.version=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"media-sequence"},a[1]&&(o.number=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"discontinuity-sequence"},a[1]&&(o.number=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"playlist-type"},a[1]&&(o.playlistType=a[1]),n.trigger("data",o);return}if(a=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(u),a){o=vt(Rf(a[1]),{type:"tag",tagType:"byterange"}),n.trigger("data",o);return}if(a=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(u),a){o={type:"tag",tagType:"allow-cache"},a[1]&&(o.allowed=!/NO/.test(a[1])),n.trigger("data",o);return}if(a=/^#EXT-X-MAP:?(.*)$/.exec(u),a){if(o={type:"tag",tagType:"map"},a[1]){var h=kr(a[1]);h.URI&&(o.uri=h.URI),h.BYTERANGE&&(o.byterange=Rf(h.BYTERANGE))}n.trigger("data",o);return}if(a=/^#EXT-X-STREAM-INF:?(.*)$/.exec(u),a){if(o={type:"tag",tagType:"stream-inf"},a[1]){if(o.attributes=kr(a[1]),o.attributes.RESOLUTION){var f=o.attributes.RESOLUTION.split("x"),g={};f[0]&&(g.width=parseInt(f[0],10)),f[1]&&(g.height=parseInt(f[1],10)),o.attributes.RESOLUTION=g}o.attributes.BANDWIDTH&&(o.attributes.BANDWIDTH=parseInt(o.attributes.BANDWIDTH,10)),o.attributes["FRAME-RATE"]&&(o.attributes["FRAME-RATE"]=parseFloat(o.attributes["FRAME-RATE"])),o.attributes["PROGRAM-ID"]&&(o.attributes["PROGRAM-ID"]=parseInt(o.attributes["PROGRAM-ID"],10))}n.trigger("data",o);return}if(a=/^#EXT-X-MEDIA:?(.*)$/.exec(u),a){o={type:"tag",tagType:"media"},a[1]&&(o.attributes=kr(a[1])),n.trigger("data",o);return}if(a=/^#EXT-X-ENDLIST/.exec(u),a){n.trigger("data",{type:"tag",tagType:"endlist"});return}if(a=/^#EXT-X-DISCONTINUITY/.exec(u),a){n.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(a=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(u),a){o={type:"tag",tagType:"program-date-time"},a[1]&&(o.dateTimeString=a[1],o.dateTimeObject=new Date(a[1])),n.trigger("data",o);return}if(a=/^#EXT-X-KEY:?(.*)$/.exec(u),a){o={type:"tag",tagType:"key"},a[1]&&(o.attributes=kr(a[1]),o.attributes.IV&&(o.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(o.attributes.IV=o.attributes.IV.substring(2)),o.attributes.IV=o.attributes.IV.match(/.{8}/g),o.attributes.IV[0]=parseInt(o.attributes.IV[0],16),o.attributes.IV[1]=parseInt(o.attributes.IV[1],16),o.attributes.IV[2]=parseInt(o.attributes.IV[2],16),o.attributes.IV[3]=parseInt(o.attributes.IV[3],16),o.attributes.IV=new Uint32Array(o.attributes.IV))),n.trigger("data",o);return}if(a=/^#EXT-X-START:?(.*)$/.exec(u),a){o={type:"tag",tagType:"start"},a[1]&&(o.attributes=kr(a[1]),o.attributes["TIME-OFFSET"]=parseFloat(o.attributes["TIME-OFFSET"]),o.attributes.PRECISE=/YES/.test(o.attributes.PRECISE)),n.trigger("data",o);return}if(a=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"cue-out-cont"},a[1]?o.data=a[1]:o.data="",n.trigger("data",o);return}if(a=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"cue-out"},a[1]?o.data=a[1]:o.data="",n.trigger("data",o);return}if(a=/^#EXT-X-CUE-IN:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"cue-in"},a[1]?o.data=a[1]:o.data="",n.trigger("data",o);return}if(a=/^#EXT-X-SKIP:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"skip"},o.attributes=kr(a[1]),o.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(o.attributes["SKIPPED-SEGMENTS"]=parseInt(o.attributes["SKIPPED-SEGMENTS"],10)),o.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(o.attributes["RECENTLY-REMOVED-DATERANGES"]=o.attributes["RECENTLY-REMOVED-DATERANGES"].split(vM)),n.trigger("data",o);return}if(a=/^#EXT-X-PART:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"part"},o.attributes=kr(a[1]),["DURATION"].forEach(function(C){o.attributes.hasOwnProperty(C)&&(o.attributes[C]=parseFloat(o.attributes[C]))}),["INDEPENDENT","GAP"].forEach(function(C){o.attributes.hasOwnProperty(C)&&(o.attributes[C]=/YES/.test(o.attributes[C]))}),o.attributes.hasOwnProperty("BYTERANGE")&&(o.attributes.byterange=Rf(o.attributes.BYTERANGE)),n.trigger("data",o);return}if(a=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"server-control"},o.attributes=kr(a[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(C){o.attributes.hasOwnProperty(C)&&(o.attributes[C]=parseFloat(o.attributes[C]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(C){o.attributes.hasOwnProperty(C)&&(o.attributes[C]=/YES/.test(o.attributes[C]))}),n.trigger("data",o);return}if(a=/^#EXT-X-PART-INF:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"part-inf"},o.attributes=kr(a[1]),["PART-TARGET"].forEach(function(C){o.attributes.hasOwnProperty(C)&&(o.attributes[C]=parseFloat(o.attributes[C]))}),n.trigger("data",o);return}if(a=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"preload-hint"},o.attributes=kr(a[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(C){if(o.attributes.hasOwnProperty(C)){o.attributes[C]=parseInt(o.attributes[C],10);var p=C==="BYTERANGE-LENGTH"?"length":"offset";o.attributes.byterange=o.attributes.byterange||{},o.attributes.byterange[p]=o.attributes[C],delete o.attributes[C]}}),n.trigger("data",o);return}if(a=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"rendition-report"},o.attributes=kr(a[1]),["LAST-MSN","LAST-PART"].forEach(function(C){o.attributes.hasOwnProperty(C)&&(o.attributes[C]=parseInt(o.attributes[C],10))}),n.trigger("data",o);return}n.trigger("data",{type:"tag",data:u.slice(4)})})}},t.addParser=function(i){var n=this,a=i.expression,o=i.customType,l=i.dataParser,u=i.segment;typeof l!="function"&&(l=function(h){return h}),this.customParsers.push(function(c){var h=a.exec(c);if(h)return n.trigger("data",{type:"custom",data:l(c),customType:o,segment:u}),!0})},t.addTagMapper=function(i){var n=i.expression,a=i.map,o=function(u){return n.test(u)?a(u):u};this.tagMappers.push(o)},e})(xg),TM=function(e){return e.toLowerCase().replace(/-(\w)/g,function(t){return t[1].toUpperCase()})},Oa=function(e){var t={};return Object.keys(e).forEach(function(r){t[TM(r)]=e[r]}),t},Bf=function(e){var t=e.serverControl,r=e.targetDuration,i=e.partTargetDuration;if(t){var n="#EXT-X-SERVER-CONTROL",a="holdBack",o="partHoldBack",l=r&&r*3,u=i&&i*2;r&&!t.hasOwnProperty(a)&&(t[a]=l,this.trigger("info",{message:n+" defaulting HOLD-BACK to targetDuration * 3 ("+l+")."})),l&&t[a]<l&&(this.trigger("warn",{message:n+" clamping HOLD-BACK ("+t[a]+") to targetDuration * 3 ("+l+")"}),t[a]=l),i&&!t.hasOwnProperty(o)&&(t[o]=i*3,this.trigger("info",{message:n+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+t[o]+")."})),i&&t[o]<u&&(this.trigger("warn",{message:n+" clamping PART-HOLD-BACK ("+t[o]+") to partTargetDuration * 2 ("+u+")."}),t[o]=u)}},bM=(function(s){we(e,s);function e(){var r;r=s.call(this)||this,r.lineStream=new gM,r.parseStream=new _M,r.lineStream.pipe(r.parseStream);var i=We(r),n=[],a={},o,l,u=!1,c=function(){},h={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},f="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",g=0;r.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var C=0,p=0;return r.on("end",function(){a.uri||!a.parts&&!a.preloadHints||(!a.map&&o&&(a.map=o),!a.key&&l&&(a.key=l),!a.timeline&&typeof g=="number"&&(a.timeline=g),r.manifest.preloadSegment=a)}),r.parseStream.on("data",function(T){var A,N;({tag:function(){({version:function(){T.version&&(this.manifest.version=T.version)},"allow-cache":function(){this.manifest.allowCache=T.allowed,"allowed"in T||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var R={};"length"in T&&(a.byterange=R,R.length=T.length,"offset"in T||(T.offset=C)),"offset"in T&&(a.byterange=R,R.offset=T.offset),C=R.offset+R.length},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),T.duration>0&&(a.duration=T.duration),T.duration===0&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=n},key:function(){if(!T.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(T.attributes.METHOD==="NONE"){l=null;return}if(!T.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(T.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:T.attributes};return}if(T.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:T.attributes.URI};return}if(T.attributes.KEYFORMAT===f){var R=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(R.indexOf(T.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(T.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),T.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(T.attributes.KEYID&&T.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:T.attributes.KEYFORMAT,keyId:T.attributes.KEYID.substring(2)},pssh:m1(T.attributes.URI.split(",")[1])};return}T.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),l={method:T.attributes.METHOD||"AES-128",uri:T.attributes.URI},typeof T.attributes.IV<"u"&&(l.iv=T.attributes.IV)},"media-sequence":function(){if(!isFinite(T.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+T.number});return}this.manifest.mediaSequence=T.number},"discontinuity-sequence":function(){if(!isFinite(T.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+T.number});return}this.manifest.discontinuitySequence=T.number,g=T.number},"playlist-type":function(){if(!/VOD|EVENT/.test(T.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+T.playlist});return}this.manifest.playlistType=T.playlistType},map:function(){o={},T.uri&&(o.uri=T.uri),T.byterange&&(o.byterange=T.byterange),l&&(o.key=l)},"stream-inf":function(){if(this.manifest.playlists=n,this.manifest.mediaGroups=this.manifest.mediaGroups||h,!T.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}a.attributes||(a.attributes={}),vt(a.attributes,T.attributes)},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||h,!(T.attributes&&T.attributes.TYPE&&T.attributes["GROUP-ID"]&&T.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}var R=this.manifest.mediaGroups[T.attributes.TYPE];R[T.attributes["GROUP-ID"]]=R[T.attributes["GROUP-ID"]]||{},A=R[T.attributes["GROUP-ID"]],N={default:/yes/i.test(T.attributes.DEFAULT)},N.default?N.autoselect=!0:N.autoselect=/yes/i.test(T.attributes.AUTOSELECT),T.attributes.LANGUAGE&&(N.language=T.attributes.LANGUAGE),T.attributes.URI&&(N.uri=T.attributes.URI),T.attributes["INSTREAM-ID"]&&(N.instreamId=T.attributes["INSTREAM-ID"]),T.attributes.CHARACTERISTICS&&(N.characteristics=T.attributes.CHARACTERISTICS),T.attributes.FORCED&&(N.forced=/yes/i.test(T.attributes.FORCED)),A[T.attributes.NAME]=N},discontinuity:function(){g+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(n.length)},"program-date-time":function(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=T.dateTimeString,this.manifest.dateTimeObject=T.dateTimeObject),a.dateTimeString=T.dateTimeString,a.dateTimeObject=T.dateTimeObject},targetduration:function(){if(!isFinite(T.duration)||T.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+T.duration});return}this.manifest.targetDuration=T.duration,Bf.call(this,this.manifest)},start:function(){if(!T.attributes||isNaN(T.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:T.attributes["TIME-OFFSET"],precise:T.attributes.PRECISE}},"cue-out":function(){a.cueOut=T.data},"cue-out-cont":function(){a.cueOutCont=T.data},"cue-in":function(){a.cueIn=T.data},skip:function(){this.manifest.skip=Oa(T.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",T.attributes,["SKIPPED-SEGMENTS"])},part:function(){var R=this;u=!0;var O=this.manifest.segments.length,M=Oa(T.attributes);a.parts=a.parts||[],a.parts.push(M),M.byterange&&(M.byterange.hasOwnProperty("offset")||(M.byterange.offset=p),p=M.byterange.offset+M.byterange.length);var U=a.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+U+" for segment #"+O,T.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(E,P){E.hasOwnProperty("lastPart")||R.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+P+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var R=this.manifest.serverControl=Oa(T.attributes);R.hasOwnProperty("canBlockReload")||(R.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Bf.call(this,this.manifest),R.canSkipDateranges&&!R.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var R=this.manifest.segments.length,O=Oa(T.attributes),M=O.type&&O.type==="PART";a.preloadHints=a.preloadHints||[],a.preloadHints.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=M?p:0,M&&(p=O.byterange.offset+O.byterange.length)));var U=a.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+U+" for segment #"+R,T.attributes,["TYPE","URI"]),!!O.type)for(var E=0;E<a.preloadHints.length-1;E++){var P=a.preloadHints[E];P.type&&P.type===O.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+U+" for segment #"+R+" has the same TYPE "+O.type+" as preload hint #"+E})}},"rendition-report":function(){var R=Oa(T.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(R);var O=this.manifest.renditionReports.length-1,M=["LAST-MSN","URI"];u&&M.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+O,T.attributes,M)},"part-inf":function(){this.manifest.partInf=Oa(T.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",T.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Bf.call(this,this.manifest)}}[T.tagType]||c).call(i)},uri:function(){a.uri=T.uri,n.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),l&&(a.key=l),a.timeline=g,o&&(a.map=o),p=0,a={}},comment:function(){},custom:function(){T.segment?(a.custom=a.custom||{},a.custom[T.customType]=T.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[T.customType]=T.data)}})[T.type].call(i)}),r}var t=e.prototype;return t.warnOnMissingAttributes_=function(i,n,a){var o=[];a.forEach(function(l){n.hasOwnProperty(l)||o.push(l)}),o.length&&this.trigger("warn",{message:i+" lacks required attribute(s): "+o.join(", ")})},t.push=function(i){this.lineStream.push(i)},t.end=function(){this.lineStream.push(`
|
|
245
|
-
`),this.trigger("end")},t.addParser=function(i){this.parseStream.addParser(i)},t.addTagMapper=function(i){this.parseStream.addTagMapper(i)},e})(xg),Ys={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},SM=["video","audio","text"],R_=["Video","Audio","Text"],g1=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,r,i){var n=("00"+Number(r).toString(16)).slice(-2),a=("00"+Number(i).toString(16)).slice(-2);return"avc1."+n+"00"+a})},qr=function(e){e===void 0&&(e="");var t=e.split(","),r=[];return t.forEach(function(i){i=i.trim();var n;SM.forEach(function(a){var o=Ys[a].exec(i.toLowerCase());if(!(!o||o.length<=1)){n=a;var l=i.substring(0,o[1].length),u=i.replace(l,"");r.push({type:l,details:u,mediaType:a})}}),n||r.push({type:i,details:"",mediaType:"unknown"})}),r},CM=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var r=e.mediaGroups.AUDIO[t];if(!r)return null;for(var i in r){var n=r[i];if(n.default&&n.playlists)return qr(n.playlists[0].attributes.CODECS)}return null},v1=function(e){return e===void 0&&(e=""),Ys.audio.test(e.trim().toLowerCase())},EM=function(e){return e===void 0&&(e=""),Ys.text.test(e.trim().toLowerCase())},zl=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return g1(n.trim())}),r="video";t.length===1&&v1(t[0])?r="audio":t.length===1&&EM(t[0])&&(r="application");var i="mp4";return t.every(function(n){return Ys.mp4.test(n)})?i="mp4":t.every(function(n){return Ys.webm.test(n)})?i="webm":t.every(function(n){return Ys.ogg.test(n)})&&(i="ogg"),r+"/"+i+';codecs="'+e+'"'}},Cc=function(e){return e===void 0&&(e=""),D.MediaSource&&D.MediaSource.isTypeSupported&&D.MediaSource.isTypeSupported(zl(e))||!1},Ff=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var r=0;r<R_.length;r++){var i=R_[r];if(Ys["muxer"+i].test(t))return!0}return!1})},B_="mp4a.40.2",wM="avc1.4d400d",kM=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,xM=/^application\/dash\+xml/i,y1=function(e){return kM.test(e)?"hls":xM.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},AM=function(e){return e.toString(2).length},IM=function(e){return Math.ceil(AM(e)/8)},_1=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},PM=function(e){return _1(e)},je=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!PM(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},ci=D.BigInt||Number,nm=[ci("0x1"),ci("0x100"),ci("0x10000"),ci("0x1000000"),ci("0x100000000"),ci("0x10000000000"),ci("0x1000000000000"),ci("0x100000000000000"),ci("0x10000000000000000")];(function(){var s=new Uint16Array([65484]),e=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var DM=function(e,t){var r=t===void 0?{}:t,i=r.signed,n=i===void 0?!1:i,a=r.le,o=a===void 0?!1:a;e=je(e);var l=o?"reduce":"reduceRight",u=e[l]?e[l]:Array.prototype[l],c=u.call(e,function(f,g,C){var p=o?C:Math.abs(C+1-e.length);return f+ci(g)*nm[p]},ci(0));if(n){var h=nm[e.length]/ci(2)-ci(1);c=ci(c),c>h&&(c-=h,c-=h,c-=ci(2))}return Number(c)},NM=function(e,t){var r={},i=r.le,n=i===void 0?!1:i;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=ci(e);for(var a=IM(e),o=new Uint8Array(new ArrayBuffer(a)),l=0;l<a;l++){var u=n?l:Math.abs(l+1-o.length);o[u]=Number(e/nm[l]&ci(255)),e<0&&(o[u]=Math.abs(~o[u]),o[u]-=l===0?1:2)}return o},T1=function(e,t){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var r=new Uint8Array(e.length),i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r},LM=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t=t.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),t.length<=1)return je(t[0]);var i=t.reduce(function(o,l,u){return o+(l.byteLength||l.length)},0),n=new Uint8Array(i),a=0;return t.forEach(function(o){o=je(o),n.set(o,a),a+=o.byteLength}),n},Dt=function(e,t,r){var i=r===void 0?{}:r,n=i.offset,a=n===void 0?0:n,o=i.mask,l=o===void 0?[]:o;e=je(e),t=je(t);var u=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,function(c,h){var f=l[h]?l[h]&e[a+h]:e[a+h];return c===f})},OM=function(e,t,r){t.forEach(function(i){for(var n in e.mediaGroups[i])for(var a in e.mediaGroups[i][n]){var o=e.mediaGroups[i][n][a];r(o,i,n,a)}})};/*! @name mpd-parser @version 0.22.1 @license Apache-2.0 */var F_=function(e){return!!e&&typeof e=="object"},Ii=function s(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(i,n){return typeof n!="object"||Object.keys(n).forEach(function(a){Array.isArray(i[a])&&Array.isArray(n[a])?i[a]=i[a].concat(n[a]):F_(i[a])&&F_(n[a])?i[a]=s(i[a],n[a]):i[a]=n[a]}),i},{})},b1=function(e){return Object.keys(e).map(function(t){return e[t]})},MM=function(e,t){for(var r=[],i=e;i<t;i++)r.push(i);return r},Kh=function(e){return e.reduce(function(t,r){return t.concat(r)},[])},S1=function(e){if(!e.length)return[];for(var t=[],r=0;r<e.length;r++)t.push(e[r]);return t},RM=function(e,t){return e.reduce(function(r,i,n){return i[t]&&r.push(n),r},[])},sm=function(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r;return-1},BM=function(e,t){return b1(e.reduce(function(r,i){return i.forEach(function(n){r[t(n)]=n}),r},{}))},To={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},Wl=function(e){var t=e.baseUrl,r=t===void 0?"":t,i=e.source,n=i===void 0?"":i,a=e.range,o=a===void 0?"":a,l=e.indexRange,u=l===void 0?"":l,c={uri:n,resolvedUri:Gh(r||"",n)};if(o||u){var h=o||u,f=h.split("-"),g=D.BigInt?D.BigInt(f[0]):parseInt(f[0],10),C=D.BigInt?D.BigInt(f[1]):parseInt(f[1],10);g<Number.MAX_SAFE_INTEGER&&typeof g=="bigint"&&(g=Number(g)),C<Number.MAX_SAFE_INTEGER&&typeof C=="bigint"&&(C=Number(C));var p;typeof C=="bigint"||typeof g=="bigint"?p=D.BigInt(C)-D.BigInt(g)+D.BigInt(1):p=C-g+1,typeof p=="bigint"&&p<Number.MAX_SAFE_INTEGER&&(p=Number(p)),c.byterange={length:p,offset:g}}return c},FM=function(e){var t;return typeof e.offset=="bigint"||typeof e.length=="bigint"?t=D.BigInt(e.offset)+D.BigInt(e.length)-D.BigInt(1):t=e.offset+e.length-1,e.offset+"-"+t},U_=function(e){return e&&typeof e!="number"&&(e=parseInt(e,10)),isNaN(e)?null:e},UM={static:function(e){var t=e.duration,r=e.timescale,i=r===void 0?1:r,n=e.sourceDuration,a=e.periodDuration,o=U_(e.endNumber),l=t/i;return typeof o=="number"?{start:0,end:o}:typeof a=="number"?{start:0,end:a/l}:{start:0,end:n/l}},dynamic:function(e){var t=e.NOW,r=e.clientOffset,i=e.availabilityStartTime,n=e.timescale,a=n===void 0?1:n,o=e.duration,l=e.periodStart,u=l===void 0?0:l,c=e.minimumUpdatePeriod,h=c===void 0?0:c,f=e.timeShiftBufferDepth,g=f===void 0?1/0:f,C=U_(e.endNumber),p=(t+r)/1e3,T=i+u,A=p+h,N=A-T,F=Math.ceil(N*a/o),V=Math.floor((p-T-g)*a/o),R=Math.floor((p-T)*a/o);return{start:Math.max(0,V),end:typeof C=="number"?C:Math.min(F,R)}}},$M=function(e){return function(t){var r=e.duration,i=e.timescale,n=i===void 0?1:i,a=e.periodStart,o=e.startNumber,l=o===void 0?1:o;return{number:l+t,duration:r/n,timeline:a,time:t*r}}},Ag=function(e){var t=e.type,r=e.duration,i=e.timescale,n=i===void 0?1:i,a=e.periodDuration,o=e.sourceDuration,l=UM[t](e),u=l.start,c=l.end,h=MM(u,c).map($M(e));if(t==="static"){var f=h.length-1,g=typeof a=="number"?a:o;h[f].duration=g-r/n*f}return h},C1=function(e){var t=e.baseUrl,r=e.initialization,i=r===void 0?{}:r,n=e.sourceDuration,a=e.indexRange,o=a===void 0?"":a,l=e.periodStart,u=e.presentationTime,c=e.number,h=c===void 0?0:c,f=e.duration;if(!t)throw new Error(To.NO_BASE_URL);var g=Wl({baseUrl:t,source:i.sourceURL,range:i.range}),C=Wl({baseUrl:t,source:t,indexRange:o});if(C.map=g,f){var p=Ag(e);p.length&&(C.duration=p[0].duration,C.timeline=p[0].timeline)}else n&&(C.duration=n,C.timeline=l);return C.presentationTime=u||l,C.number=h,[C]},Ig=function(e,t,r){var i=e.sidx.map?e.sidx.map:null,n=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,l=o.offset+o.length,u=t.timescale,c=t.references.filter(function(E){return E.referenceType!==1}),h=[],f=e.endList?"static":"dynamic",g=e.sidx.timeline,C=g,p=e.mediaSequence||0,T;typeof t.firstOffset=="bigint"?T=D.BigInt(l)+t.firstOffset:T=l+t.firstOffset;for(var A=0;A<c.length;A++){var N=t.references[A],F=N.referencedSize,V=N.subsegmentDuration,R=void 0;typeof T=="bigint"?R=T+D.BigInt(F)-D.BigInt(1):R=T+F-1;var O=T+"-"+R,M={baseUrl:r,timescale:u,timeline:a,periodStart:g,presentationTime:C,number:p,duration:V,sourceDuration:n,indexRange:O,type:f},U=C1(M)[0];i&&(U.map=i),h.push(U),typeof T=="bigint"?T+=D.BigInt(F):T+=F,C+=V/u,p++}return e.segments=h,e},jM=["AUDIO","SUBTITLES"],VM=1/60,E1=function(e){return BM(e,function(t){var r=t.timeline;return r}).sort(function(t,r){return t.timeline>r.timeline?1:-1})},HM=function(e,t){for(var r=0;r<e.length;r++)if(e[r].attributes.NAME===t)return e[r];return null},$_=function(e){var t=[];return OM(e,jM,function(r,i,n,a){t=t.concat(r.playlists||[])}),t},j_=function(e){var t=e.playlist,r=e.mediaSequence;t.mediaSequence=r,t.segments.forEach(function(i,n){i.number=t.mediaSequence+n})},qM=function(e){var t=e.oldPlaylists,r=e.newPlaylists,i=e.timelineStarts;r.forEach(function(n){n.discontinuitySequence=sm(i,function(c){var h=c.timeline;return h===n.timeline});var a=HM(t,n.attributes.NAME);if(a&&!n.sidx){var o=n.segments[0],l=sm(a.segments,function(c){return Math.abs(c.presentationTime-o.presentationTime)<VM});if(l===-1){j_({playlist:n,mediaSequence:a.mediaSequence+a.segments.length}),n.segments[0].discontinuity=!0,n.discontinuityStarts.unshift(0),(!a.segments.length&&n.timeline>a.timeline||a.segments.length&&n.timeline>a.segments[a.segments.length-1].timeline)&&n.discontinuitySequence--;return}var u=a.segments[l];u.discontinuity&&!o.discontinuity&&(o.discontinuity=!0,n.discontinuityStarts.unshift(0),n.discontinuitySequence--),j_({playlist:n,mediaSequence:a.segments[l].number})}})},zM=function(e){var t=e.oldManifest,r=e.newManifest,i=t.playlists.concat($_(t)),n=r.playlists.concat($_(r));return r.timelineStarts=E1([t.timelineStarts,r.timelineStarts]),qM({oldPlaylists:i,newPlaylists:n,timelineStarts:r.timelineStarts}),r},Xh=function(e){return e&&e.uri+"-"+FM(e.byterange)},Uf=function(e){var t=b1(e.reduce(function(r,i){var n=i.attributes.id+(i.attributes.lang||"");if(!r[n])r[n]=i,r[n].attributes.timelineStarts=[];else{if(i.segments){var a;i.segments[0]&&(i.segments[0].discontinuity=!0),(a=r[n].segments).push.apply(a,i.segments)}i.attributes.contentProtection&&(r[n].attributes.contentProtection=i.attributes.contentProtection)}return r[n].attributes.timelineStarts.push({start:i.attributes.periodStart,timeline:i.attributes.periodStart}),r},{}));return t.map(function(r){return r.discontinuityStarts=RM(r.segments||[],"discontinuity"),r})},Pg=function(e,t){var r=Xh(e.sidx),i=r&&t[r]&&t[r].sidx;return i&&Ig(e,i,e.sidx.resolvedUri),e},WM=function(e,t){if(t===void 0&&(t={}),!Object.keys(t).length)return e;for(var r in e)e[r]=Pg(e[r],t);return e},GM=function(e,t){var r,i=e.attributes,n=e.segments,a=e.sidx,o=e.mediaSequence,l=e.discontinuitySequence,u=e.discontinuityStarts,c={attributes:(r={NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs},r["PROGRAM-ID"]=1,r),uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:"",targetDuration:i.duration,discontinuitySequence:l,discontinuityStarts:u,timelineStarts:i.timelineStarts,mediaSequence:o,segments:n};return i.contentProtection&&(c.contentProtection=i.contentProtection),a&&(c.sidx=a),t&&(c.attributes.AUDIO="audio",c.attributes.SUBTITLES="subs"),c},KM=function(e){var t,r=e.attributes,i=e.segments,n=e.mediaSequence,a=e.discontinuityStarts,o=e.discontinuitySequence;typeof i>"u"&&(i=[{uri:r.baseUrl,timeline:r.periodStart,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration);var l=(t={NAME:r.id,BANDWIDTH:r.bandwidth},t["PROGRAM-ID"]=1,t);return r.codecs&&(l.CODECS=r.codecs),{attributes:l,uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:r.baseUrl||"",targetDuration:r.duration,timelineStarts:r.timelineStarts,discontinuityStarts:a,discontinuitySequence:o,mediaSequence:n,segments:i}},XM=function(e,t,r){t===void 0&&(t={}),r===void 0&&(r=!1);var i,n=e.reduce(function(o,l){var u=l.attributes.role&&l.attributes.role.value||"",c=l.attributes.lang||"",h=l.attributes.label||"main";if(c&&!l.attributes.label){var f=u?" ("+u+")":"";h=""+l.attributes.lang+f}o[h]||(o[h]={language:c,autoselect:!0,default:u==="main",playlists:[],uri:""});var g=Pg(GM(l,r),t);return o[h].playlists.push(g),typeof i>"u"&&u==="main"&&(i=l,i.default=!0),o},{});if(!i){var a=Object.keys(n)[0];n[a].default=!0}return n},YM=function(e,t){return t===void 0&&(t={}),e.reduce(function(r,i){var n=i.attributes.lang||"text";return r[n]||(r[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),r[n].playlists.push(Pg(KM(i),t)),r},{})},QM=function(e){return e.reduce(function(t,r){return r&&r.forEach(function(i){var n=i.channel,a=i.language;t[a]={autoselect:!1,default:!1,instreamId:n,language:a},i.hasOwnProperty("aspectRatio")&&(t[a].aspectRatio=i.aspectRatio),i.hasOwnProperty("easyReader")&&(t[a].easyReader=i.easyReader),i.hasOwnProperty("3D")&&(t[a]["3D"]=i["3D"])}),t},{})},JM=function(e){var t,r=e.attributes,i=e.segments,n=e.sidx,a=e.discontinuityStarts,o={attributes:(t={NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:"",targetDuration:r.duration,discontinuityStarts:a,timelineStarts:r.timelineStarts,segments:i};return r.frameRate&&(o.attributes["FRAME-RATE"]=r.frameRate),r.contentProtection&&(o.contentProtection=r.contentProtection),n&&(o.sidx=n),o},ZM=function(e){var t=e.attributes;return t.mimeType==="video/mp4"||t.mimeType==="video/webm"||t.contentType==="video"},eR=function(e){var t=e.attributes;return t.mimeType==="audio/mp4"||t.mimeType==="audio/webm"||t.contentType==="audio"},tR=function(e){var t=e.attributes;return t.mimeType==="text/vtt"||t.contentType==="text"},iR=function(e,t){e.forEach(function(r){r.mediaSequence=0,r.discontinuitySequence=sm(t,function(i){var n=i.timeline;return n===r.timeline}),r.segments&&r.segments.forEach(function(i,n){i.number=n})})},V_=function(e){return e?Object.keys(e).reduce(function(t,r){var i=e[r];return t.concat(i.playlists)},[]):[]},rR=function(e){var t,r=e.dashPlaylists,i=e.locations,n=e.sidxMapping,a=n===void 0?{}:n,o=e.previousManifest;if(!r.length)return{};var l=r[0].attributes,u=l.sourceDuration,c=l.type,h=l.suggestedPresentationDelay,f=l.minimumUpdatePeriod,g=Uf(r.filter(ZM)).map(JM),C=Uf(r.filter(eR)),p=Uf(r.filter(tR)),T=r.map(function(M){return M.attributes.captionServices}).filter(Boolean),A={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:u,playlists:WM(g,a)};f>=0&&(A.minimumUpdatePeriod=f*1e3),i&&(A.locations=i),c==="dynamic"&&(A.suggestedPresentationDelay=h);var N=A.playlists.length===0,F=C.length?XM(C,a,N):null,V=p.length?YM(p,a):null,R=g.concat(V_(F),V_(V)),O=R.map(function(M){var U=M.timelineStarts;return U});return A.timelineStarts=E1(O),iR(R,A.timelineStarts),F&&(A.mediaGroups.AUDIO.audio=F),V&&(A.mediaGroups.SUBTITLES.subs=V),T.length&&(A.mediaGroups["CLOSED-CAPTIONS"].cc=QM(T)),o?zM({oldManifest:o,newManifest:A}):A},nR=function(e,t,r){var i=e.NOW,n=e.clientOffset,a=e.availabilityStartTime,o=e.timescale,l=o===void 0?1:o,u=e.periodStart,c=u===void 0?0:u,h=e.minimumUpdatePeriod,f=h===void 0?0:h,g=(i+n)/1e3,C=a+c,p=g+f,T=p-C;return Math.ceil((T*l-t)/r)},w1=function(e,t){for(var r=e.type,i=e.minimumUpdatePeriod,n=i===void 0?0:i,a=e.media,o=a===void 0?"":a,l=e.sourceDuration,u=e.timescale,c=u===void 0?1:u,h=e.startNumber,f=h===void 0?1:h,g=e.periodStart,C=[],p=-1,T=0;T<t.length;T++){var A=t[T],N=A.d,F=A.r||0,V=A.t||0;p<0&&(p=V),V&&V>p&&(p=V);var R=void 0;if(F<0){var O=T+1;O===t.length?r==="dynamic"&&n>0&&o.indexOf("$Number$")>0?R=nR(e,p,N):R=(l*c-p)/N:R=(t[O].t-p)/N}else R=F+1;for(var M=f+C.length+R,U=f+C.length;U<M;)C.push({number:U,duration:N/c,time:p,timeline:g}),p+=N,U++}return C},sR=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,aR=function(e){return function(t,r,i,n){if(t==="$$")return"$";if(typeof e[r]>"u")return t;var a=""+e[r];return r==="RepresentationID"||(i?n=parseInt(n,10):n=1,a.length>=n)?a:""+new Array(n-a.length+1).join("0")+a}},H_=function(e,t){return e.replace(sR,aR(t))},oR=function(e,t){return!e.duration&&!t?[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]:e.duration?Ag(e):w1(e,t)},lR=function(e,t){var r={RepresentationID:e.id,Bandwidth:e.bandwidth||0},i=e.initialization,n=i===void 0?{sourceURL:"",range:""}:i,a=Wl({baseUrl:e.baseUrl,source:H_(n.sourceURL,r),range:n.range}),o=oR(e,t);return o.map(function(l){r.Number=l.number,r.Time=l.time;var u=H_(e.media||"",r),c=e.timescale||1,h=e.presentationTimeOffset||0,f=e.periodStart+(l.time-h)/c,g={uri:u,timeline:l.timeline,duration:l.duration,resolvedUri:Gh(e.baseUrl||"",u),map:a,number:l.number,presentationTime:f};return g})},uR=function(e,t){var r=e.baseUrl,i=e.initialization,n=i===void 0?{}:i,a=Wl({baseUrl:r,source:n.sourceURL,range:n.range}),o=Wl({baseUrl:r,source:t.media,range:t.mediaRange});return o.map=a,o},cR=function(e,t){var r=e.duration,i=e.segmentUrls,n=i===void 0?[]:i,a=e.periodStart;if(!r&&!t||r&&t)throw new Error(To.SEGMENT_TIME_UNSPECIFIED);var o=n.map(function(c){return uR(e,c)}),l;r&&(l=Ag(e)),t&&(l=w1(e,t));var u=l.map(function(c,h){if(o[h]){var f=o[h],g=e.timescale||1,C=e.presentationTimeOffset||0;return f.timeline=c.timeline,f.duration=c.duration,f.number=c.number,f.presentationTime=a+(c.time-C)/g,f}}).filter(function(c){return c});return u},hR=function(e){var t=e.attributes,r=e.segmentInfo,i,n;r.template?(n=lR,i=Ii(t,r.template)):r.base?(n=C1,i=Ii(t,r.base)):r.list&&(n=cR,i=Ii(t,r.list));var a={attributes:t};if(!n)return a;var o=n(i,r.segmentTimeline);if(i.duration){var l=i,u=l.duration,c=l.timescale,h=c===void 0?1:c;i.duration=u/h}else o.length?i.duration=o.reduce(function(f,g){return Math.max(f,Math.ceil(g.duration))},0):i.duration=0;return a.attributes=i,a.segments=o,r.base&&i.indexRange&&(a.sidx=o[0],a.segments=[]),a},dR=function(e){return e.map(hR)},Wt=function(e,t){return S1(e.childNodes).filter(function(r){var i=r.tagName;return i===t})},Dg=function(e){return e.textContent.trim()},fR=function(e){return parseFloat(e.split("/").reduce(function(t,r){return t/r}))},Ma=function(e){var t=31536e3,r=720*60*60,i=1440*60,n=3600,a=60,o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,l=o.exec(e);if(!l)return 0;var u=l.slice(1),c=u[0],h=u[1],f=u[2],g=u[3],C=u[4],p=u[5];return parseFloat(c||0)*t+parseFloat(h||0)*r+parseFloat(f||0)*i+parseFloat(g||0)*n+parseFloat(C||0)*a+parseFloat(p||0)},pR=function(e){var t=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;return t.test(e)&&(e+="Z"),Date.parse(e)},q_={mediaPresentationDuration:function(e){return Ma(e)},availabilityStartTime:function(e){return pR(e)/1e3},minimumUpdatePeriod:function(e){return Ma(e)},suggestedPresentationDelay:function(e){return Ma(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return Ma(e)},start:function(e){return Ma(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},frameRate:function(e){return fR(e)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?Ma(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},mi=function(e){return e&&e.attributes?S1(e.attributes).reduce(function(t,r){var i=q_[r.name]||q_.DEFAULT;return t[r.name]=i(r.value),t},{}):{}},mR={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},Yh=function(e,t){return t.length?Kh(e.map(function(r){return t.map(function(i){return Gh(r,Dg(i))})})):e},Ng=function(e){var t=Wt(e,"SegmentTemplate")[0],r=Wt(e,"SegmentList")[0],i=r&&Wt(r,"SegmentURL").map(function(f){return Ii({tag:"SegmentURL"},mi(f))}),n=Wt(e,"SegmentBase")[0],a=r||t,o=a&&Wt(a,"SegmentTimeline")[0],l=r||n||t,u=l&&Wt(l,"Initialization")[0],c=t&&mi(t);c&&u?c.initialization=u&&mi(u):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});var h={template:c,segmentTimeline:o&&Wt(o,"S").map(function(f){return mi(f)}),list:r&&Ii(mi(r),{segmentUrls:i,initialization:mi(u)}),base:n&&Ii(mi(n),{initialization:mi(u)})};return Object.keys(h).forEach(function(f){h[f]||delete h[f]}),h},gR=function(e,t,r){return function(i){var n=Wt(i,"BaseURL"),a=Yh(t,n),o=Ii(e,mi(i)),l=Ng(i);return a.map(function(u){return{segmentInfo:Ii(r,l),attributes:Ii(o,{baseUrl:u})}})}},vR=function(e){return e.reduce(function(t,r){var i=mi(r);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());var n=mR[i.schemeIdUri];if(n){t[n]={attributes:i};var a=Wt(r,"cenc:pssh")[0];if(a){var o=Dg(a);t[n].pssh=o&&m1(o)}}return t},{})},yR=function(e){if(e.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){var t=typeof e.value!="string"?[]:e.value.split(";");return t.map(function(i){var n,a;if(a=i,/^CC\d=/.test(i)){var o=i.split("=");n=o[0],a=o[1]}else/^CC\d$/.test(i)&&(n=i);return{channel:n,language:a}})}else if(e.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"){var r=typeof e.value!="string"?[]:e.value.split(";");return r.map(function(i){var n={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(i)){var a=i.split("="),o=a[0],l=a[1],u=l===void 0?"":l;n.channel=o,n.language=i,u.split(",").forEach(function(c){var h=c.split(":"),f=h[0],g=h[1];f==="lang"?n.language=g:f==="er"?n.easyReader=Number(g):f==="war"?n.aspectRatio=Number(g):f==="3D"&&(n["3D"]=Number(g))})}else n.language=i;return n.channel&&(n.channel="SERVICE"+n.channel),n})}},_R=function(e,t,r){return function(i){var n=mi(i),a=Yh(t,Wt(i,"BaseURL")),o=Wt(i,"Role")[0],l={role:mi(o)},u=Ii(e,n,l),c=Wt(i,"Accessibility")[0],h=yR(mi(c));h&&(u=Ii(u,{captionServices:h}));var f=Wt(i,"Label")[0];if(f&&f.childNodes.length){var g=f.childNodes[0].nodeValue.trim();u=Ii(u,{label:g})}var C=vR(Wt(i,"ContentProtection"));Object.keys(C).length&&(u=Ii(u,{contentProtection:C}));var p=Ng(i),T=Wt(i,"Representation"),A=Ii(r,p);return Kh(T.map(gR(u,a,A)))}},TR=function(e,t){return function(r,i){var n=Yh(t,Wt(r.node,"BaseURL")),a=Ii(e,{periodStart:r.attributes.start});typeof r.attributes.duration=="number"&&(a.periodDuration=r.attributes.duration);var o=Wt(r.node,"AdaptationSet"),l=Ng(r.node);return Kh(o.map(_R(a,n,l)))}},bR=function(e){var t=e.attributes,r=e.priorPeriodAttributes,i=e.mpdType;return typeof t.start=="number"?t.start:r&&typeof r.start=="number"&&typeof r.duration=="number"?r.start+r.duration:!r&&i==="static"?0:null},SR=function(e,t){t===void 0&&(t={});var r=t,i=r.manifestUri,n=i===void 0?"":i,a=r.NOW,o=a===void 0?Date.now():a,l=r.clientOffset,u=l===void 0?0:l,c=Wt(e,"Period");if(!c.length)throw new Error(To.INVALID_NUMBER_OF_PERIOD);var h=Wt(e,"Location"),f=mi(e),g=Yh([n],Wt(e,"BaseURL"));f.type=f.type||"static",f.sourceDuration=f.mediaPresentationDuration||0,f.NOW=o,f.clientOffset=u,h.length&&(f.locations=h.map(Dg));var C=[];return c.forEach(function(p,T){var A=mi(p),N=C[T-1];A.start=bR({attributes:A,priorPeriodAttributes:N?N.attributes:null,mpdType:f.type}),C.push({node:p,attributes:A})}),{locations:f.locations,representationInfo:Kh(C.map(TR(f,g)))}},k1=function(e){if(e==="")throw new Error(To.DASH_EMPTY_MANIFEST);var t=new O0.DOMParser,r,i;try{r=t.parseFromString(e,"application/xml"),i=r&&r.documentElement.tagName==="MPD"?r.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(To.DASH_INVALID_XML);return i},CR=function(e){var t=Wt(e,"UTCTiming")[0];if(!t)return null;var r=mi(t);switch(r.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":r.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":r.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":r.method="DIRECT",r.value=Date.parse(r.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(To.UNSUPPORTED_UTC_TIMING_SCHEME)}return r},ER=function(e,t){t===void 0&&(t={});var r=SR(k1(e),t),i=dR(r.representationInfo);return rR({dashPlaylists:i,locations:r.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})},wR=function(e){return CR(k1(e))},$f,z_;function kR(){if(z_)return $f;z_=1;var s=Math.pow(2,32),e=function(t){var r=new DataView(t.buffer,t.byteOffset,t.byteLength),i;return r.getBigUint64?(i=r.getBigUint64(0),i<Number.MAX_SAFE_INTEGER?Number(i):i):r.getUint32(0)*s+r.getUint32(4)};return $f={getUint64:e,MAX_UINT32:s},$f}var jf,W_;function xR(){if(W_)return jf;W_=1;var s=kR().getUint64,e=function(t){var r=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:r.getUint32(4),timescale:r.getUint32(8)},n=12;i.version===0?(i.earliestPresentationTime=r.getUint32(n),i.firstOffset=r.getUint32(n+4),n+=8):(i.earliestPresentationTime=s(t.subarray(n)),i.firstOffset=s(t.subarray(n+8)),n+=16),n+=2;var a=r.getUint16(n);for(n+=2;a>0;n+=12,a--)i.references.push({referenceType:(t[n]&128)>>>7,referencedSize:r.getUint32(n)&2147483647,subsegmentDuration:r.getUint32(n+4),startsWithSap:!!(t[n+8]&128),sapType:(t[n+8]&112)>>>4,sapDeltaTime:r.getUint32(n+8)&268435455});return i};return jf=e,jf}var AR=xR();const IR=qi(AR);var PR=je([73,68,51]),DR=function(e,t){t===void 0&&(t=0),e=je(e);var r=e[t+5],i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(r&16)>>4;return n?i+20:i+10},Cl=function s(e,t){return t===void 0&&(t=0),e=je(e),e.length-t<10||!Dt(e,PR,{offset:t})?t:(t+=DR(e,t),s(e,t))},G_=function(e){return typeof e=="string"?T1(e):e},NR=function(e){return Array.isArray(e)?e.map(function(t){return G_(t)}):[G_(e)]},LR=function s(e,t,r){r===void 0&&(r=!1),t=NR(t),e=je(e);var i=[];if(!t.length)return i;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,o=e.subarray(n+4,n+8);if(a===0)break;var l=n+a;if(l>e.length){if(r)break;l=e.length}var u=e.subarray(n+8,l);Dt(o,t[0])&&(t.length===1?i.push(u):i.push.apply(i,s(u,t.slice(1),r))),n=l}return i},ac={EBML:je([26,69,223,163]),DocType:je([66,130]),Segment:je([24,83,128,103]),SegmentInfo:je([21,73,169,102]),Tracks:je([22,84,174,107]),Track:je([174]),TrackNumber:je([215]),DefaultDuration:je([35,227,131]),TrackEntry:je([174]),TrackType:je([131]),FlagDefault:je([136]),CodecID:je([134]),CodecPrivate:je([99,162]),VideoTrack:je([224]),AudioTrack:je([225]),Cluster:je([31,67,182,117]),Timestamp:je([231]),TimestampScale:je([42,215,177]),BlockGroup:je([160]),BlockDuration:je([155]),Block:je([161]),SimpleBlock:je([163])},am=[128,64,32,16,8,4,2,1],OR=function(e){for(var t=1,r=0;r<am.length&&!(e&am[r]);r++)t++;return t},Zc=function(e,t,r,i){r===void 0&&(r=!0),i===void 0&&(i=!1);var n=OR(e[t]),a=e.subarray(t,t+n);return r&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=am[n-1]),{length:n,value:DM(a,{signed:i}),bytes:a}},K_=function s(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return s(t)}):typeof e=="number"?NM(e):e},MR=function(e){return Array.isArray(e)?e.map(function(t){return K_(t)}):[K_(e)]},RR=function s(e,t,r){if(r>=t.length)return t.length;var i=Zc(t,r,!1);if(Dt(e.bytes,i.bytes))return r;var n=Zc(t,r+i.length);return s(e,t,r+n.length+n.value+i.length)},X_=function s(e,t){t=MR(t),e=je(e);var r=[];if(!t.length)return r;for(var i=0;i<e.length;){var n=Zc(e,i,!1),a=Zc(e,i+n.length),o=i+n.length+a.length;a.value===127&&(a.value=RR(n,e,o),a.value!==e.length&&(a.value-=o));var l=o+a.value>e.length?e.length:o+a.value,u=e.subarray(o,l);Dt(t[0],n.bytes)&&(t.length===1?r.push(u):r=r.concat(s(u,t.slice(1))));var c=n.length+a.length+u.length;i+=c}return r},BR=je([0,0,0,1]),FR=je([0,0,1]),UR=je([0,0,3]),$R=function(e){for(var t=[],r=1;r<e.length-2;)Dt(e.subarray(r,r+3),UR)&&(t.push(r+2),r++),r++;if(t.length===0)return e;var i=e.length-t.length,n=new Uint8Array(i),a=0;for(r=0;r<i;a++,r++)a===t[0]&&(a++,t.shift()),n[r]=e[a];return n},x1=function(e,t,r,i){e=je(e),r=[].concat(r);for(var n=0,a,o=0;n<e.length&&(o<i||a);){var l=void 0;if(Dt(e.subarray(n),BR)?l=4:Dt(e.subarray(n),FR)&&(l=3),!l){n++;continue}if(o++,a)return $R(e.subarray(a,n));var u=void 0;t==="h264"?u=e[n+l]&31:t==="h265"&&(u=e[n+l]>>1&63),r.indexOf(u)!==-1&&(a=n+l),n+=l+(t==="h264"?1:2)}return e.subarray(0,0)},jR=function(e,t,r){return x1(e,"h264",t,r)},VR=function(e,t,r){return x1(e,"h265",t,r)},Ei={webm:je([119,101,98,109]),matroska:je([109,97,116,114,111,115,107,97]),flac:je([102,76,97,67]),ogg:je([79,103,103,83]),ac3:je([11,119]),riff:je([82,73,70,70]),avi:je([65,86,73]),wav:je([87,65,86,69]),"3gp":je([102,116,121,112,51,103]),mp4:je([102,116,121,112]),fmp4:je([115,116,121,112]),mov:je([102,116,121,112,113,116]),moov:je([109,111,111,118]),moof:je([109,111,111,102])},bo={aac:function(e){var t=Cl(e);return Dt(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Cl(e);return Dt(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=X_(e,[ac.EBML,ac.DocType])[0];return Dt(t,Ei.webm)},mkv:function(e){var t=X_(e,[ac.EBML,ac.DocType])[0];return Dt(t,Ei.matroska)},mp4:function(e){if(bo["3gp"](e)||bo.mov(e))return!1;if(Dt(e,Ei.mp4,{offset:4})||Dt(e,Ei.fmp4,{offset:4})||Dt(e,Ei.moof,{offset:4})||Dt(e,Ei.moov,{offset:4}))return!0},mov:function(e){return Dt(e,Ei.mov,{offset:4})},"3gp":function(e){return Dt(e,Ei["3gp"],{offset:4})},ac3:function(e){var t=Cl(e);return Dt(e,Ei.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=Cl(e);return Dt(e,Ei.flac,{offset:t})},ogg:function(e){return Dt(e,Ei.ogg)},avi:function(e){return Dt(e,Ei.riff)&&Dt(e,Ei.avi,{offset:8})},wav:function(e){return Dt(e,Ei.riff)&&Dt(e,Ei.wav,{offset:8})},h264:function(e){return jR(e,7,3).length},h265:function(e){return VR(e,[32,33],3).length}},om=Object.keys(bo).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);om.forEach(function(s){var e=bo[s];bo[s]=function(t){return e(je(t))}});var HR=bo,Lg=function(e){e=je(e);for(var t=0;t<om.length;t++){var r=om[t];if(HR[r](e))return r}return""},qR=function(e){return LR(e,["moof"]).length>0},Vf,Y_;function zR(){if(Y_)return Vf;Y_=1;var s=9e4,e,t,r,i,n,a,o;return e=function(l){return l*s},t=function(l,u){return l*u},r=function(l){return l/s},i=function(l,u){return l/u},n=function(l,u){return e(i(l,u))},a=function(l,u){return t(r(l),u)},o=function(l,u,c){return r(c?l:l-u)},Vf={ONE_SECOND_IN_TS:s,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:r,audioTsToSeconds:i,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:o},Vf}var eh=zR();function WR(s){try{return Function.toString.call(s).indexOf("[native code]")!==-1}catch{return typeof s=="function"}}function lm(s){var e=typeof Map=="function"?new Map:void 0;return lm=function(r){if(r===null||!WR(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return p1(r,arguments,rx(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),l0(i,r)},lm(s)}/**
|
|
246
|
-
* @license
|
|
247
|
-
* Video.js 7.21.7 <http://videojs.com/>
|
|
248
|
-
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
|
|
249
|
-
* Available under Apache License Version 2.0
|
|
250
|
-
* <https://github.com/videojs/video.js/blob/main/LICENSE>
|
|
251
|
-
*
|
|
252
|
-
* Includes vtt.js <https://github.com/mozilla/vtt.js>
|
|
253
|
-
* Available under Apache License Version 2.0
|
|
254
|
-
* <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
|
|
255
|
-
*/var A1="7.21.7",Sn={},as=function(e,t){return Sn[e]=Sn[e]||[],t&&(Sn[e]=Sn[e].concat(t)),Sn[e]},GR=function(e,t){as(e,t)},I1=function(e,t){var r=as(e).indexOf(t);return r<=-1?!1:(Sn[e]=Sn[e].slice(),Sn[e].splice(r,1),!0)},KR=function(e,t){as(e,[].concat(t).map(function(r){var i=function n(){return I1(e,n),r.apply(void 0,arguments)};return i}))},th={prefixed:!0},Ec=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],Q_=Ec[0],El;for(var oc=0;oc<Ec.length;oc++)if(Ec[oc][1]in ue){El=Ec[oc];break}if(El){for(var lc=0;lc<El.length;lc++)th[Q_[lc]]=El[lc];th.prefixed=El[0]!==Q_[0]}var $i=[],XR=function(e,t){return function(r,i,n){var a=t.levels[i],o=new RegExp("^("+a+")$");if(r!=="log"&&n.unshift(r.toUpperCase()+":"),n.unshift(e+":"),$i){$i.push([].concat(n));var l=$i.length-1e3;$i.splice(0,l>0?l:0)}if(D.console){var u=D.console[r];!u&&r==="debug"&&(u=D.console.info||D.console.log),!(!u||!a||!o.test(r))&&u[Array.isArray(n)?"apply":"call"](D.console,n)}}};function P1(s){var e="info",t,r=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];t("log",e,a)};return t=XR(s,r),r.createLogger=function(i){return P1(s+": "+i)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:e},r.level=function(i){if(typeof i=="string"){if(!r.levels.hasOwnProperty(i))throw new Error('"'+i+'" in not a valid log level');e=i}return e},r.history=function(){return $i?[].concat($i):[]},r.history.filter=function(i){return($i||[]).filter(function(n){return new RegExp(".*"+i+".*").test(n[0])})},r.history.clear=function(){$i&&($i.length=0)},r.history.disable=function(){$i!==null&&($i.length=0,$i=null)},r.history.enable=function(){$i===null&&($i=[])},r.error=function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return t("error",e,n)},r.warn=function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return t("warn",e,n)},r.debug=function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return t("debug",e,n)},r}var Qe=P1("VIDEOJS"),D1=Qe.createLogger,YR=Object.prototype.toString,N1=function(e){return An(e)?Object.keys(e):[]};function so(s,e){N1(s).forEach(function(t){return e(s[t],t)})}function QR(s,e,t){return t===void 0&&(t=0),N1(s).reduce(function(r,i){return e(r,s[i],i)},t)}function Ht(s){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Object.assign?vt.apply(void 0,[s].concat(t)):(t.forEach(function(i){i&&so(i,function(n,a){s[a]=n})}),s)}function An(s){return!!s&&typeof s=="object"}function Gl(s){return An(s)&&YR.call(s)==="[object Object]"&&s.constructor===Object}function Kl(s,e){if(!s||!e)return"";if(typeof D.getComputedStyle=="function"){var t;try{t=D.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}var ai=D.navigator&&D.navigator.userAgent||"",J_=/AppleWebKit\/([\d.]+)/i.exec(ai),JR=J_?parseFloat(J_.pop()):null,L1=/iPod/i.test(ai),ZR=(function(){var s=ai.match(/OS (\d+)_/i);return s&&s[1]?s[1]:null})(),Pn=/Android/i.test(ai),Og=(function(){var s=ai.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!s)return null;var e=s[1]&&parseFloat(s[1]),t=s[2]&&parseFloat(s[2]);return e&&t?parseFloat(s[1]+"."+s[2]):e||null})(),O1=Pn&&Og<5&&JR<537,M1=/Firefox/i.test(ai),ou=/Edg/i.test(ai),Dn=!ou&&(/Chrome/i.test(ai)||/CriOS/i.test(ai)),R1=(function(){var s=ai.match(/(Chrome|CriOS)\/(\d+)/);return s&&s[2]?parseFloat(s[2]):null})(),lu=(function(){var s=/MSIE\s(\d+)\.\d/.exec(ai),e=s&&parseFloat(s[1]);return!e&&/Trident\/7.0/i.test(ai)&&/rv:11.0/.test(ai)&&(e=11),e})(),Mg=/Safari/i.test(ai)&&!Dn&&!Pn&&!ou,B1=/Windows/i.test(ai),So=!!(Fo()&&("ontouchstart"in D||D.navigator.maxTouchPoints||D.DocumentTouch&&D.document instanceof D.DocumentTouch)),Rg=/iPad/i.test(ai)||Mg&&So&&!/iPhone/i.test(ai),Bg=/iPhone/i.test(ai)&&!Rg,Li=Bg||Rg||L1,Qh=(Mg||Li)&&!Dn,e4=Object.freeze({__proto__:null,IS_IPOD:L1,IOS_VERSION:ZR,IS_ANDROID:Pn,ANDROID_VERSION:Og,IS_NATIVE_ANDROID:O1,IS_FIREFOX:M1,IS_EDGE:ou,IS_CHROME:Dn,CHROME_VERSION:R1,IE_VERSION:lu,IS_SAFARI:Mg,IS_WINDOWS:B1,TOUCH_ENABLED:So,IS_IPAD:Rg,IS_IPHONE:Bg,IS_IOS:Li,IS_ANY_SAFARI:Qh});function Z_(s){return typeof s=="string"&&!!s.trim()}function F1(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function t4(s){return new RegExp("(^|\\s)"+s+"($|\\s)")}function Fo(){return ue===D.document}function Uo(s){return An(s)&&s.nodeType===1}function U1(){try{return D.parent!==D.self}catch{return!0}}function $1(s){return function(e,t){if(!Z_(e))return ue[s](null);Z_(t)&&(t=ue.querySelector(t));var r=Uo(t)?t:ue;return r[s]&&r[s](e)}}function rt(s,e,t,r){s===void 0&&(s="div"),e===void 0&&(e={}),t===void 0&&(t={});var i=ue.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){var a=e[n];n.indexOf("aria-")!==-1||n==="role"||n==="type"?(Qe.warn(`Setting attributes in the second argument of createEl()
|
|
256
|
-
has been deprecated. Use the third argument instead.
|
|
257
|
-
`+("createEl(type, properties, attributes). Attempting to set "+n+" to "+a+".")),i.setAttribute(n,a)):n==="textContent"?oa(i,a):(i[n]!==a||n==="tabIndex")&&(i[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){i.setAttribute(n,t[n])}),r&&Ug(i,r),i}function oa(s,e){return typeof s.textContent>"u"?s.innerText=e:s.textContent=e,s}function um(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function Qs(s,e){return F1(e),s.classList?s.classList.contains(e):t4(e).test(s.className)}function kn(s,e){return s.classList?s.classList.add(e):Qs(s,e)||(s.className=(s.className+" "+e).trim()),s}function uu(s,e){return s?(s.classList?s.classList.remove(e):(F1(e),s.className=s.className.split(/\s+/).filter(function(t){return t!==e}).join(" ")),s):(Qe.warn("removeClass was called with an element that doesn't exist"),null)}function j1(s,e,t){var r=Qs(s,e);if(typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=!r),t!==r)return t?kn(s,e):uu(s,e),s}function V1(s,e){Object.getOwnPropertyNames(e).forEach(function(t){var r=e[t];r===null||typeof r>"u"||r===!1?s.removeAttribute(t):s.setAttribute(t,r===!0?"":r)})}function _n(s){var e={},t=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(s&&s.attributes&&s.attributes.length>0)for(var r=s.attributes,i=r.length-1;i>=0;i--){var n=r[i].name,a=r[i].value;(typeof s[n]=="boolean"||t.indexOf(","+n+",")!==-1)&&(a=a!==null),e[n]=a}return e}function H1(s,e){return s.getAttribute(e)}function Co(s,e,t){s.setAttribute(e,t)}function Jh(s,e){s.removeAttribute(e)}function q1(){ue.body.focus(),ue.onselectstart=function(){return!1}}function z1(){ue.onselectstart=function(){return!0}}function Eo(s){if(s&&s.getBoundingClientRect&&s.parentNode){var e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(function(r){e[r]!==void 0&&(t[r]=e[r])}),t.height||(t.height=parseFloat(Kl(s,"height"))),t.width||(t.width=parseFloat(Kl(s,"width"))),t}}function Xl(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};for(var e=s.offsetWidth,t=s.offsetHeight,r=0,i=0;s.offsetParent&&s!==ue[th.fullscreenElement];)r+=s.offsetLeft,i+=s.offsetTop,s=s.offsetParent;return{left:r,top:i,width:e,height:t}}function Zh(s,e){var t={x:0,y:0};if(Li)for(var r=s;r&&r.nodeName.toLowerCase()!=="html";){var i=Kl(r,"transform");if(/^matrix/.test(i)){var n=i.slice(7,-1).split(/,\s/).map(Number);t.x+=n[4],t.y+=n[5]}else if(/^matrix3d/.test(i)){var a=i.slice(9,-1).split(/,\s/).map(Number);t.x+=a[12],t.y+=a[13]}r=r.parentNode}var o={},l=Xl(e.target),u=Xl(s),c=u.width,h=u.height,f=e.offsetY-(u.top-l.top),g=e.offsetX-(u.left-l.left);return e.changedTouches&&(g=e.changedTouches[0].pageX-u.left,f=e.changedTouches[0].pageY+u.top,Li&&(g-=t.x,f-=t.y)),o.y=1-Math.max(0,Math.min(1,f/h)),o.x=Math.max(0,Math.min(1,g/c)),o}function W1(s){return An(s)&&s.nodeType===3}function Fg(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function G1(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(function(e){if(typeof e=="function"&&(e=e()),Uo(e)||W1(e))return e;if(typeof e=="string"&&/\S/.test(e))return ue.createTextNode(e)}).filter(function(e){return e})}function Ug(s,e){return G1(e).forEach(function(t){return s.appendChild(t)}),s}function K1(s,e){return Ug(Fg(s),e)}function Yl(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0?!0:!(s.button!==0||s.buttons!==1)}var os=$1("querySelector"),X1=$1("querySelectorAll"),Y1=Object.freeze({__proto__:null,isReal:Fo,isEl:Uo,isInFrame:U1,createEl:rt,textContent:oa,prependTo:um,hasClass:Qs,addClass:kn,removeClass:uu,toggleClass:j1,setAttributes:V1,getAttributes:_n,getAttribute:H1,setAttribute:Co,removeAttribute:Jh,blockTextSelection:q1,unblockTextSelection:z1,getBoundingClientRect:Eo,findPosition:Xl,getPointerPosition:Zh,isTextNode:W1,emptyEl:Fg,normalizeContent:G1,appendContent:Ug,insertContent:K1,isSingleLeftClick:Yl,$:os,$$:X1}),Q1=!1,cm,i4=function(){if(cm.options.autoSetup!==!1){var e=Array.prototype.slice.call(ue.getElementsByTagName("video")),t=Array.prototype.slice.call(ue.getElementsByTagName("audio")),r=Array.prototype.slice.call(ue.getElementsByTagName("video-js")),i=e.concat(t,r);if(i&&i.length>0)for(var n=0,a=i.length;n<a;n++){var o=i[n];if(o&&o.getAttribute){if(o.player===void 0){var l=o.getAttribute("data-setup");l!==null&&cm(o)}}else{hm(1);break}}else Q1||hm(1)}};function hm(s,e){Fo()&&(e&&(cm=e),D.setTimeout(i4,s))}function dm(){Q1=!0,D.removeEventListener("load",dm)}Fo()&&(ue.readyState==="complete"?dm():D.addEventListener("load",dm));var J1=function(e){var t=ue.createElement("style");return t.className=e,t},Z1=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},r4=3,n4=r4;function Nn(){return n4++}var eE;D.WeakMap||(eE=(function(){function s(){this.vdata="vdata"+Math.floor(D.performance&&D.performance.now()||Date.now()),this.data={}}var e=s.prototype;return e.set=function(r,i){var n=r[this.vdata]||Nn();return r[this.vdata]||(r[this.vdata]=n),this.data[n]=i,this},e.get=function(r){var i=r[this.vdata];if(i)return this.data[i];Qe("We have no data for this element",r)},e.has=function(r){var i=r[this.vdata];return i in this.data},e.delete=function(r){var i=r[this.vdata];i&&(delete this.data[i],delete r[this.vdata])},s})());var Pi=D.WeakMap?new WeakMap:new eE;function eT(s,e){if(Pi.has(s)){var t=Pi.get(s);t.handlers[e].length===0&&(delete t.handlers[e],s.removeEventListener?s.removeEventListener(e,t.dispatcher,!1):s.detachEvent&&s.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&Pi.delete(s)}}function $g(s,e,t,r){t.forEach(function(i){s(e,i,r)})}function ed(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){var r=s||D.event;s={};for(var i in r)i!=="layerX"&&i!=="layerY"&&i!=="keyLocation"&&i!=="webkitMovementX"&&i!=="webkitMovementY"&&i!=="path"&&(i==="returnValue"&&r.preventDefault||(s[i]=r[i]));if(s.target||(s.target=s.srcElement||ue),s.relatedTarget||(s.relatedTarget=s.fromElement===s.target?s.toElement:s.fromElement),s.preventDefault=function(){r.preventDefault&&r.preventDefault(),s.returnValue=!1,r.returnValue=!1,s.defaultPrevented=!0},s.defaultPrevented=!1,s.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),s.cancelBubble=!0,r.cancelBubble=!0,s.isPropagationStopped=e},s.isPropagationStopped=t,s.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),s.isImmediatePropagationStopped=e,s.stopPropagation()},s.isImmediatePropagationStopped=t,s.clientX!==null&&s.clientX!==void 0){var n=ue.documentElement,a=ue.body;s.pageX=s.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),s.pageY=s.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}s.which=s.charCode||s.keyCode,s.button!==null&&s.button!==void 0&&(s.button=s.button&1?0:s.button&4?1:s.button&2?2:0)}return s.fixed_=!0,s}var uc,s4=function(){if(typeof uc!="boolean"){uc=!1;try{var e=Object.defineProperty({},"passive",{get:function(){uc=!0}});D.addEventListener("test",null,e),D.removeEventListener("test",null,e)}catch{}}return uc},a4=["touchstart","touchmove"];function rr(s,e,t){if(Array.isArray(e))return $g(rr,s,e,t);Pi.has(s)||Pi.set(s,{});var r=Pi.get(s);if(r.handlers||(r.handlers={}),r.handlers[e]||(r.handlers[e]=[]),t.guid||(t.guid=Nn()),r.handlers[e].push(t),r.dispatcher||(r.disabled=!1,r.dispatcher=function(n,a){if(!r.disabled){n=ed(n);var o=r.handlers[n.type];if(o)for(var l=o.slice(0),u=0,c=l.length;u<c&&!n.isImmediatePropagationStopped();u++)try{l[u].call(s,n,a)}catch(h){Qe.error(h)}}}),r.handlers[e].length===1)if(s.addEventListener){var i=!1;s4()&&a4.indexOf(e)>-1&&(i={passive:!0}),s.addEventListener(e,r.dispatcher,i)}else s.attachEvent&&s.attachEvent("on"+e,r.dispatcher)}function _i(s,e,t){if(Pi.has(s)){var r=Pi.get(s);if(r.handlers){if(Array.isArray(e))return $g(_i,s,e,t);var i=function(u,c){r.handlers[c]=[],eT(u,c)};if(e===void 0){for(var n in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},n)&&i(s,n);return}var a=r.handlers[e];if(a){if(!t){i(s,e);return}if(t.guid)for(var o=0;o<a.length;o++)a[o].guid===t.guid&&a.splice(o--,1);eT(s,e)}}}}function $o(s,e,t){var r=Pi.has(s)?Pi.get(s):{},i=s.parentNode||s.ownerDocument;if(typeof e=="string"?e={type:e,target:s}:e.target||(e.target=s),e=ed(e),r.dispatcher&&r.dispatcher.call(s,e,t),i&&!e.isPropagationStopped()&&e.bubbles===!0)$o.call(null,i,e,t);else if(!i&&!e.defaultPrevented&&e.target&&e.target[e.type]){Pi.has(e.target)||Pi.set(e.target,{});var n=Pi.get(e.target);e.target[e.type]&&(n.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),n.disabled=!1)}return!e.defaultPrevented}function td(s,e,t){if(Array.isArray(e))return $g(td,s,e,t);var r=function i(){_i(s,e,i),t.apply(this,arguments)};r.guid=t.guid=t.guid||Nn(),rr(s,e,r)}function tE(s,e,t){var r=function i(){_i(s,e,i),t.apply(this,arguments)};r.guid=t.guid=t.guid||Nn(),rr(s,e,r)}var o4=Object.freeze({__proto__:null,fixEvent:ed,on:rr,off:_i,trigger:$o,one:td,any:tE}),Nr=30,It=function(e,t,r){t.guid||(t.guid=Nn());var i=t.bind(e);return i.guid=r?r+"_"+t.guid:t.guid,i},In=function(e,t){var r=D.performance.now(),i=function(){var a=D.performance.now();a-r>=t&&(e.apply(void 0,arguments),r=a)};return i},l4=function(e,t,r,i){i===void 0&&(i=D);var n,a=function(){i.clearTimeout(n),n=null},o=function(){var u=this,c=arguments,h=function(){n=null,h=null,e.apply(u,c)};i.clearTimeout(n),n=i.setTimeout(h,t)};return o.cancel=a,o},oi=function(){};oi.prototype.allowedEvents_={};oi.prototype.on=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},rr(this,s,e),this.addEventListener=t};oi.prototype.addEventListener=oi.prototype.on;oi.prototype.off=function(s,e){_i(this,s,e)};oi.prototype.removeEventListener=oi.prototype.off;oi.prototype.one=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},td(this,s,e),this.addEventListener=t};oi.prototype.any=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},tE(this,s,e),this.addEventListener=t};oi.prototype.trigger=function(s){var e=s.type||s;typeof s=="string"&&(s={type:e}),s=ed(s),this.allowedEvents_[e]&&this["on"+e]&&this["on"+e](s),$o(this,s)};oi.prototype.dispatchEvent=oi.prototype.trigger;var dl;oi.prototype.queueTrigger=function(s){var e=this;dl||(dl=new Map);var t=s.type||s,r=dl.get(this);r||(r=new Map,dl.set(this,r));var i=r.get(t);r.delete(t),D.clearTimeout(i);var n=D.setTimeout(function(){r.delete(t),r.size===0&&(r=null,dl.delete(e)),e.trigger(s)},0);r.set(t,n)};var id=function(e){return typeof e.name=="function"?e.name():typeof e.name=="string"?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},xn=function(e){return e instanceof oi||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return typeof e[t]=="function"})},u4=function(e,t){xn(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))},fm=function(e){return typeof e=="string"&&/\S/.test(e)||Array.isArray(e)&&!!e.length},ih=function(e,t,r){if(!e||!e.nodeName&&!xn(e))throw new Error("Invalid target for "+id(t)+"#"+r+"; must be a DOM node or evented object.")},iE=function(e,t,r){if(!fm(e))throw new Error("Invalid event type for "+id(t)+"#"+r+"; must be a non-empty string or array.")},rE=function(e,t,r){if(typeof e!="function")throw new Error("Invalid listener for "+id(t)+"#"+r+"; must be a function.")},Hf=function(e,t,r){var i=t.length<3||t[0]===e||t[0]===e.eventBusEl_,n,a,o;return i?(n=e.eventBusEl_,t.length>=3&&t.shift(),a=t[0],o=t[1]):(n=t[0],a=t[1],o=t[2]),ih(n,e,r),iE(a,e,r),rE(o,e,r),o=It(e,o),{isTargetingSelf:i,target:n,type:a,listener:o}},Ds=function(e,t,r,i){ih(e,e,t),e.nodeName?o4[t](e,r,i):e[t](r,i)},c4={on:function(){for(var e=this,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var n=Hf(this,r,"on"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(Ds(o,"on",l,u),!a){var c=function(){return e.off(o,l,u)};c.guid=u.guid;var h=function(){return e.off("dispose",c)};h.guid=u.guid,Ds(this,"on","dispose",c),Ds(o,"on","dispose",h)}},one:function(){for(var e=this,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var n=Hf(this,r,"one"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(a)Ds(o,"one",l,u);else{var c=function h(){e.off(o,l,h);for(var f=arguments.length,g=new Array(f),C=0;C<f;C++)g[C]=arguments[C];u.apply(null,g)};c.guid=u.guid,Ds(o,"one",l,c)}},any:function(){for(var e=this,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var n=Hf(this,r,"any"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(a)Ds(o,"any",l,u);else{var c=function h(){e.off(o,l,h);for(var f=arguments.length,g=new Array(f),C=0;C<f;C++)g[C]=arguments[C];u.apply(null,g)};c.guid=u.guid,Ds(o,"any",l,c)}},off:function(e,t,r){if(!e||fm(e))_i(this.eventBusEl_,e,t);else{var i=e,n=t;ih(i,this,"off"),iE(n,this,"off"),rE(r,this,"off"),r=It(this,r),this.off("dispose",r),i.nodeName?(_i(i,n,r),_i(i,"dispose",r)):xn(i)&&(i.off(n,r),i.off("dispose",r))}},trigger:function(e,t){ih(this.eventBusEl_,this,"trigger");var r=e&&typeof e!="string"?e.type:e;if(!fm(r)){var i="Invalid event type for "+id(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(e)(this.log||Qe).error(i);else throw new Error(i)}return $o(this.eventBusEl_,e,t)}};function jg(s,e){e===void 0&&(e={});var t=e,r=t.eventBusKey;if(r){if(!s[r].nodeName)throw new Error('The eventBusKey "'+r+'" does not refer to an element.');s.eventBusEl_=s[r]}else s.eventBusEl_=rt("span",{className:"vjs-event-bus"});return Ht(s,c4),s.eventedCallbacks&&s.eventedCallbacks.forEach(function(i){i()}),s.on("dispose",function(){s.off(),[s,s.el_,s.eventBusEl_].forEach(function(i){i&&Pi.has(i)&&Pi.delete(i)}),D.setTimeout(function(){s.eventBusEl_=null},0)}),s}var h4={state:{},setState:function(e){var t=this;typeof e=="function"&&(e=e());var r;return so(e,function(i,n){t.state[n]!==i&&(r=r||{},r[n]={from:t.state[n],to:i}),t.state[n]=i}),r&&xn(this)&&this.trigger({changes:r,type:"statechanged"}),r}};function nE(s,e){return Ht(s,h4),s.state=Ht({},s.state,e),typeof s.handleStateChanged=="function"&&xn(s)&&s.on("statechanged",s.handleStateChanged),s}var wc=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toLowerCase()})},Gt=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toUpperCase()})},d4=function(e,t){return Gt(e)===Gt(t)};function At(){for(var s={},e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.forEach(function(i){i&&so(i,function(n,a){if(!Gl(n)){s[a]=n;return}Gl(s[a])||(s[a]={}),s[a]=At(s[a],n)})}),s}var f4=(function(){function s(){this.map_={}}var e=s.prototype;return e.has=function(r){return r in this.map_},e.delete=function(r){var i=this.has(r);return delete this.map_[r],i},e.set=function(r,i){return this.map_[r]=i,this},e.forEach=function(r,i){for(var n in this.map_)r.call(i,this.map_[n],n,this)},s})(),p4=D.Map?D.Map:f4,m4=(function(){function s(){this.set_={}}var e=s.prototype;return e.has=function(r){return r in this.set_},e.delete=function(r){var i=this.has(r);return delete this.set_[r],i},e.add=function(r){return this.set_[r]=1,this},e.forEach=function(r,i){for(var n in this.set_)r.call(i,n,n,this)},s})(),qf=D.Set?D.Set:m4,be=(function(){function s(t,r,i){var n=this;if(!t&&this.play?this.player_=t=this:this.player_=t,this.isDisposed_=!1,this.parentComponent_=null,this.options_=At({},this.options_),r=this.options_=At(this.options_,r),this.id_=r.id||r.el&&r.el.id,!this.id_){var a=t&&t.id&&t.id()||"no_player";this.id_=a+"_component_"+Nn()}this.name_=r.name||null,r.el?this.el_=r.el:r.createEl!==!1&&(this.el_=this.createEl()),r.className&&this.el_&&r.className.split(" ").forEach(function(o){return n.addClass(o)}),r.evented!==!1&&(jg(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),nE(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new qf,this.setIntervalIds_=new qf,this.rafIds_=new qf,this.namedRafs_=new p4,this.clearingTimersOnDispose_=!1,r.initChildren!==!1&&this.initChildren(),this.ready(i),r.reportTouchActivity!==!1&&this.enableTouchActivity()}var e=s.prototype;return e.dispose=function(r){if(r===void 0&&(r={}),!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var i=this.children_.length-1;i>=0;i--)this.children_[i].dispose&&this.children_[i].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(r.restoreEl?this.el_.parentNode.replaceChild(r.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},e.isDisposed=function(){return!!this.isDisposed_},e.player=function(){return this.player_},e.options=function(r){return r?(this.options_=At(this.options_,r),this.options_):this.options_},e.el=function(){return this.el_},e.createEl=function(r,i,n){return rt(r,i,n)},e.localize=function(r,i,n){n===void 0&&(n=r);var a=this.player_.language&&this.player_.language(),o=this.player_.languages&&this.player_.languages(),l=o&&o[a],u=a&&a.split("-")[0],c=o&&o[u],h=n;return l&&l[r]?h=l[r]:c&&c[r]&&(h=c[r]),i&&(h=h.replace(/\{(\d+)\}/g,function(f,g){var C=i[g-1],p=C;return typeof C>"u"&&(p=f),p})),h},e.handleLanguagechange=function(){},e.contentEl=function(){return this.contentEl_||this.el_},e.id=function(){return this.id_},e.name=function(){return this.name_},e.children=function(){return this.children_},e.getChildById=function(r){return this.childIndex_[r]},e.getChild=function(r){if(r)return this.childNameIndex_[r]},e.getDescendant=function(){for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];i=i.reduce(function(l,u){return l.concat(u)},[]);for(var a=this,o=0;o<i.length;o++)if(a=a.getChild(i[o]),!a||!a.getChild)return;return a},e.addChild=function(r,i,n){i===void 0&&(i={}),n===void 0&&(n=this.children_.length);var a,o;if(typeof r=="string"){o=Gt(r);var l=i.componentClass||o;i.name=o;var u=s.getComponent(l);if(!u)throw new Error("Component "+l+" does not exist");if(typeof u!="function")return null;a=new u(this.player_||this,i)}else a=r;if(a.parentComponent_&&a.parentComponent_.removeChild(a),this.children_.splice(n,0,a),a.parentComponent_=this,typeof a.id=="function"&&(this.childIndex_[a.id()]=a),o=o||a.name&&Gt(a.name()),o&&(this.childNameIndex_[o]=a,this.childNameIndex_[wc(o)]=a),typeof a.el=="function"&&a.el()){var c=null;this.children_[n+1]&&(this.children_[n+1].el_?c=this.children_[n+1].el_:Uo(this.children_[n+1])&&(c=this.children_[n+1])),this.contentEl().insertBefore(a.el(),c)}return a},e.removeChild=function(r){if(typeof r=="string"&&(r=this.getChild(r)),!(!r||!this.children_)){for(var i=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===r){i=!0,this.children_.splice(n,1);break}if(i){r.parentComponent_=null,this.childIndex_[r.id()]=null,this.childNameIndex_[Gt(r.name())]=null,this.childNameIndex_[wc(r.name())]=null;var a=r.el();a&&a.parentNode===this.contentEl()&&this.contentEl().removeChild(r.el())}}},e.initChildren=function(){var r=this,i=this.options_.children;if(i){var n=this.options_,a=function(c){var h=c.name,f=c.opts;if(n[h]!==void 0&&(f=n[h]),f!==!1){f===!0&&(f={}),f.playerOptions=r.options_.playerOptions;var g=r.addChild(h,f);g&&(r[h]=g)}},o,l=s.getComponent("Tech");Array.isArray(i)?o=i:o=Object.keys(i),o.concat(Object.keys(this.options_).filter(function(u){return!o.some(function(c){return typeof c=="string"?u===c:u===c.name})})).map(function(u){var c,h;return typeof u=="string"?(c=u,h=i[c]||r.options_[c]||{}):(c=u.name,h=u),{name:c,opts:h}}).filter(function(u){var c=s.getComponent(u.opts.componentClass||Gt(u.name));return c&&!l.isTech(c)}).forEach(a)}},e.buildCSSClass=function(){return""},e.ready=function(r,i){if(i===void 0&&(i=!1),!!r){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(r);return}i?r.call(this):this.setTimeout(r,1)}},e.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var r=this.readyQueue_;this.readyQueue_=[],r&&r.length>0&&r.forEach(function(i){i.call(this)},this),this.trigger("ready")},1)},e.$=function(r,i){return os(r,i||this.contentEl())},e.$$=function(r,i){return X1(r,i||this.contentEl())},e.hasClass=function(r){return Qs(this.el_,r)},e.addClass=function(r){kn(this.el_,r)},e.removeClass=function(r){uu(this.el_,r)},e.toggleClass=function(r,i){j1(this.el_,r,i)},e.show=function(){this.removeClass("vjs-hidden")},e.hide=function(){this.addClass("vjs-hidden")},e.lockShowing=function(){this.addClass("vjs-lock-showing")},e.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.getAttribute=function(r){return H1(this.el_,r)},e.setAttribute=function(r,i){Co(this.el_,r,i)},e.removeAttribute=function(r){Jh(this.el_,r)},e.width=function(r,i){return this.dimension("width",r,i)},e.height=function(r,i){return this.dimension("height",r,i)},e.dimensions=function(r,i){this.width(r,!0),this.height(i)},e.dimension=function(r,i,n){if(i!==void 0){(i===null||i!==i)&&(i=0),(""+i).indexOf("%")!==-1||(""+i).indexOf("px")!==-1?this.el_.style[r]=i:i==="auto"?this.el_.style[r]="":this.el_.style[r]=i+"px",n||this.trigger("componentresize");return}if(!this.el_)return 0;var a=this.el_.style[r],o=a.indexOf("px");return parseInt(o!==-1?a.slice(0,o):this.el_["offset"+Gt(r)],10)},e.currentDimension=function(r){var i=0;if(r!=="width"&&r!=="height")throw new Error("currentDimension only accepts width or height value");if(i=Kl(this.el_,r),i=parseFloat(i),i===0||isNaN(i)){var n="offset"+Gt(r);i=this.el_[n]}return i},e.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.currentWidth=function(){return this.currentDimension("width")},e.currentHeight=function(){return this.currentDimension("height")},e.focus=function(){this.el_.focus()},e.blur=function(){this.el_.blur()},e.handleKeyDown=function(r){this.player_&&(Ge.isEventKey(r,"Tab")||r.stopPropagation(),this.player_.handleKeyDown(r))},e.handleKeyPress=function(r){this.handleKeyDown(r)},e.emitTapEvents=function(){var r=0,i=null,n=10,a=200,o;this.on("touchstart",function(u){u.touches.length===1&&(i={pageX:u.touches[0].pageX,pageY:u.touches[0].pageY},r=D.performance.now(),o=!0)}),this.on("touchmove",function(u){if(u.touches.length>1)o=!1;else if(i){var c=u.touches[0].pageX-i.pageX,h=u.touches[0].pageY-i.pageY,f=Math.sqrt(c*c+h*h);f>n&&(o=!1)}});var l=function(){o=!1};this.on("touchleave",l),this.on("touchcancel",l),this.on("touchend",function(u){if(i=null,o===!0){var c=D.performance.now()-r;c<a&&(u.preventDefault(),this.trigger("tap"))}})},e.enableTouchActivity=function(){if(!(!this.player()||!this.player().reportUserActivity)){var r=It(this.player(),this.player().reportUserActivity),i;this.on("touchstart",function(){r(),this.clearInterval(i),i=this.setInterval(r,250)});var n=function(o){r(),this.clearInterval(i)};this.on("touchmove",r),this.on("touchend",n),this.on("touchcancel",n)}},e.setTimeout=function(r,i){var n=this,a;return r=It(this,r),this.clearTimersOnDispose_(),a=D.setTimeout(function(){n.setTimeoutIds_.has(a)&&n.setTimeoutIds_.delete(a),r()},i),this.setTimeoutIds_.add(a),a},e.clearTimeout=function(r){return this.setTimeoutIds_.has(r)&&(this.setTimeoutIds_.delete(r),D.clearTimeout(r)),r},e.setInterval=function(r,i){r=It(this,r),this.clearTimersOnDispose_();var n=D.setInterval(r,i);return this.setIntervalIds_.add(n),n},e.clearInterval=function(r){return this.setIntervalIds_.has(r)&&(this.setIntervalIds_.delete(r),D.clearInterval(r)),r},e.requestAnimationFrame=function(r){var i=this;if(!this.supportsRaf_)return this.setTimeout(r,1e3/60);this.clearTimersOnDispose_();var n;return r=It(this,r),n=D.requestAnimationFrame(function(){i.rafIds_.has(n)&&i.rafIds_.delete(n),r()}),this.rafIds_.add(n),n},e.requestNamedAnimationFrame=function(r,i){var n=this;if(!this.namedRafs_.has(r)){this.clearTimersOnDispose_(),i=It(this,i);var a=this.requestAnimationFrame(function(){i(),n.namedRafs_.has(r)&&n.namedRafs_.delete(r)});return this.namedRafs_.set(r,a),r}},e.cancelNamedAnimationFrame=function(r){this.namedRafs_.has(r)&&(this.cancelAnimationFrame(this.namedRafs_.get(r)),this.namedRafs_.delete(r))},e.cancelAnimationFrame=function(r){return this.supportsRaf_?(this.rafIds_.has(r)&&(this.rafIds_.delete(r),D.cancelAnimationFrame(r)),r):this.clearTimeout(r)},e.clearTimersOnDispose_=function(){var r=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(i){var n=i[0],a=i[1];r[n].forEach(function(o,l){return r[a](l)})}),r.clearingTimersOnDispose_=!1}))},s.registerComponent=function(r,i){if(typeof r!="string"||!r)throw new Error('Illegal component name, "'+r+'"; must be a non-empty string.');var n=s.getComponent("Tech"),a=n&&n.isTech(i),o=s===i||s.prototype.isPrototypeOf(i.prototype);if(a||!o){var l;throw a?l="techs must be registered using Tech.registerTech()":l="must be a Component subclass",new Error('Illegal component, "'+r+'"; '+l+".")}r=Gt(r),s.components_||(s.components_={});var u=s.getComponent("Player");if(r==="Player"&&u&&u.players){var c=u.players,h=Object.keys(c);if(c&&h.length>0&&h.map(function(f){return c[f]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return s.components_[r]=i,s.components_[wc(r)]=i,i},s.getComponent=function(r){if(!(!r||!s.components_))return s.components_[r]},s})();be.prototype.supportsRaf_=typeof D.requestAnimationFrame=="function"&&typeof D.cancelAnimationFrame=="function";be.registerComponent("Component",be);function g4(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error("Failed to execute '"+s+"' on 'TimeRanges': The index provided ("+e+") is non-numeric or out of bounds (0-"+t+").")}function tT(s,e,t,r){return g4(s,r,t.length-1),t[r][e]}function zf(s){var e;return s===void 0||s.length===0?e={length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:e={length:s.length,start:tT.bind(null,"start",0,s),end:tT.bind(null,"end",1,s)},D.Symbol&&D.Symbol.iterator&&(e[D.Symbol.iterator]=function(){return(s||[]).values()}),e}function Js(s,e){return Array.isArray(s)?zf(s):s===void 0||e===void 0?zf():zf([[s,e]])}function sE(s,e){var t=0,r,i;if(!e)return 0;(!s||!s.length)&&(s=Js(0,0));for(var n=0;n<s.length;n++)r=s.start(n),i=s.end(n),i>e&&(i=e),t+=i-r;return t/e}function Di(s){if(s instanceof Di)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:An(s)&&(typeof s.code=="number"&&(this.code=s.code),Ht(this,s)),this.message||(this.message=Di.defaultMessages[this.code]||"")}Di.prototype.code=0;Di.prototype.message="";Di.prototype.status=null;Di.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Di.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Ra=0;Ra<Di.errorTypes.length;Ra++)Di[Di.errorTypes[Ra]]=Ra,Di.prototype[Di.errorTypes[Ra]]=Ra;function Rl(s){return s!=null&&typeof s.then=="function"}function Qr(s){Rl(s)&&s.then(null,function(e){})}var pm=function(e){var t=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(r,i,n){return e[i]&&(r[i]=e[i]),r},{cues:e.cues&&Array.prototype.map.call(e.cues,function(r){return{startTime:r.startTime,endTime:r.endTime,text:r.text,id:r.id}})});return t},v4=function(e){var t=e.$$("track"),r=Array.prototype.map.call(t,function(n){return n.track}),i=Array.prototype.map.call(t,function(n){var a=pm(n.track);return n.src&&(a.src=n.src),a});return i.concat(Array.prototype.filter.call(e.textTracks(),function(n){return r.indexOf(n)===-1}).map(pm))},y4=function(e,t){return e.forEach(function(r){var i=t.addRemoteTextTrack(r).track;!r.src&&r.cues&&r.cues.forEach(function(n){return i.addCue(n)})}),t.textTracks()},iT={textTracksToJson:v4,jsonToTextTracks:y4,trackToJson_:pm},Wf="vjs-modal-dialog",jo=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.handleKeyDown_=function(a){return n.handleKeyDown(a)},n.close_=function(a){return n.close(a)},n.opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1,n.closeable(!n.options_.uncloseable),n.content(n.options_.content),n.contentEl_=rt("div",{className:Wf+"-content"},{role:"document"}),n.descEl_=rt("p",{className:Wf+"-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),oa(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},t.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,s.prototype.dispose.call(this)},t.buildCSSClass=function(){return Wf+" vjs-hidden "+s.prototype.buildCSSClass.call(this)},t.label=function(){return this.localize(this.options_.label||"Modal Window")},t.description=function(){var i=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(i+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),i},t.open=function(){if(!this.opened_){var i=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!i.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&i.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=i.controls(),i.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},t.opened=function(i){return typeof i=="boolean"&&this[i?"open":"close"](),this.opened_},t.close=function(){if(this.opened_){var i=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&i.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&i.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},t.closeable=function(i){if(typeof i=="boolean"){var n=this.closeable_=!!i,a=this.getChild("closeButton");if(n&&!a){var o=this.contentEl_;this.contentEl_=this.el_,a=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=o,this.on(a,"close",this.close_)}!n&&a&&(this.off(a,"close",this.close_),this.removeChild(a),a.dispose())}return this.closeable_},t.fill=function(){this.fillWith(this.content())},t.fillWith=function(i){var n=this.contentEl(),a=n.parentNode,o=n.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,a.removeChild(n),this.empty(),K1(n,i),this.trigger("modalfill"),o?a.insertBefore(n,o):a.appendChild(n);var l=this.getChild("closeButton");l&&a.appendChild(l.el_)},t.empty=function(){this.trigger("beforemodalempty"),Fg(this.contentEl()),this.trigger("modalempty")},t.content=function(i){return typeof i<"u"&&(this.content_=i),this.content_},t.conditionalFocus_=function(){var i=ue.activeElement,n=this.player_.el_;this.previouslyActiveEl_=null,(n.contains(i)||n===i)&&(this.previouslyActiveEl_=i,this.focus())},t.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},t.handleKeyDown=function(i){if(i.stopPropagation(),Ge.isEventKey(i,"Escape")&&this.closeable()){i.preventDefault(),this.close();return}if(Ge.isEventKey(i,"Tab")){for(var n=this.focusableEls_(),a=this.el_.querySelector(":focus"),o,l=0;l<n.length;l++)if(a===n[l]){o=l;break}ue.activeElement===this.el_&&(o=0),i.shiftKey&&o===0?(n[n.length-1].focus(),i.preventDefault()):!i.shiftKey&&o===n.length-1&&(n[0].focus(),i.preventDefault())}},t.focusableEls_=function(){var i=this.el_.querySelectorAll("*");return Array.prototype.filter.call(i,function(n){return(n instanceof D.HTMLAnchorElement||n instanceof D.HTMLAreaElement)&&n.hasAttribute("href")||(n instanceof D.HTMLInputElement||n instanceof D.HTMLSelectElement||n instanceof D.HTMLTextAreaElement||n instanceof D.HTMLButtonElement)&&!n.hasAttribute("disabled")||n instanceof D.HTMLIFrameElement||n instanceof D.HTMLObjectElement||n instanceof D.HTMLEmbedElement||n.hasAttribute("tabindex")&&n.getAttribute("tabindex")!==-1||n.hasAttribute("contenteditable")})},e})(be);jo.prototype.options_={pauseOnOpen:!0,temporary:!0};be.registerComponent("ModalDialog",jo);var wo=(function(s){we(e,s);function e(r){var i;r===void 0&&(r=[]),i=s.call(this)||this,i.tracks_=[],Object.defineProperty(We(i),"length",{get:function(){return this.tracks_.length}});for(var n=0;n<r.length;n++)i.addTrack(r[n]);return i}var t=e.prototype;return t.addTrack=function(i){var n=this,a=this.tracks_.length;""+a in this||Object.defineProperty(this,a,{get:function(){return this.tracks_[a]}}),this.tracks_.indexOf(i)===-1&&(this.tracks_.push(i),this.trigger({track:i,type:"addtrack",target:this})),i.labelchange_=function(){n.trigger({track:i,type:"labelchange",target:n})},xn(i)&&i.addEventListener("labelchange",i.labelchange_)},t.removeTrack=function(i){for(var n,a=0,o=this.length;a<o;a++)if(this[a]===i){n=this[a],n.off&&n.off(),this.tracks_.splice(a,1);break}n&&this.trigger({track:n,type:"removetrack",target:this})},t.getTrackById=function(i){for(var n=null,a=0,o=this.length;a<o;a++){var l=this[a];if(l.id===i){n=l;break}}return n},e})(oi);wo.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(var _4 in wo.prototype.allowedEvents_)wo.prototype["on"+_4]=null;var Gf=function(e,t){for(var r=0;r<e.length;r++)!Object.keys(e[r]).length||t.id===e[r].id||(e[r].enabled=!1)},T4=(function(s){we(e,s);function e(r){var i;r===void 0&&(r=[]);for(var n=r.length-1;n>=0;n--)if(r[n].enabled){Gf(r,r[n]);break}return i=s.call(this,r)||this,i.changing_=!1,i}var t=e.prototype;return t.addTrack=function(i){var n=this;i.enabled&&Gf(this,i),s.prototype.addTrack.call(this,i),i.addEventListener&&(i.enabledChange_=function(){n.changing_||(n.changing_=!0,Gf(n,i),n.changing_=!1,n.trigger("change"))},i.addEventListener("enabledchange",i.enabledChange_))},t.removeTrack=function(i){s.prototype.removeTrack.call(this,i),i.removeEventListener&&i.enabledChange_&&(i.removeEventListener("enabledchange",i.enabledChange_),i.enabledChange_=null)},e})(wo),Kf=function(e,t){for(var r=0;r<e.length;r++)!Object.keys(e[r]).length||t.id===e[r].id||(e[r].selected=!1)},b4=(function(s){we(e,s);function e(r){var i;r===void 0&&(r=[]);for(var n=r.length-1;n>=0;n--)if(r[n].selected){Kf(r,r[n]);break}return i=s.call(this,r)||this,i.changing_=!1,Object.defineProperty(We(i),"selectedIndex",{get:function(){for(var o=0;o<this.length;o++)if(this[o].selected)return o;return-1},set:function(){}}),i}var t=e.prototype;return t.addTrack=function(i){var n=this;i.selected&&Kf(this,i),s.prototype.addTrack.call(this,i),i.addEventListener&&(i.selectedChange_=function(){n.changing_||(n.changing_=!0,Kf(n,i),n.changing_=!1,n.trigger("change"))},i.addEventListener("selectedchange",i.selectedChange_))},t.removeTrack=function(i){s.prototype.removeTrack.call(this,i),i.removeEventListener&&i.selectedChange_&&(i.removeEventListener("selectedchange",i.selectedChange_),i.selectedChange_=null)},e})(wo),aE=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.addTrack=function(i){var n=this;s.prototype.addTrack.call(this,i),this.queueChange_||(this.queueChange_=function(){return n.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return n.trigger("selectedlanguagechange")}),i.addEventListener("modechange",this.queueChange_);var a=["metadata","chapters"];a.indexOf(i.kind)===-1&&i.addEventListener("modechange",this.triggerSelectedlanguagechange_)},t.removeTrack=function(i){s.prototype.removeTrack.call(this,i),i.removeEventListener&&(this.queueChange_&&i.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&i.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},e})(wo),S4=(function(){function s(t){t===void 0&&(t=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var r=0,i=t.length;r<i;r++)this.addTrackElement_(t[r])}var e=s.prototype;return e.addTrackElement_=function(r){var i=this.trackElements_.length;""+i in this||Object.defineProperty(this,i,{get:function(){return this.trackElements_[i]}}),this.trackElements_.indexOf(r)===-1&&this.trackElements_.push(r)},e.getTrackElementByTrack_=function(r){for(var i,n=0,a=this.trackElements_.length;n<a;n++)if(r===this.trackElements_[n].track){i=this.trackElements_[n];break}return i},e.removeTrackElement_=function(r){for(var i=0,n=this.trackElements_.length;i<n;i++)if(r===this.trackElements_[i]){this.trackElements_[i].track&&typeof this.trackElements_[i].track.off=="function"&&this.trackElements_[i].track.off(),typeof this.trackElements_[i].off=="function"&&this.trackElements_[i].off(),this.trackElements_.splice(i,1);break}},s})(),rT=(function(){function s(t){s.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var e=s.prototype;return e.setCues_=function(r){var i=this.length||0,n=0,a=r.length;this.cues_=r,this.length_=r.length;var o=function(u){""+u in this||Object.defineProperty(this,""+u,{get:function(){return this.cues_[u]}})};if(i<a)for(n=i;n<a;n++)o.call(this,n)},e.getCueById=function(r){for(var i=null,n=0,a=this.length;n<a;n++){var o=this[n];if(o.id===r){i=o;break}}return i},s})(),C4={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},E4={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},w4={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},nT={disabled:"disabled",hidden:"hidden",showing:"showing"},Vg=(function(s){we(e,s);function e(t){var r;t===void 0&&(t={}),r=s.call(this)||this;var i={id:t.id||"vjs_track_"+Nn(),kind:t.kind||"",language:t.language||""},n=t.label||"",a=function(u){Object.defineProperty(We(r),u,{get:function(){return i[u]},set:function(){}})};for(var o in i)a(o);return Object.defineProperty(We(r),"label",{get:function(){return n},set:function(u){u!==n&&(n=u,this.trigger("labelchange"))}}),r}return e})(oi),Hg=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],r=ue.createElement("a");r.href=e;for(var i={},n=0;n<t.length;n++)i[t[n]]=r[t[n]];return i.protocol==="http:"&&(i.host=i.host.replace(/:80$/,"")),i.protocol==="https:"&&(i.host=i.host.replace(/:443$/,"")),i.protocol||(i.protocol=D.location.protocol),i.host||(i.host=D.location.host),i},oE=function(e){if(!e.match(/^https?:\/\//)){var t=ue.createElement("a");t.href=e,e=t.href}return e},qg=function(e){if(typeof e=="string"){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/,r=t.exec(e);if(r)return r.pop().toLowerCase()}return""},rd=function(e,t){t===void 0&&(t=D.location);var r=Hg(e),i=r.protocol===":"?t.protocol:r.protocol,n=i+r.host!==t.protocol+t.host;return n},k4=Object.freeze({__proto__:null,parseUrl:Hg,getAbsoluteURL:oE,getFileExtension:qg,isCrossOrigin:rd}),sT=function(e,t){var r=new D.WebVTT.Parser(D,D.vttjs,D.WebVTT.StringDecoder()),i=[];r.oncue=function(n){t.addCue(n)},r.onparsingerror=function(n){i.push(n)},r.onflush=function(){t.trigger({type:"loadeddata",target:t})},r.parse(e),i.length>0&&(D.console&&D.console.groupCollapsed&&D.console.groupCollapsed("Text Track parsing errors for "+t.src),i.forEach(function(n){return Qe.error(n)}),D.console&&D.console.groupEnd&&D.console.groupEnd()),r.flush()},aT=function(e,t){var r={uri:e},i=rd(e);i&&(r.cors=i);var n=t.tech_.crossOrigin()==="use-credentials";n&&(r.withCredentials=n),d1(r,It(this,function(a,o,l){if(a)return Qe.error(a,o);t.loaded_=!0,typeof D.WebVTT!="function"?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(u){if(u.type==="vttjserror"){Qe.error("vttjs failed to load, stopping trying to process "+t.src);return}return sT(l,t)}):sT(l,t)}))},cu=(function(s){we(e,s);function e(r){var i;if(r===void 0&&(r={}),!r.tech)throw new Error("A tech was not provided.");var n=At(r,{kind:w4[r.kind]||"subtitles",language:r.language||r.srclang||""}),a=nT[n.mode]||"disabled",o=n.default;(n.kind==="metadata"||n.kind==="chapters")&&(a="hidden"),i=s.call(this,n)||this,i.tech_=n.tech,i.cues_=[],i.activeCues_=[],i.preload_=i.tech_.preloadTextTracks!==!1;var l=new rT(i.cues_),u=new rT(i.activeCues_),c=!1;i.timeupdateHandler=It(We(i),function(f){if(f===void 0&&(f={}),!this.tech_.isDisposed()){if(!this.tech_.isReady_){f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,c&&(this.trigger("cuechange"),c=!1),f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});var h=function(){i.stopTracking()};return i.tech_.one("dispose",h),a!=="disabled"&&i.startTracking(),Object.defineProperties(We(i),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return a},set:function(g){nT[g]&&a!==g&&(a=g,!this.preload_&&a!=="disabled"&&this.cues.length===0&&aT(this.src,this),this.stopTracking(),a!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?l:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(this.cues.length===0)return u;for(var g=this.tech_.currentTime(),C=[],p=0,T=this.cues.length;p<T;p++){var A=this.cues[p];(A.startTime<=g&&A.endTime>=g||A.startTime===A.endTime&&A.startTime<=g&&A.startTime+.5>=g)&&C.push(A)}if(c=!1,C.length!==this.activeCues_.length)c=!0;else for(var N=0;N<C.length;N++)this.activeCues_.indexOf(C[N])===-1&&(c=!0);return this.activeCues_=C,u.setCues_(this.activeCues_),u},set:function(){}}}),n.src?(i.src=n.src,i.preload_||(i.loaded_=!0),(i.preload_||n.kind!=="subtitles"&&n.kind!=="captions")&&aT(i.src,We(i))):i.loaded_=!0,i}var t=e.prototype;return t.startTracking=function(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)},t.stopTracking=function(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)},t.addCue=function(i){var n=i;if(!("getCueAsHTML"in n)){n=new D.vttjs.VTTCue(i.startTime,i.endTime,i.text);for(var a in i)a in n||(n[a]=i[a]);n.id=i.id,n.originalCue_=i}for(var o=this.tech_.textTracks(),l=0;l<o.length;l++)o[l]!==this&&o[l].removeCue(n);this.cues_.push(n),this.cues.setCues_(this.cues_)},t.removeCue=function(i){for(var n=this.cues_.length;n--;){var a=this.cues_[n];if(a===i||a.originalCue_&&a.originalCue_===i){this.cues_.splice(n,1),this.cues.setCues_(this.cues_);break}}},e})(Vg);cu.prototype.allowedEvents_={cuechange:"cuechange"};var lE=(function(s){we(e,s);function e(t){var r;t===void 0&&(t={});var i=At(t,{kind:E4[t.kind]||""});r=s.call(this,i)||this;var n=!1;return Object.defineProperty(We(r),"enabled",{get:function(){return n},set:function(o){typeof o!="boolean"||o===n||(n=o,this.trigger("enabledchange"))}}),i.enabled&&(r.enabled=i.enabled),r.loaded_=!0,r}return e})(Vg),uE=(function(s){we(e,s);function e(t){var r;t===void 0&&(t={});var i=At(t,{kind:C4[t.kind]||""});r=s.call(this,i)||this;var n=!1;return Object.defineProperty(We(r),"selected",{get:function(){return n},set:function(o){typeof o!="boolean"||o===n||(n=o,this.trigger("selectedchange"))}}),i.selected&&(r.selected=i.selected),r}return e})(Vg),cE=0,x4=1,hE=2,A4=3,Vo=(function(s){we(e,s);function e(t){var r;t===void 0&&(t={}),r=s.call(this)||this;var i,n=new cu(t);return r.kind=n.kind,r.src=n.src,r.srclang=n.language,r.label=n.label,r.default=n.default,Object.defineProperties(We(r),{readyState:{get:function(){return i}},track:{get:function(){return n}}}),i=cE,n.addEventListener("loadeddata",function(){i=hE,r.trigger({type:"load",target:We(r)})}),r}return e})(oi);Vo.prototype.allowedEvents_={load:"load"};Vo.NONE=cE;Vo.LOADING=x4;Vo.LOADED=hE;Vo.ERROR=A4;var pr={audio:{ListClass:T4,TrackClass:lE,capitalName:"Audio"},video:{ListClass:b4,TrackClass:uE,capitalName:"Video"},text:{ListClass:aE,TrackClass:cu,capitalName:"Text"}};Object.keys(pr).forEach(function(s){pr[s].getterName=s+"Tracks",pr[s].privateName=s+"Tracks_"});var ko={remoteText:{ListClass:aE,TrackClass:cu,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:S4,TrackClass:Vo,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ki=vt({},pr,ko);ko.names=Object.keys(ko);pr.names=Object.keys(pr);ki.names=[].concat(ko.names).concat(pr.names);function I4(s,e,t,r,i){i===void 0&&(i={});var n=s.textTracks();i.kind=e,t&&(i.label=t),r&&(i.language=r),i.tech=s;var a=new ki.text.TrackClass(i);return n.addTrack(a),a}var Et=(function(s){we(e,s);function e(r,i){var n;return r===void 0&&(r={}),i===void 0&&(i=function(){}),r.reportTouchActivity=!1,n=s.call(this,null,r,i)||this,n.onDurationChange_=function(a){return n.onDurationChange(a)},n.trackProgress_=function(a){return n.trackProgress(a)},n.trackCurrentTime_=function(a){return n.trackCurrentTime(a)},n.stopTrackingCurrentTime_=function(a){return n.stopTrackingCurrentTime(a)},n.disposeSourceHandler_=function(a){return n.disposeSourceHandler(a)},n.queuedHanders_=new Set,n.hasStarted_=!1,n.on("playing",function(){this.hasStarted_=!0}),n.on("loadstart",function(){this.hasStarted_=!1}),ki.names.forEach(function(a){var o=ki[a];r&&r[o.getterName]&&(n[o.privateName]=r[o.getterName])}),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(a){r["native"+a+"Tracks"]===!1&&(n["featuresNative"+a+"Tracks"]=!1)}),r.nativeCaptions===!1||r.nativeTextTracks===!1?n.featuresNativeTextTracks=!1:(r.nativeCaptions===!0||r.nativeTextTracks===!0)&&(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.preloadTextTracks=r.preloadTextTracks!==!1,n.autoRemoteTextTracks_=new ki.text.ListClass,n.initTrackListeners(),r.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}var t=e.prototype;return t.triggerSourceset=function(i){var n=this;this.isReady_||this.one("ready",function(){return n.setTimeout(function(){return n.triggerSourceset(i)},1)}),this.trigger({src:i,type:"sourceset"})},t.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},t.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},t.trackProgress=function(i){this.stopTrackingProgress(),this.progressInterval=this.setInterval(It(this,function(){var n=this.bufferedPercent();this.bufferedPercent_!==n&&this.trigger("progress"),this.bufferedPercent_=n,n===1&&this.stopTrackingProgress()}),500)},t.onDurationChange=function(i){this.duration_=this.duration()},t.buffered=function(){return Js(0,0)},t.bufferedPercent=function(){return sE(this.buffered(),this.duration_)},t.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},t.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},t.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},t.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},t.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.dispose=function(){this.clearTracks(pr.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),s.prototype.dispose.call(this)},t.clearTracks=function(i){var n=this;i=[].concat(i),i.forEach(function(a){for(var o=n[a+"Tracks"]()||[],l=o.length;l--;){var u=o[l];a==="text"&&n.removeRemoteTextTrack(u),o.removeTrack(u)}})},t.cleanupAutoTextTracks=function(){for(var i=this.autoRemoteTextTracks_||[],n=i.length;n--;){var a=i[n];this.removeRemoteTextTrack(a)}},t.reset=function(){},t.crossOrigin=function(){},t.setCrossOrigin=function(){},t.error=function(i){return i!==void 0&&(this.error_=new Di(i),this.trigger("error")),this.error_},t.played=function(){return this.hasStarted_?Js(0,0):Js()},t.play=function(){},t.setScrubbing=function(){},t.scrubbing=function(){},t.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.initTrackListeners=function(){var i=this;pr.names.forEach(function(n){var a=pr[n],o=function(){i.trigger(n+"trackchange")},l=i[a.getterName]();l.addEventListener("removetrack",o),l.addEventListener("addtrack",o),i.on("dispose",function(){l.removeEventListener("removetrack",o),l.removeEventListener("addtrack",o)})})},t.addWebVttScript_=function(){var i=this;if(!D.WebVTT)if(ue.body.contains(this.el())){if(!this.options_["vtt.js"]&&Gl(lo)&&Object.keys(lo).length>0){this.trigger("vttjsloaded");return}var n=ue.createElement("script");n.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",n.onload=function(){i.trigger("vttjsloaded")},n.onerror=function(){i.trigger("vttjserror")},this.on("dispose",function(){n.onload=null,n.onerror=null}),D.WebVTT=!0,this.el().parentNode.appendChild(n)}else this.ready(this.addWebVttScript_)},t.emulateTextTracks=function(){var i=this,n=this.textTracks(),a=this.remoteTextTracks(),o=function(f){return n.addTrack(f.track)},l=function(f){return n.removeTrack(f.track)};a.on("addtrack",o),a.on("removetrack",l),this.addWebVttScript_();var u=function(){return i.trigger("texttrackchange")},c=function(){u();for(var f=0;f<n.length;f++){var g=n[f];g.removeEventListener("cuechange",u),g.mode==="showing"&&g.addEventListener("cuechange",u)}};c(),n.addEventListener("change",c),n.addEventListener("addtrack",c),n.addEventListener("removetrack",c),this.on("dispose",function(){a.off("addtrack",o),a.off("removetrack",l),n.removeEventListener("change",c),n.removeEventListener("addtrack",c),n.removeEventListener("removetrack",c);for(var h=0;h<n.length;h++){var f=n[h];f.removeEventListener("cuechange",u)}})},t.addTextTrack=function(i,n,a){if(!i)throw new Error("TextTrack kind is required but was not provided");return I4(this,i,n,a)},t.createRemoteTextTrack=function(i){var n=At(i,{tech:this});return new ko.remoteTextEl.TrackClass(n)},t.addRemoteTextTrack=function(i,n){var a=this;i===void 0&&(i={});var o=this.createRemoteTextTrack(i);return n!==!0&&n!==!1&&(Qe.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),n=!0),this.remoteTextTrackEls().addTrackElement_(o),this.remoteTextTracks().addTrack(o.track),n!==!0&&this.ready(function(){return a.autoRemoteTextTracks_.addTrack(o.track)}),o},t.removeRemoteTextTrack=function(i){var n=this.remoteTextTrackEls().getTrackElementByTrack_(i);this.remoteTextTrackEls().removeTrackElement_(n),this.remoteTextTracks().removeTrack(i),this.autoRemoteTextTracks_.removeTrack(i)},t.getVideoPlaybackQuality=function(){return{}},t.requestPictureInPicture=function(){var i=this.options_.Promise||D.Promise;if(i)return i.reject()},t.disablePictureInPicture=function(){return!0},t.setDisablePictureInPicture=function(){},t.requestVideoFrameCallback=function(i){var n=this,a=Nn();return!this.isReady_||this.paused()?(this.queuedHanders_.add(a),this.one("playing",function(){n.queuedHanders_.has(a)&&(n.queuedHanders_.delete(a),i())})):this.requestNamedAnimationFrame(a,i),a},t.cancelVideoFrameCallback=function(i){this.queuedHanders_.has(i)?this.queuedHanders_.delete(i):this.cancelNamedAnimationFrame(i)},t.setPoster=function(){},t.playsinline=function(){},t.setPlaysinline=function(){},t.overrideNativeAudioTracks=function(){},t.overrideNativeVideoTracks=function(){},t.canPlayType=function(){return""},e.canPlayType=function(){return""},e.canPlaySource=function(i,n){return e.canPlayType(i.type)},e.isTech=function(i){return i.prototype instanceof e||i instanceof e||i===e},e.registerTech=function(i,n){if(e.techs_||(e.techs_={}),!e.isTech(n))throw new Error("Tech "+i+" must be a Tech");if(!e.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!e.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return i=Gt(i),e.techs_[i]=n,e.techs_[wc(i)]=n,i!=="Tech"&&e.defaultTechOrder_.push(i),n},e.getTech=function(i){if(i){if(e.techs_&&e.techs_[i])return e.techs_[i];if(i=Gt(i),D&&D.videojs&&D.videojs[i])return Qe.warn("The "+i+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),D.videojs[i]}},e})(be);ki.names.forEach(function(s){var e=ki[s];Et.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});Et.prototype.featuresVolumeControl=!0;Et.prototype.featuresMuteControl=!0;Et.prototype.featuresFullscreenResize=!1;Et.prototype.featuresPlaybackRate=!1;Et.prototype.featuresProgressEvents=!1;Et.prototype.featuresSourceset=!1;Et.prototype.featuresTimeupdateEvents=!1;Et.prototype.featuresNativeTextTracks=!1;Et.prototype.featuresVideoFrameCallback=!1;Et.withSourceHandlers=function(s){s.registerSourceHandler=function(t,r){var i=s.sourceHandlers;i||(i=s.sourceHandlers=[]),r===void 0&&(r=i.length),i.splice(r,0,t)},s.canPlayType=function(t){for(var r=s.sourceHandlers||[],i,n=0;n<r.length;n++)if(i=r[n].canPlayType(t),i)return i;return""},s.selectSourceHandler=function(t,r){for(var i=s.sourceHandlers||[],n,a=0;a<i.length;a++)if(n=i[a].canHandleSource(t,r),n)return i[a];return null},s.canPlaySource=function(t,r){var i=s.selectSourceHandler(t,r);return i?i.canHandleSource(t,r):""};var e=["seekable","seeking","duration"];e.forEach(function(t){var r=this[t];typeof r=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):r.apply(this,arguments)})},s.prototype),s.prototype.setSource=function(t){var r=s.selectSourceHandler(t,this.options_);r||(s.nativeSourceHandler?r=s.nativeSourceHandler:Qe.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),r!==s.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=r.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},s.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};be.registerComponent("Tech",Et);Et.registerTech("Tech",Et);Et.defaultTechOrder_=[];var Zs={},mm={},rh={};function P4(s,e){Zs[s]=Zs[s]||[],Zs[s].push(e)}function D4(s,e,t){s.setTimeout(function(){return Ls(e,Zs[e.type],t,s)},1)}function N4(s,e){s.forEach(function(t){return t.setTech&&t.setTech(e)})}function L4(s,e,t){return s.reduceRight(zg(t),e[t]())}function O4(s,e,t,r){return e[t](s.reduce(zg(t),r))}function oT(s,e,t,r){r===void 0&&(r=null);var i="call"+Gt(t),n=s.reduce(zg(i),r),a=n===rh,o=a?null:e[t](n);return B4(s,t,o,a),o}var M4={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},R4={setCurrentTime:1,setMuted:1,setVolume:1},lT={play:1,pause:1};function zg(s){return function(e,t){return e===rh?rh:t[s]?t[s](e):e}}function B4(s,e,t,r){for(var i=s.length-1;i>=0;i--){var n=s[i];n[e]&&n[e](r,t)}}function F4(s){mm[s.id()]=null}function U4(s,e){var t=mm[s.id()],r=null;if(t==null)return r=e(s),mm[s.id()]=[[e,r]],r;for(var i=0;i<t.length;i++){var n=t[i],a=n[0],o=n[1];a===e&&(r=o)}return r===null&&(r=e(s),t.push([e,r])),r}function Ls(s,e,t,r,i,n){s===void 0&&(s={}),e===void 0&&(e=[]),i===void 0&&(i=[]),n===void 0&&(n=!1);var a=e,o=a[0],l=a.slice(1);if(typeof o=="string")Ls(s,Zs[o],t,r,i,n);else if(o){var u=U4(r,o);if(!u.setSource)return i.push(u),Ls(s,l,t,r,i,n);u.setSource(Ht({},s),function(c,h){if(c)return Ls(s,l,t,r,i,n);i.push(u),Ls(h,s.type===h.type?l:Zs[h.type],t,r,i,n)})}else l.length?Ls(s,l,t,r,i,n):n?t(s,i):Ls(s,Zs["*"],t,r,i,!0)}var $4={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},nh=function(e){e===void 0&&(e="");var t=qg(e),r=$4[t.toLowerCase()];return r||""},j4=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var r=e.cache_.sources.filter(function(o){return o.src===t});if(r.length)return r[0].type;for(var i=e.$$("source"),n=0;n<i.length;n++){var a=i[n];if(a.type&&a.src&&a.src===t)return a.type}return nh(t)},V4=function s(e){if(Array.isArray(e)){var t=[];e.forEach(function(r){r=s(r),Array.isArray(r)?t=t.concat(r):An(r)&&t.push(r)}),e=t}else typeof e=="string"&&e.trim()?e=[uT({src:e})]:An(e)&&typeof e.src=="string"&&e.src&&e.src.trim()?e=[uT(e)]:e=[];return e};function uT(s){if(!s.type){var e=nh(s.src);e&&(s.type=e)}return s}var H4=(function(s){we(e,s);function e(t,r,i){var n,a=At({createEl:!1},r);if(n=s.call(this,t,a,i)||this,!r.playerOptions.sources||r.playerOptions.sources.length===0)for(var o=0,l=r.playerOptions.techOrder;o<l.length;o++){var u=Gt(l[o]),c=Et.getTech(u);if(u||(c=be.getComponent(u)),c&&c.isSupported()){t.loadTech_(u);break}}else t.src(r.playerOptions.sources);return n}return e})(be);be.registerComponent("MediaLoader",H4);var nd=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.options_.controlText&&n.controlText(n.options_.controlText),n.handleMouseOver_=function(a){return n.handleMouseOver(a)},n.handleMouseOut_=function(a){return n.handleMouseOut(a)},n.handleClick_=function(a){return n.handleClick(a)},n.handleKeyDown_=function(a){return n.handleKeyDown(a)},n.emitTapEvents(),n.enable(),n}var t=e.prototype;return t.createEl=function(i,n,a){i===void 0&&(i="div"),n===void 0&&(n={}),a===void 0&&(a={}),n=Ht({className:this.buildCSSClass(),tabIndex:0},n),i==="button"&&Qe.error("Creating a ClickableComponent with an HTML element of "+i+" is not supported; use a Button instead."),a=Ht({role:"button"},a),this.tabIndex_=n.tabIndex;var o=rt(i,n,a);return o.appendChild(rt("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},t.dispose=function(){this.controlTextEl_=null,s.prototype.dispose.call(this)},t.createControlTextEl=function(i){return this.controlTextEl_=rt("span",{className:"vjs-control-text"},{"aria-live":"polite"}),i&&i.appendChild(this.controlTextEl_),this.controlText(this.controlText_,i),this.controlTextEl_},t.controlText=function(i,n){if(n===void 0&&(n=this.el()),i===void 0)return this.controlText_||"Need Text";var a=this.localize(i);this.controlText_=i,oa(this.controlTextEl_,a),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&n.setAttribute("title",a)},t.buildCSSClass=function(){return"vjs-control vjs-button "+s.prototype.buildCSSClass.call(this)},t.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))},t.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)},t.handleLanguagechange=function(){this.controlText(this.controlText_)},t.handleClick=function(i){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},t.handleKeyDown=function(i){Ge.isEventKey(i,"Space")||Ge.isEventKey(i,"Enter")?(i.preventDefault(),i.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,i)},e})(be);be.registerComponent("ClickableComponent",nd);var q4=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.update(),n.update_=function(a){return n.update(a)},r.on("posterchange",n.update_),n}var t=e.prototype;return t.dispose=function(){this.player().off("posterchange",this.update_),s.prototype.dispose.call(this)},t.createEl=function(){var i=rt("div",{className:"vjs-poster",tabIndex:-1});return i},t.update=function(i){var n=this.player().poster();this.setSrc(n),n?this.show():this.hide()},t.setSrc=function(i){var n="";i&&(n='url("'+i+'")'),this.el_.style.backgroundImage=n},t.handleClick=function(i){if(this.player_.controls()){var n=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;this.player_.tech(!0)&&!((lu||ou)&&n)&&this.player_.tech(!0).focus(),this.player_.paused()?Qr(this.player_.play()):this.player_.pause()}},e})(nd);be.registerComponent("PosterImage",q4);var hr="#222",cT="#ccc",z4={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Xf(s,e){var t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else if(s.length===7)t=s.slice(1);else throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function Yf(s,e,t){try{s.style[e]=t}catch{return}}var W4=(function(s){we(e,s);function e(r,i,n){var a;a=s.call(this,r,i,n)||this;var o=function(u){return a.updateDisplay(u)};return r.on("loadstart",function(l){return a.toggleDisplay(l)}),r.on("texttrackchange",o),r.on("loadedmetadata",function(l){return a.preselectTrack(l)}),r.ready(It(We(a),function(){if(r.tech_&&r.tech_.featuresNativeTextTracks){this.hide();return}r.on("fullscreenchange",o),r.on("playerresize",o),D.addEventListener("orientationchange",o),r.on("dispose",function(){return D.removeEventListener("orientationchange",o)});for(var l=this.options_.playerOptions.tracks||[],u=0;u<l.length;u++)this.player_.addRemoteTextTrack(l[u],!0);this.preselectTrack()})),a}var t=e.prototype;return t.preselectTrack=function(){for(var i={captions:1,subtitles:1},n=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,o,l,u,c=0;c<n.length;c++){var h=n[c];a&&a.enabled&&a.language&&a.language===h.language&&h.kind in i?h.kind===a.kind?u=h:u||(u=h):a&&!a.enabled?(u=null,o=null,l=null):h.default&&(h.kind==="descriptions"&&!o?o=h:h.kind in i&&!l&&(l=h))}u?u.mode="showing":l?l.mode="showing":o&&(o.mode="showing")},t.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})},t.clearDisplay=function(){typeof D.WebVTT=="function"&&D.WebVTT.processCues(D,[],this.el_)},t.updateDisplay=function(){var i=this.player_.textTracks(),n=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),n){for(var a=[],o=0;o<i.length;++o){var l=i[o];l.mode==="showing"&&a.push(l)}this.updateForTrack(a);return}for(var u=null,c=null,h=i.length;h--;){var f=i[h];f.mode==="showing"&&(f.kind==="descriptions"?u=f:c=f)}c?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(c)):u&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(u))},t.updateDisplayState=function(i){for(var n=this.player_.textTrackSettings.getValues(),a=i.activeCues,o=a.length;o--;){var l=a[o];if(l){var u=l.displayState;if(n.color&&(u.firstChild.style.color=n.color),n.textOpacity&&Yf(u.firstChild,"color",Xf(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(u.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&Yf(u.firstChild,"backgroundColor",Xf(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?Yf(u,"backgroundColor",Xf(n.windowColor,n.windowOpacity)):u.style.backgroundColor=n.windowColor),n.edgeStyle&&(n.edgeStyle==="dropshadow"?u.firstChild.style.textShadow="2px 2px 3px "+hr+", 2px 2px 4px "+hr+", 2px 2px 5px "+hr:n.edgeStyle==="raised"?u.firstChild.style.textShadow="1px 1px "+hr+", 2px 2px "+hr+", 3px 3px "+hr:n.edgeStyle==="depressed"?u.firstChild.style.textShadow="1px 1px "+cT+", 0 1px "+cT+", -1px -1px "+hr+", 0 -1px "+hr:n.edgeStyle==="uniform"&&(u.firstChild.style.textShadow="0 0 4px "+hr+", 0 0 4px "+hr+", 0 0 4px "+hr+", 0 0 4px "+hr)),n.fontPercent&&n.fontPercent!==1){var c=D.parseFloat(u.style.fontSize);u.style.fontSize=c*n.fontPercent+"px",u.style.height="auto",u.style.top="auto"}n.fontFamily&&n.fontFamily!=="default"&&(n.fontFamily==="small-caps"?u.firstChild.style.fontVariant="small-caps":u.firstChild.style.fontFamily=z4[n.fontFamily])}}},t.updateForTrack=function(i){if(Array.isArray(i)||(i=[i]),!(typeof D.WebVTT!="function"||i.every(function(g){return!g.activeCues}))){for(var n=[],a=0;a<i.length;++a)for(var o=i[a],l=0;l<o.activeCues.length;++l)n.push(o.activeCues[l]);D.WebVTT.processCues(D,n,this.el_);for(var u=0;u<i.length;++u){for(var c=i[u],h=0;h<c.activeCues.length;++h){var f=c.activeCues[h].displayState;kn(f,"vjs-text-track-cue"),kn(f,"vjs-text-track-cue-"+(c.language?c.language:u)),c.language&&Co(f,"lang",c.language)}this.player_.textTrackSettings&&this.updateDisplayState(c)}}},e})(be);be.registerComponent("TextTrackDisplay",W4);var G4=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){var i=this.player_.isAudio(),n=this.localize(i?"Audio Player":"Video Player"),a=rt("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[n])}),o=s.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return o.appendChild(a),o},e})(be);be.registerComponent("LoadingSpinner",G4);var Dr=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(i,n,a){n===void 0&&(n={}),a===void 0&&(a={}),i="button",n=Ht({className:this.buildCSSClass()},n),a=Ht({type:"button"},a);var o=rt(i,n,a);return o.appendChild(rt("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},t.addChild=function(i,n){n===void 0&&(n={});var a=this.constructor.name;return Qe.warn("Adding an actionable (user controllable) child to a Button ("+a+") is not supported; use a ClickableComponent instead."),be.prototype.addChild.call(this,i,n)},t.enable=function(){s.prototype.enable.call(this),this.el_.removeAttribute("disabled")},t.disable=function(){s.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},t.handleKeyDown=function(i){if(Ge.isEventKey(i,"Space")||Ge.isEventKey(i,"Enter")){i.stopPropagation();return}s.prototype.handleKeyDown.call(this,i)},e})(nd);be.registerComponent("Button",Dr);var dE=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.mouseused_=!1,n.on("mousedown",function(a){return n.handleMouseDown(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-big-play-button"},t.handleClick=function(i){var n=this.player_.play();if(this.mouseused_&&i.clientX&&i.clientY){var a=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;Qr(n),this.player_.tech(!0)&&!((lu||ou)&&a)&&this.player_.tech(!0).focus();return}var o=this.player_.getChild("controlBar"),l=o&&o.getChild("playToggle");if(!l){this.player_.tech(!0).focus();return}var u=function(){return l.focus()};Rl(n)?n.then(u,function(){}):this.setTimeout(u,1)},t.handleKeyDown=function(i){this.mouseused_=!1,s.prototype.handleKeyDown.call(this,i)},t.handleMouseDown=function(i){this.mouseused_=!0},e})(Dr);dE.prototype.controlText_="Play Video";be.registerComponent("BigPlayButton",dE);var K4=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.controlText(i&&i.controlText||n.localize("Close")),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-close-button "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(i){this.trigger({type:"close",bubbles:!1})},t.handleKeyDown=function(i){Ge.isEventKey(i,"Esc")?(i.preventDefault(),i.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,i)},e})(Dr);be.registerComponent("CloseButton",K4);var fE=(function(s){we(e,s);function e(r,i){var n;return i===void 0&&(i={}),n=s.call(this,r,i)||this,i.replay=i.replay===void 0||i.replay,n.on(r,"play",function(a){return n.handlePlay(a)}),n.on(r,"pause",function(a){return n.handlePause(a)}),i.replay&&n.on(r,"ended",function(a){return n.handleEnded(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-play-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(i){this.player_.paused()?Qr(this.player_.play()):this.player_.pause()},t.handleSeeked=function(i){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(i):this.handlePlay(i)},t.handlePlay=function(i){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.handlePause=function(i){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.handleEnded=function(i){var n=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(a){return n.handleSeeked(a)})},e})(Dr);fE.prototype.controlText_="Play";be.registerComponent("PlayToggle",fE);var pE=function(e,t){e=e<0?0:e;var r=Math.floor(e%60),i=Math.floor(e/60%60),n=Math.floor(e/3600),a=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(n=i=r="-"),n=n>0||o>0?n+":":"",i=((n||a>=10)&&i<10?"0"+i:i)+":",r=r<10?"0"+r:r,n+i+r},Wg=pE;function X4(s){Wg=s}function Y4(){Wg=pE}function xo(s,e){return e===void 0&&(e=s),Wg(s,e)}var Ho=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.on(r,["timeupdate","ended"],function(a){return n.updateContent(a)}),n.updateTextNode_(),n}var t=e.prototype;return t.createEl=function(){var i=this.buildCSSClass(),n=s.prototype.createEl.call(this,"div",{className:i+" vjs-time-control vjs-control"}),a=rt("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return n.appendChild(a),this.contentEl_=rt("span",{className:i+"-display"},{"aria-live":"off",role:"presentation"}),n.appendChild(this.contentEl_),n},t.dispose=function(){this.contentEl_=null,this.textNode_=null,s.prototype.dispose.call(this)},t.updateTextNode_=function(i){var n=this;i===void 0&&(i=0),i=xo(i),this.formattedTime_!==i&&(this.formattedTime_=i,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(n.contentEl_){var a=n.textNode_;a&&n.contentEl_.firstChild!==a&&(a=null,Qe.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),n.textNode_=ue.createTextNode(n.formattedTime_),n.textNode_&&(a?n.contentEl_.replaceChild(n.textNode_,a):n.contentEl_.appendChild(n.textNode_))}}))},t.updateContent=function(i){},e})(be);Ho.prototype.labelText_="Time";Ho.prototype.controlText_="Time";be.registerComponent("TimeDisplay",Ho);var Gg=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-current-time"},t.updateContent=function(i){var n;this.player_.ended()?n=this.player_.duration():n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(n)},e})(Ho);Gg.prototype.labelText_="Current Time";Gg.prototype.controlText_="Current Time";be.registerComponent("CurrentTimeDisplay",Gg);var Kg=(function(s){we(e,s);function e(r,i){var n;n=s.call(this,r,i)||this;var a=function(l){return n.updateContent(l)};return n.on(r,"durationchange",a),n.on(r,"loadstart",a),n.on(r,"loadedmetadata",a),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-duration"},t.updateContent=function(i){var n=this.player_.duration();this.updateTextNode_(n)},e})(Ho);Kg.prototype.labelText_="Duration";Kg.prototype.controlText_="Duration";be.registerComponent("DurationDisplay",Kg);var Q4=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){var i=s.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),n=s.prototype.createEl.call(this,"div"),a=s.prototype.createEl.call(this,"span",{textContent:"/"});return n.appendChild(a),i.appendChild(n),i},e})(be);be.registerComponent("TimeDivider",Q4);var Xg=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.on(r,"durationchange",function(a){return n.updateContent(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-remaining-time"},t.createEl=function(){var i=s.prototype.createEl.call(this);return this.options_.displayNegative!==!1&&i.insertBefore(rt("span",{},{"aria-hidden":!0},"-"),this.contentEl_),i},t.updateContent=function(i){if(typeof this.player_.duration()=="number"){var n;this.player_.ended()?n=0:this.player_.remainingTimeDisplay?n=this.player_.remainingTimeDisplay():n=this.player_.remainingTime(),this.updateTextNode_(n)}},e})(Ho);Xg.prototype.labelText_="Remaining Time";Xg.prototype.controlText_="Remaining Time";be.registerComponent("RemainingTimeDisplay",Xg);var J4=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.updateShowing(),n.on(n.player(),"durationchange",function(a){return n.updateShowing(a)}),n}var t=e.prototype;return t.createEl=function(){var i=s.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=rt("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(rt("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(ue.createTextNode(this.localize("LIVE"))),i.appendChild(this.contentEl_),i},t.dispose=function(){this.contentEl_=null,s.prototype.dispose.call(this)},t.updateShowing=function(i){this.player().duration()===1/0?this.show():this.hide()},e})(be);be.registerComponent("LiveDisplay",J4);var mE=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(a){return n.updateLiveEdgeStatus(a)},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n}var t=e.prototype;return t.createEl=function(){var i=s.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=rt("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),i.appendChild(this.textEl_),i},t.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},t.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},t.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,s.prototype.dispose.call(this)},e})(Dr);mE.prototype.controlText_="Seek to live, currently playing live";be.registerComponent("SeekToLive",mE);var sd=function(e,t,r){return e=Number(e),Math.min(r,Math.max(t,isNaN(e)?t:e))},Yg=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.handleMouseDown_=function(a){return n.handleMouseDown(a)},n.handleMouseUp_=function(a){return n.handleMouseUp(a)},n.handleKeyDown_=function(a){return n.handleKeyDown(a)},n.handleClick_=function(a){return n.handleClick(a)},n.handleMouseMove_=function(a){return n.handleMouseMove(a)},n.update_=function(a){return n.update(a)},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}var t=e.prototype;return t.enabled=function(){return this.enabled_},t.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},t.disable=function(){if(this.enabled()){var i=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(i,"mousemove",this.handleMouseMove_),this.off(i,"mouseup",this.handleMouseUp_),this.off(i,"touchmove",this.handleMouseMove_),this.off(i,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},t.createEl=function(i,n,a){return n===void 0&&(n={}),a===void 0&&(a={}),n.className=n.className+" vjs-slider",n=Ht({tabIndex:0},n),a=Ht({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},a),s.prototype.createEl.call(this,i,n,a)},t.handleMouseDown=function(i){var n=this.bar.el_.ownerDocument;i.type==="mousedown"&&i.preventDefault(),i.type==="touchstart"&&!Dn&&i.preventDefault(),q1(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(n,"mousemove",this.handleMouseMove_),this.on(n,"mouseup",this.handleMouseUp_),this.on(n,"touchmove",this.handleMouseMove_),this.on(n,"touchend",this.handleMouseUp_),this.handleMouseMove(i,!0)},t.handleMouseMove=function(i){},t.handleMouseUp=function(){var i=this.bar.el_.ownerDocument;z1(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(i,"mousemove",this.handleMouseMove_),this.off(i,"mouseup",this.handleMouseUp_),this.off(i,"touchmove",this.handleMouseMove_),this.off(i,"touchend",this.handleMouseUp_),this.update()},t.update=function(){var i=this;if(!(!this.el_||!this.bar)){var n=this.getProgress();return n===this.progress_||(this.progress_=n,this.requestNamedAnimationFrame("Slider#update",function(){var a=i.vertical()?"height":"width";i.bar.el().style[a]=(n*100).toFixed(2)+"%"})),n}},t.getProgress=function(){return Number(sd(this.getPercent(),0,1).toFixed(4))},t.calculateDistance=function(i){var n=Zh(this.el_,i);return this.vertical()?n.y:n.x},t.handleKeyDown=function(i){Ge.isEventKey(i,"Left")||Ge.isEventKey(i,"Down")?(i.preventDefault(),i.stopPropagation(),this.stepBack()):Ge.isEventKey(i,"Right")||Ge.isEventKey(i,"Up")?(i.preventDefault(),i.stopPropagation(),this.stepForward()):s.prototype.handleKeyDown.call(this,i)},t.handleClick=function(i){i.stopPropagation(),i.preventDefault()},t.vertical=function(i){if(i===void 0)return this.vertical_||!1;this.vertical_=!!i,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},e})(be);be.registerComponent("Slider",Yg);var Qf=function(e,t){return sd(e/t*100,0,100).toFixed(2)+"%"},Z4=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.partEls_=[],n.on(r,"progress",function(a){return n.update(a)}),n}var t=e.prototype;return t.createEl=function(){var i=s.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=rt("span",{className:"vjs-control-text"}),a=rt("span",{textContent:this.localize("Loaded")}),o=ue.createTextNode(": ");return this.percentageEl_=rt("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),i.appendChild(n),n.appendChild(a),n.appendChild(o),n.appendChild(this.percentageEl_),i},t.dispose=function(){this.partEls_=null,this.percentageEl_=null,s.prototype.dispose.call(this)},t.update=function(i){var n=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var a=n.player_.liveTracker,o=n.player_.buffered(),l=a&&a.isLive()?a.seekableEnd():n.player_.duration(),u=n.player_.bufferedEnd(),c=n.partEls_,h=Qf(u,l);n.percent_!==h&&(n.el_.style.width=h,oa(n.percentageEl_,h),n.percent_=h);for(var f=0;f<o.length;f++){var g=o.start(f),C=o.end(f),p=c[f];p||(p=n.el_.appendChild(rt()),c[f]=p),!(p.dataset.start===g&&p.dataset.end===C)&&(p.dataset.start=g,p.dataset.end=C,p.style.left=Qf(g,u),p.style.width=Qf(C-g,u))}for(var T=c.length;T>o.length;T--)n.el_.removeChild(c[T-1]);c.length=o.length})},e})(be);be.registerComponent("LoadProgressBar",Z4);var e3=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.update=In(It(We(n),n.update),Nr),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},t.update=function(i,n,a){var o=Xl(this.el_),l=Eo(this.player_.el()),u=i.width*n;if(!(!l||!o)){var c=i.left-l.left+u,h=i.width-u+(l.right-i.right),f=o.width/2;c<f?f+=f-c:h<f&&(f=h),f<0?f=0:f>o.width&&(f=o.width),f=Math.round(f),this.el_.style.right="-"+f+"px",this.write(a)}},t.write=function(i){oa(this.el_,i)},t.updateTime=function(i,n,a,o){var l=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var u,c=l.player_.duration();if(l.player_.liveTracker&&l.player_.liveTracker.isLive()){var h=l.player_.liveTracker.liveWindow(),f=h-n*h;u=(f<1?"":"-")+xo(f,h)}else u=xo(a,c);l.update(i,n,u),o&&o()})},e})(be);be.registerComponent("TimeTooltip",e3);var Qg=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.update=In(It(We(n),n.update),Nr),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},t.update=function(i,n){var a=this.getChild("timeTooltip");if(a){var o=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(i,n,o)}},e})(be);Qg.prototype.options_={children:[]};!Li&&!Pn&&Qg.prototype.options_.children.push("timeTooltip");be.registerComponent("PlayProgressBar",Qg);var gE=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.update=In(It(We(n),n.update),Nr),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(i,n){var a=this,o=n*this.player_.duration();this.getChild("timeTooltip").updateTime(i,n,o,function(){a.el_.style.left=i.width*n+"px"})},e})(be);gE.prototype.options_={children:["timeTooltip"]};be.registerComponent("MouseTimeDisplay",gE);var cc=5,hT=12,Jg=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.setEventHandlers_(),n}var t=e.prototype;return t.setEventHandlers_=function(){var i=this;this.update_=It(this,this.update),this.update=In(this.update_,Nr),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(n){return i.enableInterval_(n)},this.disableIntervalHandler_=function(n){return i.disableInterval_(n)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in ue&&"visibilityState"in ue&&this.on(ue,"visibilitychange",this.toggleVisibility_)},t.toggleVisibility_=function(i){ue.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(i)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},t.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Nr))},t.disableInterval_=function(i){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&i&&i.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.update=function(i){var n=this;if(ue.visibilityState!=="hidden"){var a=s.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var o=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),l=n.player_.liveTracker,u=n.player_.duration();l&&l.isLive()&&(u=n.player_.liveTracker.liveCurrentTime()),n.percent_!==a&&(n.el_.setAttribute("aria-valuenow",(a*100).toFixed(2)),n.percent_=a),(n.currentTime_!==o||n.duration_!==u)&&(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[xo(o,u),xo(u,u)],"{1} of {2}")),n.currentTime_=o,n.duration_=u),n.bar&&n.bar.update(Eo(n.el()),n.getProgress())}),a}},t.userSeek_=function(i){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(i)},t.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.getPercent=function(){var i=this.getCurrentTime_(),n,a=this.player_.liveTracker;return a&&a.isLive()?(n=(i-a.seekableStart())/a.liveWindow(),a.atLiveEdge()&&(n=1)):n=i/this.player_.duration(),n},t.handleMouseDown=function(i){Yl(i)&&(i.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),s.prototype.handleMouseDown.call(this,i))},t.handleMouseMove=function(i,n){if(n===void 0&&(n=!1),!!Yl(i)){!n&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var a,o=this.calculateDistance(i),l=this.player_.liveTracker;if(!l||!l.isLive())a=o*this.player_.duration(),a===this.player_.duration()&&(a=a-.1);else{if(o>=.99){l.seekToLiveEdge();return}var u=l.seekableStart(),c=l.liveCurrentTime();if(a=u+o*l.liveWindow(),a>=c&&(a=c),a<=u&&(a=u+.1),a===1/0)return}this.userSeek_(a)}},t.enable=function(){s.prototype.enable.call(this);var i=this.getChild("mouseTimeDisplay");i&&i.show()},t.disable=function(){s.prototype.disable.call(this);var i=this.getChild("mouseTimeDisplay");i&&i.hide()},t.handleMouseUp=function(i){s.prototype.handleMouseUp.call(this,i),i&&i.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Qr(this.player_.play()):this.update_()},t.stepForward=function(){this.userSeek_(this.player_.currentTime()+cc)},t.stepBack=function(){this.userSeek_(this.player_.currentTime()-cc)},t.handleAction=function(i){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleKeyDown=function(i){var n=this.player_.liveTracker;if(Ge.isEventKey(i,"Space")||Ge.isEventKey(i,"Enter"))i.preventDefault(),i.stopPropagation(),this.handleAction(i);else if(Ge.isEventKey(i,"Home"))i.preventDefault(),i.stopPropagation(),this.userSeek_(0);else if(Ge.isEventKey(i,"End"))i.preventDefault(),i.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(Ge(i))){i.preventDefault(),i.stopPropagation();var a=(Ge.codes[Ge(i)]-Ge.codes[0])*10/100;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*a):this.userSeek_(this.player_.duration()*a)}else Ge.isEventKey(i,"PgDn")?(i.preventDefault(),i.stopPropagation(),this.userSeek_(this.player_.currentTime()-cc*hT)):Ge.isEventKey(i,"PgUp")?(i.preventDefault(),i.stopPropagation(),this.userSeek_(this.player_.currentTime()+cc*hT)):s.prototype.handleKeyDown.call(this,i)},t.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in ue&&"visibilityState"in ue&&this.off(ue,"visibilitychange",this.toggleVisibility_),s.prototype.dispose.call(this)},e})(Yg);Jg.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!Li&&!Pn&&Jg.prototype.options_.children.splice(1,0,"mouseTimeDisplay");be.registerComponent("SeekBar",Jg);var vE=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.handleMouseMove=In(It(We(n),n.handleMouseMove),Nr),n.throttledHandleMouseSeek=In(It(We(n),n.handleMouseSeek),Nr),n.handleMouseUpHandler_=function(a){return n.handleMouseUp(a)},n.handleMouseDownHandler_=function(a){return n.handleMouseDown(a)},n.enable(),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.handleMouseMove=function(i){var n=this.getChild("seekBar");if(n){var a=n.getChild("playProgressBar"),o=n.getChild("mouseTimeDisplay");if(!(!a&&!o)){var l=n.el(),u=Xl(l),c=Zh(l,i).x;c=sd(c,0,1),o&&o.update(u,c),a&&a.update(u,n.getProgress())}}},t.handleMouseSeek=function(i){var n=this.getChild("seekBar");n&&n.handleMouseMove(i)},t.enabled=function(){return this.enabled_},t.disable=function(){if(this.children().forEach(function(n){return n.disable&&n.disable()}),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var i=this.getChild("seekBar");this.player_.scrubbing(!1),i.videoWasPlaying&&Qr(this.player_.play())}},t.enable=function(){this.children().forEach(function(i){return i.enable&&i.enable()}),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.removeListenersAddedOnMousedownAndTouchstart=function(){var i=this.el_.ownerDocument;this.off(i,"mousemove",this.throttledHandleMouseSeek),this.off(i,"touchmove",this.throttledHandleMouseSeek),this.off(i,"mouseup",this.handleMouseUpHandler_),this.off(i,"touchend",this.handleMouseUpHandler_)},t.handleMouseDown=function(i){var n=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseDown(i),this.on(n,"mousemove",this.throttledHandleMouseSeek),this.on(n,"touchmove",this.throttledHandleMouseSeek),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(i){var n=this.getChild("seekBar");n&&n.handleMouseUp(i),this.removeListenersAddedOnMousedownAndTouchstart()},e})(be);vE.prototype.options_={children:["seekBar"]};be.registerComponent("ProgressControl",vE);var yE=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.on(r,["enterpictureinpicture","leavepictureinpicture"],function(a){return n.handlePictureInPictureChange(a)}),n.on(r,["disablepictureinpicturechanged","loadedmetadata"],function(a){return n.handlePictureInPictureEnabledChange(a)}),n.on(r,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){var a=r.currentType().substring(0,5)==="audio";a||r.audioPosterMode()||r.audioOnlyMode()?(r.isInPictureInPicture()&&r.exitPictureInPicture(),n.hide()):n.show()}),n.disable(),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-picture-in-picture-control "+s.prototype.buildCSSClass.call(this)},t.handlePictureInPictureEnabledChange=function(){ue.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1?this.enable():this.disable()},t.handlePictureInPictureChange=function(i){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},t.handleClick=function(i){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},e})(Dr);yE.prototype.controlText_="Picture-in-Picture";be.registerComponent("PictureInPictureToggle",yE);var _E=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.on(r,"fullscreenchange",function(a){return n.handleFullscreenChange(a)}),ue[r.fsApi_.fullscreenEnabled]===!1&&n.disable(),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-fullscreen-control "+s.prototype.buildCSSClass.call(this)},t.handleFullscreenChange=function(i){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.handleClick=function(i){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},e})(Dr);_E.prototype.controlText_="Fullscreen";be.registerComponent("FullscreenToggle",_E);var t3=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},i3=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){var i=s.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return i.appendChild(s.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),i},e})(be);be.registerComponent("VolumeLevel",i3);var r3=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.update=In(It(We(n),n.update),Nr),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},t.update=function(i,n,a,o){if(!a){var l=Eo(this.el_),u=Eo(this.player_.el()),c=i.width*n;if(!u||!l)return;var h=i.left-u.left+c,f=i.width-c+(u.right-i.right),g=l.width/2;h<g?g+=g-h:f<g&&(g=f),g<0?g=0:g>l.width&&(g=l.width),this.el_.style.right="-"+g+"px"}this.write(o+"%")},t.write=function(i){oa(this.el_,i)},t.updateVolume=function(i,n,a,o,l){var u=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){u.update(i,n,a,o.toFixed(0)),l&&l()})},e})(be);be.registerComponent("VolumeLevelTooltip",r3);var TE=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.update=In(It(We(n),n.update),Nr),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(i,n,a){var o=this,l=100*n;this.getChild("volumeLevelTooltip").updateVolume(i,n,a,l,function(){a?o.el_.style.bottom=i.height*n+"px":o.el_.style.left=i.width*n+"px"})},e})(be);TE.prototype.options_={children:["volumeLevelTooltip"]};be.registerComponent("MouseVolumeLevelDisplay",TE);var ad=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.on("slideractive",function(a){return n.updateLastVolume_(a)}),n.on(r,"volumechange",function(a){return n.updateARIAAttributes(a)}),r.ready(function(){return n.updateARIAAttributes()}),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.handleMouseDown=function(i){Yl(i)&&s.prototype.handleMouseDown.call(this,i)},t.handleMouseMove=function(i){var n=this.getChild("mouseVolumeLevelDisplay");if(n){var a=this.el(),o=Eo(a),l=this.vertical(),u=Zh(a,i);u=l?u.y:u.x,u=sd(u,0,1),n.update(o,u,l)}Yl(i)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(i)))},t.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.updateARIAAttributes=function(i){var n=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",n),this.el_.setAttribute("aria-valuetext",n+"%")},t.volumeAsPercentage_=function(){return Math.round(this.player_.volume()*100)},t.updateLastVolume_=function(){var i=this,n=this.player_.volume();this.one("sliderinactive",function(){i.player_.volume()===0&&i.player_.lastVolume_(n)})},e})(Yg);ad.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Li&&!Pn&&ad.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");ad.prototype.playerEvent="volumechange";be.registerComponent("VolumeBar",ad);var bE=(function(s){we(e,s);function e(r,i){var n;return i===void 0&&(i={}),i.vertical=i.vertical||!1,(typeof i.volumeBar>"u"||Gl(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),n=s.call(this,r,i)||this,t3(We(n),r),n.throttledHandleMouseMove=In(It(We(n),n.handleMouseMove),Nr),n.handleMouseUpHandler_=function(a){return n.handleMouseUp(a)},n.on("mousedown",function(a){return n.handleMouseDown(a)}),n.on("touchstart",function(a){return n.handleMouseDown(a)}),n.on("mousemove",function(a){return n.handleMouseMove(a)}),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")}),n}var t=e.prototype;return t.createEl=function(){var i="vjs-volume-horizontal";return this.options_.vertical&&(i="vjs-volume-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+i})},t.handleMouseDown=function(i){var n=this.el_.ownerDocument;this.on(n,"mousemove",this.throttledHandleMouseMove),this.on(n,"touchmove",this.throttledHandleMouseMove),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(i){var n=this.el_.ownerDocument;this.off(n,"mousemove",this.throttledHandleMouseMove),this.off(n,"touchmove",this.throttledHandleMouseMove),this.off(n,"mouseup",this.handleMouseUpHandler_),this.off(n,"touchend",this.handleMouseUpHandler_)},t.handleMouseMove=function(i){this.volumeBar.handleMouseMove(i)},e})(be);bE.prototype.options_={children:["volumeBar"]};be.registerComponent("VolumeControl",bE);var n3=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},SE=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n3(We(n),r),n.on(r,["loadstart","volumechange"],function(a){return n.update(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-mute-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(i){var n=this.player_.volume(),a=this.player_.lastVolume_();if(n===0){var o=a<.1?.1:a;this.player_.volume(o),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.update=function(i){this.updateIcon_(),this.updateControlText_()},t.updateIcon_=function(){var i=this.player_.volume(),n=3;Li&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),i===0||this.player_.muted()?n=0:i<.33?n=1:i<.67&&(n=2);for(var a=0;a<4;a++)uu(this.el_,"vjs-vol-"+a);kn(this.el_,"vjs-vol-"+n)},t.updateControlText_=function(){var i=this.player_.muted()||this.player_.volume()===0,n=i?"Unmute":"Mute";this.controlText()!==n&&this.controlText(n)},e})(Dr);SE.prototype.controlText_="Mute";be.registerComponent("MuteToggle",SE);var CE=(function(s){we(e,s);function e(r,i){var n;return i===void 0&&(i={}),typeof i.inline<"u"?i.inline=i.inline:i.inline=!0,(typeof i.volumeControl>"u"||Gl(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),n=s.call(this,r,i)||this,n.handleKeyPressHandler_=function(a){return n.handleKeyPress(a)},n.on(r,["loadstart"],function(a){return n.volumePanelState_(a)}),n.on(n.muteToggle,"keyup",function(a){return n.handleKeyPress(a)}),n.on(n.volumeControl,"keyup",function(a){return n.handleVolumeControlKeyUp(a)}),n.on("keydown",function(a){return n.handleKeyPress(a)}),n.on("mouseover",function(a){return n.handleMouseOver(a)}),n.on("mouseout",function(a){return n.handleMouseOut(a)}),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}var t=e.prototype;return t.sliderActive_=function(){this.addClass("vjs-slider-active")},t.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},t.createEl=function(){var i="vjs-volume-panel-horizontal";return this.options_.inline||(i="vjs-volume-panel-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+i})},t.dispose=function(){this.handleMouseOut(),s.prototype.dispose.call(this)},t.handleVolumeControlKeyUp=function(i){Ge.isEventKey(i,"Esc")&&this.muteToggle.focus()},t.handleMouseOver=function(i){this.addClass("vjs-hover"),rr(ue,"keyup",this.handleKeyPressHandler_)},t.handleMouseOut=function(i){this.removeClass("vjs-hover"),_i(ue,"keyup",this.handleKeyPressHandler_)},t.handleKeyPress=function(i){Ge.isEventKey(i,"Esc")&&this.handleMouseOut()},e})(be);CE.prototype.options_={children:["muteToggle","volumeControl"]};be.registerComponent("VolumePanel",CE);var EE=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",function(a){return n.handleKeyDown(a)}),n.boundHandleBlur_=function(a){return n.handleBlur(a)},n.boundHandleTapClick_=function(a){return n.handleTapClick(a)},n}var t=e.prototype;return t.addEventListenerForItem=function(i){i instanceof be&&(this.on(i,"blur",this.boundHandleBlur_),this.on(i,["tap","click"],this.boundHandleTapClick_))},t.removeEventListenerForItem=function(i){i instanceof be&&(this.off(i,"blur",this.boundHandleBlur_),this.off(i,["tap","click"],this.boundHandleTapClick_))},t.removeChild=function(i){typeof i=="string"&&(i=this.getChild(i)),this.removeEventListenerForItem(i),s.prototype.removeChild.call(this,i)},t.addItem=function(i){var n=this.addChild(i);n&&this.addEventListenerForItem(n)},t.createEl=function(){var i=this.options_.contentElType||"ul";this.contentEl_=rt(i,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=s.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),rr(n,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),n},t.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,s.prototype.dispose.call(this)},t.handleBlur=function(i){var n=i.relatedTarget||ue.activeElement;if(!this.children().some(function(o){return o.el()===n})){var a=this.menuButton_;a&&a.buttonPressed_&&n!==a.el().firstChild&&a.unpressButton()}},t.handleTapClick=function(i){if(this.menuButton_){this.menuButton_.unpressButton();var n=this.children();if(!Array.isArray(n))return;var a=n.filter(function(o){return o.el()===i.target})[0];if(!a)return;a.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},t.handleKeyDown=function(i){Ge.isEventKey(i,"Left")||Ge.isEventKey(i,"Down")?(i.preventDefault(),i.stopPropagation(),this.stepForward()):(Ge.isEventKey(i,"Right")||Ge.isEventKey(i,"Up"))&&(i.preventDefault(),i.stopPropagation(),this.stepBack())},t.stepForward=function(){var i=0;this.focusedChild_!==void 0&&(i=this.focusedChild_+1),this.focus(i)},t.stepBack=function(){var i=0;this.focusedChild_!==void 0&&(i=this.focusedChild_-1),this.focus(i)},t.focus=function(i){i===void 0&&(i=0);var n=this.children().slice(),a=n.length&&n[0].hasClass("vjs-menu-title");a&&n.shift(),n.length>0&&(i<0?i=0:i>=n.length&&(i=n.length-1),this.focusedChild_=i,n[i].el_.focus())},e})(be);be.registerComponent("Menu",EE);var Zg=(function(s){we(e,s);function e(r,i){var n;i===void 0&&(i={}),n=s.call(this,r,i)||this,n.menuButton_=new Dr(r,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var a=Dr.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+a,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var o=function(u){return n.handleClick(u)};return n.handleMenuKeyUp_=function(l){return n.handleMenuKeyUp(l)},n.on(n.menuButton_,"tap",o),n.on(n.menuButton_,"click",o),n.on(n.menuButton_,"keydown",function(l){return n.handleKeyDown(l)}),n.on(n.menuButton_,"mouseenter",function(){n.addClass("vjs-hover"),n.menu.show(),rr(ue,"keyup",n.handleMenuKeyUp_)}),n.on("mouseleave",function(l){return n.handleMouseLeave(l)}),n.on("keydown",function(l){return n.handleSubmenuKeyDown(l)}),n}var t=e.prototype;return t.update=function(){var i=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=i,this.addChild(i),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},t.createMenu=function(){var i=new EE(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var n=rt("li",{className:"vjs-menu-title",textContent:Gt(this.options_.title),tabIndex:-1}),a=new be(this.player_,{el:n});i.addItem(a)}if(this.items=this.createItems(),this.items)for(var o=0;o<this.items.length;o++)i.addItem(this.items[o]);return i},t.createItems=function(){},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},t.buildWrapperCSSClass=function(){var i="vjs-menu-button";this.options_.inline===!0?i+="-inline":i+="-popup";var n=Dr.prototype.buildCSSClass();return"vjs-menu-button "+i+" "+n+" "+s.prototype.buildCSSClass.call(this)},t.buildCSSClass=function(){var i="vjs-menu-button";return this.options_.inline===!0?i+="-inline":i+="-popup","vjs-menu-button "+i+" "+s.prototype.buildCSSClass.call(this)},t.controlText=function(i,n){return n===void 0&&(n=this.menuButton_.el()),this.menuButton_.controlText(i,n)},t.dispose=function(){this.handleMouseLeave(),s.prototype.dispose.call(this)},t.handleClick=function(i){this.buttonPressed_?this.unpressButton():this.pressButton()},t.handleMouseLeave=function(i){this.removeClass("vjs-hover"),_i(ue,"keyup",this.handleMenuKeyUp_)},t.focus=function(){this.menuButton_.focus()},t.blur=function(){this.menuButton_.blur()},t.handleKeyDown=function(i){Ge.isEventKey(i,"Esc")||Ge.isEventKey(i,"Tab")?(this.buttonPressed_&&this.unpressButton(),Ge.isEventKey(i,"Tab")||(i.preventDefault(),this.menuButton_.focus())):(Ge.isEventKey(i,"Up")||Ge.isEventKey(i,"Down"))&&(this.buttonPressed_||(i.preventDefault(),this.pressButton()))},t.handleMenuKeyUp=function(i){(Ge.isEventKey(i,"Esc")||Ge.isEventKey(i,"Tab"))&&this.removeClass("vjs-hover")},t.handleSubmenuKeyPress=function(i){this.handleSubmenuKeyDown(i)},t.handleSubmenuKeyDown=function(i){(Ge.isEventKey(i,"Esc")||Ge.isEventKey(i,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),Ge.isEventKey(i,"Tab")||(i.preventDefault(),this.menuButton_.focus()))},t.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Li&&U1())return;this.menu.focus()}},t.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},t.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},t.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},e})(be);be.registerComponent("MenuButton",Zg);var ev=(function(s){we(e,s);function e(t,r){var i,n=r.tracks;if(i=s.call(this,t,r)||this,i.items.length<=1&&i.hide(),!n)return We(i);var a=It(We(i),i.update);return n.addEventListener("removetrack",a),n.addEventListener("addtrack",a),n.addEventListener("labelchange",a),i.player_.on("ready",a),i.player_.on("dispose",function(){n.removeEventListener("removetrack",a),n.removeEventListener("addtrack",a),n.removeEventListener("labelchange",a)}),i}return e})(Zg);be.registerComponent("TrackButton",ev);var s3=["Tab","Esc","Up","Down","Right","Left"],hu=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.selectable=i.selectable,n.isSelected_=i.selected||!1,n.multiSelectable=i.multiSelectable,n.selected(n.isSelected_),n.selectable?n.multiSelectable?n.el_.setAttribute("role","menuitemcheckbox"):n.el_.setAttribute("role","menuitemradio"):n.el_.setAttribute("role","menuitem"),n}var t=e.prototype;return t.createEl=function(i,n,a){this.nonIconControl=!0;var o=s.prototype.createEl.call(this,"li",Ht({className:"vjs-menu-item",tabIndex:-1},n),a);return o.replaceChild(rt("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),o.querySelector(".vjs-icon-placeholder")),o},t.handleKeyDown=function(i){s3.some(function(n){return Ge.isEventKey(i,n)})||s.prototype.handleKeyDown.call(this,i)},t.handleClick=function(i){this.selected(!0)},t.selected=function(i){this.selectable&&(i?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},e})(nd);be.registerComponent("MenuItem",hu);var du=(function(s){we(e,s);function e(r,i){var n,a=i.track,o=r.textTracks();i.label=a.label||a.language||"Unknown",i.selected=a.mode==="showing",n=s.call(this,r,i)||this,n.track=a,n.kinds=(i.kinds||[i.kind||n.track.kind]).filter(Boolean);var l=function(){for(var f=arguments.length,g=new Array(f),C=0;C<f;C++)g[C]=arguments[C];n.handleTracksChange.apply(We(n),g)},u=function(){for(var f=arguments.length,g=new Array(f),C=0;C<f;C++)g[C]=arguments[C];n.handleSelectedLanguageChange.apply(We(n),g)};if(r.on(["loadstart","texttrackchange"],l),o.addEventListener("change",l),o.addEventListener("selectedlanguagechange",u),n.on("dispose",function(){r.off(["loadstart","texttrackchange"],l),o.removeEventListener("change",l),o.removeEventListener("selectedlanguagechange",u)}),o.onchange===void 0){var c;n.on(["tap","click"],function(){if(typeof D.Event!="object")try{c=new D.Event("change")}catch{}c||(c=ue.createEvent("Event"),c.initEvent("change",!0,!0)),o.dispatchEvent(c)})}return n.handleTracksChange(),n}var t=e.prototype;return t.handleClick=function(i){var n=this.track,a=this.player_.textTracks();if(s.prototype.handleClick.call(this,i),!!a)for(var o=0;o<a.length;o++){var l=a[o];this.kinds.indexOf(l.kind)!==-1&&(l===n?l.mode!=="showing"&&(l.mode="showing"):l.mode!=="disabled"&&(l.mode="disabled"))}},t.handleTracksChange=function(i){var n=this.track.mode==="showing";n!==this.isSelected_&&this.selected(n)},t.handleSelectedLanguageChange=function(i){if(this.track.mode==="showing"){var n=this.player_.cache_.selectedLanguage;if(n&&n.enabled&&n.language===this.track.language&&n.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},t.dispose=function(){this.track=null,s.prototype.dispose.call(this)},e})(hu);be.registerComponent("TextTrackMenuItem",du);var wE=(function(s){we(e,s);function e(r,i){return i.track={player:r,kind:i.kind,kinds:i.kinds,default:!1,mode:"disabled"},i.kinds||(i.kinds=[i.kind]),i.label?i.track.label=i.label:i.track.label=i.kinds.join(" and ")+" off",i.selectable=!0,i.multiSelectable=!1,s.call(this,r,i)||this}var t=e.prototype;return t.handleTracksChange=function(i){for(var n=this.player().textTracks(),a=!0,o=0,l=n.length;o<l;o++){var u=n[o];if(this.options_.kinds.indexOf(u.kind)>-1&&u.mode==="showing"){a=!1;break}}a!==this.isSelected_&&this.selected(a)},t.handleSelectedLanguageChange=function(i){for(var n=this.player().textTracks(),a=!0,o=0,l=n.length;o<l;o++){var u=n[o];if(["captions","descriptions","subtitles"].indexOf(u.kind)>-1&&u.mode==="showing"){a=!1;break}}a&&(this.player_.cache_.selectedLanguage={enabled:!1})},e})(du);be.registerComponent("OffTextTrackMenuItem",wE);var qo=(function(s){we(e,s);function e(r,i){return i===void 0&&(i={}),i.tracks=r.textTracks(),s.call(this,r,i)||this}var t=e.prototype;return t.createItems=function(i,n){i===void 0&&(i=[]),n===void 0&&(n=du);var a;this.label_&&(a=this.label_+" off"),i.push(new wE(this.player_,{kinds:this.kinds_,kind:this.kind_,label:a})),this.hideThreshold_+=1;var o=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var l=0;l<o.length;l++){var u=o[l];if(this.kinds_.indexOf(u.kind)>-1){var c=new n(this.player_,{track:u,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});c.addClass("vjs-"+u.kind+"-menu-item"),i.push(c)}}return i},e})(ev);be.registerComponent("TextTrackButton",qo);var kE=(function(s){we(e,s);function e(r,i){var n,a=i.track,o=i.cue,l=r.currentTime();return i.selectable=!0,i.multiSelectable=!1,i.label=o.text,i.selected=o.startTime<=l&&l<o.endTime,n=s.call(this,r,i)||this,n.track=a,n.cue=o,n}var t=e.prototype;return t.handleClick=function(i){s.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime)},e})(hu);be.registerComponent("ChaptersTrackMenuItem",kE);var tv=(function(s){we(e,s);function e(r,i,n){var a;return a=s.call(this,r,i,n)||this,a.selectCurrentItem_=function(){a.items.forEach(function(o){o.selected(a.track_.activeCues[0]===o.cue)})},a}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-chapters-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-chapters-button "+s.prototype.buildWrapperCSSClass.call(this)},t.update=function(i){if(!(i&&i.track&&i.track.kind!=="chapters")){var n=this.findChaptersTrack();n!==this.track_?(this.setTrack(n),s.prototype.update.call(this)):(!this.items||n&&n.cues&&n.cues.length!==this.items.length)&&s.prototype.update.call(this)}},t.setTrack=function(i){if(this.track_!==i){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=i,this.track_){this.track_.mode="hidden";var a=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);a&&a.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}},t.findChaptersTrack=function(){for(var i=this.player_.textTracks()||[],n=i.length-1;n>=0;n--){var a=i[n];if(a.kind===this.kind_)return a}},t.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Gt(this.kind_))},t.createMenu=function(){return this.options_.title=this.getMenuCaption(),s.prototype.createMenu.call(this)},t.createItems=function(){var i=[];if(!this.track_)return i;var n=this.track_.cues;if(!n)return i;for(var a=0,o=n.length;a<o;a++){var l=n[a],u=new kE(this.player_,{track:this.track_,cue:l});i.push(u)}return i},e})(qo);tv.prototype.kind_="chapters";tv.prototype.controlText_="Chapters";be.registerComponent("ChaptersButton",tv);var iv=(function(s){we(e,s);function e(r,i,n){var a;a=s.call(this,r,i,n)||this;var o=r.textTracks(),l=It(We(a),a.handleTracksChange);return o.addEventListener("change",l),a.on("dispose",function(){o.removeEventListener("change",l)}),a}var t=e.prototype;return t.handleTracksChange=function(i){for(var n=this.player().textTracks(),a=!1,o=0,l=n.length;o<l;o++){var u=n[o];if(u.kind!==this.kind_&&u.mode==="showing"){a=!0;break}}a?this.disable():this.enable()},t.buildCSSClass=function(){return"vjs-descriptions-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+s.prototype.buildWrapperCSSClass.call(this)},e})(qo);iv.prototype.kind_="descriptions";iv.prototype.controlText_="Descriptions";be.registerComponent("DescriptionsButton",iv);var rv=(function(s){we(e,s);function e(r,i,n){return s.call(this,r,i,n)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-subtitles-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+s.prototype.buildWrapperCSSClass.call(this)},e})(qo);rv.prototype.kind_="subtitles";rv.prototype.controlText_="Subtitles";be.registerComponent("SubtitlesButton",rv);var nv=(function(s){we(e,s);function e(r,i){var n;return i.track={player:r,kind:i.kind,label:i.kind+" settings",selectable:!1,default:!1,mode:"disabled"},i.selectable=!1,i.name="CaptionSettingsMenuItem",n=s.call(this,r,i)||this,n.addClass("vjs-texttrack-settings"),n.controlText(", opens "+i.kind+" settings dialog"),n}var t=e.prototype;return t.handleClick=function(i){this.player().getChild("textTrackSettings").open()},e})(du);be.registerComponent("CaptionSettingsMenuItem",nv);var sv=(function(s){we(e,s);function e(r,i,n){return s.call(this,r,i,n)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-captions-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-captions-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var i=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(i.push(new nv(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),s.prototype.createItems.call(this,i)},e})(qo);sv.prototype.kind_="captions";sv.prototype.controlText_="Captions";be.registerComponent("CaptionsButton",sv);var xE=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(i,n,a){var o=s.prototype.createEl.call(this,i,n,a),l=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(l.appendChild(rt("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),l.appendChild(rt("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),o},e})(du);be.registerComponent("SubsCapsMenuItem",xE);var av=(function(s){we(e,s);function e(r,i){var n;return i===void 0&&(i={}),n=s.call(this,r,i)||this,n.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(n.player_.language_)>-1&&(n.label_="captions"),n.menuButton_.controlText(Gt(n.label_)),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var i=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(i.push(new nv(this.player_,{kind:this.label_})),this.hideThreshold_+=1),i=s.prototype.createItems.call(this,i,xE),i},e})(qo);av.prototype.kinds_=["captions","subtitles"];av.prototype.controlText_="Subtitles";be.registerComponent("SubsCapsButton",av);var AE=(function(s){we(e,s);function e(r,i){var n,a=i.track,o=r.audioTracks();i.label=a.label||a.language||"Unknown",i.selected=a.enabled,n=s.call(this,r,i)||this,n.track=a,n.addClass("vjs-"+a.kind+"-menu-item");var l=function(){for(var c=arguments.length,h=new Array(c),f=0;f<c;f++)h[f]=arguments[f];n.handleTracksChange.apply(We(n),h)};return o.addEventListener("change",l),n.on("dispose",function(){o.removeEventListener("change",l)}),n}var t=e.prototype;return t.createEl=function(i,n,a){var o=s.prototype.createEl.call(this,i,n,a),l=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="main-desc"&&(l.appendChild(rt("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),l.appendChild(rt("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),o},t.handleClick=function(i){if(s.prototype.handleClick.call(this,i),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks)for(var n=this.player_.audioTracks(),a=0;a<n.length;a++){var o=n[a];o!==this.track&&(o.enabled=o===this.track)}},t.handleTracksChange=function(i){this.selected(this.track.enabled)},e})(hu);be.registerComponent("AudioTrackMenuItem",AE);var IE=(function(s){we(e,s);function e(r,i){return i===void 0&&(i={}),i.tracks=r.audioTracks(),s.call(this,r,i)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-audio-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-audio-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(i){i===void 0&&(i=[]),this.hideThreshold_=1;for(var n=this.player_.audioTracks(),a=0;a<n.length;a++){var o=n[a];i.push(new AE(this.player_,{track:o,selectable:!0,multiSelectable:!1}))}return i},e})(ev);IE.prototype.controlText_="Audio Track";be.registerComponent("AudioTrackButton",IE);var ov=(function(s){we(e,s);function e(r,i){var n,a=i.rate,o=parseFloat(a,10);return i.label=a,i.selected=o===r.playbackRate(),i.selectable=!0,i.multiSelectable=!1,n=s.call(this,r,i)||this,n.label=a,n.rate=o,n.on(r,"ratechange",function(l){return n.update(l)}),n}var t=e.prototype;return t.handleClick=function(i){s.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},t.update=function(i){this.selected(this.player().playbackRate()===this.rate)},e})(hu);ov.prototype.contentElType="button";be.registerComponent("PlaybackRateMenuItem",ov);var PE=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.menuButton_.el_.setAttribute("aria-describedby",n.labelElId_),n.updateVisibility(),n.updateLabel(),n.on(r,"loadstart",function(a){return n.updateVisibility(a)}),n.on(r,"ratechange",function(a){return n.updateLabel(a)}),n.on(r,"playbackrateschange",function(a){return n.handlePlaybackRateschange(a)}),n}var t=e.prototype;return t.createEl=function(){var i=s.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=rt("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),i.appendChild(this.labelEl_),i},t.dispose=function(){this.labelEl_=null,s.prototype.dispose.call(this)},t.buildCSSClass=function(){return"vjs-playback-rate "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-playback-rate "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){for(var i=this.playbackRates(),n=[],a=i.length-1;a>=0;a--)n.push(new ov(this.player(),{rate:i[a]+"x"}));return n},t.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.handleClick=function(i){var n=this.player().playbackRate(),a=this.playbackRates(),o=a.indexOf(n),l=(o+1)%a.length;this.player().playbackRate(a[l])},t.handlePlaybackRateschange=function(i){this.update()},t.playbackRates=function(){var i=this.player();return i.playbackRates&&i.playbackRates()||[]},t.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},t.updateVisibility=function(i){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.updateLabel=function(i){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},e})(Zg);PE.prototype.controlText_="Playback Rate";be.registerComponent("PlaybackRateMenuButton",PE);var DE=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(i,n,a){return i===void 0&&(i="div"),n===void 0&&(n={}),a===void 0&&(a={}),n.className||(n.className=this.buildCSSClass()),s.prototype.createEl.call(this,i,n,a)},e})(be);be.registerComponent("Spacer",DE);var a3=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-custom-control-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},e})(DE);be.registerComponent("CustomControlSpacer",a3);var sh=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},e})(be);sh.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]};"exitPictureInPicture"in ue&&sh.prototype.options_.children.splice(sh.prototype.options_.children.length-1,0,"pictureInPictureToggle");be.registerComponent("ControlBar",sh);var NE=(function(s){we(e,s);function e(r,i){var n;return n=s.call(this,r,i)||this,n.on(r,"error",function(a){return n.open(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-error-display "+s.prototype.buildCSSClass.call(this)},t.content=function(){var i=this.player().error();return i?this.localize(i.message):""},e})(jo);NE.prototype.options_=vt({},jo.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});be.registerComponent("ErrorDisplay",NE);var Jf="vjs-text-track-settings",dT=["#000","Black"],fT=["#00F","Blue"],pT=["#0FF","Cyan"],mT=["#0F0","Green"],gT=["#F0F","Magenta"],vT=["#F00","Red"],yT=["#FFF","White"],_T=["#FF0","Yellow"],Zf=["1","Opaque"],ep=["0.5","Semi-Transparent"],TT=["0","Transparent"],Bs={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[dT,yT,vT,mT,fT,_T,gT,pT]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Zf,ep,TT]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[yT,dT,vT,mT,fT,_T,gT,pT]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return e==="1.00"?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Zf,ep]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[TT,ep,Zf]}};Bs.windowColor.options=Bs.backgroundColor.options;function LE(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function o3(s,e){var t=s.options[s.options.selectedIndex].value;return LE(t,e)}function l3(s,e,t){if(e){for(var r=0;r<s.options.length;r++)if(LE(s.options[r].value,t)===e){s.selectedIndex=r;break}}}var u3=(function(s){we(e,s);function e(r,i){var n;return i.temporary=!1,n=s.call(this,r,i)||this,n.updateDisplay=n.updateDisplay.bind(We(n)),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=rt("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),i.persistTextTrackSettings===void 0&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",function(){n.saveSettings(),n.close()}),n.on(n.$(".vjs-default-button"),"click",function(){n.setDefaults(),n.updateDisplay()}),so(Bs,function(a){n.on(n.$(a.selector),"change",n.updateDisplay)}),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}var t=e.prototype;return t.dispose=function(){this.endDialog=null,s.prototype.dispose.call(this)},t.createElSelect_=function(i,n,a){var o=this;n===void 0&&(n=""),a===void 0&&(a="label");var l=Bs[i],u=l.id.replace("%s",this.id_),c=[n,u].join(" ").trim();return["<"+a+' id="'+u+'" class="'+(a==="label"?"vjs-label":"")+'">',this.localize(l.label),"</"+a+">",'<select aria-labelledby="'+c+'">'].concat(l.options.map(function(h){var f=u+"-"+h[1].replace(/\W+/g,"");return['<option id="'+f+'" value="'+h[0]+'" ','aria-labelledby="'+c+" "+f+'">',o.localize(h[1]),"</option>"].join("")})).concat("</select>").join("")},t.createElFgColor_=function(){var i="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+i+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",i),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",i),"</span>","</fieldset>"].join("")},t.createElBgColor_=function(){var i="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+i+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",i),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",i),"</span>","</fieldset>"].join("")},t.createElWinColor_=function(){var i="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+i+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",i),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",i),"</span>","</fieldset>"].join("")},t.createElColors_=function(){return rt("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.createElFont_=function(){return rt("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},t.createElControls_=function(){var i=this.localize("restore all settings to the default values");return rt("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+i+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+i+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},t.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.label=function(){return this.localize("Caption Settings Dialog")},t.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.buildCSSClass=function(){return s.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.getValues=function(){var i=this;return QR(Bs,function(n,a,o){var l=o3(i.$(a.selector),a.parser);return l!==void 0&&(n[o]=l),n},{})},t.setValues=function(i){var n=this;so(Bs,function(a,o){l3(n.$(a.selector),i[o],a.parser)})},t.setDefaults=function(){var i=this;so(Bs,function(n){var a=n.hasOwnProperty("default")?n.default:0;i.$(n.selector).selectedIndex=a})},t.restoreSettings=function(){var i;try{i=JSON.parse(D.localStorage.getItem(Jf))}catch(n){Qe.warn(n)}i&&this.setValues(i)},t.saveSettings=function(){if(this.options_.persistTextTrackSettings){var i=this.getValues();try{Object.keys(i).length?D.localStorage.setItem(Jf,JSON.stringify(i)):D.localStorage.removeItem(Jf)}catch(n){Qe.warn(n)}}},t.updateDisplay=function(){var i=this.player_.getChild("textTrackDisplay");i&&i.updateDisplay()},t.conditionalBlur_=function(){this.previouslyActiveEl_=null;var i=this.player_.controlBar,n=i&&i.subsCapsButton,a=i&&i.captionsButton;n?n.focus():a&&a.focus()},e})(jo);be.registerComponent("TextTrackSettings",u3);var c3=(function(s){we(e,s);function e(r,i){var n,a=i.ResizeObserver||D.ResizeObserver;i.ResizeObserver===null&&(a=!1);var o=At({createEl:!a,reportTouchActivity:!1},i);return n=s.call(this,r,o)||this,n.ResizeObserver=i.ResizeObserver||D.ResizeObserver,n.loadListener_=null,n.resizeObserver_=null,n.debouncedHandler_=l4(function(){n.resizeHandler()},100,!1,We(n)),a?(n.resizeObserver_=new n.ResizeObserver(n.debouncedHandler_),n.resizeObserver_.observe(r.el())):(n.loadListener_=function(){if(!(!n.el_||!n.el_.contentWindow)){var l=n.debouncedHandler_,u=n.unloadListener_=function(){_i(this,"resize",l),_i(this,"unload",u),u=null};rr(n.el_.contentWindow,"unload",u),rr(n.el_.contentWindow,"resize",l)}},n.one("load",n.loadListener_)),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})},t.resizeHandler=function(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")},t.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,s.prototype.dispose.call(this)},e})(be);be.registerComponent("ResizeManager",c3);var h3={trackingThreshold:20,liveTolerance:15},d3=(function(s){we(e,s);function e(r,i){var n,a=At(h3,i,{createEl:!1});return n=s.call(this,r,a)||this,n.handleVisibilityChange_=function(o){return n.handleVisibilityChange(o)},n.trackLiveHandler_=function(){return n.trackLive_()},n.handlePlay_=function(o){return n.handlePlay(o)},n.handleFirstTimeupdate_=function(o){return n.handleFirstTimeupdate(o)},n.handleSeeked_=function(o){return n.handleSeeked(o)},n.seekToLiveEdge_=function(o){return n.seekToLiveEdge(o)},n.reset_(),n.on(n.player_,"durationchange",function(o){return n.handleDurationchange(o)}),n.on(n.player_,"canplay",function(){return n.toggleTracking()}),lu&&"hidden"in ue&&"visibilityState"in ue&&n.on(ue,"visibilitychange",n.handleVisibilityChange_),n}var t=e.prototype;return t.handleVisibilityChange=function(){this.player_.duration()===1/0&&(ue.hidden?this.stopTracking():this.startTracking())},t.trackLive_=function(){var i=this.player_.seekable();if(!(!i||!i.length)){var n=Number(D.performance.now().toFixed(4)),a=this.lastTime_===-1?0:(n-this.lastTime_)/1e3;this.lastTime_=n,this.pastSeekEnd_=this.pastSeekEnd()+a;var o=this.liveCurrentTime(),l=this.player_.currentTime(),u=this.player_.paused()||this.seekedBehindLive_||Math.abs(o-l)>this.options_.liveTolerance;(!this.timeupdateSeen_||o===1/0)&&(u=!1),u!==this.behindLiveEdge_&&(this.behindLiveEdge_=u,this.trigger("liveedgechange"))}},t.handleDurationchange=function(){this.toggleTracking()},t.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},t.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Nr),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},t.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},t.handleSeeked=function(){var i=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&i>2,this.nextSeekedFromUser_=!1,this.trackLive_()},t.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},t.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},t.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},t.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},t.seekableEnd=function(){for(var i=this.player_.seekable(),n=[],a=i?i.length:0;a--;)n.push(i.end(a));return n.length?n.sort()[n.length-1]:1/0},t.seekableStart=function(){for(var i=this.player_.seekable(),n=[],a=i?i.length:0;a--;)n.push(i.start(a));return n.length?n.sort()[0]:0},t.liveWindow=function(){var i=this.liveCurrentTime();return i===1/0?0:i-this.seekableStart()},t.isLive=function(){return this.isTracking()},t.atLiveEdge=function(){return!this.behindLiveEdge()},t.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},t.pastSeekEnd=function(){var i=this.seekableEnd();return this.lastSeekEnd_!==-1&&i!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=i,this.pastSeekEnd_},t.behindLiveEdge=function(){return this.behindLiveEdge_},t.isTracking=function(){return typeof this.trackingInterval_=="number"},t.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},t.dispose=function(){this.off(ue,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),s.prototype.dispose.call(this)},e})(be);be.registerComponent("LiveTracker",d3);var gm=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var r=e.$$("source"),i=[],n="";if(!r.length)return!1;for(var a=0;a<r.length;a++){var o=r[a].src;o&&i.indexOf(o)===-1&&i.push(o)}return i.length?(i.length===1&&(n=i[0]),e.triggerSourceset(n),!0):!1},f3=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=ue.createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var r=ue.createDocumentFragment();t.childNodes.length;)r.appendChild(t.childNodes[0]);return this.innerText="",D.Element.prototype.appendChild.call(this,r),this.innerHTML}}),OE=function(e,t){for(var r={},i=0;i<e.length&&(r=Object.getOwnPropertyDescriptor(e[i],t),!(r&&r.set&&r.get));i++);return r.enumerable=!0,r.configurable=!0,r},p3=function(e){return OE([e.el(),D.HTMLMediaElement.prototype,D.Element.prototype,f3],"innerHTML")},bT=function(e){var t=e.el();if(!t.resetSourceWatch_){var r={},i=p3(e),n=function(o){return function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];var h=o.apply(t,u);return gm(e),h}};["append","appendChild","insertAdjacentHTML"].forEach(function(a){t[a]&&(r[a]=t[a],t[a]=n(r[a]))}),Object.defineProperty(t,"innerHTML",At(i,{set:n(i.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(r).forEach(function(a){t[a]=r[a]}),Object.defineProperty(t,"innerHTML",i)},e.one("sourceset",t.resetSourceWatch_)}},m3=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?oE(D.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return D.Element.prototype.setAttribute.call(this,"src",e),e}}),g3=function(e){return OE([e.el(),D.HTMLMediaElement.prototype,m3],"src")},v3=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var r=g3(e),i=t.setAttribute,n=t.load;Object.defineProperty(t,"src",At(r,{set:function(o){var l=r.set.call(t,o);return e.triggerSourceset(t.src),l}})),t.setAttribute=function(a,o){var l=i.call(t,a,o);return/src/i.test(a)&&e.triggerSourceset(t.src),l},t.load=function(){var a=n.call(t);return gm(e)||(e.triggerSourceset(""),bT(e)),a},t.currentSrc?e.triggerSourceset(t.currentSrc):gm(e)||bT(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=n,t.setAttribute=i,Object.defineProperty(t,"src",r),t.resetSourceWatch_&&t.resetSourceWatch_()}}}},lv=function(e,t,r,i){i===void 0&&(i=!0);var n=function(l){return Object.defineProperty(e,t,{value:l,enumerable:!0,writable:!0})},a={configurable:!0,enumerable:!0,get:function(){var l=r();return n(l),l}};return i&&(a.set=n),Object.defineProperty(e,t,a)},Ie=(function(s){we(e,s);function e(r,i){var n;n=s.call(this,r,i)||this;var a=r.source,o=!1;if(n.featuresVideoFrameCallback=n.featuresVideoFrameCallback&&n.el_.tagName==="VIDEO",a&&(n.el_.currentSrc!==a.src||r.tag&&r.tag.initNetworkState_===3)?n.setSource(a):n.handleLateInit_(n.el_),r.enableSourceset&&n.setupSourcesetHandling_(),n.isScrubbing_=!1,n.el_.hasChildNodes()){for(var l=n.el_.childNodes,u=l.length,c=[];u--;){var h=l[u],f=h.nodeName.toLowerCase();f==="track"&&(n.featuresNativeTextTracks?(n.remoteTextTrackEls().addTrackElement_(h),n.remoteTextTracks().addTrack(h.track),n.textTracks().addTrack(h.track),!o&&!n.el_.hasAttribute("crossorigin")&&rd(h.src)&&(o=!0)):c.push(h))}for(var g=0;g<c.length;g++)n.el_.removeChild(c[g])}return n.proxyNativeTracks_(),n.featuresNativeTextTracks&&o&&Qe.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
|
|
258
|
-
This may prevent text tracks from loading.`),n.restoreMetadataTracksInIOSNativePlayer_(),(So||Bg||O1)&&r.nativeControlsForTouch===!0&&n.setControls(!0),n.proxyWebkitFullscreen_(),n.triggerReady(),n}var t=e.prototype;return t.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),e.disposeMediaElement(this.el_),this.options_=null,s.prototype.dispose.call(this)},t.setupSourcesetHandling_=function(){v3(this)},t.restoreMetadataTracksInIOSNativePlayer_=function(){var i=this.textTracks(),n,a=function(){n=[];for(var u=0;u<i.length;u++){var c=i[u];c.kind==="metadata"&&n.push({track:c,storedMode:c.mode})}};a(),i.addEventListener("change",a),this.on("dispose",function(){return i.removeEventListener("change",a)});var o=function l(){for(var u=0;u<n.length;u++){var c=n[u];c.track.mode==="disabled"&&c.track.mode!==c.storedMode&&(c.track.mode=c.storedMode)}i.removeEventListener("change",l)};this.on("webkitbeginfullscreen",function(){i.removeEventListener("change",a),i.removeEventListener("change",o),i.addEventListener("change",o)}),this.on("webkitendfullscreen",function(){i.removeEventListener("change",a),i.addEventListener("change",a),i.removeEventListener("change",o)})},t.overrideNative_=function(i,n){var a=this;if(n===this["featuresNative"+i+"Tracks"]){var o=i.toLowerCase();this[o+"TracksListeners_"]&&Object.keys(this[o+"TracksListeners_"]).forEach(function(l){var u=a.el()[o+"Tracks"];u.removeEventListener(l,a[o+"TracksListeners_"][l])}),this["featuresNative"+i+"Tracks"]=!n,this[o+"TracksListeners_"]=null,this.proxyNativeTracksForType_(o)}},t.overrideNativeAudioTracks=function(i){this.overrideNative_("Audio",i)},t.overrideNativeVideoTracks=function(i){this.overrideNative_("Video",i)},t.proxyNativeTracksForType_=function(i){var n=this,a=pr[i],o=this.el()[a.getterName],l=this[a.getterName]();if(!(!this["featuresNative"+a.capitalName+"Tracks"]||!o||!o.addEventListener)){var u={change:function(f){var g={type:"change",target:l,currentTarget:l,srcElement:l};l.trigger(g),i==="text"&&n[ko.remoteText.getterName]().trigger(g)},addtrack:function(f){l.addTrack(f.track)},removetrack:function(f){l.removeTrack(f.track)}},c=function(){for(var f=[],g=0;g<l.length;g++){for(var C=!1,p=0;p<o.length;p++)if(o[p]===l[g]){C=!0;break}C||f.push(l[g])}for(;f.length;)l.removeTrack(f.shift())};this[a.getterName+"Listeners_"]=u,Object.keys(u).forEach(function(h){var f=u[h];o.addEventListener(h,f),n.on("dispose",function(g){return o.removeEventListener(h,f)})}),this.on("loadstart",c),this.on("dispose",function(h){return n.off("loadstart",c)})}},t.proxyNativeTracks_=function(){var i=this;pr.names.forEach(function(n){i.proxyNativeTracksForType_(n)})},t.createEl=function(){var i=this.options_.tag;if(!i||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(i){var n=i.cloneNode(!0);i.parentNode&&i.parentNode.insertBefore(n,i),e.disposeMediaElement(i),i=n}else{i=ue.createElement("video");var a=this.options_.tag&&_n(this.options_.tag),o=At({},a);(!So||this.options_.nativeControlsForTouch!==!0)&&delete o.controls,V1(i,Ht(o,{id:this.options_.techId,class:"vjs-tech"}))}i.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&Co(i,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(i.disablePictureInPicture=this.options_.disablePictureInPicture);for(var l=["loop","muted","playsinline","autoplay"],u=0;u<l.length;u++){var c=l[u],h=this.options_[c];typeof h<"u"&&(h?Co(i,c,c):Jh(i,c),i[c]=h)}return i},t.handleLateInit_=function(i){if(!(i.networkState===0||i.networkState===3)){if(i.readyState===0){var n=!1,a=function(){n=!0};this.on("loadstart",a);var o=function(){n||this.trigger("loadstart")};this.on("loadedmetadata",o),this.ready(function(){this.off("loadstart",a),this.off("loadedmetadata",o),n||this.trigger("loadstart")});return}var l=["loadstart"];l.push("loadedmetadata"),i.readyState>=2&&l.push("loadeddata"),i.readyState>=3&&l.push("canplay"),i.readyState>=4&&l.push("canplaythrough"),this.ready(function(){l.forEach(function(u){this.trigger(u)},this)})}},t.setScrubbing=function(i){this.isScrubbing_=i},t.scrubbing=function(){return this.isScrubbing_},t.setCurrentTime=function(i){try{this.isScrubbing_&&this.el_.fastSeek&&Qh?this.el_.fastSeek(i):this.el_.currentTime=i}catch(n){Qe(n,"Video is not ready. (Video.js)")}},t.duration=function(){var i=this;if(this.el_.duration===1/0&&Pn&&Dn&&this.el_.currentTime===0){var n=function a(){i.el_.currentTime>0&&(i.el_.duration===1/0&&i.trigger("durationchange"),i.off("timeupdate",a))};return this.on("timeupdate",n),NaN}return this.el_.duration||NaN},t.width=function(){return this.el_.offsetWidth},t.height=function(){return this.el_.offsetHeight},t.proxyWebkitFullscreen_=function(){var i=this;if("webkitDisplayingFullscreen"in this.el_){var n=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},a=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",n),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",a),this.on("dispose",function(){i.off("webkitbeginfullscreen",a),i.off("webkitendfullscreen",n)})}},t.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var i=D.navigator&&D.navigator.userAgent||"";if(/Android/.test(i)||!/Chrome|Mac OS X 10.5/.test(i))return!0}return!1},t.enterFullScreen=function(){var i=this.el_;if(i.paused&&i.networkState<=i.HAVE_METADATA)Qr(this.el_.play()),this.setTimeout(function(){i.pause();try{i.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},0);else try{i.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},t.exitFullScreen=function(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()},t.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},t.requestVideoFrameCallback=function(i){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(i):s.prototype.requestVideoFrameCallback.call(this,i)},t.cancelVideoFrameCallback=function(i){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(i):s.prototype.cancelVideoFrameCallback.call(this,i)},t.src=function(i){if(i===void 0)return this.el_.src;this.setSrc(i)},t.reset=function(){e.resetMediaElement(this.el_)},t.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.setControls=function(i){this.el_.controls=!!i},t.addTextTrack=function(i,n,a){return this.featuresNativeTextTracks?this.el_.addTextTrack(i,n,a):s.prototype.addTextTrack.call(this,i,n,a)},t.createRemoteTextTrack=function(i){if(!this.featuresNativeTextTracks)return s.prototype.createRemoteTextTrack.call(this,i);var n=ue.createElement("track");return i.kind&&(n.kind=i.kind),i.label&&(n.label=i.label),(i.language||i.srclang)&&(n.srclang=i.language||i.srclang),i.default&&(n.default=i.default),i.id&&(n.id=i.id),i.src&&(n.src=i.src),n},t.addRemoteTextTrack=function(i,n){var a=s.prototype.addRemoteTextTrack.call(this,i,n);return this.featuresNativeTextTracks&&this.el().appendChild(a),a},t.removeRemoteTextTrack=function(i){if(s.prototype.removeRemoteTextTrack.call(this,i),this.featuresNativeTextTracks)for(var n=this.$$("track"),a=n.length;a--;)(i===n[a]||i===n[a].track)&&this.el().removeChild(n[a])},t.getVideoPlaybackQuality=function(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();var i={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(i.droppedVideoFrames=this.el().webkitDroppedFrameCount,i.totalVideoFrames=this.el().webkitDecodedFrameCount),D.performance&&typeof D.performance.now=="function"?i.creationTime=D.performance.now():D.performance&&D.performance.timing&&typeof D.performance.timing.navigationStart=="number"&&(i.creationTime=D.Date.now()-D.performance.timing.navigationStart),i},e})(Et);lv(Ie,"TEST_VID",function(){if(Fo()){var s=ue.createElement("video"),e=ue.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s}});Ie.isSupported=function(){try{Ie.TEST_VID.volume=.5}catch{return!1}return!!(Ie.TEST_VID&&Ie.TEST_VID.canPlayType)};Ie.canPlayType=function(s){return Ie.TEST_VID.canPlayType(s)};Ie.canPlaySource=function(s,e){return Ie.canPlayType(s.type)};Ie.canControlVolume=function(){try{var s=Ie.TEST_VID.volume;Ie.TEST_VID.volume=s/2+.1;var e=s!==Ie.TEST_VID.volume;return e&&Li?(D.setTimeout(function(){Ie&&Ie.prototype&&(Ie.prototype.featuresVolumeControl=s!==Ie.TEST_VID.volume)}),!1):e}catch{return!1}};Ie.canMuteVolume=function(){try{var s=Ie.TEST_VID.muted;return Ie.TEST_VID.muted=!s,Ie.TEST_VID.muted?Co(Ie.TEST_VID,"muted","muted"):Jh(Ie.TEST_VID,"muted","muted"),s!==Ie.TEST_VID.muted}catch{return!1}};Ie.canControlPlaybackRate=function(){if(Pn&&Dn&&R1<58)return!1;try{var s=Ie.TEST_VID.playbackRate;return Ie.TEST_VID.playbackRate=s/2+.1,s!==Ie.TEST_VID.playbackRate}catch{return!1}};Ie.canOverrideAttributes=function(){try{var s=function(){};Object.defineProperty(ue.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(ue.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(ue.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(ue.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0};Ie.supportsNativeTextTracks=function(){return Qh||Li&&Dn};Ie.supportsNativeVideoTracks=function(){return!!(Ie.TEST_VID&&Ie.TEST_VID.videoTracks)};Ie.supportsNativeAudioTracks=function(){return!!(Ie.TEST_VID&&Ie.TEST_VID.audioTracks)};Ie.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(s){var e=s[0],t=s[1];lv(Ie.prototype,e,function(){return Ie[t]()},!0)});Ie.prototype.featuresVolumeControl=Ie.canControlVolume();Ie.prototype.movingMediaElementInDOM=!Li;Ie.prototype.featuresFullscreenResize=!0;Ie.prototype.featuresProgressEvents=!0;Ie.prototype.featuresTimeupdateEvents=!0;Ie.prototype.featuresVideoFrameCallback=!!(Ie.TEST_VID&&Ie.TEST_VID.requestVideoFrameCallback);var ah;Ie.patchCanPlayType=function(){Og>=4&&!M1&&!Dn&&(ah=Ie.TEST_VID&&Ie.TEST_VID.constructor.prototype.canPlayType,Ie.TEST_VID.constructor.prototype.canPlayType=function(s){var e=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;return s&&e.test(s)?"maybe":ah.call(this,s)})};Ie.unpatchCanPlayType=function(){var s=Ie.TEST_VID.constructor.prototype.canPlayType;return ah&&(Ie.TEST_VID.constructor.prototype.canPlayType=ah),s};Ie.patchCanPlayType();Ie.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()}};Ie.resetMediaElement=function(s){if(s){for(var e=s.querySelectorAll("source"),t=e.length;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){Ie.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){Ie.prototype["set"+Gt(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){Ie.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){Ie.prototype["set"+Gt(s)]=function(e){this.el_[s]=e}});["pause","load","play"].forEach(function(s){Ie.prototype[s]=function(){return this.el_[s]()}});Et.withSourceHandlers(Ie);Ie.nativeSourceHandler={};Ie.nativeSourceHandler.canPlayType=function(s){try{return Ie.TEST_VID.canPlayType(s)}catch{return""}};Ie.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return Ie.nativeSourceHandler.canPlayType(s.type);if(s.src){var t=qg(s.src);return Ie.nativeSourceHandler.canPlayType("video/"+t)}return""};Ie.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)};Ie.nativeSourceHandler.dispose=function(){};Ie.registerSourceHandler(Ie.nativeSourceHandler);Et.registerTech("Html5",Ie);var ME=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],tp={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},vm=["tiny","xsmall","small","medium","large","xlarge","huge"],kc={};vm.forEach(function(s){var e=s.charAt(0)==="x"?"x-"+s.substring(1):s;kc[s]="vjs-layout-"+e});var y3={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Yt=(function(s){we(e,s);function e(r,i,n){var a;if(r.id=r.id||i.id||"vjs_video_"+Nn(),i=Ht(e.getTagSettings(r),i),i.initChildren=!1,i.createEl=!1,i.evented=!1,i.reportTouchActivity=!1,!i.language)if(typeof r.closest=="function"){var o=r.closest("[lang]");o&&o.getAttribute&&(i.language=o.getAttribute("lang"))}else for(var l=r;l&&l.nodeType===1;){if(_n(l).hasOwnProperty("lang")){i.language=l.getAttribute("lang");break}l=l.parentNode}if(a=s.call(this,null,i,n)||this,a.boundDocumentFullscreenChange_=function(f){return a.documentFullscreenChange_(f)},a.boundFullWindowOnEscKey_=function(f){return a.fullWindowOnEscKey(f)},a.boundUpdateStyleEl_=function(f){return a.updateStyleEl_(f)},a.boundApplyInitTime_=function(f){return a.applyInitTime_(f)},a.boundUpdateCurrentBreakpoint_=function(f){return a.updateCurrentBreakpoint_(f)},a.boundHandleTechClick_=function(f){return a.handleTechClick_(f)},a.boundHandleTechDoubleClick_=function(f){return a.handleTechDoubleClick_(f)},a.boundHandleTechTouchStart_=function(f){return a.handleTechTouchStart_(f)},a.boundHandleTechTouchMove_=function(f){return a.handleTechTouchMove_(f)},a.boundHandleTechTouchEnd_=function(f){return a.handleTechTouchEnd_(f)},a.boundHandleTechTap_=function(f){return a.handleTechTap_(f)},a.isFullscreen_=!1,a.log=D1(a.id_),a.fsApi_=th,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,a.audioOnlyMode_=!1,a.audioPosterMode_=!1,a.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=r,a.tagAttributes=r&&_n(r),a.language(a.options_.language),i.languages){var u={};Object.getOwnPropertyNames(i.languages).forEach(function(f){u[f.toLowerCase()]=i.languages[f]}),a.languages_=u}else a.languages_=e.prototype.options_.languages;a.resetCache_(),a.poster_=i.poster||"",a.controls_=!!i.controls,r.controls=!1,r.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],r.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),i.plugins&&Object.keys(i.plugins).forEach(function(f){if(typeof a[f]!="function")throw new Error('plugin "'+f+'" does not exist')}),a.scrubbing_=!1,a.el_=a.createEl(),jg(We(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(rr(ue,a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var c=At(a.options_);i.plugins&&Object.keys(i.plugins).forEach(function(f){a[f](i.plugins[f])}),i.debug&&a.debug(!0),a.options_.playerOptions=c,a.middleware_=[],a.playbackRates(i.playbackRates),a.initChildren(),a.isAudio(r.nodeName.toLowerCase()==="audio"),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),So&&a.addClass("vjs-touch-enabled"),Li||a.addClass("vjs-workinghover"),e.players[a.id_]=We(a);var h=A1.split(".")[0];return a.addClass("vjs-v"+h),a.userActive(!0),a.reportUserActivity(),a.one("play",function(f){return a.listenForUserActivity_(f)}),a.on("stageclick",function(f){return a.handleStageClick_(f)}),a.on("keydown",function(f){return a.handleKeyDown(f)}),a.on("languagechange",function(f){return a.handleLanguagechange(f)}),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a.on("ready",function(){a.audioPosterMode(a.options_.audioPosterMode),a.audioOnlyMode(a.options_.audioOnlyMode)}),a}var t=e.prototype;return t.dispose=function(){var i=this;this.trigger("dispose"),this.off("dispose"),_i(ue,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),_i(ue,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),e.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),F4(this),ki.names.forEach(function(n){var a=ki[n],o=i[a.getterName]();o&&o.off&&o.off()}),s.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},t.createEl=function(){var i=this.tag,n,a=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),o=this.tag.tagName.toLowerCase()==="video-js";a?n=this.el_=i.parentNode:o||(n=this.el_=s.prototype.createEl.call(this,"div"));var l=_n(i);if(o){for(n=this.el_=i,i=this.tag=ue.createElement("video");n.children.length;)i.appendChild(n.firstChild);Qs(n,"video-js")||kn(n,"video-js"),n.appendChild(i),a=this.playerElIngest_=n,Object.keys(n).forEach(function(C){try{i[C]=n[C]}catch{}})}if(i.setAttribute("tabindex","-1"),l.tabindex="-1",(lu||Dn&&B1)&&(i.setAttribute("role","application"),l.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in l&&delete l.width,"height"in l&&delete l.height,Object.getOwnPropertyNames(l).forEach(function(C){o&&C==="class"||n.setAttribute(C,l[C]),o&&i.setAttribute(C,l[C])}),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",i.player=n.player=this,this.addClass("vjs-paused"),D.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=J1("vjs-styles-dimensions");var u=os(".vjs-styles-defaults"),c=os("head");c.insertBefore(this.styleEl_,u?u.nextSibling:c.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var h=i.getElementsByTagName("a"),f=0;f<h.length;f++){var g=h.item(f);kn(g,"vjs-hidden"),g.setAttribute("hidden","hidden")}return i.initNetworkState_=i.networkState,i.parentNode&&!a&&i.parentNode.insertBefore(n,i),um(i,n),this.children_.unshift(i),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=n,n},t.crossOrigin=function(i){if(!i)return this.techGet_("crossOrigin");if(i!=="anonymous"&&i!=="use-credentials"){Qe.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+i+'"');return}this.techCall_("setCrossOrigin",i)},t.width=function(i){return this.dimension("width",i)},t.height=function(i){return this.dimension("height",i)},t.dimension=function(i,n){var a=i+"_";if(n===void 0)return this[a]||0;if(n===""||n==="auto"){this[a]=void 0,this.updateStyleEl_();return}var o=parseFloat(n);if(isNaN(o)){Qe.error('Improper value "'+n+'" supplied for for '+i);return}this[a]=o,this.updateStyleEl_()},t.fluid=function(i){var n=this;if(i===void 0)return!!this.fluid_;this.fluid_=!!i,xn(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),i?(this.addClass("vjs-fluid"),this.fill(!1),u4(this,function(){n.on(["playerreset","resize"],n.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()},t.fill=function(i){if(i===void 0)return!!this.fill_;this.fill_=!!i,i?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},t.aspectRatio=function(i){if(i===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(i))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=i,this.fluid(!0),this.updateStyleEl_()},t.updateStyleEl_=function(){if(D.VIDEOJS_NO_DYNAMIC_STYLE===!0){var i=typeof this.width_=="number"?this.width_:this.options_.width,n=typeof this.height_=="number"?this.height_:this.options_.height,a=this.tech_&&this.tech_.el();a&&(i>=0&&(a.width=i),n>=0&&(a.height=n));return}var o,l,u,c;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?u=this.aspectRatio_:this.videoWidth()>0?u=this.videoWidth()+":"+this.videoHeight():u="16:9";var h=u.split(":"),f=h[1]/h[0];this.width_!==void 0?o=this.width_:this.height_!==void 0?o=this.height_/f:o=this.videoWidth()||300,this.height_!==void 0?l=this.height_:l=o*f,/^[^a-zA-Z]/.test(this.id())?c="dimensions-"+this.id():c=this.id()+"-dimensions",this.addClass(c),Z1(this.styleEl_,`
|
|
259
|
-
.`+c+` {
|
|
260
|
-
width: `+o+`px;
|
|
261
|
-
height: `+l+`px;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.`+c+`.vjs-fluid:not(.vjs-audio-only-mode) {
|
|
265
|
-
padding-top: `+f*100+`%;
|
|
266
|
-
}
|
|
267
|
-
`)},t.loadTech_=function(i,n){var a=this;this.tech_&&this.unloadTech_();var o=Gt(i),l=i.charAt(0).toLowerCase()+i.slice(1);o!=="Html5"&&this.tag&&(Et.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=o,this.isReady_=!1;var u=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(u=!1);var c={source:n,autoplay:u,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+l+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};ki.names.forEach(function(f){var g=ki[f];c[g.getterName]=a[g.privateName]}),Ht(c,this.options_[o]),Ht(c,this.options_[l]),Ht(c,this.options_[i.toLowerCase()]),this.tag&&(c.tag=this.tag),n&&n.src===this.cache_.src&&this.cache_.currentTime>0&&(c.startTime=this.cache_.currentTime);var h=Et.getTech(i);if(!h)throw new Error("No Tech named '"+o+"' exists! '"+o+"' should be registered using videojs.registerTech()'");this.tech_=new h(c),this.tech_.ready(It(this,this.handleTechReady_),!0),iT.jsonToTextTracks(this.textTracksJson_||[],this.tech_),ME.forEach(function(f){a.on(a.tech_,f,function(g){return a["handleTech"+Gt(f)+"_"](g)})}),Object.keys(tp).forEach(function(f){a.on(a.tech_,f,function(g){if(a.tech_.playbackRate()===0&&a.tech_.seeking()){a.queuedCallbacks_.push({callback:a["handleTech"+tp[f]+"_"].bind(a),event:g});return}a["handleTech"+tp[f]+"_"](g)})}),this.on(this.tech_,"loadstart",function(f){return a.handleTechLoadStart_(f)}),this.on(this.tech_,"sourceset",function(f){return a.handleTechSourceset_(f)}),this.on(this.tech_,"waiting",function(f){return a.handleTechWaiting_(f)}),this.on(this.tech_,"ended",function(f){return a.handleTechEnded_(f)}),this.on(this.tech_,"seeking",function(f){return a.handleTechSeeking_(f)}),this.on(this.tech_,"play",function(f){return a.handleTechPlay_(f)}),this.on(this.tech_,"firstplay",function(f){return a.handleTechFirstPlay_(f)}),this.on(this.tech_,"pause",function(f){return a.handleTechPause_(f)}),this.on(this.tech_,"durationchange",function(f){return a.handleTechDurationChange_(f)}),this.on(this.tech_,"fullscreenchange",function(f,g){return a.handleTechFullscreenChange_(f,g)}),this.on(this.tech_,"fullscreenerror",function(f,g){return a.handleTechFullscreenError_(f,g)}),this.on(this.tech_,"enterpictureinpicture",function(f){return a.handleTechEnterPictureInPicture_(f)}),this.on(this.tech_,"leavepictureinpicture",function(f){return a.handleTechLeavePictureInPicture_(f)}),this.on(this.tech_,"error",function(f){return a.handleTechError_(f)}),this.on(this.tech_,"posterchange",function(f){return a.handleTechPosterChange_(f)}),this.on(this.tech_,"textdata",function(f){return a.handleTechTextData_(f)}),this.on(this.tech_,"ratechange",function(f){return a.handleTechRateChange_(f)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(o!=="Html5"||!this.tag)&&um(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.unloadTech_=function(){var i=this;ki.names.forEach(function(n){var a=ki[n];i[a.privateName]=i[a.getterName]()}),this.textTracksJson_=iT.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},t.tech=function(i){return i===void 0&&Qe.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
|
|
268
|
-
See https://github.com/videojs/video.js/issues/2617 for more info.
|
|
269
|
-
`),this.tech_},t.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},t.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},t.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},t.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())},t.manualAutoplay_=function(i){var n=this;if(!(!this.tech_||typeof i!="string")){var a=function(){var u=n.muted();n.muted(!0);var c=function(){n.muted(u)};n.playTerminatedQueue_.push(c);var h=n.play();if(Rl(h))return h.catch(function(f){throw c(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(f||""))})},o;if(i==="any"&&!this.muted()?(o=this.play(),Rl(o)&&(o=o.catch(a))):i==="muted"&&!this.muted()?o=a():o=this.play(),!!Rl(o))return o.then(function(){n.trigger({type:"autoplay-success",autoplay:i})}).catch(function(){n.trigger({type:"autoplay-failure",autoplay:i})})}},t.updateSourceCaches_=function(i){i===void 0&&(i="");var n=i,a="";typeof n!="string"&&(n=i.src,a=i.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],n&&!a&&(a=j4(this,n)),this.cache_.source=At({},i,{src:n,type:a});for(var o=this.cache_.sources.filter(function(g){return g.src&&g.src===n}),l=[],u=this.$$("source"),c=[],h=0;h<u.length;h++){var f=_n(u[h]);l.push(f),f.src&&f.src===n&&c.push(f.src)}c.length&&!o.length?this.cache_.sources=l:o.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=n},t.handleTechSourceset_=function(i){var n=this;if(!this.changingSrc_){var a=function(c){return n.updateSourceCaches_(c)},o=this.currentSource().src,l=i.src;o&&!/^blob:/.test(o)&&/^blob:/.test(l)&&(!this.lastSource_||this.lastSource_.tech!==l&&this.lastSource_.player!==o)&&(a=function(){}),a(l),i.src||this.tech_.any(["sourceset","loadstart"],function(u){if(u.type!=="sourceset"){var c=n.techGet("currentSrc");n.lastSource_.tech=c,n.updateSourceCaches_(c)}})}this.lastSource_={player:this.currentSource().src,tech:i.src},this.trigger({src:i.src,type:"sourceset"})},t.hasStarted=function(i){if(i===void 0)return this.hasStarted_;i!==this.hasStarted_&&(this.hasStarted_=i,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},t.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},t.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(function(i){return i.callback(i.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},t.handleTechWaiting_=function(){var i=this;this.addClass("vjs-waiting"),this.trigger("waiting");var n=this.currentTime(),a=function o(){n!==i.currentTime()&&(i.removeClass("vjs-waiting"),i.off("timeupdate",o))};this.on("timeupdate",a)},t.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},t.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},t.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},t.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},t.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},t.handleTechFirstPlay_=function(){this.options_.starttime&&(Qe.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},t.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},t.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},t.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},t.handleTechClick_=function(i){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,i):this.paused()?Qr(this.play()):this.pause())},t.handleTechDoubleClick_=function(i){if(this.controls_){var n=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(a){return a.contains(i.target)});n||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,i):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}},t.handleTechTap_=function(){this.userActive(!this.userActive())},t.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},t.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},t.handleTechTouchEnd_=function(i){i.cancelable&&i.preventDefault()},t.handleStageClick_=function(){this.reportUserActivity()},t.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},t.documentFullscreenChange_=function(i){var n=i.target.player;if(!(n&&n!==this)){var a=this.el(),o=ue[this.fsApi_.fullscreenElement]===a;!o&&a.matches?o=a.matches(":"+this.fsApi_.fullscreen):!o&&a.msMatchesSelector&&(o=a.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(o)}},t.handleTechFullscreenChange_=function(i,n){var a=this;n&&(n.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){a.removeClass("vjs-ios-native-fs")})),this.isFullscreen(n.isFullscreen))},t.handleTechFullscreenError_=function(i,n){this.trigger("fullscreenerror",n)},t.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},t.handleTechEnterPictureInPicture_=function(i){this.isInPictureInPicture(!0)},t.handleTechLeavePictureInPicture_=function(i){this.isInPictureInPicture(!1)},t.handleTechError_=function(){var i=this.tech_.error();this.error(i)},t.handleTechTextData_=function(){var i=null;arguments.length>1&&(i=arguments[1]),this.trigger("textdata",i)},t.getCache=function(){return this.cache_},t.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},t.techCall_=function(i,n){this.ready(function(){if(i in R4)return O4(this.middleware_,this.tech_,i,n);if(i in lT)return oT(this.middleware_,this.tech_,i,n);try{this.tech_&&this.tech_[i](n)}catch(a){throw Qe(a),a}},!0)},t.techGet_=function(i){if(!(!this.tech_||!this.tech_.isReady_)){if(i in M4)return L4(this.middleware_,this.tech_,i);if(i in lT)return oT(this.middleware_,this.tech_,i);try{return this.tech_[i]()}catch(n){throw this.tech_[i]===void 0?(Qe("Video.js: "+i+" method not defined for "+this.techName_+" playback technology.",n),n):n.name==="TypeError"?(Qe("Video.js: "+i+" unavailable on "+this.techName_+" playback technology element.",n),this.tech_.isReady_=!1,n):(Qe(n),n)}}},t.play=function(){var i=this,n=this.options_.Promise||D.Promise;return n?new n(function(a){i.play_(a)}):this.play_()},t.play_=function(i){var n=this;i===void 0&&(i=Qr),this.playCallbacks_.push(i);var a=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),o=!!(Qh||Li);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!a){this.waitToPlay_=function(c){n.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!a&&o&&this.load();return}var l=this.techGet_("play"),u=o&&this.hasClass("vjs-ended");u&&this.resetProgressBar_(),l===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(l)},t.runPlayTerminatedQueue_=function(){var i=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],i.forEach(function(n){n()})},t.runPlayCallbacks_=function(i){var n=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],n.forEach(function(a){a(i)})},t.pause=function(){this.techCall_("pause")},t.paused=function(){return this.techGet_("paused")!==!1},t.played=function(){return this.techGet_("played")||Js(0,0)},t.scrubbing=function(i){if(typeof i>"u")return this.scrubbing_;this.scrubbing_=!!i,this.techCall_("setScrubbing",this.scrubbing_),i?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},t.currentTime=function(i){if(typeof i<"u"){if(i<0&&(i=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=i,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",i),this.cache_.initTime=0;return}return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime},t.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},t.duration=function(i){if(i===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;i=parseFloat(i),i<0&&(i=1/0),i!==this.cache_.duration&&(this.cache_.duration=i,i===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(i)||this.trigger("durationchange"))},t.remainingTime=function(){return this.duration()-this.currentTime()},t.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},t.buffered=function(){var i=this.techGet_("buffered");return(!i||!i.length)&&(i=Js(0,0)),i},t.bufferedPercent=function(){return sE(this.buffered(),this.duration())},t.bufferedEnd=function(){var i=this.buffered(),n=this.duration(),a=i.end(i.length-1);return a>n&&(a=n),a},t.volume=function(i){var n;if(i!==void 0){n=Math.max(0,Math.min(1,parseFloat(i))),this.cache_.volume=n,this.techCall_("setVolume",n),n>0&&this.lastVolume_(n);return}return n=parseFloat(this.techGet_("volume")),isNaN(n)?1:n},t.muted=function(i){if(i!==void 0){this.techCall_("setMuted",i);return}return this.techGet_("muted")||!1},t.defaultMuted=function(i){return i!==void 0?this.techCall_("setDefaultMuted",i):this.techGet_("defaultMuted")||!1},t.lastVolume_=function(i){if(i!==void 0&&i!==0){this.cache_.lastVolume=i;return}return this.cache_.lastVolume},t.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},t.isFullscreen=function(i){if(i!==void 0){var n=this.isFullscreen_;this.isFullscreen_=!!i,this.isFullscreen_!==n&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_},t.requestFullscreen=function(i){var n=this.options_.Promise||D.Promise;if(n){var a=this;return new n(function(o,l){function u(){a.off("fullscreenerror",h),a.off("fullscreenchange",c)}function c(){u(),o()}function h(g,C){u(),l(C)}a.one("fullscreenchange",c),a.one("fullscreenerror",h);var f=a.requestFullscreenHelper_(i);f&&(f.then(u,u),f.then(o,l))})}return this.requestFullscreenHelper_()},t.requestFullscreenHelper_=function(i){var n=this,a;if(this.fsApi_.prefixed||(a=this.options_.fullscreen&&this.options_.fullscreen.options||{},i!==void 0&&(a=i)),this.fsApi_.requestFullscreen){var o=this.el_[this.fsApi_.requestFullscreen](a);return o&&o.then(function(){return n.isFullscreen(!0)},function(){return n.isFullscreen(!1)}),o}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},t.exitFullscreen=function(){var i=this.options_.Promise||D.Promise;if(i){var n=this;return new i(function(a,o){function l(){n.off("fullscreenerror",c),n.off("fullscreenchange",u)}function u(){l(),a()}function c(f,g){l(),o(g)}n.one("fullscreenchange",u),n.one("fullscreenerror",c);var h=n.exitFullscreenHelper_();h&&(h.then(l,l),h.then(a,o))})}return this.exitFullscreenHelper_()},t.exitFullscreenHelper_=function(){var i=this;if(this.fsApi_.requestFullscreen){var n=ue[this.fsApi_.exitFullscreen]();return n&&Qr(n.then(function(){return i.isFullscreen(!1)})),n}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},t.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=ue.documentElement.style.overflow,rr(ue,"keydown",this.boundFullWindowOnEscKey_),ue.documentElement.style.overflow="hidden",kn(ue.body,"vjs-full-window"),this.trigger("enterFullWindow")},t.fullWindowOnEscKey=function(i){Ge.isEventKey(i,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},t.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,_i(ue,"keydown",this.boundFullWindowOnEscKey_),ue.documentElement.style.overflow=this.docOrigOverflow,uu(ue.body,"vjs-full-window"),this.trigger("exitFullWindow")},t.disablePictureInPicture=function(i){if(i===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",i),this.options_.disablePictureInPicture=i,this.trigger("disablepictureinpicturechanged")},t.isInPictureInPicture=function(i){if(i!==void 0){this.isInPictureInPicture_=!!i,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_},t.requestPictureInPicture=function(){if("pictureInPictureEnabled"in ue&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture")},t.exitPictureInPicture=function(){if("pictureInPictureEnabled"in ue)return ue.exitPictureInPicture()},t.handleKeyDown=function(i){var n=this.options_.userActions;if(!(!n||!n.hotkeys)){var a=function(l){var u=l.tagName.toLowerCase();if(l.isContentEditable)return!0;var c=["button","checkbox","hidden","radio","reset","submit"];if(u==="input")return c.indexOf(l.type)===-1;var h=["textarea"];return h.indexOf(u)!==-1};a(this.el_.ownerDocument.activeElement)||(typeof n.hotkeys=="function"?n.hotkeys.call(this,i):this.handleHotkeys(i))}},t.handleHotkeys=function(i){var n=this.options_.userActions?this.options_.userActions.hotkeys:{},a=n.fullscreenKey,o=a===void 0?function(p){return Ge.isEventKey(p,"f")}:a,l=n.muteKey,u=l===void 0?function(p){return Ge.isEventKey(p,"m")}:l,c=n.playPauseKey,h=c===void 0?function(p){return Ge.isEventKey(p,"k")||Ge.isEventKey(p,"Space")}:c;if(o.call(this,i)){i.preventDefault(),i.stopPropagation();var f=be.getComponent("FullscreenToggle");ue[this.fsApi_.fullscreenEnabled]!==!1&&f.prototype.handleClick.call(this,i)}else if(u.call(this,i)){i.preventDefault(),i.stopPropagation();var g=be.getComponent("MuteToggle");g.prototype.handleClick.call(this,i)}else if(h.call(this,i)){i.preventDefault(),i.stopPropagation();var C=be.getComponent("PlayToggle");C.prototype.handleClick.call(this,i)}},t.canPlayType=function(i){for(var n,a=0,o=this.options_.techOrder;a<o.length;a++){var l=o[a],u=Et.getTech(l);if(u||(u=be.getComponent(l)),!u){Qe.error('The "'+l+'" tech is undefined. Skipped browser support check for that tech.');continue}if(u.isSupported()&&(n=u.canPlayType(i),n))return n}return""},t.selectSource=function(i){var n=this,a=this.options_.techOrder.map(function(h){return[h,Et.getTech(h)]}).filter(function(h){var f=h[0],g=h[1];return g?g.isSupported():(Qe.error('The "'+f+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),o=function(f,g,C){var p;return f.some(function(T){return g.some(function(A){if(p=C(T,A),p)return!0})}),p},l,u=function(f){return function(g,C){return f(C,g)}},c=function(f,g){var C=f[0],p=f[1];if(p.canPlaySource(g,n.options_[C.toLowerCase()]))return{source:g,tech:C}};return this.options_.sourceOrder?l=o(i,a,u(c)):l=o(a,i,c),l||!1},t.handleSrc_=function(i,n){var a=this;if(typeof i>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var o=V4(i);if(!o.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,n||(this.cache_.sources=o),this.updateSourceCaches_(o[0]),D4(this,o[0],function(c,h){a.middleware_=h,n||(a.cache_.sources=o),a.updateSourceCaches_(c);var f=a.src_(c);if(f){if(o.length>1)return a.handleSrc_(o.slice(1));a.changingSrc_=!1,a.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),a.triggerReady();return}N4(h,a.tech_)}),this.options_.retryOnError&&o.length>1){var l=function(){a.error(null),a.handleSrc_(o.slice(1),!0)},u=function(){a.off("error",l)};this.one("error",l),this.one("playing",u),this.resetRetryOnError_=function(){a.off("error",l),a.off("playing",u)}}},t.src=function(i){return this.handleSrc_(i,!1)},t.src_=function(i){var n=this,a=this.selectSource([i]);return a?d4(a.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",i):this.techCall_("src",i.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(a.tech,a.source),this.tech_.ready(function(){n.changingSrc_=!1}),!1):!0},t.load=function(){this.techCall_("load")},t.reset=function(){var i=this,n=this.options_.Promise||D.Promise;if(this.paused()||!n)this.doReset_();else{var a=this.play();Qr(a.then(function(){return i.doReset_()}))}},t.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),xn(this)&&this.trigger("playerreset")},t.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},t.resetProgressBar_=function(){this.currentTime(0);var i=this.controlBar||{},n=i.durationDisplay,a=i.remainingTimeDisplay;n&&n.updateContent(),a&&a.updateContent()},t.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},t.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},t.currentSources=function(){var i=this.currentSource(),n=[];return Object.keys(i).length!==0&&n.push(i),this.cache_.sources||n},t.currentSource=function(){return this.cache_.source||{}},t.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},t.currentType=function(){return this.currentSource()&&this.currentSource().type||""},t.preload=function(i){if(i!==void 0){this.techCall_("setPreload",i),this.options_.preload=i;return}return this.techGet_("preload")},t.autoplay=function(i){if(i===void 0)return this.options_.autoplay||!1;var n;typeof i=="string"&&/(any|play|muted)/.test(i)||i===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=i,this.manualAutoplay_(typeof i=="string"?i:"play"),n=!1):i?this.options_.autoplay=!0:this.options_.autoplay=!1,n=typeof n>"u"?this.options_.autoplay:n,this.tech_&&this.techCall_("setAutoplay",n)},t.playsinline=function(i){return i!==void 0?(this.techCall_("setPlaysinline",i),this.options_.playsinline=i,this):this.techGet_("playsinline")},t.loop=function(i){if(i!==void 0){this.techCall_("setLoop",i),this.options_.loop=i;return}return this.techGet_("loop")},t.poster=function(i){if(i===void 0)return this.poster_;i||(i=""),i!==this.poster_&&(this.poster_=i,this.techCall_("setPoster",i),this.isPosterFromTech_=!1,this.trigger("posterchange"))},t.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var i=this.tech_.poster()||"";i!==this.poster_&&(this.poster_=i,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},t.controls=function(i){if(i===void 0)return!!this.controls_;i=!!i,this.controls_!==i&&(this.controls_=i,this.usingNativeControls()&&this.techCall_("setControls",i),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},t.usingNativeControls=function(i){if(i===void 0)return!!this.usingNativeControls_;i=!!i,this.usingNativeControls_!==i&&(this.usingNativeControls_=i,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},t.error=function(i){var n=this;if(i===void 0)return this.error_||null;if(as("beforeerror").forEach(function(o){var l=o(n,i);if(!(An(l)&&!Array.isArray(l)||typeof l=="string"||typeof l=="number"||l===null)){n.log.error("please return a value that MediaError expects in beforeerror hooks");return}i=l}),this.options_.suppressNotSupportedError&&i&&i.code===4){var a=function(){this.error(i)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],a),this.one("loadstart",function(){this.off(["click","touchstart"],a)});return}if(i===null){this.error_=i,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new Di(i),this.addClass("vjs-error"),Qe.error("(CODE:"+this.error_.code+" "+Di.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),as("error").forEach(function(o){return o(n,n.error_)})},t.reportUserActivity=function(i){this.userActivity_=!0},t.userActive=function(i){if(i===void 0)return this.userActive_;if(i=!!i,i!==this.userActive_){if(this.userActive_=i,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(n){n.stopPropagation(),n.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},t.listenForUserActivity_=function(){var i,n,a,o=It(this,this.reportUserActivity),l=function(C){(C.screenX!==n||C.screenY!==a)&&(n=C.screenX,a=C.screenY,o())},u=function(){o(),this.clearInterval(i),i=this.setInterval(o,250)},c=function(C){o(),this.clearInterval(i)};this.on("mousedown",u),this.on("mousemove",l),this.on("mouseup",c),this.on("mouseleave",c);var h=this.getChild("controlBar");h&&!Li&&!Pn&&(h.on("mouseenter",function(g){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),h.on("mouseleave",function(g){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",o),this.on("keyup",o);var f;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(f);var g=this.options_.inactivityTimeout;g<=0||(f=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},g))}},250)},t.playbackRate=function(i){if(i!==void 0){this.techCall_("setPlaybackRate",i);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1},t.defaultPlaybackRate=function(i){return i!==void 0?this.techCall_("setDefaultPlaybackRate",i):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},t.isAudio=function(i){if(i!==void 0){this.isAudio_=!!i;return}return!!this.isAudio_},t.enableAudioOnlyUI_=function(){var i=this;this.addClass("vjs-audio-only-mode");var n=this.children(),a=this.getChild("ControlBar"),o=a&&a.currentHeight();n.forEach(function(l){l!==a&&l.el_&&!l.hasClass("vjs-hidden")&&(l.hide(),i.audioOnlyCache_.hiddenChildren.push(l))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(o),this.trigger("audioonlymodechange")},t.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(i){return i.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},t.audioOnlyMode=function(i){var n=this;if(typeof i!="boolean"||i===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=i;var a=this.options_.Promise||D.Promise;if(a){if(i){var o=[];return this.isInPictureInPicture()&&o.push(this.exitPictureInPicture()),this.isFullscreen()&&o.push(this.exitFullscreen()),this.audioPosterMode()&&o.push(this.audioPosterMode(!1)),a.all(o).then(function(){return n.enableAudioOnlyUI_()})}return a.resolve().then(function(){return n.disableAudioOnlyUI_()})}i?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},t.enablePosterModeUI_=function(){var i=this.tech_&&this.tech_;i.hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},t.disablePosterModeUI_=function(){var i=this.tech_&&this.tech_;i.show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},t.audioPosterMode=function(i){var n=this;if(typeof i!="boolean"||i===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=i;var a=this.options_.Promise||D.Promise;if(a){if(i){if(this.audioOnlyMode()){var o=this.audioOnlyMode(!1);return o.then(function(){n.enablePosterModeUI_()})}return a.resolve().then(function(){n.enablePosterModeUI_()})}return a.resolve().then(function(){n.disablePosterModeUI_()})}if(i){this.audioOnlyMode()&&this.audioOnlyMode(!1),this.enablePosterModeUI_();return}this.disablePosterModeUI_()},t.addTextTrack=function(i,n,a){if(this.tech_)return this.tech_.addTextTrack(i,n,a)},t.addRemoteTextTrack=function(i,n){if(this.tech_)return this.tech_.addRemoteTextTrack(i,n)},t.removeRemoteTextTrack=function(i){i===void 0&&(i={});var n=i,a=n.track;if(a||(a=i),this.tech_)return this.tech_.removeRemoteTextTrack(a)},t.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},t.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},t.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},t.language=function(i){if(i===void 0)return this.language_;this.language_!==String(i).toLowerCase()&&(this.language_=String(i).toLowerCase(),xn(this)&&this.trigger("languagechange"))},t.languages=function(){return At(e.prototype.options_.languages,this.languages_)},t.toJSON=function(){var i=At(this.options_),n=i.tracks;i.tracks=[];for(var a=0;a<n.length;a++){var o=n[a];o=At(o),o.player=void 0,i.tracks[a]=o}return i},t.createModal=function(i,n){var a=this;n=n||{},n.content=i||"";var o=new jo(this,n);return this.addChild(o),o.on("dispose",function(){a.removeChild(o)}),o.open(),o},t.updateCurrentBreakpoint_=function(){if(this.responsive())for(var i=this.currentBreakpoint(),n=this.currentWidth(),a=0;a<vm.length;a++){var o=vm[a],l=this.breakpoints_[o];if(n<=l){if(i===o)return;i&&this.removeClass(kc[i]),this.addClass(kc[o]),this.breakpoint_=o;break}}},t.removeCurrentBreakpoint_=function(){var i=this.currentBreakpointClass();this.breakpoint_="",i&&this.removeClass(i)},t.breakpoints=function(i){return i===void 0?Ht(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Ht({},y3,i),this.updateCurrentBreakpoint_(),Ht(this.breakpoints_))},t.responsive=function(i){if(i===void 0)return this.responsive_;i=!!i;var n=this.responsive_;if(i!==n)return this.responsive_=i,i?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),i},t.currentBreakpoint=function(){return this.breakpoint_},t.currentBreakpointClass=function(){return kc[this.breakpoint_]||""},t.loadMedia=function(i,n){var a=this;if(!(!i||typeof i!="object")){this.reset(),this.cache_.media=At(i);var o=this.cache_.media,l=o.artwork,u=o.poster,c=o.src,h=o.textTracks;!l&&u&&(this.cache_.media.artwork=[{src:u,type:nh(u)}]),c&&this.src(c),u&&this.poster(u),Array.isArray(h)&&h.forEach(function(f){return a.addRemoteTextTrack(f,!1)}),this.ready(n)}},t.getMedia=function(){if(!this.cache_.media){var i=this.poster(),n=this.currentSources(),a=Array.prototype.map.call(this.remoteTextTracks(),function(l){return{kind:l.kind,label:l.label,language:l.language,src:l.src}}),o={src:n,textTracks:a};return i&&(o.poster=i,o.artwork=[{src:o.poster,type:nh(o.poster)}]),o}return At(this.cache_.media)},e.getTagSettings=function(i){var n={sources:[],tracks:[]},a=_n(i),o=a["data-setup"];if(Qs(i,"vjs-fill")&&(a.fill=!0),Qs(i,"vjs-fluid")&&(a.fluid=!0),o!==null){var l=uM(o||"{}"),u=l[0],c=l[1];u&&Qe.error(u),Ht(a,c)}if(Ht(n,a),i.hasChildNodes())for(var h=i.childNodes,f=0,g=h.length;f<g;f++){var C=h[f],p=C.nodeName.toLowerCase();p==="source"?n.sources.push(_n(C)):p==="track"&&n.tracks.push(_n(C))}return n},t.flexNotSupported_=function(){var i=ue.createElement("i");return!("flexBasis"in i.style||"webkitFlexBasis"in i.style||"mozFlexBasis"in i.style||"msFlexBasis"in i.style||"msFlexOrder"in i.style)},t.debug=function(i){if(i===void 0)return this.debugEnabled_;i?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)},t.playbackRates=function(i){if(i===void 0)return this.cache_.playbackRates;Array.isArray(i)&&i.every(function(n){return typeof n=="number"})&&(this.cache_.playbackRates=i,this.trigger("playbackrateschange"))},e})(be);ki.names.forEach(function(s){var e=ki[s];Yt.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Yt.prototype.crossorigin=Yt.prototype.crossOrigin;Yt.players={};var fl=D.navigator;Yt.prototype.options_={techOrder:Et.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:fl&&(fl.languages&&fl.languages[0]||fl.userLanguage||fl.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1};["ended","seeking","seekable","networkState","readyState"].forEach(function(s){Yt.prototype[s]=function(){return this.techGet_(s)}});ME.forEach(function(s){Yt.prototype["handleTech"+Gt(s)+"_"]=function(){return this.trigger(s)}});be.registerComponent("Player",Yt);var oh="plugin",ao="activePlugins_",qa={},lh=function(e){return qa.hasOwnProperty(e)},xc=function(e){return lh(e)?qa[e]:void 0},RE=function(e,t){e[ao]=e[ao]||{},e[ao][t]=!0},uh=function(e,t,r){var i=(r?"before":"")+"pluginsetup";e.trigger(i,t),e.trigger(i+":"+t.name,t)},_3=function(e,t){var r=function(){uh(this,{name:e,plugin:t,instance:null},!0);var n=t.apply(this,arguments);return RE(this,e),uh(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach(function(i){r[i]=t[i]}),r},ST=function(e,t){return t.prototype.name=e,function(){uh(this,{name:e,plugin:t,instance:null},!0);for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];var a=p1(t,[this].concat(i));return this[e]=function(){return a},uh(this,a.getEventHash()),a}},an=(function(){function s(t){if(this.constructor===s)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,this.log||(this.log=this.player.log.createLogger(this.name)),jg(this),delete this.trigger,nE(this,this.constructor.defaultState),RE(t,this.name),this.dispose=this.dispose.bind(this),t.on("dispose",this.dispose)}var e=s.prototype;return e.version=function(){return this.constructor.VERSION},e.getEventHash=function(r){return r===void 0&&(r={}),r.name=this.name,r.plugin=this.constructor,r.instance=this,r},e.trigger=function(r,i){return i===void 0&&(i={}),$o(this.eventBusEl_,r,this.getEventHash(i))},e.handleStateChanged=function(r){},e.dispose=function(){var r=this.name,i=this.player;this.trigger("dispose"),this.off(),i.off("dispose",this.dispose),i[ao][r]=!1,this.player=this.state=null,i[r]=ST(r,qa[r])},s.isBasic=function(r){var i=typeof r=="string"?xc(r):r;return typeof i=="function"&&!s.prototype.isPrototypeOf(i.prototype)},s.registerPlugin=function(r,i){if(typeof r!="string")throw new Error('Illegal plugin name, "'+r+'", must be a string, was '+typeof r+".");if(lh(r))Qe.warn('A plugin named "'+r+'" already exists. You may want to avoid re-registering plugins!');else if(Yt.prototype.hasOwnProperty(r))throw new Error('Illegal plugin name, "'+r+'", cannot share a name with an existing player method!');if(typeof i!="function")throw new Error('Illegal plugin for "'+r+'", must be a function, was '+typeof i+".");return qa[r]=i,r!==oh&&(s.isBasic(i)?Yt.prototype[r]=_3(r,i):Yt.prototype[r]=ST(r,i)),i},s.deregisterPlugin=function(r){if(r===oh)throw new Error("Cannot de-register base plugin.");lh(r)&&(delete qa[r],delete Yt.prototype[r])},s.getPlugins=function(r){r===void 0&&(r=Object.keys(qa));var i;return r.forEach(function(n){var a=xc(n);a&&(i=i||{},i[n]=a)}),i},s.getPluginVersion=function(r){var i=xc(r);return i&&i.VERSION||""},s})();an.getPlugin=xc;an.BASE_PLUGIN_NAME=oh;an.registerPlugin(oh,an);Yt.prototype.usingPlugin=function(s){return!!this[ao]&&this[ao][s]===!0};Yt.prototype.hasPlugin=function(s){return!!lh(s)};var CT=!1,T3=function(e,t){t===void 0&&(t={}),CT||(Qe.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0"),CT=!0);var r=function(){e.apply(this,arguments)},i={};typeof t=="object"?(t.constructor!==Object.prototype.constructor&&(r=t.constructor),i=t):typeof t=="function"&&(r=t),nx(r,e),e&&(r.super_=e);for(var n in i)i.hasOwnProperty(n)&&(r.prototype[n]=i[n]);return r},BE=function(e){return e.indexOf("#")===0?e.slice(1):e};function ne(s,e,t){var r=ne.getPlayer(s);if(r)return e&&Qe.warn('Player "'+s+'" is already initialised. Options will not be applied.'),t&&r.ready(t),r;var i=typeof s=="string"?os("#"+BE(s)):s;if(!Uo(i))throw new TypeError("The element or ID supplied is not valid. (videojs)");(!i.ownerDocument.defaultView||!i.ownerDocument.body.contains(i))&&Qe.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(i.parentNode&&i.parentNode.hasAttribute("data-vjs-player")?i.parentNode:i).cloneNode(!0)),as("beforesetup").forEach(function(a){var o=a(i,At(e));if(!An(o)||Array.isArray(o)){Qe.error("please return an object in beforesetup hooks");return}e=At(e,o)});var n=be.getComponent("Player");return r=new n(i,e,t),as("setup").forEach(function(a){return a(r)}),r}ne.hooks_=Sn;ne.hooks=as;ne.hook=GR;ne.hookOnce=KR;ne.removeHook=I1;if(D.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Fo()){var hc=os(".vjs-styles-defaults");if(!hc){hc=J1("vjs-styles-defaults");var ip=os("head");ip&&ip.insertBefore(hc,ip.firstChild),Z1(hc,`
|
|
270
|
-
.video-js {
|
|
271
|
-
width: 300px;
|
|
272
|
-
height: 150px;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.vjs-fluid:not(.vjs-audio-only-mode) {
|
|
276
|
-
padding-top: 56.25%
|
|
277
|
-
}
|
|
278
|
-
`)}}hm(1,ne);ne.VERSION=A1;ne.options=Yt.prototype.options_;ne.getPlayers=function(){return Yt.players};ne.getPlayer=function(s){var e=Yt.players,t;if(typeof s=="string"){var r=BE(s),i=e[r];if(i)return i;t=os("#"+r)}else t=s;if(Uo(t)){var n=t,a=n.player,o=n.playerId;if(a||e[o])return a||e[o]}};ne.getAllPlayers=function(){return Object.keys(Yt.players).map(function(s){return Yt.players[s]}).filter(Boolean)};ne.players=Yt.players;ne.getComponent=be.getComponent;ne.registerComponent=function(s,e){Et.isTech(e)&&Qe.warn("The "+s+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),be.registerComponent.call(be,s,e)};ne.getTech=Et.getTech;ne.registerTech=Et.registerTech;ne.use=P4;Object.defineProperty(ne,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(ne.middleware,"TERMINATOR",{value:rh,writeable:!1,enumerable:!0});ne.browser=e4;ne.TOUCH_ENABLED=So;ne.extend=T3;ne.mergeOptions=At;ne.bind=It;ne.registerPlugin=an.registerPlugin;ne.deregisterPlugin=an.deregisterPlugin;ne.plugin=function(s,e){return Qe.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),an.registerPlugin(s,e)};ne.getPlugins=an.getPlugins;ne.getPlugin=an.getPlugin;ne.getPluginVersion=an.getPluginVersion;ne.addLanguage=function(s,e){var t;return s=(""+s).toLowerCase(),ne.options.languages=At(ne.options.languages,(t={},t[s]=e,t)),ne.options.languages[s]};ne.log=Qe;ne.createLogger=D1;ne.createTimeRange=ne.createTimeRanges=Js;ne.formatTime=xo;ne.setFormatTime=X4;ne.resetFormatTime=Y4;ne.parseUrl=Hg;ne.isCrossOrigin=rd;ne.EventTarget=oi;ne.on=rr;ne.one=td;ne.off=_i;ne.trigger=$o;ne.xhr=d1;ne.TextTrack=cu;ne.AudioTrack=lE;ne.VideoTrack=uE;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(s){ne[s]=function(){return Qe.warn("videojs."+s+"() is deprecated; use videojs.dom."+s+"() instead"),Y1[s].apply(null,arguments)}});ne.computedStyle=Kl;ne.dom=Y1;ne.url=k4;ne.defineLazyProperty=lv;ne.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});/*! @name @videojs/http-streaming @version 2.16.3 @license Apache-2.0 */var xr=Gh,ch=function(e,t,r){return e&&r&&r.responseURL&&t!==r.responseURL?r.responseURL:t},Or=function(e){return ne.log.debug?ne.log.debug.bind(ne,"VHS:",e+" >"):function(){}},ls=1/30,Jr=ls*3,FE=function(e,t){var r=[],i;if(e&&e.length)for(i=0;i<e.length;i++)t(e.start(i),e.end(i))&&r.push([e.start(i),e.end(i)]);return ne.createTimeRanges(r)},za=function(e,t){return FE(e,function(r,i){return r-Jr<=t&&i+Jr>=t})},dc=function(e,t){return FE(e,function(r){return r-ls>=t})},b3=function(e){if(e.length<2)return ne.createTimeRanges();for(var t=[],r=1;r<e.length;r++){var i=e.end(r-1),n=e.start(r);t.push([i,n])}return ne.createTimeRanges(t)},S3=function(e,t){var r=null,i=null,n=0,a=[],o=[];if(!e||!e.length||!t||!t.length)return ne.createTimeRange();for(var l=e.length;l--;)a.push({time:e.start(l),type:"start"}),a.push({time:e.end(l),type:"end"});for(l=t.length;l--;)a.push({time:t.start(l),type:"start"}),a.push({time:t.end(l),type:"end"});for(a.sort(function(u,c){return u.time-c.time}),l=0;l<a.length;l++)a[l].type==="start"?(n++,n===2&&(r=a[l].time)):a[l].type==="end"&&(n--,n===1&&(i=a[l].time)),r!==null&&i!==null&&(o.push([r,i]),r=null,i=null);return ne.createTimeRanges(o)},UE=function(e){var t=[];if(!e||!e.length)return"";for(var r=0;r<e.length;r++)t.push(e.start(r)+" => "+e.end(r));return t.join(", ")},C3=function(e,t,r){r===void 0&&(r=1);var i=e.length?e.end(e.length-1):0;return(i-t)/r},$s=function(e){for(var t=[],r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t},E3=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e||e.length!==t.length)return!0;for(var r=0;r<e.length;r++)if(e.start(r)!==t.start(r)||e.end(r)!==t.end(r))return!0;return!1},ET=function(e){if(!(!e||!e.length||!e.end))return e.end(e.length-1)},uv=function(e,t){var r=0;if(!e||!e.length)return r;for(var i=0;i<e.length;i++){var n=e.start(i),a=e.end(i);if(!(t>a)){if(t>n&&t<=a){r+=a-t;continue}r+=a-n}}return r},wT=ne.createTimeRange,cv=function(e,t){if(!t.preload)return t.duration;var r=0;return(t.parts||[]).forEach(function(i){r+=i.duration}),(t.preloadHints||[]).forEach(function(i){i.type==="PART"&&(r+=e.partTargetDuration)}),r},ym=function(e){return(e.segments||[]).reduce(function(t,r,i){return r.parts?r.parts.forEach(function(n,a){t.push({duration:n.duration,segmentIndex:i,partIndex:a,part:n,segment:r})}):t.push({duration:r.duration,segmentIndex:i,partIndex:null,segment:r,part:null}),t},[])},$E=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},jE=function(e){var t=e.preloadSegment;if(t){var r=t.parts,i=t.preloadHints,n=(i||[]).reduce(function(a,o){return a+(o.type==="PART"?1:0)},0);return n+=r&&r.length?r.length:0,n}},VE=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var r=$E(t).length>0;return r&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:r&&t.partTargetDuration?t.partTargetDuration*3:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?t.targetDuration*3:0},w3=function(e,t){var r=0,i=t-e.mediaSequence,n=e.segments[i];if(n){if(typeof n.start<"u")return{result:n.start,precise:!0};if(typeof n.end<"u")return{result:n.end-n.duration,precise:!0}}for(;i--;){if(n=e.segments[i],typeof n.end<"u")return{result:r+n.end,precise:!0};if(r+=cv(e,n),typeof n.start<"u")return{result:r+n.start,precise:!0}}return{result:r,precise:!1}},k3=function(e,t){for(var r=0,i,n=t-e.mediaSequence;n<e.segments.length;n++){if(i=e.segments[n],typeof i.start<"u")return{result:i.start-r,precise:!0};if(r+=cv(e,i),typeof i.end<"u")return{result:i.end-r,precise:!0}}return{result:-1,precise:!1}},HE=function(e,t,r){if(typeof t>"u"&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var i=w3(e,t);if(i.precise)return i.result;var n=k3(e,t);return n.precise?n.result:i.result+r},qE=function(e,t,r){if(!e)return 0;if(typeof r!="number"&&(r=0),typeof t>"u"){if(e.totalDuration)return e.totalDuration;if(!e.endList)return D.Infinity}return HE(e,t,r)},Bl=function(e){var t=e.defaultDuration,r=e.durationList,i=e.startIndex,n=e.endIndex,a=0;if(i>n){var o=[n,i];i=o[0],n=o[1]}if(i<0){for(var l=i;l<Math.min(0,n);l++)a+=t;i=0}for(var u=i;u<n;u++)a+=r[u].duration;return a},zE=function(e,t,r,i){if(!e||!e.segments)return null;if(e.endList)return qE(e);if(t===null)return null;t=t||0;var n=HE(e,e.mediaSequence+e.segments.length,t);return r&&(i=typeof i=="number"?i:VE(null,e),n-=i),Math.max(0,n)},x3=function(e,t,r){var i=!0,n=t||0,a=zE(e,t,i,r);return a===null?wT():wT(n,a)},A3=function(e){for(var t=e.playlist,r=e.currentTime,i=e.startingSegmentIndex,n=e.startingPartIndex,a=e.startTime,o=e.experimentalExactManifestTimings,l=r-a,u=ym(t),c=0,h=0;h<u.length;h++){var f=u[h];if(i===f.segmentIndex&&!(typeof n=="number"&&typeof f.partIndex=="number"&&n!==f.partIndex)){c=h;break}}if(l<0){if(c>0)for(var g=c-1;g>=0;g--){var C=u[g];if(l+=C.duration,o){if(l<0)continue}else if(l+ls<=0)continue;return{partIndex:C.partIndex,segmentIndex:C.segmentIndex,startTime:a-Bl({defaultDuration:t.targetDuration,durationList:u,startIndex:c,endIndex:g})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:r}}if(c<0){for(var p=c;p<0;p++)if(l-=t.targetDuration,l<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:r};c=0}for(var T=c;T<u.length;T++){var A=u[T];if(l-=A.duration,o){if(l>0)continue}else if(l-ls>=0)continue;return{partIndex:A.partIndex,segmentIndex:A.segmentIndex,startTime:a+Bl({defaultDuration:t.targetDuration,durationList:u,startIndex:c,endIndex:T})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:r}},WE=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},hv=function(e){return e.excludeUntil&&e.excludeUntil===1/0},od=function(e){var t=WE(e);return!e.disabled&&!t},I3=function(e){return e.disabled},P3=function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},GE=function(e,t){return t.attributes&&t.attributes[e]},D3=function(e,t,r,i){if(i===void 0&&(i=0),!GE("BANDWIDTH",r))return NaN;var n=e*r.attributes.BANDWIDTH;return(n-i*8)/t},_m=function(e,t){if(e.playlists.length===1)return!0;var r=t.attributes.BANDWIDTH||Number.MAX_VALUE;return e.playlists.filter(function(i){return od(i)?(i.attributes.BANDWIDTH||0)<r:!1}).length===0},dv=function(e,t){return!e&&!t||!e&&t||e&&!t?!1:!!(e===t||e.id&&t.id&&e.id===t.id||e.resolvedUri&&t.resolvedUri&&e.resolvedUri===t.resolvedUri||e.uri&&t.uri&&e.uri===t.uri)},kT=function(e,t){var r=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},i=!1;for(var n in r){for(var a in r[n])if(i=t(r[n][a]),i)break;if(i)break}return!!i},fu=function(e){if(!e||!e.playlists||!e.playlists.length){var t=kT(e,function(a){return a.playlists&&a.playlists.length||a.uri});return t}for(var r=function(o){var l=e.playlists[o],u=l.attributes&&l.attributes.CODECS;if(u&&u.split(",").every(function(h){return v1(h)}))return"continue";var c=kT(e,function(h){return dv(l,h)});return c?"continue":{v:!1}},i=0;i<e.playlists.length;i++){var n=r(i);if(n!=="continue"&&typeof n=="object")return n.v}return!0},Hi={liveEdgeDelay:VE,duration:qE,seekable:x3,getMediaInfoForTime:A3,isEnabled:od,isDisabled:I3,isBlacklisted:WE,isIncompatible:hv,playlistEnd:zE,isAes:P3,hasAttribute:GE,estimateSegmentRequestTime:D3,isLowestEnabledRendition:_m,isAudioOnly:fu,playlistMatch:dv,segmentDurationWithParts:cv},KE=ne.log,fv=function(e,t){return e+"-"+t},N3=function(e,t,r){return"placeholder-uri-"+e+"-"+t+"-"+r},L3=function(e){var t=e.onwarn,r=e.oninfo,i=e.manifestString,n=e.customTagParsers,a=n===void 0?[]:n,o=e.customTagMappers,l=o===void 0?[]:o,u=e.experimentalLLHLS,c=new bM;t&&c.on("warn",t),r&&c.on("info",r),a.forEach(function(p){return c.addParser(p)}),l.forEach(function(p){return c.addTagMapper(p)}),c.push(i),c.end();var h=c.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(p){h.hasOwnProperty(p)&&delete h[p]}),h.segments&&h.segments.forEach(function(p){["parts","preloadHints"].forEach(function(T){p.hasOwnProperty(T)&&delete p[T]})})),!h.targetDuration){var f=10;h.segments&&h.segments.length&&(f=h.segments.reduce(function(p,T){return Math.max(p,T.duration)},0)),t&&t("manifest has no targetDuration defaulting to "+f),h.targetDuration=f}var g=$E(h);if(g.length&&!h.partTargetDuration){var C=g.reduce(function(p,T){return Math.max(p,T.duration)},0);t&&(t("manifest has no partTargetDuration defaulting to "+C),KE.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),h.partTargetDuration=C}return h},zo=function(e,t){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(function(r){if(e.mediaGroups[r])for(var i in e.mediaGroups[r])for(var n in e.mediaGroups[r][i]){var a=e.mediaGroups[r][i][n];t(a,r,i,n)}})},XE=function(e){var t=e.playlist,r=e.uri,i=e.id;t.id=i,t.playlistErrors_=0,r&&(t.uri=r),t.attributes=t.attributes||{}},O3=function(e){for(var t=e.playlists.length;t--;){var r=e.playlists[t];XE({playlist:r,id:fv(t,r.uri)}),r.resolvedUri=xr(e.uri,r.uri),e.playlists[r.id]=r,e.playlists[r.uri]=r,r.attributes.BANDWIDTH||KE.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},M3=function(e){zo(e,function(t){t.uri&&(t.resolvedUri=xr(e.uri,t.uri))})},R3=function(e,t){var r=fv(0,t),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:D.location.href,resolvedUri:D.location.href,playlists:[{uri:t,id:r,resolvedUri:t,attributes:{}}]};return i.playlists[r]=i.playlists[0],i.playlists[t]=i.playlists[0],i},YE=function(e,t,r){r===void 0&&(r=N3),e.uri=t;for(var i=0;i<e.playlists.length;i++)if(!e.playlists[i].uri){var n="placeholder-uri-"+i;e.playlists[i].uri=n}var a=fu(e);zo(e,function(o,l,u,c){if(!o.playlists||!o.playlists.length){if(a&&l==="AUDIO"&&!o.uri)for(var h=0;h<e.playlists.length;h++){var f=e.playlists[h];if(f.attributes&&f.attributes.AUDIO&&f.attributes.AUDIO===u)return}o.playlists=[vt({},o)]}o.playlists.forEach(function(g,C){var p=r(l,u,c,g),T=fv(C,p);g.uri?g.resolvedUri=g.resolvedUri||xr(e.uri,g.uri):(g.uri=C===0?p:T,g.resolvedUri=g.uri),g.id=g.id||T,g.attributes=g.attributes||{},e.playlists[g.id]=g,e.playlists[g.uri]=g})}),O3(e),M3(e)},hh=ne.mergeOptions,B3=ne.EventTarget,F3=function(e,t){if(t.endList||!t.serverControl)return e;var r={};if(t.serverControl.canBlockReload){var i=t.preloadSegment,n=t.mediaSequence+t.segments.length;if(i){var a=i.parts||[],o=jE(t)-1;o>-1&&o!==a.length-1&&(r._HLS_part=o),(o>-1||a.length)&&n--}r._HLS_msn=n}if(t.serverControl&&t.serverControl.canSkipUntil&&(r._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(r).length){var l=new D.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(u){r.hasOwnProperty(u)&&l.searchParams.set(u,r[u])}),e=l.toString()}return e},U3=function(e,t){if(!e)return t;var r=hh(e,t);if(e.preloadHints&&!t.preloadHints&&delete r.preloadHints,e.parts&&!t.parts)delete r.parts;else if(e.parts&&t.parts)for(var i=0;i<t.parts.length;i++)e.parts&&e.parts[i]&&(r.parts[i]=hh(e.parts[i],t.parts[i]));return!e.skipped&&t.skipped&&(r.skipped=!1),e.preload&&!t.preload&&(r.preload=!1),r},$3=function(e,t,r){var i=e.slice(),n=t.slice();r=r||0;for(var a=[],o,l=0;l<n.length;l++){var u=i[l+r],c=n[l];u?(o=u.map||o,a.push(U3(u,c))):(o&&!c.map&&(c.map=o),a.push(c))}return a},QE=function(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=xr(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=xr(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=xr(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=xr(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(function(r){r.resolvedUri||(r.resolvedUri=xr(t,r.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(function(r){r.resolvedUri||(r.resolvedUri=xr(t,r.uri))})},JE=function(e){var t=e.segments||[],r=e.preloadSegment;if(r&&r.parts&&r.parts.length){if(r.preloadHints){for(var i=0;i<r.preloadHints.length;i++)if(r.preloadHints[i].type==="MAP")return t}r.duration=e.targetDuration,r.preload=!0,t.push(r)}return t},ZE=function(e,t){return e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment},Tm=function(e,t,r){r===void 0&&(r=ZE);var i=hh(e,{}),n=i.playlists[t.id];if(!n||r(n,t))return null;t.segments=JE(t);var a=hh(n,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,n.segments){if(t.skip){t.segments=t.segments||[];for(var o=0;o<t.skip.skippedSegments;o++)t.segments.unshift({skipped:!0})}a.segments=$3(n.segments,t.segments,t.mediaSequence-n.mediaSequence)}a.segments.forEach(function(u){QE(u,a.resolvedUri)});for(var l=0;l<i.playlists.length;l++)i.playlists[l].id===t.id&&(i.playlists[l]=a);return i.playlists[t.id]=a,i.playlists[t.uri]=a,zo(e,function(u,c,h,f){if(u.playlists)for(var g=0;g<u.playlists.length;g++)t.id===u.playlists[g].id&&(u.playlists[g]=a)}),i},bm=function(e,t){var r=e.segments||[],i=r[r.length-1],n=i&&i.parts&&i.parts[i.parts.length-1],a=n&&n.duration||i&&i.duration;return t&&a?a*1e3:(e.partTargetDuration||e.targetDuration||10)*500},Wa=(function(s){we(e,s);function e(r,i,n){var a;if(n===void 0&&(n={}),a=s.call(this)||this,!r)throw new Error("A non-empty playlist URL or object is required");a.logger_=Or("PlaylistLoader");var o=n,l=o.withCredentials,u=l===void 0?!1:l,c=o.handleManifestRedirects,h=c===void 0?!1:c;a.src=r,a.vhs_=i,a.withCredentials=u,a.handleManifestRedirects=h;var f=i.options_;return a.customTagParsers=f&&f.customTagParsers||[],a.customTagMappers=f&&f.customTagMappers||[],a.experimentalLLHLS=f&&f.experimentalLLHLS||!1,ne.browser.IE_VERSION&&(a.experimentalLLHLS=!1),a.state="HAVE_NOTHING",a.handleMediaupdatetimeout_=a.handleMediaupdatetimeout_.bind(We(a)),a.on("mediaupdatetimeout",a.handleMediaupdatetimeout_),a}var t=e.prototype;return t.handleMediaupdatetimeout_=function(){var i=this;if(this.state==="HAVE_METADATA"){var n=this.media(),a=xr(this.master.uri,n.uri);this.experimentalLLHLS&&(a=F3(a,n)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:a,withCredentials:this.withCredentials},function(o,l){if(i.request){if(o)return i.playlistRequestError(i.request,i.media(),"HAVE_METADATA");i.haveMetadata({playlistString:i.request.responseText,url:i.media().uri,id:i.media().id})}})}},t.playlistRequestError=function(i,n,a){var o=n.uri,l=n.id;this.request=null,a&&(this.state=a),this.error={playlist:this.master.playlists[l],status:i.status,message:"HLS playlist request error at URL: "+o+".",responseText:i.responseText,code:i.status>=500?4:2},this.trigger("error")},t.parseManifest_=function(i){var n=this,a=i.url,o=i.manifestString;return L3({onwarn:function(u){var c=u.message;return n.logger_("m3u8-parser warn for "+a+": "+c)},oninfo:function(u){var c=u.message;return n.logger_("m3u8-parser info for "+a+": "+c)},manifestString:o,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},t.haveMetadata=function(i){var n=i.playlistString,a=i.playlistObject,o=i.url,l=i.id;this.request=null,this.state="HAVE_METADATA";var u=a||this.parseManifest_({url:o,manifestString:n});u.lastRequest=Date.now(),XE({playlist:u,uri:o,id:l});var c=Tm(this.master,u);this.targetDuration=u.partTargetDuration||u.targetDuration,this.pendingMedia_=null,c?(this.master=c,this.media_=this.master.playlists[l]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(bm(this.media(),!!c)),this.trigger("loadedplaylist")},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),D.clearTimeout(this.mediaUpdateTimeout),D.clearTimeout(this.finalRenditionTimeout),this.off()},t.stopRequest=function(){if(this.request){var i=this.request;this.request=null,i.onreadystatechange=null,i.abort()}},t.media=function(i,n){var a=this;if(!i)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof i=="string"){if(!this.master.playlists[i])throw new Error("Unknown playlist URI: "+i);i=this.master.playlists[i]}if(D.clearTimeout(this.finalRenditionTimeout),n){var o=(i.partTargetDuration||i.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=D.setTimeout(this.media.bind(this,i,!1),o);return}var l=this.state,u=!this.media_||i.id!==this.media_.id,c=this.master.playlists[i.id];if(c&&c.endList||i.endList&&i.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=i,u&&(this.trigger("mediachanging"),l==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(bm(i,!0)),!!u){if(this.state="SWITCHING_MEDIA",this.request){if(i.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=i,this.request=this.vhs_.xhr({uri:i.resolvedUri,withCredentials:this.withCredentials},function(h,f){if(a.request){if(i.lastRequest=Date.now(),i.resolvedUri=ch(a.handleManifestRedirects,i.resolvedUri,f),h)return a.playlistRequestError(a.request,i,l);a.haveMetadata({playlistString:f.responseText,url:i.uri,id:i.id}),l==="HAVE_MASTER"?a.trigger("loadedmetadata"):a.trigger("mediachange")}})}},t.pause=function(){this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")},t.load=function(i){var n=this;this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var a=this.media();if(i){var o=a?(a.partTargetDuration||a.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=D.setTimeout(function(){n.mediaUpdateTimeout=null,n.load()},o);return}if(!this.started){this.start();return}a&&!a.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")},t.updateMediaUpdateTimeout_=function(i){var n=this;this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=D.setTimeout(function(){n.mediaUpdateTimeout=null,n.trigger("mediaupdatetimeout"),n.updateMediaUpdateTimeout_(i)},i))},t.start=function(){var i=this;if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=D.location.href),this.src.resolvedUri=this.src.uri,setTimeout(function(){i.setupInitialPlaylist(i.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(n,a){if(i.request){if(i.request=null,n)return i.error={status:a.status,message:"HLS playlist request error at URL: "+i.src+".",responseText:a.responseText,code:2},i.state==="HAVE_NOTHING"&&(i.started=!1),i.trigger("error");i.src=ch(i.handleManifestRedirects,i.src,a);var o=i.parseManifest_({manifestString:a.responseText,url:i.src});i.setupInitialPlaylist(o)}})},t.srcUri=function(){return typeof this.src=="string"?this.src:this.src.uri},t.setupInitialPlaylist=function(i){if(this.state="HAVE_MASTER",i.playlists){this.master=i,YE(this.master,this.srcUri()),i.playlists.forEach(function(a){a.segments=JE(a),a.segments.forEach(function(o){QE(o,a.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.master.playlists[0]);return}var n=this.srcUri()||D.location.href;this.master=R3(i,n),this.haveMetadata({playlistObject:i,url:n,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},e})(B3),j3=ne.xhr,V3=ne.mergeOptions,Sm=function(e,t,r,i){var n=e.responseType==="arraybuffer"?e.response:e.responseText;!t&&n&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=n.byteLength||n.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),r.headers&&(e.responseHeaders=r.headers),t&&t.code==="ETIMEDOUT"&&(e.timedout=!0),!t&&!e.aborted&&r.statusCode!==200&&r.statusCode!==206&&r.statusCode!==0&&(t=new Error("XHR Failed with a response of: "+(e&&(n||e.responseText)))),i(t,e)},e2=function(){var e=function t(r,i){r=V3({timeout:45e3},r);var n=t.beforeRequest||ne.Vhs.xhr.beforeRequest;if(n&&typeof n=="function"){var a=n(r);a&&(r=a)}var o=ne.Vhs.xhr.original===!0?j3:ne.Vhs.xhr,l=o(r,function(c,h){return Sm(l,c,h,i)}),u=l.abort;return l.abort=function(){return l.aborted=!0,u.apply(l,arguments)},l.uri=r.uri,l.requestTime=Date.now(),l};return e.original=!0,e},H3=function(e){var t,r=e.offset;return typeof e.offset=="bigint"||typeof e.length=="bigint"?t=D.BigInt(e.offset)+D.BigInt(e.length)-D.BigInt(1):t=e.offset+e.length-1,"bytes="+r+"-"+t},Cm=function(e){var t={};return e.byterange&&(t.Range=H3(e.byterange)),t},q3=function(e,t){return e.start(t)+"-"+e.end(t)},z3=function(e,t){var r=e.toString(16);return"00".substring(0,2-r.length)+r+(t%2?" ":"")},W3=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},t2=function(e){var t={};return Object.keys(e).forEach(function(r){var i=e[r];_1(i)?t[r]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:t[r]=i}),t},dh=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},i2=function(e){return e.resolvedUri},r2=function(e){for(var t=Array.prototype.slice.call(e),r=16,i="",n,a,o=0;o<t.length/r;o++)n=t.slice(o*r,o*r+r).map(z3).join(""),a=t.slice(o*r,o*r+r).map(W3).join(""),i+=n+" "+a+`
|
|
279
|
-
`;return i},G3=function(e){var t=e.bytes;return r2(t)},K3=function(e){var t="",r;for(r=0;r<e.length;r++)t+=q3(e,r)+" ";return t},X3=Object.freeze({__proto__:null,createTransferableMessage:t2,initSegmentId:dh,segmentKeyId:i2,hexDump:r2,tagDump:G3,textRanges:K3}),n2=.25,Y3=function(e,t){if(!t.dateTimeObject)return null;var r=t.videoTimingInfo.transmuxerPrependedSeconds,i=t.videoTimingInfo.transmuxedPresentationStart,n=i+r,a=e-n;return new Date(t.dateTimeObject.getTime()+a*1e3)},Q3=function(e){return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds},J3=function(e,t){var r;try{r=new Date(e)}catch{return null}if(!t||!t.segments||t.segments.length===0)return null;var i=t.segments[0];if(r<i.dateTimeObject)return null;for(var n=0;n<t.segments.length-1;n++){i=t.segments[n];var a=t.segments[n+1].dateTimeObject;if(r<a)break}var o=t.segments[t.segments.length-1],l=o.dateTimeObject,u=o.videoTimingInfo?Q3(o.videoTimingInfo):o.duration+o.duration*n2,c=new Date(l.getTime()+u*1e3);return r>c?null:(r>l&&(i=o),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:Hi.duration(t,t.mediaSequence+t.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},Z3=function(e,t){if(!t||!t.segments||t.segments.length===0)return null;for(var r=0,i,n=0;n<t.segments.length&&(i=t.segments[n],r=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:r+i.duration,!(e<=r));n++);var a=t.segments[t.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>r){if(e>r+a.duration*n2)return null;i=a}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:r-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},eB=function(e,t){var r,i;try{r=new Date(e),i=new Date(t)}catch{}var n=r.getTime(),a=i.getTime();return(a-n)/1e3},tB=function(e){if(!e.segments||e.segments.length===0)return!1;for(var t=0;t<e.segments.length;t++){var r=e.segments[t];if(!r.dateTimeObject)return!1}return!0},iB=function(e){var t=e.playlist,r=e.time,i=r===void 0?void 0:r,n=e.callback;if(!n)throw new Error("getProgramTime: callback must be provided");if(!t||i===void 0)return n({message:"getProgramTime: playlist and time must be provided"});var a=Z3(i,t);if(!a)return n({message:"valid programTime was not found"});if(a.type==="estimate")return n({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var o={mediaSeconds:i},l=Y3(i,a.segment);return l&&(o.programDateTime=l.toISOString()),n(null,o)},rB=function s(e){var t=e.programTime,r=e.playlist,i=e.retryCount,n=i===void 0?2:i,a=e.seekTo,o=e.pauseAfterSeek,l=o===void 0?!0:o,u=e.tech,c=e.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(typeof t>"u"||!r||!a)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!r.endList&&!u.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!tB(r))return c({message:"programDateTime tags must be provided in the manifest "+r.resolvedUri});var h=J3(t,r);if(!h)return c({message:t+" was not found in the stream"});var f=h.segment,g=eB(f.dateTimeObject,t);if(h.type==="estimate"){if(n===0)return c({message:t+" is not buffered yet. Try again"});a(h.estimatedStart+g),u.one("seeked",function(){s({programTime:t,playlist:r,retryCount:n-1,seekTo:a,pauseAfterSeek:l,tech:u,callback:c})});return}var C=f.start+g,p=function(){return c(null,u.currentTime())};u.one("seeked",p),l&&u.pause(),a(C)},rp=function(e,t){if(e.readyState===4)return t()},nB=function(e,t,r){var i=[],n,a=!1,o=function(f,g,C,p){return g.abort(),a=!0,r(f,g,C,p)},l=function(f,g){if(!a){if(f)return o(f,g,"",i);var C=g.responseText.substring(i&&i.byteLength||0,g.responseText.length);if(i=LM(i,T1(C,!0)),n=n||Cl(i),i.length<10||n&&i.length<n+2)return rp(g,function(){return o(f,g,"",i)});var p=Lg(i);return p==="ts"&&i.length<188?rp(g,function(){return o(f,g,"",i)}):!p&&i.length<376?rp(g,function(){return o(f,g,"",i)}):o(null,g,p,i)}},u={uri:e,beforeSend:function(f){f.overrideMimeType("text/plain; charset=x-user-defined"),f.addEventListener("progress",function(g){return g.total,g.loaded,Sm(f,null,{statusCode:f.status},l)})}},c=t(u,function(h,f){return Sm(c,h,f,l)});return c},sB=ne.EventTarget,s2=ne.mergeOptions,xT=function(e,t){if(!ZE(e,t)||e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx||e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var r=0;r<e.segments.length;r++){var i=e.segments[r],n=t.segments[r];if(i.uri!==n.uri)return!1;if(!(!i.byterange&&!n.byterange)){var a=i.byterange,o=n.byterange;if(a&&!o||!a&&o||a.offset!==o.offset||a.length!==o.length)return!1}}return!0},aB=function(e,t,r,i){var n=i.attributes.NAME||r;return"placeholder-uri-"+e+"-"+t+"-"+n},oB=function(e){var t=e.masterXml,r=e.srcUrl,i=e.clientOffset,n=e.sidxMapping,a=e.previousManifest,o=ER(t,{manifestUri:r,clientOffset:i,sidxMapping:n,previousManifest:a});return YE(o,r,aB),o},lB=function(e,t){zo(e,function(r,i,n,a){a in t.mediaGroups[i][n]||delete e.mediaGroups[i][n][a]})},uB=function(e,t,r){for(var i=!0,n=s2(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),a=0;a<t.playlists.length;a++){var o=t.playlists[a];if(o.sidx){var l=Xh(o.sidx);r&&r[l]&&r[l].sidx&&Ig(o,r[l].sidx,o.sidx.resolvedUri)}var u=Tm(n,o,xT);u&&(n=u,i=!1)}return zo(t,function(c,h,f,g){if(c.playlists&&c.playlists.length){var C=c.playlists[0].id,p=Tm(n,c.playlists[0],xT);p&&(n=p,g in n.mediaGroups[h][f]||(n.mediaGroups[h][f][g]=c),n.mediaGroups[h][f][g].playlists[0]=n.playlists[C],i=!1)}}),lB(n,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(i=!1),i?null:n},cB=function(e,t){var r=!e.map&&!t.map,i=r||!!(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length);return i&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length},AT=function(e,t){var r={};for(var i in e){var n=e[i],a=n.sidx;if(a){var o=Xh(a);if(!t[o])break;var l=t[o].sidxInfo;cB(l,a)&&(r[o]=t[o])}}return r},hB=function(e,t){var r=AT(e.playlists,t),i=r;return zo(e,function(n,a,o,l){if(n.playlists&&n.playlists.length){var u=n.playlists;i=s2(i,AT(u,t))}}),i},Em=(function(s){we(e,s);function e(r,i,n,a){var o;n===void 0&&(n={}),o=s.call(this)||this,o.masterPlaylistLoader_=a||We(o),a||(o.isMaster_=!0);var l=n,u=l.withCredentials,c=u===void 0?!1:u,h=l.handleManifestRedirects,f=h===void 0?!1:h;if(o.vhs_=i,o.withCredentials=c,o.handleManifestRedirects=f,!r)throw new Error("A non-empty playlist URL or object is required");return o.on("minimumUpdatePeriod",function(){o.refreshXml_()}),o.on("mediaupdatetimeout",function(){o.refreshMedia_(o.media().id)}),o.state="HAVE_NOTHING",o.loadedPlaylists_={},o.logger_=Or("DashPlaylistLoader"),o.isMaster_?(o.masterPlaylistLoader_.srcUrl=r,o.masterPlaylistLoader_.sidxMapping_={}):o.childPlaylist_=r,o}var t=e.prototype;return t.requestErrored_=function(i,n,a){if(!this.request)return!0;if(this.request=null,i)return this.error=typeof i=="object"&&!(i instanceof Error)?i:{status:n.status,message:"DASH request error at URL: "+n.uri,response:n.response,code:2},a&&(this.state=a),this.trigger("error"),!0},t.addSidxSegments_=function(i,n,a){var o=this,l=i.sidx&&Xh(i.sidx);if(!i.sidx||!l||this.masterPlaylistLoader_.sidxMapping_[l]){this.mediaRequest_=D.setTimeout(function(){return a(!1)},0);return}var u=ch(this.handleManifestRedirects,i.sidx.resolvedUri),c=function(f,g){if(!o.requestErrored_(f,g,n)){var C=o.masterPlaylistLoader_.sidxMapping_,p;try{p=IR(je(g.response).subarray(8))}catch(T){o.requestErrored_(T,g,n);return}return C[l]={sidxInfo:i.sidx,sidx:p},Ig(i,p,i.sidx.resolvedUri),a(!0)}};this.request=nB(u,this.vhs_.xhr,function(h,f,g,C){if(h)return c(h,f);if(!g||g!=="mp4")return c({status:f.status,message:"Unsupported "+(g||"unknown")+" container type for sidx segment at URL: "+u,response:"",playlist:i,internal:!0,blacklistDuration:1/0,code:2},f);var p=i.sidx.byterange,T=p.offset,A=p.length;if(C.length>=A+T)return c(h,{response:C.subarray(T,T+A),status:f.status,uri:f.uri});o.request=o.vhs_.xhr({uri:u,responseType:"arraybuffer",headers:Cm({byterange:i.sidx.byterange})},c)})},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},D.clearTimeout(this.minimumUpdatePeriodTimeout_),D.clearTimeout(this.mediaRequest_),D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},t.hasPendingRequest=function(){return this.request||this.mediaRequest_},t.stopRequest=function(){if(this.request){var i=this.request;this.request=null,i.onreadystatechange=null,i.abort()}},t.media=function(i){var n=this;if(!i)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);var a=this.state;if(typeof i=="string"){if(!this.masterPlaylistLoader_.master.playlists[i])throw new Error("Unknown playlist URI: "+i);i=this.masterPlaylistLoader_.master.playlists[i]}var o=!this.media_||i.id!==this.media_.id;if(o&&this.loadedPlaylists_[i.id]&&this.loadedPlaylists_[i.id].endList){this.state="HAVE_METADATA",this.media_=i,o&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}o&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(i,a,function(l){n.haveMetadata({startingState:a,playlist:i})}))},t.haveMetadata=function(i){var n=i.startingState,a=i.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[a.id]=a,this.mediaRequest_=null,this.refreshMedia_(a.id),n==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")},t.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(D.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)},t.load=function(i){var n=this;D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var a=this.media();if(i){var o=a?a.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=D.setTimeout(function(){return n.load()},o);return}if(!this.started){this.start();return}a&&!a.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")},t.start=function(){var i=this;if(this.started=!0,!this.isMaster_){this.mediaRequest_=D.setTimeout(function(){return i.haveMaster_()},0);return}this.requestMaster_(function(n,a){i.haveMaster_(),!i.hasPendingRequest()&&!i.media_&&i.media(i.masterPlaylistLoader_.master.playlists[0])})},t.requestMaster_=function(i){var n=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(a,o){if(n.requestErrored_(a,o)){n.state==="HAVE_NOTHING"&&(n.started=!1);return}var l=o.responseText!==n.masterPlaylistLoader_.masterXml_;if(n.masterPlaylistLoader_.masterXml_=o.responseText,o.responseHeaders&&o.responseHeaders.date?n.masterLoaded_=Date.parse(o.responseHeaders.date):n.masterLoaded_=Date.now(),n.masterPlaylistLoader_.srcUrl=ch(n.handleManifestRedirects,n.masterPlaylistLoader_.srcUrl,o),l){n.handleMaster_(),n.syncClientServerClock_(function(){return i(o,l)});return}return i(o,l)})},t.syncClientServerClock_=function(i){var n=this,a=wR(this.masterPlaylistLoader_.masterXml_);if(a===null)return this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),i();if(a.method==="DIRECT")return this.masterPlaylistLoader_.clientOffset_=a.value-Date.now(),i();this.request=this.vhs_.xhr({uri:xr(this.masterPlaylistLoader_.srcUrl,a.value),method:a.method,withCredentials:this.withCredentials},function(o,l){if(n.request){if(o)return n.masterPlaylistLoader_.clientOffset_=n.masterLoaded_-Date.now(),i();var u;a.method==="HEAD"?!l.responseHeaders||!l.responseHeaders.date?u=n.masterLoaded_:u=Date.parse(l.responseHeaders.date):u=Date.parse(l.responseText),n.masterPlaylistLoader_.clientOffset_=u-Date.now(),i()}})},t.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},t.handleMaster_=function(){this.mediaRequest_=null;var i=this.masterPlaylistLoader_.master,n=oB({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:i});i&&(n=uB(i,n,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=n||i;var a=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return a&&a!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=a),(!i||n&&n.minimumUpdatePeriod!==i.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),!!n},t.updateMinimumUpdatePeriodTimeout_=function(){var i=this.masterPlaylistLoader_;i.createMupOnMedia_&&(i.off("loadedmetadata",i.createMupOnMedia_),i.createMupOnMedia_=null),i.minimumUpdatePeriodTimeout_&&(D.clearTimeout(i.minimumUpdatePeriodTimeout_),i.minimumUpdatePeriodTimeout_=null);var n=i.master&&i.master.minimumUpdatePeriod;if(n===0&&(i.media()?n=i.media().targetDuration*1e3:(i.createMupOnMedia_=i.updateMinimumUpdatePeriodTimeout_,i.one("loadedmetadata",i.createMupOnMedia_))),typeof n!="number"||n<=0){n<0&&this.logger_("found invalid minimumUpdatePeriod of "+n+", not setting a timeout");return}this.createMUPTimeout_(n)},t.createMUPTimeout_=function(i){var n=this.masterPlaylistLoader_;n.minimumUpdatePeriodTimeout_=D.setTimeout(function(){n.minimumUpdatePeriodTimeout_=null,n.trigger("minimumUpdatePeriod"),n.createMUPTimeout_(i)},i)},t.refreshXml_=function(){var i=this;this.requestMaster_(function(n,a){a&&(i.media_&&(i.media_=i.masterPlaylistLoader_.master.playlists[i.media_.id]),i.masterPlaylistLoader_.sidxMapping_=hB(i.masterPlaylistLoader_.master,i.masterPlaylistLoader_.sidxMapping_),i.addSidxSegments_(i.media(),i.state,function(o){i.refreshMedia_(i.media().id)}))})},t.refreshMedia_=function(i){var n=this;if(!i)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var a=this.masterPlaylistLoader_.master.playlists,o=!this.media_||this.media_!==a[i];if(o?this.media_=a[i]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){var l=function u(){n.media().endList||(n.mediaUpdateTimeout=D.setTimeout(function(){n.trigger("mediaupdatetimeout"),u()},bm(n.media(),!!o)))};l()}this.trigger("loadedplaylist")},e})(sB),ri={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30},dB=function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t.buffer},a2=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},fB=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch{var t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}},o2=function(e){return function(){var t=fB(e),r=a2(new Worker(t));r.objURL=t;var i=r.terminate;return r.on=r.addEventListener,r.off=r.removeEventListener,r.terminate=function(){return URL.revokeObjectURL(t),i.call(this)},r}},l2=function(e){return"var browserWorkerPolyFill = "+a2.toString()+`;
|
|
280
|
-
browserWorkerPolyFill(self);
|
|
281
|
-
`+e},u2=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},pB=l2(u2(function(){var s=function(){this.init=function(){var m={};this.on=function(S,y){m[S]||(m[S]=[]),m[S]=m[S].concat(y)},this.off=function(S,y){var w;return m[S]?(w=m[S].indexOf(y),m[S]=m[S].slice(),m[S].splice(w,1),w>-1):!1},this.trigger=function(S){var y,w,x,L;if(y=m[S],!!y)if(arguments.length===2)for(x=y.length,w=0;w<x;++w)y[w].call(this,arguments[1]);else{for(L=[],w=arguments.length,w=1;w<arguments.length;++w)L.push(arguments[w]);for(x=y.length,w=0;w<x;++w)y[w].apply(this,L)}},this.dispose=function(){m={}}}};s.prototype.pipe=function($){return this.on("data",function(m){$.push(m)}),this.on("done",function(m){$.flush(m)}),this.on("partialdone",function(m){$.partialFlush(m)}),this.on("endedtimeline",function(m){$.endTimeline(m)}),this.on("reset",function(m){$.reset(m)}),$},s.prototype.push=function($){this.trigger("data",$)},s.prototype.flush=function($){this.trigger("done",$)},s.prototype.partialFlush=function($){this.trigger("partialdone",$)},s.prototype.endTimeline=function($){this.trigger("endedtimeline",$)},s.prototype.reset=function($){this.trigger("reset",$)};var e=s,t=Math.pow(2,32),r=function(m){var S=new DataView(m.buffer,m.byteOffset,m.byteLength),y;return S.getBigUint64?(y=S.getBigUint64(0),y<Number.MAX_SAFE_INTEGER?Number(y):y):S.getUint32(0)*t+S.getUint32(4)},i={getUint64:r,MAX_UINT32:t},n=i.MAX_UINT32,a,o,l,u,c,h,f,g,C,p,T,A,N,F,V,R,O,M,U,E,P,Y,G,K,le,de,pe,se,ae,ce,he,ve,Ae,De,Me,Ne;(function(){var $;if(G={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for($ in G)G.hasOwnProperty($)&&(G[$]=[$.charCodeAt(0),$.charCodeAt(1),$.charCodeAt(2),$.charCodeAt(3)]);K=new Uint8Array([105,115,111,109]),de=new Uint8Array([97,118,99,49]),le=new Uint8Array([0,0,0,1]),pe=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),se=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),ae={video:pe,audio:se},ve=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),he=new Uint8Array([0,0,0,0,0,0,0,0]),Ae=new Uint8Array([0,0,0,0,0,0,0,0]),De=Ae,Me=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ne=Ae,ce=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),a=function(m){var S=[],y=0,w,x,L;for(w=1;w<arguments.length;w++)S.push(arguments[w]);for(w=S.length;w--;)y+=S[w].byteLength;for(x=new Uint8Array(y+8),L=new DataView(x.buffer,x.byteOffset,x.byteLength),L.setUint32(0,x.byteLength),x.set(m,4),w=0,y=8;w<S.length;w++)x.set(S[w],y),y+=S[w].byteLength;return x},o=function(){return a(G.dinf,a(G.dref,ve))},l=function(m){return a(G.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,m.audioobjecttype<<3|m.samplingfrequencyindex>>>1,m.samplingfrequencyindex<<7|m.channelcount<<3,6,1,2]))},u=function(){return a(G.ftyp,K,le,K,de)},R=function(m){return a(G.hdlr,ae[m])},c=function(m){return a(G.mdat,m)},V=function(m){var S=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,m.duration>>>24&255,m.duration>>>16&255,m.duration>>>8&255,m.duration&255,85,196,0,0]);return m.samplerate&&(S[12]=m.samplerate>>>24&255,S[13]=m.samplerate>>>16&255,S[14]=m.samplerate>>>8&255,S[15]=m.samplerate&255),a(G.mdhd,S)},F=function(m){return a(G.mdia,V(m),R(m.type),f(m))},h=function(m){return a(G.mfhd,new Uint8Array([0,0,0,0,(m&4278190080)>>24,(m&16711680)>>16,(m&65280)>>8,m&255]))},f=function(m){return a(G.minf,m.type==="video"?a(G.vmhd,ce):a(G.smhd,he),o(),M(m))},g=function(m,S){for(var y=[],w=S.length;w--;)y[w]=E(S[w]);return a.apply(null,[G.moof,h(m)].concat(y))},C=function(m){for(var S=m.length,y=[];S--;)y[S]=A(m[S]);return a.apply(null,[G.moov,T(4294967295)].concat(y).concat(p(m)))},p=function(m){for(var S=m.length,y=[];S--;)y[S]=P(m[S]);return a.apply(null,[G.mvex].concat(y))},T=function(m){var S=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(m&4278190080)>>24,(m&16711680)>>16,(m&65280)>>8,m&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return a(G.mvhd,S)},O=function(m){var S=m.samples||[],y=new Uint8Array(4+S.length),w,x;for(x=0;x<S.length;x++)w=S[x].flags,y[x+4]=w.dependsOn<<4|w.isDependedOn<<2|w.hasRedundancy;return a(G.sdtp,y)},M=function(m){return a(G.stbl,U(m),a(G.stts,Ne),a(G.stsc,De),a(G.stsz,Me),a(G.stco,Ae))},(function(){var $,m;U=function(y){return a(G.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),y.type==="video"?$(y):m(y))},$=function(y){var w=y.sps||[],x=y.pps||[],L=[],q=[],X,ie;for(X=0;X<w.length;X++)L.push((w[X].byteLength&65280)>>>8),L.push(w[X].byteLength&255),L=L.concat(Array.prototype.slice.call(w[X]));for(X=0;X<x.length;X++)q.push((x[X].byteLength&65280)>>>8),q.push(x[X].byteLength&255),q=q.concat(Array.prototype.slice.call(x[X]));if(ie=[G.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(y.width&65280)>>8,y.width&255,(y.height&65280)>>8,y.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a(G.avcC,new Uint8Array([1,y.profileIdc,y.profileCompatibility,y.levelIdc,255].concat([w.length],L,[x.length],q))),a(G.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],y.sarRatio){var Z=y.sarRatio[0],re=y.sarRatio[1];ie.push(a(G.pasp,new Uint8Array([(Z&4278190080)>>24,(Z&16711680)>>16,(Z&65280)>>8,Z&255,(re&4278190080)>>24,(re&16711680)>>16,(re&65280)>>8,re&255])))}return a.apply(null,ie)},m=function(y){return a(G.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(y.channelcount&65280)>>8,y.channelcount&255,(y.samplesize&65280)>>8,y.samplesize&255,0,0,0,0,(y.samplerate&65280)>>8,y.samplerate&255,0,0]),l(y))}})(),N=function(m){var S=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(m.id&4278190080)>>24,(m.id&16711680)>>16,(m.id&65280)>>8,m.id&255,0,0,0,0,(m.duration&4278190080)>>24,(m.duration&16711680)>>16,(m.duration&65280)>>8,m.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(m.width&65280)>>8,m.width&255,0,0,(m.height&65280)>>8,m.height&255,0,0]);return a(G.tkhd,S)},E=function(m){var S,y,w,x,L,q,X;return S=a(G.tfhd,new Uint8Array([0,0,0,58,(m.id&4278190080)>>24,(m.id&16711680)>>16,(m.id&65280)>>8,m.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),q=Math.floor(m.baseMediaDecodeTime/n),X=Math.floor(m.baseMediaDecodeTime%n),y=a(G.tfdt,new Uint8Array([1,0,0,0,q>>>24&255,q>>>16&255,q>>>8&255,q&255,X>>>24&255,X>>>16&255,X>>>8&255,X&255])),L=92,m.type==="audio"?(w=Y(m,L),a(G.traf,S,y,w)):(x=O(m),w=Y(m,x.length+L),a(G.traf,S,y,w,x))},A=function(m){return m.duration=m.duration||4294967295,a(G.trak,N(m),F(m))},P=function(m){var S=new Uint8Array([0,0,0,0,(m.id&4278190080)>>24,(m.id&16711680)>>16,(m.id&65280)>>8,m.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return m.type!=="video"&&(S[S.length-1]=0),a(G.trex,S)},(function(){var $,m,S;S=function(w,x){var L=0,q=0,X=0,ie=0;return w.length&&(w[0].duration!==void 0&&(L=1),w[0].size!==void 0&&(q=2),w[0].flags!==void 0&&(X=4),w[0].compositionTimeOffset!==void 0&&(ie=8)),[0,0,L|q|X|ie,1,(w.length&4278190080)>>>24,(w.length&16711680)>>>16,(w.length&65280)>>>8,w.length&255,(x&4278190080)>>>24,(x&16711680)>>>16,(x&65280)>>>8,x&255]},m=function(w,x){var L,q,X,ie,Z,re;for(ie=w.samples||[],x+=20+16*ie.length,X=S(ie,x),q=new Uint8Array(X.length+ie.length*16),q.set(X),L=X.length,re=0;re<ie.length;re++)Z=ie[re],q[L++]=(Z.duration&4278190080)>>>24,q[L++]=(Z.duration&16711680)>>>16,q[L++]=(Z.duration&65280)>>>8,q[L++]=Z.duration&255,q[L++]=(Z.size&4278190080)>>>24,q[L++]=(Z.size&16711680)>>>16,q[L++]=(Z.size&65280)>>>8,q[L++]=Z.size&255,q[L++]=Z.flags.isLeading<<2|Z.flags.dependsOn,q[L++]=Z.flags.isDependedOn<<6|Z.flags.hasRedundancy<<4|Z.flags.paddingValue<<1|Z.flags.isNonSyncSample,q[L++]=Z.flags.degradationPriority&61440,q[L++]=Z.flags.degradationPriority&15,q[L++]=(Z.compositionTimeOffset&4278190080)>>>24,q[L++]=(Z.compositionTimeOffset&16711680)>>>16,q[L++]=(Z.compositionTimeOffset&65280)>>>8,q[L++]=Z.compositionTimeOffset&255;return a(G.trun,q)},$=function(w,x){var L,q,X,ie,Z,re;for(ie=w.samples||[],x+=20+8*ie.length,X=S(ie,x),L=new Uint8Array(X.length+ie.length*8),L.set(X),q=X.length,re=0;re<ie.length;re++)Z=ie[re],L[q++]=(Z.duration&4278190080)>>>24,L[q++]=(Z.duration&16711680)>>>16,L[q++]=(Z.duration&65280)>>>8,L[q++]=Z.duration&255,L[q++]=(Z.size&4278190080)>>>24,L[q++]=(Z.size&16711680)>>>16,L[q++]=(Z.size&65280)>>>8,L[q++]=Z.size&255;return a(G.trun,L)},Y=function(w,x){return w.type==="audio"?$(w,x):m(w,x)}})();var Je={ftyp:u,mdat:c,moof:g,moov:C,initSegment:function(m){var S=u(),y=C(m),w;return w=new Uint8Array(S.byteLength+y.byteLength),w.set(S),w.set(y,S.byteLength),w}},Re=function(m){var S,y,w=[],x=[];for(x.byteLength=0,x.nalCount=0,x.duration=0,w.byteLength=0,S=0;S<m.length;S++)y=m[S],y.nalUnitType==="access_unit_delimiter_rbsp"?(w.length&&(w.duration=y.dts-w.dts,x.byteLength+=w.byteLength,x.nalCount+=w.length,x.duration+=w.duration,x.push(w)),w=[y],w.byteLength=y.data.byteLength,w.pts=y.pts,w.dts=y.dts):(y.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(w.keyFrame=!0),w.duration=y.dts-w.dts,w.byteLength+=y.data.byteLength,w.push(y));return x.length&&(!w.duration||w.duration<=0)&&(w.duration=x[x.length-1].duration),x.byteLength+=w.byteLength,x.nalCount+=w.length,x.duration+=w.duration,x.push(w),x},Oe=function(m){var S,y,w=[],x=[];for(w.byteLength=0,w.nalCount=0,w.duration=0,w.pts=m[0].pts,w.dts=m[0].dts,x.byteLength=0,x.nalCount=0,x.duration=0,x.pts=m[0].pts,x.dts=m[0].dts,S=0;S<m.length;S++)y=m[S],y.keyFrame?(w.length&&(x.push(w),x.byteLength+=w.byteLength,x.nalCount+=w.nalCount,x.duration+=w.duration),w=[y],w.nalCount=y.length,w.byteLength=y.byteLength,w.pts=y.pts,w.dts=y.dts,w.duration=y.duration):(w.duration+=y.duration,w.nalCount+=y.length,w.byteLength+=y.byteLength,w.push(y));return x.length&&w.duration<=0&&(w.duration=x[x.length-1].duration),x.byteLength+=w.byteLength,x.nalCount+=w.nalCount,x.duration+=w.duration,x.push(w),x},He=function(m){var S;return!m[0][0].keyFrame&&m.length>1&&(S=m.shift(),m.byteLength-=S.byteLength,m.nalCount-=S.nalCount,m[0][0].dts=S.dts,m[0][0].pts=S.pts,m[0][0].duration+=S.duration),m},ot=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},wt=function(m,S){var y=ot();return y.dataOffset=S,y.compositionTimeOffset=m.pts-m.dts,y.duration=m.duration,y.size=4*m.length,y.size+=m.byteLength,m.keyFrame&&(y.flags.dependsOn=2,y.flags.isNonSyncSample=0),y},Lt=function(m,S){var y,w,x,L,q,X=S||0,ie=[];for(y=0;y<m.length;y++)for(L=m[y],w=0;w<L.length;w++)q=L[w],x=wt(q,X),X+=x.size,ie.push(x);return ie},Oi=function(m){var S,y,w,x,L,q,X=0,ie=m.byteLength,Z=m.nalCount,re=ie+4*Z,ge=new Uint8Array(re),Ee=new DataView(ge.buffer);for(S=0;S<m.length;S++)for(x=m[S],y=0;y<x.length;y++)for(L=x[y],w=0;w<L.length;w++)q=L[w],Ee.setUint32(X,q.data.byteLength),X+=4,ge.set(q.data,X),X+=q.data.byteLength;return ge},Ft=function(m,S){var y,w=S||0,x=[];return y=wt(m,w),x.push(y),x},zi=function(m){var S,y,w=0,x=m.byteLength,L=m.length,q=x+4*L,X=new Uint8Array(q),ie=new DataView(X.buffer);for(S=0;S<m.length;S++)y=m[S],ie.setUint32(w,y.data.byteLength),w+=4,X.set(y.data,w),w+=y.data.byteLength;return X},Te={groupNalsIntoFrames:Re,groupFramesIntoGops:Oe,extendFirstKeyFrame:He,generateSampleTable:Lt,concatenateNalData:Oi,generateSampleTableForFrame:Ft,concatenateNalDataForFrame:zi},ke=[33,16,5,32,164,27],Fe=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Be=function(m){for(var S=[];m--;)S.push(0);return S},Ke=function(m){return Object.keys(m).reduce(function(S,y){return S[y]=new Uint8Array(m[y].reduce(function(w,x){return w.concat(x)},[])),S},{})},nt,ht=function(){if(!nt){var m={96e3:[ke,[227,64],Be(154),[56]],88200:[ke,[231],Be(170),[56]],64e3:[ke,[248,192],Be(240),[56]],48e3:[ke,[255,192],Be(268),[55,148,128],Be(54),[112]],44100:[ke,[255,192],Be(268),[55,163,128],Be(84),[112]],32e3:[ke,[255,192],Be(268),[55,234],Be(226),[112]],24e3:[ke,[255,192],Be(268),[55,255,128],Be(268),[111,112],Be(126),[224]],16e3:[ke,[255,192],Be(268),[55,255,128],Be(268),[111,255],Be(269),[223,108],Be(195),[1,192]],12e3:[Fe,Be(268),[3,127,248],Be(268),[6,255,240],Be(268),[13,255,224],Be(268),[27,253,128],Be(259),[56]],11025:[Fe,Be(268),[3,127,248],Be(268),[6,255,240],Be(268),[13,255,224],Be(268),[27,255,192],Be(268),[55,175,128],Be(108),[112]],8e3:[Fe,Be(268),[3,121,16],Be(47),[7]]};nt=Ke(m)}return nt},sr=9e4,Wi,yr,ar,or,_r,Ln,On;Wi=function(m){return m*sr},yr=function(m,S){return m*S},ar=function(m){return m/sr},or=function(m,S){return m/S},_r=function(m,S){return Wi(or(m,S))},Ln=function(m,S){return yr(ar(m),S)},On=function(m,S,y){return ar(y?m:m-S)};var tt={ONE_SECOND_IN_TS:sr,secondsToVideoTs:Wi,secondsToAudioTs:yr,videoTsToSeconds:ar,audioTsToSeconds:or,audioTsToVideoTs:_r,videoTsToAudioTs:Ln,metadataTsToSeconds:On},st=function(m){var S,y,w=0;for(S=0;S<m.length;S++)y=m[S],w+=y.data.byteLength;return w},cs=function(m,S,y,w){var x,L=0,q=0,X=0,ie=0,Z,re,ge;if(S.length&&(x=tt.audioTsToVideoTs(m.baseMediaDecodeTime,m.samplerate),L=Math.ceil(tt.ONE_SECOND_IN_TS/(m.samplerate/1024)),y&&w&&(q=x-Math.max(y,w),X=Math.floor(q/L),ie=X*L),!(X<1||ie>tt.ONE_SECOND_IN_TS/2))){for(Z=ht()[m.samplerate],Z||(Z=S[0].data),re=0;re<X;re++)ge=S[0],S.splice(0,0,{data:Z,dts:ge.dts-L,pts:ge.pts-L});return m.baseMediaDecodeTime-=Math.floor(tt.videoTsToAudioTs(ie,m.samplerate)),ie}},on=function(m,S,y){return S.minSegmentDts>=y?m:(S.minSegmentDts=1/0,m.filter(function(w){return w.dts>=y?(S.minSegmentDts=Math.min(S.minSegmentDts,w.dts),S.minSegmentPts=S.minSegmentDts,!0):!1}))},la=function(m){var S,y,w=[];for(S=0;S<m.length;S++)y=m[S],w.push({size:y.data.byteLength,duration:1024});return w},ua=function(m){var S,y,w=0,x=new Uint8Array(st(m));for(S=0;S<m.length;S++)y=m[S],x.set(y.data,w),w+=y.data.byteLength;return x},Mr={prefixWithSilence:cs,trimAdtsFramesByEarliestDts:on,generateSampleTable:la,concatenateFrameData:ua},Rr=tt.ONE_SECOND_IN_TS,ca=function(m,S){typeof S.pts=="number"&&(m.timelineStartInfo.pts===void 0&&(m.timelineStartInfo.pts=S.pts),m.minSegmentPts===void 0?m.minSegmentPts=S.pts:m.minSegmentPts=Math.min(m.minSegmentPts,S.pts),m.maxSegmentPts===void 0?m.maxSegmentPts=S.pts:m.maxSegmentPts=Math.max(m.maxSegmentPts,S.pts)),typeof S.dts=="number"&&(m.timelineStartInfo.dts===void 0&&(m.timelineStartInfo.dts=S.dts),m.minSegmentDts===void 0?m.minSegmentDts=S.dts:m.minSegmentDts=Math.min(m.minSegmentDts,S.dts),m.maxSegmentDts===void 0?m.maxSegmentDts=S.dts:m.maxSegmentDts=Math.max(m.maxSegmentDts,S.dts))},hs=function(m){delete m.minSegmentDts,delete m.maxSegmentDts,delete m.minSegmentPts,delete m.maxSegmentPts},ha=function(m,S){var y,w,x=m.minSegmentDts;return S||(x-=m.timelineStartInfo.dts),y=m.timelineStartInfo.baseMediaDecodeTime,y+=x,y=Math.max(0,y),m.type==="audio"&&(w=m.samplerate/Rr,y*=w,y=Math.floor(y)),y},j={clearDtsInfo:hs,calculateTrackBaseMediaDecodeTime:ha,collectDtsInfo:ca},H=4,ee=128,fe=function(m){for(var S=0,y={payloadType:-1,payloadSize:0},w=0,x=0;S<m.byteLength&&m[S]!==ee;){for(;m[S]===255;)w+=255,S++;for(w+=m[S++];m[S]===255;)x+=255,S++;if(x+=m[S++],!y.payload&&w===H){var L=String.fromCharCode(m[S+3],m[S+4],m[S+5],m[S+6]);if(L==="GA94"){y.payloadType=w,y.payloadSize=x,y.payload=m.subarray(S,S+x);break}else y.payload=void 0}S+=x,w=0,x=0}return y},Ce=function(m){return m.payload[0]!==181||(m.payload[1]<<8|m.payload[2])!==49||String.fromCharCode(m.payload[3],m.payload[4],m.payload[5],m.payload[6])!=="GA94"||m.payload[7]!==3?null:m.payload.subarray(8,m.payload.length-1)},Ve=function(m,S){var y=[],w,x,L,q;if(!(S[0]&64))return y;for(x=S[0]&31,w=0;w<x;w++)L=w*3,q={type:S[L+2]&3,pts:m},S[L+2]&4&&(q.ccData=S[L+3]<<8|S[L+4],y.push(q));return y},dt=function(m){for(var S=m.byteLength,y=[],w=1,x,L;w<S-2;)m[w]===0&&m[w+1]===0&&m[w+2]===3?(y.push(w+2),w+=2):w++;if(y.length===0)return m;x=S-y.length,L=new Uint8Array(x);var q=0;for(w=0;w<x;q++,w++)q===y[0]&&(q++,y.shift()),L[w]=m[q];return L},Ut={parseSei:fe,parseUserData:Ce,parseCaptionPackets:Ve,discardEmulationPreventionBytes:dt,USER_DATA_REGISTERED_ITU_T_T35:H},yt=function $(m){m=m||{},$.prototype.init.call(this),this.parse708captions_=typeof m.parse708captions=="boolean"?m.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new mt(0,0),new mt(0,1),new mt(1,0),new mt(1,1)],this.parse708captions_&&(this.cc708Stream_=new Ze({captionServices:m.captionServices})),this.reset(),this.ccStreams_.forEach(function(S){S.on("data",this.trigger.bind(this,"data")),S.on("partialdone",this.trigger.bind(this,"partialdone")),S.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};yt.prototype=new e,yt.prototype.push=function($){var m,S,y;if($.nalUnitType==="sei_rbsp"&&(m=Ut.parseSei($.escapedRBSP),!!m.payload&&m.payloadType===Ut.USER_DATA_REGISTERED_ITU_T_T35&&(S=Ut.parseUserData(m),!!S))){if($.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if($.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}y=Ut.parseCaptionPackets($.pts,S),this.captionPackets_=this.captionPackets_.concat(y),this.latestDts_!==$.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=$.dts}},yt.prototype.flushCCStreams=function($){this.ccStreams_.forEach(function(m){return $==="flush"?m.flush():m.partialFlush()},this)},yt.prototype.flushStream=function($){if(!this.captionPackets_.length){this.flushCCStreams($);return}this.captionPackets_.forEach(function(m,S){m.presortIndex=S}),this.captionPackets_.sort(function(m,S){return m.pts===S.pts?m.presortIndex-S.presortIndex:m.pts-S.pts}),this.captionPackets_.forEach(function(m){m.type<2?this.dispatchCea608Packet(m):this.dispatchCea708Packet(m)},this),this.captionPackets_.length=0,this.flushCCStreams($)},yt.prototype.flush=function(){return this.flushStream("flush")},yt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},yt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function($){$.reset()})},yt.prototype.dispatchCea608Packet=function($){this.setsTextOrXDSActive($)?this.activeCea608Channel_[$.type]=null:this.setsChannel1Active($)?this.activeCea608Channel_[$.type]=0:this.setsChannel2Active($)&&(this.activeCea608Channel_[$.type]=1),this.activeCea608Channel_[$.type]!==null&&this.ccStreams_[($.type<<1)+this.activeCea608Channel_[$.type]].push($)},yt.prototype.setsChannel1Active=function($){return($.ccData&30720)===4096},yt.prototype.setsChannel2Active=function($){return($.ccData&30720)===6144},yt.prototype.setsTextOrXDSActive=function($){return($.ccData&28928)===256||($.ccData&30974)===4138||($.ccData&30974)===6186},yt.prototype.dispatchCea708Packet=function($){this.parse708captions_&&this.cc708Stream_.push($)};var lr={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},Mi=function(m){var S=lr[m]||m;return m&4096&&m===S?"":String.fromCharCode(S)},di=function(m){return 32<=m&&m<=127||160<=m&&m<=255},$t=function(m){this.windowNum=m,this.reset()};$t.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},$t.prototype.getText=function(){return this.rows.join(`
|
|
282
|
-
`)},$t.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},$t.prototype.newLine=function($){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow($),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},$t.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},$t.prototype.addText=function($){this.rows[this.rowIdx]+=$},$t.prototype.backspace=function(){if(!this.isEmpty()){var $=this.rows[this.rowIdx];this.rows[this.rowIdx]=$.substr(0,$.length-1)}};var _t=function(m,S,y){this.serviceNum=m,this.text="",this.currentWindow=new $t(-1),this.windows=[],this.stream=y,typeof S=="string"&&this.createTextDecoder(S)};_t.prototype.init=function($,m){this.startPts=$;for(var S=0;S<8;S++)this.windows[S]=new $t(S),typeof m=="function"&&(this.windows[S].beforeRowOverflow=m)},_t.prototype.setCurrentWindow=function($){this.currentWindow=this.windows[$]},_t.prototype.createTextDecoder=function($){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder($)}catch(m){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+$+" encoding. "+m})}};var Ze=function $(m){m=m||{},$.prototype.init.call(this);var S=this,y=m.captionServices||{},w={},x;Object.keys(y).forEach(function(L){x=y[L],/^SERVICE/.test(L)&&(w[L]=x.encoding)}),this.serviceEncodings=w,this.current708Packet=null,this.services={},this.push=function(L){L.type===3?(S.new708Packet(),S.add708Bytes(L)):(S.current708Packet===null&&S.new708Packet(),S.add708Bytes(L))}};Ze.prototype=new e,Ze.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Ze.prototype.add708Bytes=function($){var m=$.ccData,S=m>>>8,y=m&255;this.current708Packet.ptsVals.push($.pts),this.current708Packet.data.push(S),this.current708Packet.data.push(y)},Ze.prototype.push708Packet=function(){var $=this.current708Packet,m=$.data,S=null,y=null,w=0,x=m[w++];for($.seq=x>>6,$.sizeCode=x&63;w<m.length;w++)x=m[w++],S=x>>5,y=x&31,S===7&&y>0&&(x=m[w++],S=x),this.pushServiceBlock(S,w,y),y>0&&(w+=y-1)},Ze.prototype.pushServiceBlock=function($,m,S){var y,w=m,x=this.current708Packet.data,L=this.services[$];for(L||(L=this.initService($,w));w<m+S&&w<x.length;w++)y=x[w],di(y)?w=this.handleText(w,L):y===24?w=this.multiByteCharacter(w,L):y===16?w=this.extendedCommands(w,L):128<=y&&y<=135?w=this.setCurrentWindow(w,L):152<=y&&y<=159?w=this.defineWindow(w,L):y===136?w=this.clearWindows(w,L):y===140?w=this.deleteWindows(w,L):y===137?w=this.displayWindows(w,L):y===138?w=this.hideWindows(w,L):y===139?w=this.toggleWindows(w,L):y===151?w=this.setWindowAttributes(w,L):y===144?w=this.setPenAttributes(w,L):y===145?w=this.setPenColor(w,L):y===146?w=this.setPenLocation(w,L):y===143?L=this.reset(w,L):y===8?L.currentWindow.backspace():y===12?L.currentWindow.clearText():y===13?L.currentWindow.pendingNewLine=!0:y===14?L.currentWindow.clearText():y===141&&w++},Ze.prototype.extendedCommands=function($,m){var S=this.current708Packet.data,y=S[++$];return di(y)&&($=this.handleText($,m,{isExtended:!0})),$},Ze.prototype.getPts=function($){return this.current708Packet.ptsVals[Math.floor($/2)]},Ze.prototype.initService=function($,m){var y="SERVICE"+$,S=this,y,w;return y in this.serviceEncodings&&(w=this.serviceEncodings[y]),this.services[$]=new _t($,w,S),this.services[$].init(this.getPts(m),function(x){S.flushDisplayed(x,S.services[$])}),this.services[$]},Ze.prototype.handleText=function($,m,S){var y=S&&S.isExtended,w=S&&S.isMultiByte,x=this.current708Packet.data,L=y?4096:0,q=x[$],X=x[$+1],ie=m.currentWindow,Z,re;return m.textDecoder_&&!y?(w?(re=[q,X],$++):re=[q],Z=m.textDecoder_.decode(new Uint8Array(re))):Z=Mi(L|q),ie.pendingNewLine&&!ie.isEmpty()&&ie.newLine(this.getPts($)),ie.pendingNewLine=!1,ie.addText(Z),$},Ze.prototype.multiByteCharacter=function($,m){var S=this.current708Packet.data,y=S[$+1],w=S[$+2];return di(y)&&di(w)&&($=this.handleText(++$,m,{isMultiByte:!0})),$},Ze.prototype.setCurrentWindow=function($,m){var S=this.current708Packet.data,y=S[$],w=y&7;return m.setCurrentWindow(w),$},Ze.prototype.defineWindow=function($,m){var S=this.current708Packet.data,y=S[$],w=y&7;m.setCurrentWindow(w);var x=m.currentWindow;return y=S[++$],x.visible=(y&32)>>5,x.rowLock=(y&16)>>4,x.columnLock=(y&8)>>3,x.priority=y&7,y=S[++$],x.relativePositioning=(y&128)>>7,x.anchorVertical=y&127,y=S[++$],x.anchorHorizontal=y,y=S[++$],x.anchorPoint=(y&240)>>4,x.rowCount=y&15,y=S[++$],x.columnCount=y&63,y=S[++$],x.windowStyle=(y&56)>>3,x.penStyle=y&7,x.virtualRowCount=x.rowCount+1,$},Ze.prototype.setWindowAttributes=function($,m){var S=this.current708Packet.data,y=S[$],w=m.currentWindow.winAttr;return y=S[++$],w.fillOpacity=(y&192)>>6,w.fillRed=(y&48)>>4,w.fillGreen=(y&12)>>2,w.fillBlue=y&3,y=S[++$],w.borderType=(y&192)>>6,w.borderRed=(y&48)>>4,w.borderGreen=(y&12)>>2,w.borderBlue=y&3,y=S[++$],w.borderType+=(y&128)>>5,w.wordWrap=(y&64)>>6,w.printDirection=(y&48)>>4,w.scrollDirection=(y&12)>>2,w.justify=y&3,y=S[++$],w.effectSpeed=(y&240)>>4,w.effectDirection=(y&12)>>2,w.displayEffect=y&3,$},Ze.prototype.flushDisplayed=function($,m){for(var S=[],y=0;y<8;y++)m.windows[y].visible&&!m.windows[y].isEmpty()&&S.push(m.windows[y].getText());m.endPts=$,m.text=S.join(`
|
|
283
|
-
|
|
284
|
-
`),this.pushCaption(m),m.startPts=$},Ze.prototype.pushCaption=function($){$.text!==""&&(this.trigger("data",{startPts:$.startPts,endPts:$.endPts,text:$.text,stream:"cc708_"+$.serviceNum}),$.text="",$.startPts=$.endPts)},Ze.prototype.displayWindows=function($,m){var S=this.current708Packet.data,y=S[++$],w=this.getPts($);this.flushDisplayed(w,m);for(var x=0;x<8;x++)y&1<<x&&(m.windows[x].visible=1);return $},Ze.prototype.hideWindows=function($,m){var S=this.current708Packet.data,y=S[++$],w=this.getPts($);this.flushDisplayed(w,m);for(var x=0;x<8;x++)y&1<<x&&(m.windows[x].visible=0);return $},Ze.prototype.toggleWindows=function($,m){var S=this.current708Packet.data,y=S[++$],w=this.getPts($);this.flushDisplayed(w,m);for(var x=0;x<8;x++)y&1<<x&&(m.windows[x].visible^=1);return $},Ze.prototype.clearWindows=function($,m){var S=this.current708Packet.data,y=S[++$],w=this.getPts($);this.flushDisplayed(w,m);for(var x=0;x<8;x++)y&1<<x&&m.windows[x].clearText();return $},Ze.prototype.deleteWindows=function($,m){var S=this.current708Packet.data,y=S[++$],w=this.getPts($);this.flushDisplayed(w,m);for(var x=0;x<8;x++)y&1<<x&&m.windows[x].reset();return $},Ze.prototype.setPenAttributes=function($,m){var S=this.current708Packet.data,y=S[$],w=m.currentWindow.penAttr;return y=S[++$],w.textTag=(y&240)>>4,w.offset=(y&12)>>2,w.penSize=y&3,y=S[++$],w.italics=(y&128)>>7,w.underline=(y&64)>>6,w.edgeType=(y&56)>>3,w.fontStyle=y&7,$},Ze.prototype.setPenColor=function($,m){var S=this.current708Packet.data,y=S[$],w=m.currentWindow.penColor;return y=S[++$],w.fgOpacity=(y&192)>>6,w.fgRed=(y&48)>>4,w.fgGreen=(y&12)>>2,w.fgBlue=y&3,y=S[++$],w.bgOpacity=(y&192)>>6,w.bgRed=(y&48)>>4,w.bgGreen=(y&12)>>2,w.bgBlue=y&3,y=S[++$],w.edgeRed=(y&48)>>4,w.edgeGreen=(y&12)>>2,w.edgeBlue=y&3,$},Ze.prototype.setPenLocation=function($,m){var S=this.current708Packet.data,y=S[$],w=m.currentWindow.penLoc;return m.currentWindow.pendingNewLine=!0,y=S[++$],w.row=y&15,y=S[++$],w.column=y&63,$},Ze.prototype.reset=function($,m){var S=this.getPts($);return this.flushDisplayed(S,m),this.initService(m.serviceNum,$)};var Tr={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ti=function(m){return m===null?"":(m=Tr[m]||m,String.fromCharCode(m))},lt=14,ln=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Xe=function(){for(var m=[],S=lt+1;S--;)m.push("");return m},mt=function $(m,S){$.prototype.init.call(this),this.field_=m||0,this.dataChannel_=S||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(y){var w,x,L,q,X;if(w=y.ccData&32639,w===this.lastControlCode_){this.lastControlCode_=null;return}if((w&61440)===4096?this.lastControlCode_=w:w!==this.PADDING_&&(this.lastControlCode_=null),L=w>>>8,q=w&255,w!==this.PADDING_)if(w===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(w===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(y.pts),this.flushDisplayed(y.pts),x=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=x,this.startPts_=y.pts;else if(w===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(y.pts);else if(w===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(y.pts);else if(w===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(y.pts);else if(w===this.CARRIAGE_RETURN_)this.clearFormatting(y.pts),this.flushDisplayed(y.pts),this.shiftRowsUp_(),this.startPts_=y.pts;else if(w===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(w===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(y.pts),this.displayed_=Xe();else if(w===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Xe();else if(w===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(y.pts),this.displayed_=Xe()),this.mode_="paintOn",this.startPts_=y.pts;else if(this.isSpecialCharacter(L,q))L=(L&3)<<8,X=Ti(L|q),this[this.mode_](y.pts,X),this.column_++;else if(this.isExtCharacter(L,q))this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),L=(L&3)<<8,X=Ti(L|q),this[this.mode_](y.pts,X),this.column_++;else if(this.isMidRowCode(L,q))this.clearFormatting(y.pts),this[this.mode_](y.pts," "),this.column_++,(q&14)===14&&this.addFormatting(y.pts,["i"]),(q&1)===1&&this.addFormatting(y.pts,["u"]);else if(this.isOffsetControlCode(L,q))this.column_+=q&3;else if(this.isPAC(L,q)){var ie=ln.indexOf(w&7968);this.mode_==="rollUp"&&(ie-this.rollUpRows_+1<0&&(ie=this.rollUpRows_-1),this.setRollUp(y.pts,ie)),ie!==this.row_&&(this.clearFormatting(y.pts),this.row_=ie),q&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(y.pts,["u"]),(w&16)===16&&(this.column_=((w&14)>>1)*4),this.isColorPAC(q)&&(q&14)===14&&this.addFormatting(y.pts,["i"])}else this.isNormalChar(L)&&(q===0&&(q=null),X=Ti(L),X+=Ti(q),this[this.mode_](y.pts,X),this.column_+=X.length)}};mt.prototype=new e,mt.prototype.flushDisplayed=function($){var m=this.displayed_.map(function(S,y){try{return S.trim()}catch{return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+y+"."}),""}},this).join(`
|
|
285
|
-
`).replace(/^\n+|\n+$/g,"");m.length&&this.trigger("data",{startPts:this.startPts_,endPts:$,text:m,stream:this.name_})},mt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Xe(),this.nonDisplayed_=Xe(),this.lastControlCode_=null,this.column_=0,this.row_=lt,this.rollUpRows_=2,this.formatting_=[]},mt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},mt.prototype.isSpecialCharacter=function($,m){return $===this.EXT_&&m>=48&&m<=63},mt.prototype.isExtCharacter=function($,m){return($===this.EXT_+1||$===this.EXT_+2)&&m>=32&&m<=63},mt.prototype.isMidRowCode=function($,m){return $===this.EXT_&&m>=32&&m<=47},mt.prototype.isOffsetControlCode=function($,m){return $===this.OFFSET_&&m>=33&&m<=35},mt.prototype.isPAC=function($,m){return $>=this.BASE_&&$<this.BASE_+8&&m>=64&&m<=127},mt.prototype.isColorPAC=function($){return $>=64&&$<=79||$>=96&&$<=127},mt.prototype.isNormalChar=function($){return $>=32&&$<=127},mt.prototype.setRollUp=function($,m){if(this.mode_!=="rollUp"&&(this.row_=lt,this.mode_="rollUp",this.flushDisplayed($),this.nonDisplayed_=Xe(),this.displayed_=Xe()),m!==void 0&&m!==this.row_)for(var S=0;S<this.rollUpRows_;S++)this.displayed_[m-S]=this.displayed_[this.row_-S],this.displayed_[this.row_-S]="";m===void 0&&(m=this.row_),this.topRow_=m-this.rollUpRows_+1},mt.prototype.addFormatting=function($,m){this.formatting_=this.formatting_.concat(m);var S=m.reduce(function(y,w){return y+"<"+w+">"},"");this[this.mode_]($,S)},mt.prototype.clearFormatting=function($){if(this.formatting_.length){var m=this.formatting_.reverse().reduce(function(S,y){return S+"</"+y+">"},"");this.formatting_=[],this[this.mode_]($,m)}},mt.prototype.popOn=function($,m){var S=this.nonDisplayed_[this.row_];S+=m,this.nonDisplayed_[this.row_]=S},mt.prototype.rollUp=function($,m){var S=this.displayed_[this.row_];S+=m,this.displayed_[this.row_]=S},mt.prototype.shiftRowsUp_=function(){var $;for($=0;$<this.topRow_;$++)this.displayed_[$]="";for($=this.row_+1;$<lt+1;$++)this.displayed_[$]="";for($=this.topRow_;$<this.row_;$++)this.displayed_[$]=this.displayed_[$+1];this.displayed_[this.row_]=""},mt.prototype.paintOn=function($,m){var S=this.displayed_[this.row_];S+=m,this.displayed_[this.row_]=S};var un={CaptionStream:yt,Cea608Stream:mt,Cea708Stream:Ze},jt={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},cd=8589934592,cn=4294967296,Tt="shared",da=function(m,S){var y=1;for(m>S&&(y=-1);Math.abs(S-m)>cn;)m+=y*cd;return m},ds=function $(m){var S,y;$.prototype.init.call(this),this.type_=m||Tt,this.push=function(w){this.type_!==Tt&&w.type!==this.type_||(y===void 0&&(y=w.dts),w.dts=da(w.dts,y),w.pts=da(w.pts,y),S=w.dts,this.trigger("data",w))},this.flush=function(){y=S,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){y=void 0,S=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};ds.prototype=new e;var mu={TimestampRolloverStream:ds,handleRollover:da},gu=function(m,S,y){var w,x="";for(w=S;w<y;w++)x+="%"+("00"+m[w].toString(16)).slice(-2);return x},fa=function(m,S,y){return decodeURIComponent(gu(m,S,y))},vu=function(m,S,y){return unescape(gu(m,S,y))},Mn=function(m){return m[0]<<21|m[1]<<14|m[2]<<7|m[3]},pa={TXXX:function(m){var S;if(m.data[0]===3){for(S=1;S<m.data.length;S++)if(m.data[S]===0){m.description=fa(m.data,1,S),m.value=fa(m.data,S+1,m.data.length).replace(/\0*$/,"");break}m.data=m.value}},WXXX:function(m){var S;if(m.data[0]===3){for(S=1;S<m.data.length;S++)if(m.data[S]===0){m.description=fa(m.data,1,S),m.url=fa(m.data,S+1,m.data.length);break}}},PRIV:function(m){var S;for(S=0;S<m.data.length;S++)if(m.data[S]===0){m.owner=vu(m.data,0,S);break}m.privateData=m.data.subarray(S+1),m.data=m.privateData}},fs;fs=function(m){var S={descriptor:m&&m.descriptor},y=0,w=[],x=0,L;if(fs.prototype.init.call(this),this.dispatchType=jt.METADATA_STREAM_TYPE.toString(16),S.descriptor)for(L=0;L<S.descriptor.length;L++)this.dispatchType+=("00"+S.descriptor[L].toString(16)).slice(-2);this.push=function(q){var X,ie,Z,re,ge,Ee;if(q.type==="timed-metadata"){if(q.dataAlignmentIndicator&&(x=0,w.length=0),w.length===0&&(q.data.length<10||q.data[0]!==73||q.data[1]!==68||q.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(w.push(q),x+=q.data.byteLength,w.length===1&&(y=Mn(q.data.subarray(6,10)),y+=10),!(x<y)){for(X={data:new Uint8Array(y),frames:[],pts:w[0].pts,dts:w[0].dts},ge=0;ge<y;)X.data.set(w[0].data.subarray(0,y-ge),ge),ge+=w[0].data.byteLength,x-=w[0].data.byteLength,w.shift();ie=10,X.data[5]&64&&(ie+=4,ie+=Mn(X.data.subarray(10,14)),y-=Mn(X.data.subarray(16,20)));do{if(Z=Mn(X.data.subarray(ie+4,ie+8)),Z<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});return}if(Ee=String.fromCharCode(X.data[ie],X.data[ie+1],X.data[ie+2],X.data[ie+3]),re={id:Ee,data:X.data.subarray(ie+10,ie+Z+10)},re.key=re.id,pa[re.id]&&(pa[re.id](re),re.owner==="com.apple.streaming.transportStreamTimestamp")){var Pe=re.data,Se=(Pe[3]&1)<<30|Pe[4]<<22|Pe[5]<<14|Pe[6]<<6|Pe[7]>>>2;Se*=4,Se+=Pe[7]&3,re.timeStamp=Se,X.pts===void 0&&X.dts===void 0&&(X.pts=re.timeStamp,X.dts=re.timeStamp),this.trigger("timestamp",re)}X.frames.push(re),ie+=10,ie+=Z}while(ie<y);this.trigger("data",X)}}}},fs.prototype=new e;var hd=fs,dd=mu.TimestampRolloverStream,hn,Br,ps,ur=188,dn=71;hn=function(){var m=new Uint8Array(ur),S=0;hn.prototype.init.call(this),this.push=function(y){var w=0,x=ur,L;for(S?(L=new Uint8Array(y.byteLength+S),L.set(m.subarray(0,S)),L.set(y,S),S=0):L=y;x<L.byteLength;){if(L[w]===dn&&L[x]===dn){this.trigger("data",L.subarray(w,x)),w+=ur,x+=ur;continue}w++,x++}w<L.byteLength&&(m.set(L.subarray(w),0),S=L.byteLength-w)},this.flush=function(){S===ur&&m[0]===dn&&(this.trigger("data",m),S=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){S=0,this.trigger("reset")}},hn.prototype=new e,Br=function(){var m,S,y,w;Br.prototype.init.call(this),w=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,m=function(L,q){var X=0;q.payloadUnitStartIndicator&&(X+=L[X]+1),q.type==="pat"?S(L.subarray(X),q):y(L.subarray(X),q)},S=function(L,q){q.section_number=L[7],q.last_section_number=L[8],w.pmtPid=(L[10]&31)<<8|L[11],q.pmtPid=w.pmtPid},y=function(L,q){var X,ie,Z,re;if(L[5]&1){for(w.programMapTable={video:null,audio:null,"timed-metadata":{}},X=(L[1]&15)<<8|L[2],ie=3+X-4,Z=(L[10]&15)<<8|L[11],re=12+Z;re<ie;){var ge=L[re],Ee=(L[re+1]&31)<<8|L[re+2];ge===jt.H264_STREAM_TYPE&&w.programMapTable.video===null?w.programMapTable.video=Ee:ge===jt.ADTS_STREAM_TYPE&&w.programMapTable.audio===null?w.programMapTable.audio=Ee:ge===jt.METADATA_STREAM_TYPE&&(w.programMapTable["timed-metadata"][Ee]=ge),re+=((L[re+3]&15)<<8|L[re+4])+5}q.programMapTable=w.programMapTable}},this.push=function(x){var L={},q=4;if(L.payloadUnitStartIndicator=!!(x[1]&64),L.pid=x[1]&31,L.pid<<=8,L.pid|=x[2],(x[3]&48)>>>4>1&&(q+=x[q]+1),L.pid===0)L.type="pat",m(x.subarray(q),L),this.trigger("data",L);else if(L.pid===this.pmtPid)for(L.type="pmt",m(x.subarray(q),L),this.trigger("data",L);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([x,q,L]):this.processPes_(x,q,L)},this.processPes_=function(x,L,q){q.pid===this.programMapTable.video?q.streamType=jt.H264_STREAM_TYPE:q.pid===this.programMapTable.audio?q.streamType=jt.ADTS_STREAM_TYPE:q.streamType=this.programMapTable["timed-metadata"][q.pid],q.type="pes",q.data=x.subarray(L),this.trigger("data",q)}},Br.prototype=new e,Br.STREAM_TYPES={h264:27,adts:15},ps=function(){var m=this,S=!1,y={data:[],size:0},w={data:[],size:0},x={data:[],size:0},L,q=function(Z,re){var ge,Ee=Z[0]<<16|Z[1]<<8|Z[2];re.data=new Uint8Array,Ee===1&&(re.packetLength=6+(Z[4]<<8|Z[5]),re.dataAlignmentIndicator=(Z[6]&4)!==0,ge=Z[7],ge&192&&(re.pts=(Z[9]&14)<<27|(Z[10]&255)<<20|(Z[11]&254)<<12|(Z[12]&255)<<5|(Z[13]&254)>>>3,re.pts*=4,re.pts+=(Z[13]&6)>>>1,re.dts=re.pts,ge&64&&(re.dts=(Z[14]&14)<<27|(Z[15]&255)<<20|(Z[16]&254)<<12|(Z[17]&255)<<5|(Z[18]&254)>>>3,re.dts*=4,re.dts+=(Z[18]&6)>>>1)),re.data=Z.subarray(9+Z[8]))},X=function(Z,re,ge){var Ee=new Uint8Array(Z.size),Pe={type:re},Se=0,ze=0,Ot=!1,li;if(!(!Z.data.length||Z.size<9)){for(Pe.trackId=Z.data[0].pid,Se=0;Se<Z.data.length;Se++)li=Z.data[Se],Ee.set(li.data,ze),ze+=li.data.byteLength;q(Ee,Pe),Ot=re==="video"||Pe.packetLength<=Z.size,(ge||Ot)&&(Z.size=0,Z.data.length=0),Ot&&m.trigger("data",Pe)}};ps.prototype.init.call(this),this.push=function(ie){({pat:function(){},pes:function(){var re,ge;switch(ie.streamType){case jt.H264_STREAM_TYPE:re=y,ge="video";break;case jt.ADTS_STREAM_TYPE:re=w,ge="audio";break;case jt.METADATA_STREAM_TYPE:re=x,ge="timed-metadata";break;default:return}ie.payloadUnitStartIndicator&&X(re,ge,!0),re.data.push(ie),re.size+=ie.data.byteLength},pmt:function(){var re={type:"metadata",tracks:[]};L=ie.programMapTable,L.video!==null&&re.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+L.video,codec:"avc",type:"video"}),L.audio!==null&&re.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+L.audio,codec:"adts",type:"audio"}),S=!0,m.trigger("data",re)}})[ie.type]()},this.reset=function(){y.size=0,y.data.length=0,w.size=0,w.data.length=0,this.trigger("reset")},this.flushStreams_=function(){X(y,"video"),X(w,"audio"),X(x,"timed-metadata")},this.flush=function(){if(!S&&L){var ie={type:"metadata",tracks:[]};L.video!==null&&ie.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+L.video,codec:"avc",type:"video"}),L.audio!==null&&ie.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+L.audio,codec:"adts",type:"audio"}),m.trigger("data",ie)}S=!1,this.flushStreams_(),this.trigger("done")}},ps.prototype=new e;var Rn={PAT_PID:0,MP2T_PACKET_LENGTH:ur,TransportPacketStream:hn,TransportParseStream:Br,ElementaryStream:ps,TimestampRolloverStream:dd,CaptionStream:un.CaptionStream,Cea608Stream:un.Cea608Stream,Cea708Stream:un.Cea708Stream,MetadataStream:hd};for(var fn in jt)jt.hasOwnProperty(fn)&&(Rn[fn]=jt[fn]);var br=Rn,yu=tt.ONE_SECOND_IN_TS,ma,_u=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];ma=function(m){var S,y=0;ma.prototype.init.call(this),this.skipWarn_=function(w,x){this.trigger("log",{level:"warn",message:"adts skiping bytes "+w+" to "+x+" in frame "+y+" outside syncword"})},this.push=function(w){var x=0,L,q,X,ie,Z;if(m||(y=0),w.type==="audio"){S&&S.length?(X=S,S=new Uint8Array(X.byteLength+w.data.byteLength),S.set(X),S.set(w.data,X.byteLength)):S=w.data;for(var re;x+7<S.length;){if(S[x]!==255||(S[x+1]&246)!==240){typeof re!="number"&&(re=x),x++;continue}if(typeof re=="number"&&(this.skipWarn_(re,x),re=null),q=(~S[x+1]&1)*2,L=(S[x+3]&3)<<11|S[x+4]<<3|(S[x+5]&224)>>5,ie=((S[x+6]&3)+1)*1024,Z=ie*yu/_u[(S[x+2]&60)>>>2],S.byteLength-x<L)break;this.trigger("data",{pts:w.pts+y*Z,dts:w.dts+y*Z,sampleCount:ie,audioobjecttype:(S[x+2]>>>6&3)+1,channelcount:(S[x+2]&1)<<2|(S[x+3]&192)>>>6,samplerate:_u[(S[x+2]&60)>>>2],samplingfrequencyindex:(S[x+2]&60)>>>2,samplesize:16,data:S.subarray(x+7+q,x+L)}),y++,x+=L}typeof re=="number"&&(this.skipWarn_(re,x),re=null),S=S.subarray(x)}},this.flush=function(){y=0,this.trigger("done")},this.reset=function(){S=void 0,this.trigger("reset")},this.endTimeline=function(){S=void 0,this.trigger("endedtimeline")}},ma.prototype=new e;var Sr=ma,ms;ms=function(m){var S=m.byteLength,y=0,w=0;this.length=function(){return 8*S},this.bitsAvailable=function(){return 8*S+w},this.loadWord=function(){var x=m.byteLength-S,L=new Uint8Array(4),q=Math.min(4,S);if(q===0)throw new Error("no bytes available");L.set(m.subarray(x,x+q)),y=new DataView(L.buffer).getUint32(0),w=q*8,S-=q},this.skipBits=function(x){var L;w>x?(y<<=x,w-=x):(x-=w,L=Math.floor(x/8),x-=L*8,S-=L,this.loadWord(),y<<=x,w-=x)},this.readBits=function(x){var L=Math.min(w,x),q=y>>>32-L;return w-=L,w>0?y<<=L:S>0&&this.loadWord(),L=x-L,L>0?q<<L|this.readBits(L):q},this.skipLeadingZeros=function(){var x;for(x=0;x<w;++x)if((y&2147483648>>>x)!==0)return y<<=x,w-=x,x;return this.loadWord(),x+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var x=this.skipLeadingZeros();return this.readBits(x+1)-1},this.readExpGolomb=function(){var x=this.readUnsignedExpGolomb();return 1&x?1+x>>>1:-1*(x>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var fd=ms,Bn,Fn,Ri;Fn=function(){var m=0,S,y;Fn.prototype.init.call(this),this.push=function(w){var x;y?(x=new Uint8Array(y.byteLength+w.data.byteLength),x.set(y),x.set(w.data,y.byteLength),y=x):y=w.data;for(var L=y.byteLength;m<L-3;m++)if(y[m+2]===1){S=m+5;break}for(;S<L;)switch(y[S]){case 0:if(y[S-1]!==0){S+=2;break}else if(y[S-2]!==0){S++;break}m+3!==S-2&&this.trigger("data",y.subarray(m+3,S-2));do S++;while(y[S]!==1&&S<L);m=S-2,S+=3;break;case 1:if(y[S-1]!==0||y[S-2]!==0){S+=3;break}this.trigger("data",y.subarray(m+3,S-2)),m=S-2,S+=3;break;default:S+=3;break}y=y.subarray(m),S-=m,m=0},this.reset=function(){y=null,m=0,this.trigger("reset")},this.flush=function(){y&&y.byteLength>3&&this.trigger("data",y.subarray(m+3)),y=null,m=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Fn.prototype=new e,Ri={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Bn=function(){var m=new Fn,S,y,w,x,L,q,X;Bn.prototype.init.call(this),S=this,this.push=function(ie){ie.type==="video"&&(y=ie.trackId,w=ie.pts,x=ie.dts,m.push(ie))},m.on("data",function(ie){var Z={trackId:y,pts:w,dts:x,data:ie,nalUnitTypeCode:ie[0]&31};switch(Z.nalUnitTypeCode){case 5:Z.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:Z.nalUnitType="sei_rbsp",Z.escapedRBSP=L(ie.subarray(1));break;case 7:Z.nalUnitType="seq_parameter_set_rbsp",Z.escapedRBSP=L(ie.subarray(1)),Z.config=q(Z.escapedRBSP);break;case 8:Z.nalUnitType="pic_parameter_set_rbsp";break;case 9:Z.nalUnitType="access_unit_delimiter_rbsp";break}S.trigger("data",Z)}),m.on("done",function(){S.trigger("done")}),m.on("partialdone",function(){S.trigger("partialdone")}),m.on("reset",function(){S.trigger("reset")}),m.on("endedtimeline",function(){S.trigger("endedtimeline")}),this.flush=function(){m.flush()},this.partialFlush=function(){m.partialFlush()},this.reset=function(){m.reset()},this.endTimeline=function(){m.endTimeline()},X=function(Z,re){var ge=8,Ee=8,Pe,Se;for(Pe=0;Pe<Z;Pe++)Ee!==0&&(Se=re.readExpGolomb(),Ee=(ge+Se+256)%256),ge=Ee===0?ge:Ee},L=function(Z){for(var re=Z.byteLength,ge=[],Ee=1,Pe,Se;Ee<re-2;)Z[Ee]===0&&Z[Ee+1]===0&&Z[Ee+2]===3?(ge.push(Ee+2),Ee+=2):Ee++;if(ge.length===0)return Z;Pe=re-ge.length,Se=new Uint8Array(Pe);var ze=0;for(Ee=0;Ee<Pe;ze++,Ee++)ze===ge[0]&&(ze++,ge.shift()),Se[Ee]=Z[ze];return Se},q=function(Z){var re=0,ge=0,Ee=0,Pe=0,Se,ze,Ot,li,Ki,Qo,Jo,Zo,Fu,el,tl,Mt=[1,1],Uu,Er;if(Se=new fd(Z),ze=Se.readUnsignedByte(),li=Se.readUnsignedByte(),Ot=Se.readUnsignedByte(),Se.skipUnsignedExpGolomb(),Ri[ze]&&(Ki=Se.readUnsignedExpGolomb(),Ki===3&&Se.skipBits(1),Se.skipUnsignedExpGolomb(),Se.skipUnsignedExpGolomb(),Se.skipBits(1),Se.readBoolean()))for(tl=Ki!==3?8:12,Er=0;Er<tl;Er++)Se.readBoolean()&&(Er<6?X(16,Se):X(64,Se));if(Se.skipUnsignedExpGolomb(),Qo=Se.readUnsignedExpGolomb(),Qo===0)Se.readUnsignedExpGolomb();else if(Qo===1)for(Se.skipBits(1),Se.skipExpGolomb(),Se.skipExpGolomb(),Jo=Se.readUnsignedExpGolomb(),Er=0;Er<Jo;Er++)Se.skipExpGolomb();if(Se.skipUnsignedExpGolomb(),Se.skipBits(1),Zo=Se.readUnsignedExpGolomb(),Fu=Se.readUnsignedExpGolomb(),el=Se.readBits(1),el===0&&Se.skipBits(1),Se.skipBits(1),Se.readBoolean()&&(re=Se.readUnsignedExpGolomb(),ge=Se.readUnsignedExpGolomb(),Ee=Se.readUnsignedExpGolomb(),Pe=Se.readUnsignedExpGolomb()),Se.readBoolean()&&Se.readBoolean()){switch(Uu=Se.readUnsignedByte(),Uu){case 1:Mt=[1,1];break;case 2:Mt=[12,11];break;case 3:Mt=[10,11];break;case 4:Mt=[16,11];break;case 5:Mt=[40,33];break;case 6:Mt=[24,11];break;case 7:Mt=[20,11];break;case 8:Mt=[32,11];break;case 9:Mt=[80,33];break;case 10:Mt=[18,11];break;case 11:Mt=[15,11];break;case 12:Mt=[64,33];break;case 13:Mt=[160,99];break;case 14:Mt=[4,3];break;case 15:Mt=[3,2];break;case 16:Mt=[2,1];break;case 255:{Mt=[Se.readUnsignedByte()<<8|Se.readUnsignedByte(),Se.readUnsignedByte()<<8|Se.readUnsignedByte()];break}}Mt&&Mt[0]/Mt[1]}return{profileIdc:ze,levelIdc:Ot,profileCompatibility:li,width:(Zo+1)*16-re*2-ge*2,height:(2-el)*(Fu+1)*16-Ee*2-Pe*2,sarRatio:Mt}}},Bn.prototype=new e;var pd={H264Stream:Bn},ga=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Un=function(m,S){var y=m[S+6]<<21|m[S+7]<<14|m[S+8]<<7|m[S+9],w=m[S+5],x=(w&16)>>4;return y=y>=0?y:0,x?y+20:y+10},va=function $(m,S){return m.length-S<10||m[S]!==73||m[S+1]!==68||m[S+2]!==51?S:(S+=Un(m,S),$(m,S))},$n=function(m){var S=va(m,0);return m.length>=S+2&&(m[S]&255)===255&&(m[S+1]&240)===240&&(m[S+1]&22)===16},ya=function(m){return m[0]<<21|m[1]<<14|m[2]<<7|m[3]},Tu=function(m,S,y){var w,x="";for(w=S;w<y;w++)x+="%"+("00"+m[w].toString(16)).slice(-2);return x},Go=function(m,S,y){return unescape(Tu(m,S,y))},md=function(m,S){var y=(m[S+5]&224)>>5,w=m[S+4]<<3,x=m[S+3]&6144;return x|w|y},gd=function(m,S){return m[S]===73&&m[S+1]===68&&m[S+2]===51?"timed-metadata":m[S]&!0&&(m[S+1]&240)===240?"audio":null},vd=function(m){for(var S=0;S+5<m.length;){if(m[S]!==255||(m[S+1]&246)!==240){S++;continue}return ga[(m[S+2]&60)>>>2]}return null},_a=function(m){var S,y,w,x;S=10,m[5]&64&&(S+=4,S+=ya(m.subarray(10,14)));do{if(y=ya(m.subarray(S+4,S+8)),y<1)return null;if(x=String.fromCharCode(m[S],m[S+1],m[S+2],m[S+3]),x==="PRIV"){w=m.subarray(S+10,S+y+10);for(var L=0;L<w.byteLength;L++)if(w[L]===0){var q=Go(w,0,L);if(q==="com.apple.streaming.transportStreamTimestamp"){var X=w.subarray(L+1),ie=(X[3]&1)<<30|X[4]<<22|X[5]<<14|X[6]<<6|X[7]>>>2;return ie*=4,ie+=X[7]&3,ie}break}}S+=10,S+=y}while(S<m.byteLength);return null},gs={isLikelyAacData:$n,parseId3TagSize:Un,parseAdtsSize:md,parseType:gd,parseSampleRate:vd,parseAacTimestamp:_a},Ta;Ta=function(){var m=new Uint8Array,S=0;Ta.prototype.init.call(this),this.setTimestamp=function(y){S=y},this.push=function(y){var w=0,x=0,L,q,X,ie;for(m.length?(ie=m.length,m=new Uint8Array(y.byteLength+ie),m.set(m.subarray(0,ie)),m.set(y,ie)):m=y;m.length-x>=3;){if(m[x]===73&&m[x+1]===68&&m[x+2]===51){if(m.length-x<10||(w=gs.parseId3TagSize(m,x),x+w>m.length))break;q={type:"timed-metadata",data:m.subarray(x,x+w)},this.trigger("data",q),x+=w;continue}else if((m[x]&255)===255&&(m[x+1]&240)===240){if(m.length-x<7||(w=gs.parseAdtsSize(m,x),x+w>m.length))break;X={type:"audio",data:m.subarray(x,x+w),pts:S,dts:S},this.trigger("data",X),x+=w;continue}x++}L=m.length-x,L>0?m=m.subarray(x):m=new Uint8Array},this.reset=function(){m=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){m=new Uint8Array,this.trigger("endedtimeline")}},Ta.prototype=new e;var bu=Ta,yd=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Ko=yd,_d=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],vs=_d,ba=pd.H264Stream,Su=gs.isLikelyAacData,Td=tt.ONE_SECOND_IN_TS,Sa,jn,ys,pn,Cu=function(m,S){S.stream=m,this.trigger("log",S)},Eu=function(m,S){for(var y=Object.keys(S),w=0;w<y.length;w++){var x=y[w];x==="headOfPipeline"||!S[x].on||S[x].on("log",Cu.bind(m,x))}},wu=function(m,S){var y;if(m.length!==S.length)return!1;for(y=0;y<m.length;y++)if(m[y]!==S[y])return!1;return!0},ku=function(m,S,y,w,x,L){var q=y-S,X=w-S,ie=x-y;return{start:{dts:m,pts:m+q},end:{dts:m+X,pts:m+ie},prependedContentDuration:L,baseMediaDecodeTime:m}};jn=function(m,S){var y=[],w,x=0,L=0,q=1/0;S=S||{},w=S.firstSequenceNumber||0,jn.prototype.init.call(this),this.push=function(X){j.collectDtsInfo(m,X),m&&Ko.forEach(function(ie){m[ie]=X[ie]}),y.push(X)},this.setEarliestDts=function(X){x=X},this.setVideoBaseMediaDecodeTime=function(X){q=X},this.setAudioAppendStart=function(X){L=X},this.flush=function(){var X,ie,Z,re,ge,Ee,Pe;if(y.length===0){this.trigger("done","AudioSegmentStream");return}X=Mr.trimAdtsFramesByEarliestDts(y,m,x),m.baseMediaDecodeTime=j.calculateTrackBaseMediaDecodeTime(m,S.keepOriginalTimestamps),Pe=Mr.prefixWithSilence(m,X,L,q),m.samples=Mr.generateSampleTable(X),Z=Je.mdat(Mr.concatenateFrameData(X)),y=[],ie=Je.moof(w,[m]),re=new Uint8Array(ie.byteLength+Z.byteLength),w++,re.set(ie),re.set(Z,ie.byteLength),j.clearDtsInfo(m),ge=Math.ceil(Td*1024/m.samplerate),X.length&&(Ee=X.length*ge,this.trigger("segmentTimingInfo",ku(tt.audioTsToVideoTs(m.baseMediaDecodeTime,m.samplerate),X[0].dts,X[0].pts,X[0].dts+Ee,X[0].pts+Ee,Pe||0)),this.trigger("timingInfo",{start:X[0].pts,end:X[0].pts+Ee})),this.trigger("data",{track:m,boxes:re}),this.trigger("done","AudioSegmentStream")},this.reset=function(){j.clearDtsInfo(m),y=[],this.trigger("reset")}},jn.prototype=new e,Sa=function(m,S){var y,w=[],x=[],L,q;S=S||{},y=S.firstSequenceNumber||0,Sa.prototype.init.call(this),delete m.minPTS,this.gopCache_=[],this.push=function(X){j.collectDtsInfo(m,X),X.nalUnitType==="seq_parameter_set_rbsp"&&!L&&(L=X.config,m.sps=[X.data],vs.forEach(function(ie){m[ie]=L[ie]},this)),X.nalUnitType==="pic_parameter_set_rbsp"&&!q&&(q=X.data,m.pps=[X.data]),w.push(X)},this.flush=function(){for(var X,ie,Z,re,ge,Ee,Pe=0,Se,ze;w.length&&w[0].nalUnitType!=="access_unit_delimiter_rbsp";)w.shift();if(w.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(X=Te.groupNalsIntoFrames(w),Z=Te.groupFramesIntoGops(X),Z[0][0].keyFrame||(ie=this.getGopForFusion_(w[0],m),ie?(Pe=ie.duration,Z.unshift(ie),Z.byteLength+=ie.byteLength,Z.nalCount+=ie.nalCount,Z.pts=ie.pts,Z.dts=ie.dts,Z.duration+=ie.duration):Z=Te.extendFirstKeyFrame(Z)),x.length){var Ot;if(S.alignGopsAtEnd?Ot=this.alignGopsAtEnd_(Z):Ot=this.alignGopsAtStart_(Z),!Ot){this.gopCache_.unshift({gop:Z.pop(),pps:m.pps,sps:m.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),w=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}j.clearDtsInfo(m),Z=Ot}j.collectDtsInfo(m,Z),m.samples=Te.generateSampleTable(Z),ge=Je.mdat(Te.concatenateNalData(Z)),m.baseMediaDecodeTime=j.calculateTrackBaseMediaDecodeTime(m,S.keepOriginalTimestamps),this.trigger("processedGopsInfo",Z.map(function(li){return{pts:li.pts,dts:li.dts,byteLength:li.byteLength}})),Se=Z[0],ze=Z[Z.length-1],this.trigger("segmentTimingInfo",ku(m.baseMediaDecodeTime,Se.dts,Se.pts,ze.dts+ze.duration,ze.pts+ze.duration,Pe)),this.trigger("timingInfo",{start:Z[0].pts,end:Z[Z.length-1].pts+Z[Z.length-1].duration}),this.gopCache_.unshift({gop:Z.pop(),pps:m.pps,sps:m.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),w=[],this.trigger("baseMediaDecodeTime",m.baseMediaDecodeTime),this.trigger("timelineStartInfo",m.timelineStartInfo),re=Je.moof(y,[m]),Ee=new Uint8Array(re.byteLength+ge.byteLength),y++,Ee.set(re),Ee.set(ge,re.byteLength),this.trigger("data",{track:m,boxes:Ee}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),w=[],this.gopCache_.length=0,x.length=0,this.trigger("reset")},this.resetStream_=function(){j.clearDtsInfo(m),L=void 0,q=void 0},this.getGopForFusion_=function(X){var ie=45e3,Z=1/0,re,ge,Ee,Pe,Se;for(Se=0;Se<this.gopCache_.length;Se++)Pe=this.gopCache_[Se],Ee=Pe.gop,!(!(m.pps&&wu(m.pps[0],Pe.pps[0]))||!(m.sps&&wu(m.sps[0],Pe.sps[0])))&&(Ee.dts<m.timelineStartInfo.dts||(re=X.dts-Ee.dts-Ee.duration,re>=-1e4&&re<=ie&&(!ge||Z>re)&&(ge=Pe,Z=re)));return ge?ge.gop:null},this.alignGopsAtStart_=function(X){var ie,Z,re,ge,Ee,Pe,Se,ze;for(Ee=X.byteLength,Pe=X.nalCount,Se=X.duration,ie=Z=0;ie<x.length&&Z<X.length&&(re=x[ie],ge=X[Z],re.pts!==ge.pts);){if(ge.pts>re.pts){ie++;continue}Z++,Ee-=ge.byteLength,Pe-=ge.nalCount,Se-=ge.duration}return Z===0?X:Z===X.length?null:(ze=X.slice(Z),ze.byteLength=Ee,ze.duration=Se,ze.nalCount=Pe,ze.pts=ze[0].pts,ze.dts=ze[0].dts,ze)},this.alignGopsAtEnd_=function(X){var ie,Z,re,ge,Ee,Pe;for(ie=x.length-1,Z=X.length-1,Ee=null,Pe=!1;ie>=0&&Z>=0;){if(re=x[ie],ge=X[Z],re.pts===ge.pts){Pe=!0;break}if(re.pts>ge.pts){ie--;continue}ie===x.length-1&&(Ee=Z),Z--}if(!Pe&&Ee===null)return null;var Se;if(Pe?Se=Z:Se=Ee,Se===0)return X;var ze=X.slice(Se),Ot=ze.reduce(function(li,Ki){return li.byteLength+=Ki.byteLength,li.duration+=Ki.duration,li.nalCount+=Ki.nalCount,li},{byteLength:0,duration:0,nalCount:0});return ze.byteLength=Ot.byteLength,ze.duration=Ot.duration,ze.nalCount=Ot.nalCount,ze.pts=ze[0].pts,ze.dts=ze[0].dts,ze},this.alignGopsWith=function(X){x=X}},Sa.prototype=new e,pn=function(m,S){this.numberOfTracks=0,this.metadataStream=S,m=m||{},typeof m.remux<"u"?this.remuxTracks=!!m.remux:this.remuxTracks=!0,typeof m.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=m.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,pn.prototype.init.call(this),this.push=function(y){if(y.text)return this.pendingCaptions.push(y);if(y.frames)return this.pendingMetadata.push(y);this.pendingTracks.push(y.track),this.pendingBytes+=y.boxes.byteLength,y.track.type==="video"&&(this.videoTrack=y.track,this.pendingBoxes.push(y.boxes)),y.track.type==="audio"&&(this.audioTrack=y.track,this.pendingBoxes.unshift(y.boxes))}},pn.prototype=new e,pn.prototype.flush=function($){var m=0,S={captions:[],captionStreams:{},metadata:[],info:{}},y,w,x,L=0,q;if(this.pendingTracks.length<this.numberOfTracks){if($!=="VideoSegmentStream"&&$!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(L=this.videoTrack.timelineStartInfo.pts,vs.forEach(function(X){S.info[X]=this.videoTrack[X]},this)):this.audioTrack&&(L=this.audioTrack.timelineStartInfo.pts,Ko.forEach(function(X){S.info[X]=this.audioTrack[X]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?S.type=this.pendingTracks[0].type:S.type="combined",this.emittedTracks+=this.pendingTracks.length,x=Je.initSegment(this.pendingTracks),S.initSegment=new Uint8Array(x.byteLength),S.initSegment.set(x),S.data=new Uint8Array(this.pendingBytes),q=0;q<this.pendingBoxes.length;q++)S.data.set(this.pendingBoxes[q],m),m+=this.pendingBoxes[q].byteLength;for(q=0;q<this.pendingCaptions.length;q++)y=this.pendingCaptions[q],y.startTime=tt.metadataTsToSeconds(y.startPts,L,this.keepOriginalTimestamps),y.endTime=tt.metadataTsToSeconds(y.endPts,L,this.keepOriginalTimestamps),S.captionStreams[y.stream]=!0,S.captions.push(y);for(q=0;q<this.pendingMetadata.length;q++)w=this.pendingMetadata[q],w.cueTime=tt.metadataTsToSeconds(w.pts,L,this.keepOriginalTimestamps),S.metadata.push(w);for(S.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",S),q=0;q<S.captions.length;q++)y=S.captions[q],this.trigger("caption",y);for(q=0;q<S.metadata.length;q++)w=S.metadata[q],this.trigger("id3Frame",w)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},pn.prototype.setRemux=function($){this.remuxTracks=$},ys=function(m){var S=this,y=!0,w,x;ys.prototype.init.call(this),m=m||{},this.baseMediaDecodeTime=m.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var L={};this.transmuxPipeline_=L,L.type="aac",L.metadataStream=new br.MetadataStream,L.aacStream=new bu,L.audioTimestampRolloverStream=new br.TimestampRolloverStream("audio"),L.timedMetadataTimestampRolloverStream=new br.TimestampRolloverStream("timed-metadata"),L.adtsStream=new Sr,L.coalesceStream=new pn(m,L.metadataStream),L.headOfPipeline=L.aacStream,L.aacStream.pipe(L.audioTimestampRolloverStream).pipe(L.adtsStream),L.aacStream.pipe(L.timedMetadataTimestampRolloverStream).pipe(L.metadataStream).pipe(L.coalesceStream),L.metadataStream.on("timestamp",function(q){L.aacStream.setTimestamp(q.timeStamp)}),L.aacStream.on("data",function(q){q.type!=="timed-metadata"&&q.type!=="audio"||L.audioSegmentStream||(x=x||{timelineStartInfo:{baseMediaDecodeTime:S.baseMediaDecodeTime},codec:"adts",type:"audio"},L.coalesceStream.numberOfTracks++,L.audioSegmentStream=new jn(x,m),L.audioSegmentStream.on("log",S.getLogTrigger_("audioSegmentStream")),L.audioSegmentStream.on("timingInfo",S.trigger.bind(S,"audioTimingInfo")),L.adtsStream.pipe(L.audioSegmentStream).pipe(L.coalesceStream),S.trigger("trackinfo",{hasAudio:!!x,hasVideo:!!w}))}),L.coalesceStream.on("data",this.trigger.bind(this,"data")),L.coalesceStream.on("done",this.trigger.bind(this,"done")),Eu(this,L)},this.setupTsPipeline=function(){var L={};this.transmuxPipeline_=L,L.type="ts",L.metadataStream=new br.MetadataStream,L.packetStream=new br.TransportPacketStream,L.parseStream=new br.TransportParseStream,L.elementaryStream=new br.ElementaryStream,L.timestampRolloverStream=new br.TimestampRolloverStream,L.adtsStream=new Sr,L.h264Stream=new ba,L.captionStream=new br.CaptionStream(m),L.coalesceStream=new pn(m,L.metadataStream),L.headOfPipeline=L.packetStream,L.packetStream.pipe(L.parseStream).pipe(L.elementaryStream).pipe(L.timestampRolloverStream),L.timestampRolloverStream.pipe(L.h264Stream),L.timestampRolloverStream.pipe(L.adtsStream),L.timestampRolloverStream.pipe(L.metadataStream).pipe(L.coalesceStream),L.h264Stream.pipe(L.captionStream).pipe(L.coalesceStream),L.elementaryStream.on("data",function(q){var X;if(q.type==="metadata"){for(X=q.tracks.length;X--;)!w&&q.tracks[X].type==="video"?(w=q.tracks[X],w.timelineStartInfo.baseMediaDecodeTime=S.baseMediaDecodeTime):!x&&q.tracks[X].type==="audio"&&(x=q.tracks[X],x.timelineStartInfo.baseMediaDecodeTime=S.baseMediaDecodeTime);w&&!L.videoSegmentStream&&(L.coalesceStream.numberOfTracks++,L.videoSegmentStream=new Sa(w,m),L.videoSegmentStream.on("log",S.getLogTrigger_("videoSegmentStream")),L.videoSegmentStream.on("timelineStartInfo",function(ie){x&&!m.keepOriginalTimestamps&&(x.timelineStartInfo=ie,L.audioSegmentStream.setEarliestDts(ie.dts-S.baseMediaDecodeTime))}),L.videoSegmentStream.on("processedGopsInfo",S.trigger.bind(S,"gopInfo")),L.videoSegmentStream.on("segmentTimingInfo",S.trigger.bind(S,"videoSegmentTimingInfo")),L.videoSegmentStream.on("baseMediaDecodeTime",function(ie){x&&L.audioSegmentStream.setVideoBaseMediaDecodeTime(ie)}),L.videoSegmentStream.on("timingInfo",S.trigger.bind(S,"videoTimingInfo")),L.h264Stream.pipe(L.videoSegmentStream).pipe(L.coalesceStream)),x&&!L.audioSegmentStream&&(L.coalesceStream.numberOfTracks++,L.audioSegmentStream=new jn(x,m),L.audioSegmentStream.on("log",S.getLogTrigger_("audioSegmentStream")),L.audioSegmentStream.on("timingInfo",S.trigger.bind(S,"audioTimingInfo")),L.audioSegmentStream.on("segmentTimingInfo",S.trigger.bind(S,"audioSegmentTimingInfo")),L.adtsStream.pipe(L.audioSegmentStream).pipe(L.coalesceStream)),S.trigger("trackinfo",{hasAudio:!!x,hasVideo:!!w})}}),L.coalesceStream.on("data",this.trigger.bind(this,"data")),L.coalesceStream.on("id3Frame",function(q){q.dispatchType=L.metadataStream.dispatchType,S.trigger("id3Frame",q)}),L.coalesceStream.on("caption",this.trigger.bind(this,"caption")),L.coalesceStream.on("done",this.trigger.bind(this,"done")),Eu(this,L)},this.setBaseMediaDecodeTime=function(L){var q=this.transmuxPipeline_;m.keepOriginalTimestamps||(this.baseMediaDecodeTime=L),x&&(x.timelineStartInfo.dts=void 0,x.timelineStartInfo.pts=void 0,j.clearDtsInfo(x),q.audioTimestampRolloverStream&&q.audioTimestampRolloverStream.discontinuity()),w&&(q.videoSegmentStream&&(q.videoSegmentStream.gopCache_=[]),w.timelineStartInfo.dts=void 0,w.timelineStartInfo.pts=void 0,j.clearDtsInfo(w),q.captionStream.reset()),q.timestampRolloverStream&&q.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(L){x&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(L)},this.setRemux=function(L){var q=this.transmuxPipeline_;m.remux=L,q&&q.coalesceStream&&q.coalesceStream.setRemux(L)},this.alignGopsWith=function(L){w&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(L)},this.getLogTrigger_=function(L){var q=this;return function(X){X.stream=L,q.trigger("log",X)}},this.push=function(L){if(y){var q=Su(L);q&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!q&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),y=!1}this.transmuxPipeline_.headOfPipeline.push(L)},this.flush=function(){y=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},ys.prototype=new e;var bd={Transmuxer:ys},Sd=function(m){return m>>>0},Cd=function(m){return("00"+m.toString(16)).slice(-2)},Vn={toUnsigned:Sd,toHexString:Cd},Ed=function(m){var S="";return S+=String.fromCharCode(m[0]),S+=String.fromCharCode(m[1]),S+=String.fromCharCode(m[2]),S+=String.fromCharCode(m[3]),S},Fr=Ed,Ca=Vn.toUnsigned,wd=function $(m,S){var y=[],w,x,L,q,X;if(!S.length)return null;for(w=0;w<m.byteLength;)x=Ca(m[w]<<24|m[w+1]<<16|m[w+2]<<8|m[w+3]),L=Fr(m.subarray(w+4,w+8)),q=x>1?w+x:m.byteLength,L===S[0]&&(S.length===1?y.push(m.subarray(w+8,q)):(X=$(m.subarray(w+8,q),S.slice(1)),X.length&&(y=y.concat(X)))),w=q;return y},bt=wd,kd=Vn.toUnsigned,xd=i.getUint64,Ad=function(m){var S={version:m[0],flags:new Uint8Array(m.subarray(1,4))};return S.version===1?S.baseMediaDecodeTime=xd(m.subarray(4)):S.baseMediaDecodeTime=kd(m[4]<<24|m[5]<<16|m[6]<<8|m[7]),S},_s=Ad,Ts=function(m){return{isLeading:(m[0]&12)>>>2,dependsOn:m[0]&3,isDependedOn:(m[1]&192)>>>6,hasRedundancy:(m[1]&48)>>>4,paddingValue:(m[1]&14)>>>1,isNonSyncSample:m[1]&1,degradationPriority:m[2]<<8|m[3]}},Hn=Ts,Ea=function(m){var S={version:m[0],flags:new Uint8Array(m.subarray(1,4)),samples:[]},y=new DataView(m.buffer,m.byteOffset,m.byteLength),w=S.flags[2]&1,x=S.flags[2]&4,L=S.flags[1]&1,q=S.flags[1]&2,X=S.flags[1]&4,ie=S.flags[1]&8,Z=y.getUint32(4),re=8,ge;for(w&&(S.dataOffset=y.getInt32(re),re+=4),x&&Z&&(ge={flags:Hn(m.subarray(re,re+4))},re+=4,L&&(ge.duration=y.getUint32(re),re+=4),q&&(ge.size=y.getUint32(re),re+=4),ie&&(S.version===1?ge.compositionTimeOffset=y.getInt32(re):ge.compositionTimeOffset=y.getUint32(re),re+=4),S.samples.push(ge),Z--);Z--;)ge={},L&&(ge.duration=y.getUint32(re),re+=4),q&&(ge.size=y.getUint32(re),re+=4),X&&(ge.flags=Hn(m.subarray(re,re+4)),re+=4),ie&&(S.version===1?ge.compositionTimeOffset=y.getInt32(re):ge.compositionTimeOffset=y.getUint32(re),re+=4),S.samples.push(ge);return S},Bi=Ea,Cr=function(m){var S=new DataView(m.buffer,m.byteOffset,m.byteLength),y={version:m[0],flags:new Uint8Array(m.subarray(1,4)),trackId:S.getUint32(4)},w=y.flags[2]&1,x=y.flags[2]&2,L=y.flags[2]&8,q=y.flags[2]&16,X=y.flags[2]&32,ie=y.flags[0]&65536,Z=y.flags[0]&131072,re;return re=8,w&&(re+=4,y.baseDataOffset=S.getUint32(12),re+=4),x&&(y.sampleDescriptionIndex=S.getUint32(re),re+=4),L&&(y.defaultSampleDuration=S.getUint32(re),re+=4),q&&(y.defaultSampleSize=S.getUint32(re),re+=4),X&&(y.defaultSampleFlags=S.getUint32(re)),ie&&(y.durationIsEmpty=!0),!w&&Z&&(y.baseDataOffsetIsMoof=!0),y},bs=Cr,Xo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},Ss;typeof window<"u"?Ss=window:typeof Xo<"u"?Ss=Xo:typeof self<"u"?Ss=self:Ss={};var Cs=Ss,Id=Ut.discardEmulationPreventionBytes,Pd=un.CaptionStream,xu=function(m,S){for(var y=m,w=0;w<S.length;w++){var x=S[w];if(y<x.size)return x;y-=x.size}return null},Au=function(m,S,y){var w=new DataView(m.buffer,m.byteOffset,m.byteLength),x={logs:[],seiNals:[]},L,q,X,ie;for(q=0;q+4<m.length;q+=X)if(X=w.getUint32(q),q+=4,!(X<=0))switch(m[q]&31){case 6:var Z=m.subarray(q+1,q+1+X),re=xu(q,S);if(L={nalUnitType:"sei_rbsp",size:X,data:Z,escapedRBSP:Id(Z),trackId:y},re)L.pts=re.pts,L.dts=re.dts,ie=re;else if(ie)L.pts=ie.pts,L.dts=ie.dts;else{x.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+q+" for trackId "+y+". See mux.js#223."});break}x.seiNals.push(L);break}return x},wa=function(m,S,y){var w=S,x=y.defaultSampleDuration||0,L=y.defaultSampleSize||0,q=y.trackId,X=[];return m.forEach(function(ie){var Z=Bi(ie),re=Z.samples;re.forEach(function(ge){ge.duration===void 0&&(ge.duration=x),ge.size===void 0&&(ge.size=L),ge.trackId=q,ge.dts=w,ge.compositionTimeOffset===void 0&&(ge.compositionTimeOffset=0),typeof w=="bigint"?(ge.pts=w+Cs.BigInt(ge.compositionTimeOffset),w+=Cs.BigInt(ge.duration)):(ge.pts=w+ge.compositionTimeOffset,w+=ge.duration)}),X=X.concat(re)}),X},Es=function(m,S){var y=bt(m,["moof","traf"]),w=bt(m,["mdat"]),x={},L=[];return w.forEach(function(q,X){var ie=y[X];L.push({mdat:q,traf:ie})}),L.forEach(function(q){var X=q.mdat,ie=q.traf,Z=bt(ie,["tfhd"]),re=bs(Z[0]),ge=re.trackId,Ee=bt(ie,["tfdt"]),Pe=Ee.length>0?_s(Ee[0]).baseMediaDecodeTime:0,Se=bt(ie,["trun"]),ze,Ot;S===ge&&Se.length>0&&(ze=wa(Se,Pe,re),Ot=Au(X,ze,ge),x[ge]||(x[ge]={seiNals:[],logs:[]}),x[ge].seiNals=x[ge].seiNals.concat(Ot.seiNals),x[ge].logs=x[ge].logs.concat(Ot.logs))}),x},ka=function(m,S,y){var w;if(S===null)return null;w=Es(m,S);var x=w[S]||{};return{seiNals:x.seiNals,logs:x.logs,timescale:y}},mn=function(){var m=!1,S,y,w,x,L,q;this.isInitialized=function(){return m},this.init=function(X){S=new Pd,m=!0,q=X?X.isPartial:!1,S.on("data",function(ie){ie.startTime=ie.startPts/x,ie.endTime=ie.endPts/x,L.captions.push(ie),L.captionStreams[ie.stream]=!0}),S.on("log",function(ie){L.logs.push(ie)})},this.isNewInit=function(X,ie){return X&&X.length===0||ie&&typeof ie=="object"&&Object.keys(ie).length===0?!1:w!==X[0]||x!==ie[w]},this.parse=function(X,ie,Z){var re;if(this.isInitialized()){if(!ie||!Z)return null;if(this.isNewInit(ie,Z))w=ie[0],x=Z[w];else if(w===null||!x)return y.push(X),null}else return null;for(;y.length>0;){var ge=y.shift();this.parse(ge,ie,Z)}return re=ka(X,w,x),re&&re.logs&&(L.logs=L.logs.concat(re.logs)),re===null||!re.seiNals?L.logs.length?{logs:L.logs,captions:[],captionStreams:[]}:null:(this.pushNals(re.seiNals),this.flushStream(),L)},this.pushNals=function(X){if(!this.isInitialized()||!X||X.length===0)return null;X.forEach(function(ie){S.push(ie)})},this.flushStream=function(){if(!this.isInitialized())return null;q?S.partialFlush():S.flush()},this.clearParsedCaptions=function(){L.captions=[],L.captionStreams={},L.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;S.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){y=[],w=null,x=null,L?this.clearParsedCaptions():L={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Dd=mn,ws=Vn.toUnsigned,qn=Vn.toHexString,Iu=i.getUint64,Pu,Du,Nu,ks,Lu,xa;Pu=function(m){var S={},y=bt(m,["moov","trak"]);return y.reduce(function(w,x){var L,q,X,ie,Z;return L=bt(x,["tkhd"])[0],!L||(q=L[0],X=q===0?12:20,ie=ws(L[X]<<24|L[X+1]<<16|L[X+2]<<8|L[X+3]),Z=bt(x,["mdia","mdhd"])[0],!Z)?null:(q=Z[0],X=q===0?12:20,w[ie]=ws(Z[X]<<24|Z[X+1]<<16|Z[X+2]<<8|Z[X+3]),w)},S)},Du=function(m,S){var y;y=bt(S,["moof","traf"]);var w=y.reduce(function(x,L){var q=bt(L,["tfhd"])[0],X=ws(q[4]<<24|q[5]<<16|q[6]<<8|q[7]),ie=m[X]||9e4,Z=bt(L,["tfdt"])[0],re=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),ge;Z[0]===1?ge=Iu(Z.subarray(4,12)):ge=re.getUint32(4);var Ee;return typeof ge=="bigint"?Ee=ge/Cs.BigInt(ie):typeof ge=="number"&&!isNaN(ge)&&(Ee=ge/ie),Ee<Number.MAX_SAFE_INTEGER&&(Ee=Number(Ee)),Ee<x&&(x=Ee),x},1/0);return typeof w=="bigint"||isFinite(w)?w:0},Nu=function(m,S){var y=bt(S,["moof","traf"]),w=0,x=0,L;if(y&&y.length){var q=bt(y[0],["tfhd"])[0],X=bt(y[0],["trun"])[0],ie=bt(y[0],["tfdt"])[0];if(q){var Z=bs(q);L=Z.trackId}if(ie){var re=_s(ie);w=re.baseMediaDecodeTime}if(X){var ge=Bi(X);ge.samples&&ge.samples.length&&(x=ge.samples[0].compositionTimeOffset||0)}}var Ee=m[L]||9e4;typeof w=="bigint"&&(x=Cs.BigInt(x),Ee=Cs.BigInt(Ee));var Pe=(w+x)/Ee;return typeof Pe=="bigint"&&Pe<Number.MAX_SAFE_INTEGER&&(Pe=Number(Pe)),Pe},ks=function(m){var S=bt(m,["moov","trak"]),y=[];return S.forEach(function(w){var x=bt(w,["mdia","hdlr"]),L=bt(w,["tkhd"]);x.forEach(function(q,X){var ie=Fr(q.subarray(8,12)),Z=L[X],re,ge,Ee;ie==="vide"&&(re=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),ge=re.getUint8(0),Ee=ge===0?re.getUint32(12):re.getUint32(20),y.push(Ee))})}),y},xa=function(m){var S=m[0],y=S===0?12:20;return ws(m[y]<<24|m[y+1]<<16|m[y+2]<<8|m[y+3])},Lu=function(m){var S=bt(m,["moov","trak"]),y=[];return S.forEach(function(w){var x={},L=bt(w,["tkhd"])[0],q,X;L&&(q=new DataView(L.buffer,L.byteOffset,L.byteLength),X=q.getUint8(0),x.id=X===0?q.getUint32(12):q.getUint32(20));var ie=bt(w,["mdia","hdlr"])[0];if(ie){var Z=Fr(ie.subarray(8,12));Z==="vide"?x.type="video":Z==="soun"?x.type="audio":x.type=Z}var re=bt(w,["mdia","minf","stbl","stsd"])[0];if(re){var ge=re.subarray(8);x.codec=Fr(ge.subarray(4,8));var Ee=bt(ge,[x.codec])[0],Pe,Se;Ee&&(/^[asm]vc[1-9]$/i.test(x.codec)?(Pe=Ee.subarray(78),Se=Fr(Pe.subarray(4,8)),Se==="avcC"&&Pe.length>11?(x.codec+=".",x.codec+=qn(Pe[9]),x.codec+=qn(Pe[10]),x.codec+=qn(Pe[11])):x.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(x.codec)?(Pe=Ee.subarray(28),Se=Fr(Pe.subarray(4,8)),Se==="esds"&&Pe.length>20&&Pe[19]!==0?(x.codec+="."+qn(Pe[19]),x.codec+="."+qn(Pe[20]>>>2&63).replace(/^0/,"")):x.codec="mp4a.40.2"):x.codec=x.codec.toLowerCase())}var ze=bt(w,["mdia","mdhd"])[0];ze&&(x.timescale=xa(ze)),y.push(x)}),y};var Ou={findBox:bt,parseType:Fr,timescale:Pu,startTime:Du,compositionStartTime:Nu,videoTrackIds:ks,tracks:Lu,getTimescaleFromMediaHeader:xa},Mu=function(m){var S=m[1]&31;return S<<=8,S|=m[2],S},xs=function(m){return!!(m[1]&64)},zn=function(m){var S=0;return(m[3]&48)>>>4>1&&(S+=m[4]+1),S},Nd=function(m,S){var y=Mu(m);return y===0?"pat":y===S?"pmt":S?"pes":null},Ld=function(m){var S=xs(m),y=4+zn(m);return S&&(y+=m[y]+1),(m[y+10]&31)<<8|m[y+11]},Od=function(m){var S={},y=xs(m),w=4+zn(m);if(y&&(w+=m[w]+1),!!(m[w+5]&1)){var x,L,q;x=(m[w+1]&15)<<8|m[w+2],L=3+x-4,q=(m[w+10]&15)<<8|m[w+11];for(var X=12+q;X<L;){var ie=w+X;S[(m[ie+1]&31)<<8|m[ie+2]]=m[ie],X+=((m[ie+3]&15)<<8|m[ie+4])+5}return S}},Yo=function(m,S){var y=Mu(m),w=S[y];switch(w){case jt.H264_STREAM_TYPE:return"video";case jt.ADTS_STREAM_TYPE:return"audio";case jt.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Md=function(m){var S=xs(m);if(!S)return null;var y=4+zn(m);if(y>=m.byteLength)return null;var w=null,x;return x=m[y+7],x&192&&(w={},w.pts=(m[y+9]&14)<<27|(m[y+10]&255)<<20|(m[y+11]&254)<<12|(m[y+12]&255)<<5|(m[y+13]&254)>>>3,w.pts*=4,w.pts+=(m[y+13]&6)>>>1,w.dts=w.pts,x&64&&(w.dts=(m[y+14]&14)<<27|(m[y+15]&255)<<20|(m[y+16]&254)<<12|(m[y+17]&255)<<5|(m[y+18]&254)>>>3,w.dts*=4,w.dts+=(m[y+18]&6)>>>1)),w},Aa=function(m){switch(m){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Rd=function(m){for(var S=4+zn(m),y=m.subarray(S),w=0,x=0,L=!1,q;x<y.byteLength-3;x++)if(y[x+2]===1){w=x+5;break}for(;w<y.byteLength;)switch(y[w]){case 0:if(y[w-1]!==0){w+=2;break}else if(y[w-2]!==0){w++;break}x+3!==w-2&&(q=Aa(y[x+3]&31),q==="slice_layer_without_partitioning_rbsp_idr"&&(L=!0));do w++;while(y[w]!==1&&w<y.length);x=w-2,w+=3;break;case 1:if(y[w-1]!==0||y[w-2]!==0){w+=3;break}q=Aa(y[x+3]&31),q==="slice_layer_without_partitioning_rbsp_idr"&&(L=!0),x=w-2,w+=3;break;default:w+=3;break}return y=y.subarray(x),w-=x,x=0,y&&y.byteLength>3&&(q=Aa(y[x+3]&31),q==="slice_layer_without_partitioning_rbsp_idr"&&(L=!0)),L},Bd={parseType:Nd,parsePat:Ld,parsePmt:Od,parsePayloadUnitStartIndicator:xs,parsePesType:Yo,parsePesTime:Md,videoPacketContainsKeyFrame:Rd},gn=mu.handleRollover,ut={};ut.ts=Bd,ut.aac=gs;var Ur=tt.ONE_SECOND_IN_TS,ei=188,Gi=71,Fd=function(m,S){for(var y=0,w=ei,x,L;w<m.byteLength;){if(m[y]===Gi&&m[w]===Gi){switch(x=m.subarray(y,w),L=ut.ts.parseType(x,S.pid),L){case"pat":S.pid=ut.ts.parsePat(x);break;case"pmt":var q=ut.ts.parsePmt(x);S.table=S.table||{},Object.keys(q).forEach(function(X){S.table[X]=q[X]});break}y+=ei,w+=ei;continue}y++,w++}},Ru=function(m,S,y){for(var w=0,x=ei,L,q,X,ie,Z,re=!1;x<=m.byteLength;){if(m[w]===Gi&&(m[x]===Gi||x===m.byteLength)){switch(L=m.subarray(w,x),q=ut.ts.parseType(L,S.pid),q){case"pes":X=ut.ts.parsePesType(L,S.table),ie=ut.ts.parsePayloadUnitStartIndicator(L),X==="audio"&&ie&&(Z=ut.ts.parsePesTime(L),Z&&(Z.type="audio",y.audio.push(Z),re=!0));break}if(re)break;w+=ei,x+=ei;continue}w++,x++}for(x=m.byteLength,w=x-ei,re=!1;w>=0;){if(m[w]===Gi&&(m[x]===Gi||x===m.byteLength)){switch(L=m.subarray(w,x),q=ut.ts.parseType(L,S.pid),q){case"pes":X=ut.ts.parsePesType(L,S.table),ie=ut.ts.parsePayloadUnitStartIndicator(L),X==="audio"&&ie&&(Z=ut.ts.parsePesTime(L),Z&&(Z.type="audio",y.audio.push(Z),re=!0));break}if(re)break;w-=ei,x-=ei;continue}w--,x--}},Ia=function(m,S,y){for(var w=0,x=ei,L,q,X,ie,Z,re,ge,Ee,Pe=!1,Se={data:[],size:0};x<m.byteLength;){if(m[w]===Gi&&m[x]===Gi){switch(L=m.subarray(w,x),q=ut.ts.parseType(L,S.pid),q){case"pes":if(X=ut.ts.parsePesType(L,S.table),ie=ut.ts.parsePayloadUnitStartIndicator(L),X==="video"&&(ie&&!Pe&&(Z=ut.ts.parsePesTime(L),Z&&(Z.type="video",y.video.push(Z),Pe=!0)),!y.firstKeyFrame)){if(ie&&Se.size!==0){for(re=new Uint8Array(Se.size),ge=0;Se.data.length;)Ee=Se.data.shift(),re.set(Ee,ge),ge+=Ee.byteLength;if(ut.ts.videoPacketContainsKeyFrame(re)){var ze=ut.ts.parsePesTime(re);ze?(y.firstKeyFrame=ze,y.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}Se.size=0}Se.data.push(L),Se.size+=L.byteLength}break}if(Pe&&y.firstKeyFrame)break;w+=ei,x+=ei;continue}w++,x++}for(x=m.byteLength,w=x-ei,Pe=!1;w>=0;){if(m[w]===Gi&&m[x]===Gi){switch(L=m.subarray(w,x),q=ut.ts.parseType(L,S.pid),q){case"pes":X=ut.ts.parsePesType(L,S.table),ie=ut.ts.parsePayloadUnitStartIndicator(L),X==="video"&&ie&&(Z=ut.ts.parsePesTime(L),Z&&(Z.type="video",y.video.push(Z),Pe=!0));break}if(Pe)break;w-=ei,x-=ei;continue}w--,x--}},Ud=function(m,S){if(m.audio&&m.audio.length){var y=S;(typeof y>"u"||isNaN(y))&&(y=m.audio[0].dts),m.audio.forEach(function(L){L.dts=gn(L.dts,y),L.pts=gn(L.pts,y),L.dtsTime=L.dts/Ur,L.ptsTime=L.pts/Ur})}if(m.video&&m.video.length){var w=S;if((typeof w>"u"||isNaN(w))&&(w=m.video[0].dts),m.video.forEach(function(L){L.dts=gn(L.dts,w),L.pts=gn(L.pts,w),L.dtsTime=L.dts/Ur,L.ptsTime=L.pts/Ur}),m.firstKeyFrame){var x=m.firstKeyFrame;x.dts=gn(x.dts,w),x.pts=gn(x.pts,w),x.dtsTime=x.dts/Ur,x.ptsTime=x.pts/Ur}}},$d=function(m){for(var S=!1,y=0,w=null,x=null,L=0,q=0,X;m.length-q>=3;){var ie=ut.aac.parseType(m,q);switch(ie){case"timed-metadata":if(m.length-q<10){S=!0;break}if(L=ut.aac.parseId3TagSize(m,q),L>m.length){S=!0;break}x===null&&(X=m.subarray(q,q+L),x=ut.aac.parseAacTimestamp(X)),q+=L;break;case"audio":if(m.length-q<7){S=!0;break}if(L=ut.aac.parseAdtsSize(m,q),L>m.length){S=!0;break}w===null&&(X=m.subarray(q,q+L),w=ut.aac.parseSampleRate(X)),y++,q+=L;break;default:q++;break}if(S)return null}if(w===null||x===null)return null;var Z=Ur/w,re={audio:[{type:"audio",dts:x,pts:x},{type:"audio",dts:x+y*1024*Z,pts:x+y*1024*Z}]};return re},jd=function(m){var S={pid:null,table:null},y={};Fd(m,S);for(var w in S.table)if(S.table.hasOwnProperty(w)){var x=S.table[w];switch(x){case jt.H264_STREAM_TYPE:y.video=[],Ia(m,S,y),y.video.length===0&&delete y.video;break;case jt.ADTS_STREAM_TYPE:y.audio=[],Ru(m,S,y),y.audio.length===0&&delete y.audio;break}}return y},Vd=function(m,S){var y=ut.aac.isLikelyAacData(m),w;return y?w=$d(m):w=jd(m),!w||!w.audio&&!w.video?null:(Ud(w,S),w)},Bu={inspect:Vd,parseAudioPes_:Ru},Hd=function(m,S){S.on("data",function(y){var w=y.initSegment;y.initSegment={data:w.buffer,byteOffset:w.byteOffset,byteLength:w.byteLength};var x=y.data;y.data=x.buffer,m.postMessage({action:"data",segment:y,byteOffset:x.byteOffset,byteLength:x.byteLength},[y.data])}),S.on("done",function(y){m.postMessage({action:"done"})}),S.on("gopInfo",function(y){m.postMessage({action:"gopInfo",gopInfo:y})}),S.on("videoSegmentTimingInfo",function(y){var w={start:{decode:tt.videoTsToSeconds(y.start.dts),presentation:tt.videoTsToSeconds(y.start.pts)},end:{decode:tt.videoTsToSeconds(y.end.dts),presentation:tt.videoTsToSeconds(y.end.pts)},baseMediaDecodeTime:tt.videoTsToSeconds(y.baseMediaDecodeTime)};y.prependedContentDuration&&(w.prependedContentDuration=tt.videoTsToSeconds(y.prependedContentDuration)),m.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:w})}),S.on("audioSegmentTimingInfo",function(y){var w={start:{decode:tt.videoTsToSeconds(y.start.dts),presentation:tt.videoTsToSeconds(y.start.pts)},end:{decode:tt.videoTsToSeconds(y.end.dts),presentation:tt.videoTsToSeconds(y.end.pts)},baseMediaDecodeTime:tt.videoTsToSeconds(y.baseMediaDecodeTime)};y.prependedContentDuration&&(w.prependedContentDuration=tt.videoTsToSeconds(y.prependedContentDuration)),m.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:w})}),S.on("id3Frame",function(y){m.postMessage({action:"id3Frame",id3Frame:y})}),S.on("caption",function(y){m.postMessage({action:"caption",caption:y})}),S.on("trackinfo",function(y){m.postMessage({action:"trackinfo",trackInfo:y})}),S.on("audioTimingInfo",function(y){m.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:tt.videoTsToSeconds(y.start),end:tt.videoTsToSeconds(y.end)}})}),S.on("videoTimingInfo",function(y){m.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:tt.videoTsToSeconds(y.start),end:tt.videoTsToSeconds(y.end)}})}),S.on("log",function(y){m.postMessage({action:"log",log:y})})},Wn=(function(){function $(S,y){this.options=y||{},this.self=S,this.init()}var m=$.prototype;return m.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new bd.Transmuxer(this.options),Hd(this.self,this.transmuxer)},m.pushMp4Captions=function(y){this.captionParser||(this.captionParser=new Dd,this.captionParser.init());var w=new Uint8Array(y.data,y.byteOffset,y.byteLength),x=this.captionParser.parse(w,y.trackIds,y.timescales);this.self.postMessage({action:"mp4Captions",captions:x&&x.captions||[],logs:x&&x.logs||[],data:w.buffer},[w.buffer])},m.probeMp4StartTime=function(y){var w=y.timescales,x=y.data,L=Ou.startTime(w,x);this.self.postMessage({action:"probeMp4StartTime",startTime:L,data:x},[x.buffer])},m.probeMp4Tracks=function(y){var w=y.data,x=Ou.tracks(w);this.self.postMessage({action:"probeMp4Tracks",tracks:x,data:w},[w.buffer])},m.probeTs=function(y){var w=y.data,x=y.baseStartTime,L=typeof x=="number"&&!isNaN(x)?x*tt.ONE_SECOND_IN_TS:void 0,q=Bu.inspect(w,L),X=null;q&&(X={hasVideo:q.video&&q.video.length===2||!1,hasAudio:q.audio&&q.audio.length===2||!1},X.hasVideo&&(X.videoStart=q.video[0].ptsTime),X.hasAudio&&(X.audioStart=q.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:X,data:w},[w.buffer])},m.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},m.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},m.push=function(y){var w=new Uint8Array(y.data,y.byteOffset,y.byteLength);this.transmuxer.push(w)},m.reset=function(){this.transmuxer.reset()},m.setTimestampOffset=function(y){var w=y.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(tt.secondsToVideoTs(w)))},m.setAudioAppendStart=function(y){this.transmuxer.setAudioAppendStart(Math.ceil(tt.secondsToVideoTs(y.appendStart)))},m.setRemux=function(y){this.transmuxer.setRemux(y.remux)},m.flush=function(y){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},m.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},m.alignGopsWith=function(y){this.transmuxer.alignGopsWith(y.gopsToAlignWith.slice())},$})();self.onmessage=function($){if($.data.action==="init"&&$.data.options){this.messageHandlers=new Wn(self,$.data.options);return}this.messageHandlers||(this.messageHandlers=new Wn(self)),$.data&&$.data.action&&$.data.action!=="init"&&this.messageHandlers[$.data.action]&&this.messageHandlers[$.data.action]($.data)}})),mB=o2(pB),gB=function(e,t,r){var i=e.data.segment,n=i.type,a=i.initSegment,o=i.captions,l=i.captionStreams,u=i.metadata,c=i.videoFrameDtsTime,h=i.videoFramePtsTime;t.buffer.push({captions:o,captionStreams:l,metadata:u});var f=e.data.segment.boxes||{data:e.data.segment.data},g={type:n,data:new Uint8Array(f.data,f.data.byteOffset,f.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};typeof c<"u"&&(g.videoFrameDtsTime=c),typeof h<"u"&&(g.videoFramePtsTime=h),r(g)},vB=function(e){var t=e.transmuxedData,r=e.callback;t.buffer=[],r(t)},yB=function(e,t){t.gopInfo=e.data.gopInfo},c2=function(e){var t=e.transmuxer,r=e.bytes,i=e.audioAppendStart,n=e.gopsToAlignWith,a=e.remux,o=e.onData,l=e.onTrackInfo,u=e.onAudioTimingInfo,c=e.onVideoTimingInfo,h=e.onVideoSegmentTimingInfo,f=e.onAudioSegmentTimingInfo,g=e.onId3,C=e.onCaptions,p=e.onDone,T=e.onEndedTimeline,A=e.onTransmuxerLog,N=e.isEndOfTimeline,F={buffer:[]},V=N,R=function(E){t.currentTransmux===e&&(E.data.action==="data"&&gB(E,F,o),E.data.action==="trackinfo"&&l(E.data.trackInfo),E.data.action==="gopInfo"&&yB(E,F),E.data.action==="audioTimingInfo"&&u(E.data.audioTimingInfo),E.data.action==="videoTimingInfo"&&c(E.data.videoTimingInfo),E.data.action==="videoSegmentTimingInfo"&&h(E.data.videoSegmentTimingInfo),E.data.action==="audioSegmentTimingInfo"&&f(E.data.audioSegmentTimingInfo),E.data.action==="id3Frame"&&g([E.data.id3Frame],E.data.id3Frame.dispatchType),E.data.action==="caption"&&C(E.data.caption),E.data.action==="endedtimeline"&&(V=!1,T()),E.data.action==="log"&&A(E.data.log),E.data.type==="transmuxed"&&(V||(t.onmessage=null,vB({transmuxedData:F,callback:p}),h2(t))))};if(t.onmessage=R,i&&t.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(n)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),typeof a<"u"&&t.postMessage({action:"setRemux",remux:a}),r.byteLength){var O=r instanceof ArrayBuffer?r:r.buffer,M=r instanceof ArrayBuffer?0:r.byteOffset;t.postMessage({action:"push",data:O,byteOffset:M,byteLength:r.byteLength},[O])}N&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},h2=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),typeof e.currentTransmux=="function"?e.currentTransmux():c2(e.currentTransmux))},IT=function(e,t){e.postMessage({action:t}),h2(e)},d2=function(e,t){if(!t.currentTransmux){t.currentTransmux=e,IT(t,e);return}t.transmuxQueue.push(IT.bind(null,t,e))},_B=function(e){d2("reset",e)},TB=function(e){d2("endTimeline",e)},f2=function(e){if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e,c2(e);return}e.transmuxer.transmuxQueue.push(e)},bB=function(e){var t=new mB;t.currentTransmux=null,t.transmuxQueue=[];var r=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,r.call(t)},t.postMessage({action:"init",options:e}),t},np={reset:_B,endTimeline:TB,transmux:f2,createTransmuxer:bB},fh=function(e){var t=e.transmuxer,r=e.endAction||e.action,i=e.callback,n=vt({},e,{endAction:null,transmuxer:null,callback:null}),a=function u(c){c.data.action===r&&(t.removeEventListener("message",u),c.data.data&&(c.data.data=new Uint8Array(c.data.data,e.byteOffset||0,e.byteLength||c.data.data.byteLength),e.data&&(e.data=c.data.data)),i(c.data))};if(t.addEventListener("message",a),e.data){var o=e.data instanceof ArrayBuffer;n.byteOffset=o?0:e.data.byteOffset,n.byteLength=e.data.byteLength;var l=[o?e.data:e.data.buffer];t.postMessage(n,l)}else t.postMessage(n)},Zr={FAILURE:2,TIMEOUT:-101,ABORTED:-102},wm=function(e){e.forEach(function(t){t.abort()})},SB=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},CB=function(e){var t=e.target,r=Date.now()-t.requestTime,i={bandwidth:1/0,bytesReceived:0,roundTripTime:r||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i},pv=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Zr.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Zr.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Zr.FAILURE,xhr:t}:t.responseType==="arraybuffer"&&t.response.byteLength===0?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Zr.FAILURE,xhr:t}:null},PT=function(e,t,r){return function(i,n){var a=n.response,o=pv(i,n);if(o)return r(o,e);if(a.byteLength!==16)return r({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Zr.FAILURE,xhr:n},e);for(var l=new DataView(a),u=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]),c=0;c<t.length;c++)t[c].bytes=u;return r(null,e)}},p2=function(e,t){var r=Lg(e.map.bytes);if(r!=="mp4"){var i=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:"Found unsupported "+(r||"unknown")+" container for initialization segment at URL: "+i,code:Zr.FAILURE})}fh({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(a){var o=a.tracks,l=a.data;return e.map.bytes=l,o.forEach(function(u){e.map.tracks=e.map.tracks||{},!e.map.tracks[u.type]&&(e.map.tracks[u.type]=u,typeof u.id=="number"&&u.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[u.id]=u.timescale))}),t(null)}})},EB=function(e){var t=e.segment,r=e.finishProcessingFn;return function(i,n){var a=pv(i,n);if(a)return r(a,t);var o=new Uint8Array(n.response);if(t.map.key)return t.map.encryptedBytes=o,r(null,t);t.map.bytes=o,p2(t,function(l){if(l)return l.xhr=n,l.status=n.status,r(l,t);r(null,t)})}},wB=function(e){var t=e.segment,r=e.finishProcessingFn,i=e.responseType;return function(n,a){var o=pv(n,a);if(o)return r(o,t);var l=i==="arraybuffer"||!a.responseText?a.response:dB(a.responseText.substring(t.lastReachedChar||0));return t.stats=SB(a),t.key?t.encryptedBytes=new Uint8Array(l):t.bytes=new Uint8Array(l),r(null,t)}},kB=function(e){var t=e.segment,r=e.bytes,i=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,h=e.endedTimelineFn,f=e.dataFn,g=e.doneFn,C=e.onTransmuxerLog,p=t.map&&t.map.tracks||{},T=!!(p.audio&&p.video),A=n.bind(null,t,"audio","start"),N=n.bind(null,t,"audio","end"),F=n.bind(null,t,"video","start"),V=n.bind(null,t,"video","end"),R=function(){return f2({bytes:r,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:T,onData:function(U){U.type=U.type==="combined"?"video":U.type,f(t,U)},onTrackInfo:function(U){i&&(T&&(U.isMuxed=!0),i(t,U))},onAudioTimingInfo:function(U){A&&typeof U.start<"u"&&(A(U.start),A=null),N&&typeof U.end<"u"&&N(U.end)},onVideoTimingInfo:function(U){F&&typeof U.start<"u"&&(F(U.start),F=null),V&&typeof U.end<"u"&&V(U.end)},onVideoSegmentTimingInfo:function(U){a(U)},onAudioSegmentTimingInfo:function(U){o(U)},onId3:function(U,E){l(t,U,E)},onCaptions:function(U){u(t,[U])},isEndOfTimeline:c,onEndedTimeline:function(){h()},onTransmuxerLog:C,onDone:function(U){g&&(U.type=U.type==="combined"?"video":U.type,g(null,t,U))}})};fh({action:"probeTs",transmuxer:t.transmuxer,data:r,baseStartTime:t.baseStartTime,callback:function(M){t.bytes=r=M.data;var U=M.result;U&&(i(t,{hasAudio:U.hasAudio,hasVideo:U.hasVideo,isMuxed:T}),i=null,U.hasAudio&&!T&&A(U.audioStart),U.hasVideo&&F(U.videoStart),A=null,F=null),R()}})},m2=function(e){var t=e.segment,r=e.bytes,i=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,h=e.endedTimelineFn,f=e.dataFn,g=e.doneFn,C=e.onTransmuxerLog,p=new Uint8Array(r);if(qR(p)){t.isFmp4=!0;var T=t.map.tracks,A={isFmp4:!0,hasVideo:!!T.video,hasAudio:!!T.audio};T.audio&&T.audio.codec&&T.audio.codec!=="enca"&&(A.audioCodec=T.audio.codec),T.video&&T.video.codec&&T.video.codec!=="encv"&&(A.videoCodec=T.video.codec),T.video&&T.audio&&(A.isMuxed=!0),i(t,A);var N=function(V){f(t,{data:p,type:A.hasAudio&&!A.isMuxed?"audio":"video"}),V&&V.length&&u(t,V),g(null,t,{})};fh({action:"probeMp4StartTime",timescales:t.map.timescales,data:p,transmuxer:t.transmuxer,callback:function(V){var R=V.data,O=V.startTime;if(r=R.buffer,t.bytes=p=R,A.hasAudio&&!A.isMuxed&&n(t,"audio","start",O),A.hasVideo&&n(t,"video","start",O),!T.video||!R.byteLength||!t.transmuxer){N();return}fh({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:p,timescales:t.map.timescales,trackIds:[T.video.id],callback:function(U){r=U.data.buffer,t.bytes=p=U.data,U.logs.forEach(function(E){C(ne.mergeOptions(E,{stream:"mp4CaptionParser"}))}),N(U.captions)}})}});return}if(!t.transmuxer){g(null,t,{});return}if(typeof t.container>"u"&&(t.container=Lg(p)),t.container!=="ts"&&t.container!=="aac"){i(t,{hasAudio:!1,hasVideo:!1}),g(null,t,{});return}kB({segment:t,bytes:r,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:f,doneFn:g,onTransmuxerLog:C})},g2=function(e,t){var r=e.id,i=e.key,n=e.encryptedBytes,a=e.decryptionWorker,o=function u(c){if(c.data.source===r){a.removeEventListener("message",u);var h=c.data.decrypted;t(new Uint8Array(h.bytes,h.byteOffset,h.byteLength))}};a.addEventListener("message",o);var l;i.bytes.slice?l=i.bytes.slice():l=new Uint32Array(Array.prototype.slice.call(i.bytes)),a.postMessage(t2({source:r,encrypted:n,key:l,iv:i.iv}),[n.buffer,l.buffer])},xB=function(e){var t=e.decryptionWorker,r=e.segment,i=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,h=e.endedTimelineFn,f=e.dataFn,g=e.doneFn,C=e.onTransmuxerLog;g2({id:r.requestId,key:r.key,encryptedBytes:r.encryptedBytes,decryptionWorker:t},function(p){r.bytes=p,m2({segment:r,bytes:r.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:f,doneFn:g,onTransmuxerLog:C})})},AB=function(e){var t=e.activeXhrs,r=e.decryptionWorker,i=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,h=e.endedTimelineFn,f=e.dataFn,g=e.doneFn,C=e.onTransmuxerLog,p=0,T=!1;return function(A,N){if(!T){if(A)return T=!0,wm(t),g(A,N);if(p+=1,p===t.length){var F=function(){if(N.encryptedBytes)return xB({decryptionWorker:r,segment:N,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:f,doneFn:g,onTransmuxerLog:C});m2({segment:N,bytes:N.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:f,doneFn:g,onTransmuxerLog:C})};if(N.endOfAllRequests=Date.now(),N.map&&N.map.encryptedBytes&&!N.map.bytes)return g2({decryptionWorker:r,id:N.requestId+"-init",encryptedBytes:N.map.encryptedBytes,key:N.map.key},function(V){N.map.bytes=V,p2(N,function(R){if(R)return wm(t),g(R,N);F()})});F()}}}},IB=function(e){var t=e.loadendState,r=e.abortFn;return function(i){var n=i.target;n.aborted&&r&&!t.calledAbortFn&&(r(),t.calledAbortFn=!0)}},PB=function(e){var t=e.segment,r=e.progressFn;return function(i){var n=i.target;if(!n.aborted)return t.stats=ne.mergeOptions(t.stats,CB(i)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),r(i,t)}},DB=function(e){var t=e.xhr,r=e.xhrOptions,i=e.decryptionWorker,n=e.segment,a=e.abortFn,o=e.progressFn,l=e.trackInfoFn,u=e.timingInfoFn,c=e.videoSegmentTimingInfoFn,h=e.audioSegmentTimingInfoFn,f=e.id3Fn,g=e.captionsFn,C=e.isEndOfTimeline,p=e.endedTimelineFn,T=e.dataFn,A=e.doneFn,N=e.onTransmuxerLog,F=[],V=AB({activeXhrs:F,decryptionWorker:i,trackInfoFn:l,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:h,id3Fn:f,captionsFn:g,isEndOfTimeline:C,endedTimelineFn:p,dataFn:T,doneFn:A,onTransmuxerLog:N});if(n.key&&!n.key.bytes){var R=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&R.push(n.map.key);var O=ne.mergeOptions(r,{uri:n.key.resolvedUri,responseType:"arraybuffer"}),M=PT(n,R,V),U=t(O,M);F.push(U)}if(n.map&&!n.map.bytes){var E=n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri);if(E){var P=ne.mergeOptions(r,{uri:n.map.key.resolvedUri,responseType:"arraybuffer"}),Y=PT(n,[n.map.key],V),G=t(P,Y);F.push(G)}var K=ne.mergeOptions(r,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:Cm(n.map)}),le=EB({segment:n,finishProcessingFn:V}),de=t(K,le);F.push(de)}var pe=ne.mergeOptions(r,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:Cm(n)}),se=wB({segment:n,finishProcessingFn:V,responseType:pe.responseType}),ae=t(pe,se);ae.addEventListener("progress",PB({segment:n,progressFn:o})),F.push(ae);var ce={};return F.forEach(function(he){he.addEventListener("loadend",IB({loadendState:ce,abortFn:a}))}),function(){return wm(F)}},NB=Or("CodecUtils"),LB=function(e){var t=e.attributes||{};if(t.CODECS)return qr(t.CODECS)},v2=function(e,t){var r=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&r.AUDIO&&e.mediaGroups.AUDIO[r.AUDIO]},OB=function(e,t){if(!v2(e,t))return!0;var r=t.attributes||{},i=e.mediaGroups.AUDIO[r.AUDIO];for(var n in i)if(!i[n].uri&&!i[n].playlists)return!0;return!1},ph=function(e){var t={};return e.forEach(function(r){var i=r.mediaType,n=r.type,a=r.details;t[i]=t[i]||[],t[i].push(g1(""+n+a))}),Object.keys(t).forEach(function(r){if(t[r].length>1){NB("multiple "+r+" codecs found as attributes: "+t[r].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),t[r]=null;return}t[r]=t[r][0]}),t},DT=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},Fl=function(e,t){var r=t.attributes||{},i=ph(LB(t)||[]);if(v2(e,t)&&!i.audio&&!OB(e,t)){var n=ph(CM(e,r.AUDIO)||[]);n.audio&&(i.audio=n.audio)}return i},fc=Or("PlaylistSelector"),NT=function(e){if(!(!e||!e.playlist)){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},mh=function(e,t){if(!e)return"";var r=D.getComputedStyle(e);return r?r[t]:""},oo=function(e,t){var r=e.slice();e.sort(function(i,n){var a=t(i,n);return a===0?r.indexOf(i)-r.indexOf(n):a})},mv=function(e,t){var r,i;return e.attributes.BANDWIDTH&&(r=e.attributes.BANDWIDTH),r=r||D.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),i=i||D.Number.MAX_VALUE,r-i},MB=function(e,t){var r,i;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(r=e.attributes.RESOLUTION.width),r=r||D.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),i=i||D.Number.MAX_VALUE,r===i&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:r-i},y2=function(e,t,r,i,n,a){if(e){var o={bandwidth:t,width:r,height:i,limitRenditionByPlayerDimensions:n},l=e.playlists;Hi.isAudioOnly(e)&&(l=a.getAudioTrackPlaylists_(),o.audioOnly=!0);var u=l.map(function(P){var Y,G=P.attributes&&P.attributes.RESOLUTION&&P.attributes.RESOLUTION.width,K=P.attributes&&P.attributes.RESOLUTION&&P.attributes.RESOLUTION.height;return Y=P.attributes&&P.attributes.BANDWIDTH,Y=Y||D.Number.MAX_VALUE,{bandwidth:Y,width:G,height:K,playlist:P}});oo(u,function(P,Y){return P.bandwidth-Y.bandwidth}),u=u.filter(function(P){return!Hi.isIncompatible(P.playlist)});var c=u.filter(function(P){return Hi.isEnabled(P.playlist)});c.length||(c=u.filter(function(P){return!Hi.isDisabled(P.playlist)}));var h=c.filter(function(P){return P.bandwidth*ri.BANDWIDTH_VARIANCE<t}),f=h[h.length-1],g=h.filter(function(P){return P.bandwidth===f.bandwidth})[0];if(n===!1){var C=g||c[0]||u[0];if(C&&C.playlist){var p="sortedPlaylistReps";return g&&(p="bandwidthBestRep"),c[0]&&(p="enabledPlaylistReps"),fc("choosing "+NT(C)+" using "+p+" with options",o),C.playlist}return fc("could not choose a playlist with options",o),null}var T=h.filter(function(P){return P.width&&P.height});oo(T,function(P,Y){return P.width-Y.width});var A=T.filter(function(P){return P.width===r&&P.height===i});f=A[A.length-1];var N=A.filter(function(P){return P.bandwidth===f.bandwidth})[0],F,V,R;N||(F=T.filter(function(P){return P.width>r||P.height>i}),V=F.filter(function(P){return P.width===F[0].width&&P.height===F[0].height}),f=V[V.length-1],R=V.filter(function(P){return P.bandwidth===f.bandwidth})[0]);var O;if(a.experimentalLeastPixelDiffSelector){var M=T.map(function(P){return P.pixelDiff=Math.abs(P.width-r)+Math.abs(P.height-i),P});oo(M,function(P,Y){return P.pixelDiff===Y.pixelDiff?Y.bandwidth-P.bandwidth:P.pixelDiff-Y.pixelDiff}),O=M[0]}var U=O||R||N||g||c[0]||u[0];if(U&&U.playlist){var E="sortedPlaylistReps";return O?E="leastPixelDiffRep":R?E="resolutionPlusOneRep":N?E="resolutionBestRep":g?E="bandwidthBestRep":c[0]&&(E="enabledPlaylistReps"),fc("choosing "+NT(U)+" using "+E+" with options",o),U.playlist}return fc("could not choose a playlist with options",o),null}},LT=function(){var e=this.useDevicePixelRatio&&D.devicePixelRatio||1;return y2(this.playlists.master,this.systemBandwidth,parseInt(mh(this.tech_.el(),"width"),10)*e,parseInt(mh(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},RB=function(e){var t=-1,r=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var i=this.useDevicePixelRatio&&D.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,r=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==r&&(t=e*this.systemBandwidth+(1-e)*t,r=this.systemBandwidth),y2(this.playlists.master,t,parseInt(mh(this.tech_.el(),"width"),10)*i,parseInt(mh(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},BB=function(e){var t=e.master,r=e.currentTime,i=e.bandwidth,n=e.duration,a=e.segmentDuration,o=e.timeUntilRebuffer,l=e.currentTimeline,u=e.syncController,c=t.playlists.filter(function(p){return!Hi.isIncompatible(p)}),h=c.filter(Hi.isEnabled);h.length||(h=c.filter(function(p){return!Hi.isDisabled(p)}));var f=h.filter(Hi.hasAttribute.bind(null,"BANDWIDTH")),g=f.map(function(p){var T=u.getSyncPoint(p,n,l,r),A=T?1:2,N=Hi.estimateSegmentRequestTime(a,i,p),F=N*A-o;return{playlist:p,rebufferingImpact:F}}),C=g.filter(function(p){return p.rebufferingImpact<=0});return oo(C,function(p,T){return mv(T.playlist,p.playlist)}),C.length?C[0]:(oo(g,function(p,T){return p.rebufferingImpact-T.rebufferingImpact}),g[0]||null)},FB=function(){var e=this,t=this.playlists.master.playlists.filter(Hi.isEnabled);oo(t,function(i,n){return mv(i,n)});var r=t.filter(function(i){return!!Fl(e.playlists.master,i).video});return r[0]||null},UB=function(e){var t=0,r;return e.bytes&&(r=new Uint8Array(e.bytes),e.segments.forEach(function(i){r.set(i,t),t+=i.byteLength})),r},$B=function(e,t,r){if(!e[r]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var i=r;/^cc708_/.test(r)&&(i="SERVICE"+r.split("_")[1]);var n=t.textTracks().getTrackById(i);if(n)e[r]=n;else{var a=t.options_.vhs&&t.options_.vhs.captionServices||{},o=r,l=r,u=!1,c=a[i];c&&(o=c.label,l=c.language,u=c.default),e[r]=t.addRemoteTextTrack({kind:"captions",id:i,default:u,label:o,language:l},!1).track}}},jB=function(e){var t=e.inbandTextTracks,r=e.captionArray,i=e.timestampOffset;if(r){var n=D.WebKitDataCue||D.VTTCue;r.forEach(function(a){var o=a.stream;t[o].addCue(new n(a.startTime+i,a.endTime+i,a.text))})}},VB=function(e){Object.defineProperties(e.frame,{id:{get:function(){return ne.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return ne.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return ne.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},HB=function(e){var t=e.inbandTextTracks,r=e.metadataArray,i=e.timestampOffset,n=e.videoDuration;if(r){var a=D.WebKitDataCue||D.VTTCue,o=t.metadataTrack_;if(o&&(r.forEach(function(g){var C=g.cueTime+i;typeof C!="number"||D.isNaN(C)||C<0||!(C<1/0)||g.frames.forEach(function(p){var T=new a(C,C,p.value||p.url||p.data||"");T.frame=p,T.value=p,VB(T),o.addCue(T)})}),!(!o.cues||!o.cues.length))){for(var l=o.cues,u=[],c=0;c<l.length;c++)l[c]&&u.push(l[c]);var h=u.reduce(function(g,C){var p=g[C.startTime]||[];return p.push(C),g[C.startTime]=p,g},{}),f=Object.keys(h).sort(function(g,C){return Number(g)-Number(C)});f.forEach(function(g,C){var p=h[g],T=Number(f[C+1])||n;p.forEach(function(A){A.endTime=T})})}}},qB=function(e,t,r){e.metadataTrack_||(e.metadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)},wl=function(e,t,r){var i,n;if(r&&r.cues)for(i=r.cues.length;i--;)n=r.cues[i],n.startTime>=e&&n.endTime<=t&&r.removeCue(n)},zB=function(e){var t=e.cues;if(t)for(var r=0;r<t.length;r++){for(var i=[],n=0,a=0;a<t.length;a++)t[r].startTime===t[a].startTime&&t[r].endTime===t[a].endTime&&t[r].text===t[a].text&&(n++,n>1&&i.push(t[a]));i.length&&i.forEach(function(o){return e.removeCue(o)})}},WB=function(e,t,r){if(typeof t>"u"||t===null||!e.length)return[];var i=Math.ceil((t-r+3)*eh.ONE_SECOND_IN_TS),n;for(n=0;n<e.length&&!(e[n].pts>i);n++);return e.slice(n)},GB=function(e,t,r){if(!t.length)return e;if(r)return t.slice();var i=t[0].pts,n=0;for(n;n<e.length&&!(e[n].pts>=i);n++);return e.slice(0,n).concat(t)},KB=function(e,t,r,i){for(var n=Math.ceil((t-i)*eh.ONE_SECOND_IN_TS),a=Math.ceil((r-i)*eh.ONE_SECOND_IN_TS),o=e.slice(),l=e.length;l--&&!(e[l].pts<=a););if(l===-1)return o;for(var u=l+1;u--&&!(e[u].pts<=n););return u=Math.max(u,0),o.splice(u,l-u+1),o},XB=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var r=Object.keys(e).sort(),i=Object.keys(t).sort();if(r.length!==i.length)return!1;for(var n=0;n<r.length;n++){var a=r[n];if(a!==i[n]||e[a]!==t[a])return!1}return!0},_2=22,YB=function(e,t,r){t=t||[];for(var i=[],n=0,a=0;a<t.length;a++){var o=t[a];if(e===o.timeline&&(i.push(a),n+=o.duration,n>r))return a}return i.length===0?0:i[i.length-1]},pl=1,QB=500,OT=function(e){return typeof e=="number"&&isFinite(e)},pc=1/60,JB=function(e,t,r){return e!=="main"||!t||!r?null:!r.hasAudio&&!r.hasVideo?"Neither audio nor video found in segment.":t.hasVideo&&!r.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&r.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null},ZB=function(e,t,r){var i=t-ri.BACK_BUFFER_LENGTH;e.length&&(i=Math.max(i,e.start(0)));var n=t-r;return Math.min(n,i)},Ba=function(e){var t=e.startOfSegment,r=e.duration,i=e.segment,n=e.part,a=e.playlist,o=a.mediaSequence,l=a.id,u=a.segments,c=u===void 0?[]:u,h=e.mediaIndex,f=e.partIndex,g=e.timeline,C=c.length-1,p="mediaIndex/partIndex increment";e.getMediaInfoForTime?p="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(p="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(p+=" with independent "+e.independent);var T=typeof f=="number",A=e.segment.uri?"segment":"pre-segment",N=T?jE({preloadSegment:i})-1:0;return A+" ["+(o+h)+"/"+(o+C)+"]"+(T?" part ["+f+"/"+N+"]":"")+(" segment start/end ["+i.start+" => "+i.end+"]")+(T?" part start/end ["+n.start+" => "+n.end+"]":"")+(" startOfSegment ["+t+"]")+(" duration ["+r+"]")+(" timeline ["+g+"]")+(" selected by ["+p+"]")+(" playlist ["+l+"]")},MT=function(e){return e+"TimingInfo"},e5=function(e){var t=e.segmentTimeline,r=e.currentTimeline,i=e.startOfSegment,n=e.buffered,a=e.overrideCheck;return!a&&t===r?null:t<r?i:n.length?n.end(n.length-1):i},RT=function(e){var t=e.timelineChangeController,r=e.currentTimeline,i=e.segmentTimeline,n=e.loaderType,a=e.audioDisabled;if(r===i)return!1;if(n==="audio"){var o=t.lastTimelineChange({type:"main"});return!o||o.to!==i}if(n==="main"&&a){var l=t.pendingTimelineChange({type:"audio"});return!(l&&l.to===i)}return!1},t5=function(e){var t=0;return["video","audio"].forEach(function(r){var i=e[r+"TimingInfo"];if(i){var n=i.start,a=i.end,o;typeof n=="bigint"||typeof a=="bigint"?o=D.BigInt(a)-D.BigInt(n):typeof n=="number"&&typeof a=="number"&&(o=a-n),typeof o<"u"&&o>t&&(t=o)}}),typeof t=="bigint"&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t},BT=function(e){var t=e.segmentDuration,r=e.maxDuration;return t?Math.round(t)>r+ls:!1},i5=function(e,t){if(t!=="hls")return null;var r=t5({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!r)return null;var i=e.playlist.targetDuration,n=BT({segmentDuration:r,maxDuration:i*2}),a=BT({segmentDuration:r,maxDuration:i}),o="Segment with index "+e.mediaIndex+" "+("from playlist "+e.playlist.id+" ")+("has a duration of "+r+" ")+("when the reported duration is "+e.duration+" ")+("and the target duration is "+i+". ")+"For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return n||a?{severity:n?"warn":"info",message:o}:null},km=(function(s){we(e,s);function e(r,i){var n;if(n=s.call(this)||this,!r)throw new TypeError("Initialization settings are required");if(typeof r.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!r.mediaSource)throw new TypeError("No MediaSource specified");return n.bandwidth=r.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=r.hasPlayed,n.currentTime_=r.currentTime,n.seekable_=r.seekable,n.seeking_=r.seeking,n.duration_=r.duration,n.mediaSource_=r.mediaSource,n.vhs_=r.vhs,n.loaderType_=r.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=r.segmentMetadataTrack,n.goalBufferLength_=r.goalBufferLength,n.sourceType_=r.sourceType,n.sourceUpdater_=r.sourceUpdater,n.inbandTextTracks_=r.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=r.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=r.parse708captions,n.useDtsForTimestampOffset_=r.useDtsForTimestampOffset,n.captionServices_=r.captionServices,n.experimentalExactManifestTimings=r.experimentalExactManifestTimings,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=ne.browser.IE_VERSION>=11,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=r.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=r.decrypter,n.syncController_=r.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate")},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",function(){n.isEndOfStream_()||(n.ended_=!1)}),n.fetchAtBuffer_=!1,n.logger_=Or("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty(We(n),"state",{get:function(){return this.state_},set:function(o){o!==this.state_&&(this.logger_(this.state_+" -> "+o),this.state_=o,this.trigger("statechange"))}}),n.sourceUpdater_.on("ready",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n.loaderType_==="main"&&n.timelineChangeController_.on("pendingtimelinechange",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n.loaderType_==="audio"&&n.timelineChangeController_.on("timelinechange",function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n}var t=e.prototype;return t.createTransmuxer_=function(){return np.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},t.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},t.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},t.setAudio=function(i){this.audioDisabled_=!i,i?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},t.abort=function(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()},t.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,D.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},t.checkForAbort_=function(i){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==i},t.error=function(i){return typeof i<"u"&&(this.logger_("error occurred:",i),this.error_=i),this.pendingSegment_=null,this.error_},t.endOfStream=function(){this.ended_=!0,this.transmuxer_&&np.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},t.buffered_=function(){var i=this.getMediaInfo_();if(!this.sourceUpdater_||!i)return ne.createTimeRanges();if(this.loaderType_==="main"){var n=i.hasAudio,a=i.hasVideo,o=i.isMuxed;if(a&&n&&!this.audioDisabled_&&!o)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},t.initSegmentForMap=function(i,n){if(n===void 0&&(n=!1),!i)return null;var a=dh(i),o=this.initSegments_[a];return n&&!o&&i.bytes&&(this.initSegments_[a]=o={resolvedUri:i.resolvedUri,byterange:i.byterange,bytes:i.bytes,tracks:i.tracks,timescales:i.timescales}),o||i},t.segmentKey=function(i,n){if(n===void 0&&(n=!1),!i)return null;var a=i2(i),o=this.keyCache_[a];this.cacheEncryptionKeys_&&n&&!o&&i.bytes&&(this.keyCache_[a]=o={resolvedUri:i.resolvedUri,bytes:i.bytes});var l={resolvedUri:(o||i).resolvedUri};return o&&(l.bytes=o.bytes),l},t.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},t.load=function(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}},t.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},t.playlist=function(i,n){if(n===void 0&&(n={}),!!i){var a=this.playlist_,o=this.pendingSegment_;this.playlist_=i,this.xhrOptions_=n,this.state==="INIT"&&(i.syncInfo={mediaSequence:i.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(i));var l=null;if(a&&(a.id?l=a.id:a.uri&&(l=a.uri)),this.logger_("playlist update ["+l+" => "+(i.id||i.uri)+"]"),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==i.uri){this.mediaIndex!==null&&(i.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}var u=i.mediaSequence-a.mediaSequence;if(this.logger_("live window shift ["+u+"]"),this.mediaIndex!==null)if(this.mediaIndex-=u,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var c=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!c.parts||!c.parts.length||!c.parts[this.partIndex])){var h=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=h}}o&&(o.mediaIndex-=u,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=i.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(a,i)}},t.pause=function(){this.checkBufferTimeout_&&(D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},t.paused=function(){return this.checkBufferTimeout_===null},t.resetEverything=function(i){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,i),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},t.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},t.resyncLoader=function(){this.transmuxer_&&np.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},t.remove=function(i,n,a,o){if(a===void 0&&(a=function(){}),o===void 0&&(o=!1),n===1/0&&(n=this.duration_()),n<=i){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}var l=1,u=function(){l--,l===0&&a()};(o||!this.audioDisabled_)&&(l++,this.sourceUpdater_.removeAudio(i,n,u)),(o||this.loaderType_==="main")&&(this.gopBuffer_=KB(this.gopBuffer_,i,n,this.timeMapping_),l++,this.sourceUpdater_.removeVideo(i,n,u));for(var c in this.inbandTextTracks_)wl(i,n,this.inbandTextTracks_[c]);wl(i,n,this.segmentMetadataTrack_),u()},t.monitorBuffer_=function(){this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),1)},t.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),QB)},t.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var i=this.chooseNextRequest_();i&&(typeof i.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:i.timeline})),this.loadSegment_(i))}},t.isEndOfStream_=function(i,n,a){if(i===void 0&&(i=this.mediaIndex),n===void 0&&(n=this.playlist_),a===void 0&&(a=this.partIndex),!n||!this.mediaSource_)return!1;var o=typeof i=="number"&&n.segments[i],l=i+1===n.segments.length,u=!o||!o.parts||a+1===o.parts.length;return n.endList&&this.mediaSource_.readyState==="open"&&l&&u},t.chooseNextRequest_=function(){var i=this.buffered_(),n=ET(i)||0,a=uv(i,this.currentTime_()),o=!this.hasPlayed_()&&a>=1,l=a>=this.goalBufferLength_(),u=this.playlist_.segments;if(!u.length||o||l)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var c={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(c.isSyncRequest)c.mediaIndex=YB(this.currentTimeline_,u,n);else if(this.mediaIndex!==null){var h=u[this.mediaIndex],f=typeof this.partIndex=="number"?this.partIndex:-1;c.startOfSegment=h.end?h.end:n,h.parts&&h.parts[f+1]?(c.mediaIndex=this.mediaIndex,c.partIndex=f+1):c.mediaIndex=this.mediaIndex+1}else{var g=Hi.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?n:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),C=g.segmentIndex,p=g.startTime,T=g.partIndex;c.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+n:"currentTime "+this.currentTime_(),c.mediaIndex=C,c.startOfSegment=p,c.partIndex=T}var A=u[c.mediaIndex],N=A&&typeof c.partIndex=="number"&&A.parts&&A.parts[c.partIndex];if(!A||typeof c.partIndex=="number"&&!N)return null;if(typeof c.partIndex!="number"&&A.parts&&(c.partIndex=0,N=A.parts[0]),!a&&N&&!N.independent)if(c.partIndex===0){var F=u[c.mediaIndex-1],V=F.parts&&F.parts.length&&F.parts[F.parts.length-1];V&&V.independent&&(c.mediaIndex-=1,c.partIndex=F.parts.length-1,c.independent="previous segment")}else A.parts[c.partIndex-1].independent&&(c.partIndex-=1,c.independent="previous part");var R=this.mediaSource_&&this.mediaSource_.readyState==="ended";return c.mediaIndex>=u.length-1&&R&&!this.seeking_()?null:this.generateSegmentInfo_(c)},t.generateSegmentInfo_=function(i){var n=i.independent,a=i.playlist,o=i.mediaIndex,l=i.startOfSegment,u=i.isSyncRequest,c=i.partIndex,h=i.forceTimestampOffset,f=i.getMediaInfoForTime,g=a.segments[o],C=typeof c=="number"&&g.parts[c],p={requestId:"segment-loader-"+Math.random(),uri:C&&C.resolvedUri||g.resolvedUri,mediaIndex:o,partIndex:C?c:null,isSyncRequest:u,startOfSegment:l,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:C&&C.duration||g.duration,segment:g,part:C,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:f,independent:n},T=typeof h<"u"?h:this.isPendingTimestampOffset_;p.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:l,buffered:this.buffered_(),overrideCheck:T});var A=ET(this.sourceUpdater_.audioBuffered());return typeof A=="number"&&(p.audioAppendStart=A-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(p.gopsToAlignWith=WB(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),p},t.timestampOffsetForSegment_=function(i){return e5(i)},t.earlyAbortWhenNeeded_=function(i){if(!(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)&&!(Date.now()-(i.firstBytesReceivedAt||Date.now())<1e3)){var n=this.currentTime_(),a=i.bandwidth,o=this.pendingSegment_.duration,l=Hi.estimateSegmentRequestTime(o,a,this.playlist_,i.bytesReceived),u=C3(this.buffered_(),n,this.vhs_.tech_.playbackRate())-1;if(!(l<=u)){var c=BB({master:this.vhs_.playlists.master,currentTime:n,bandwidth:a,duration:this.duration_(),segmentDuration:o,timeUntilRebuffer:u,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(c){var h=l-u,f=h-c.rebufferingImpact,g=.5;u<=ls&&(g=1),!(!c.playlist||c.playlist.uri===this.playlist_.uri||f<g)&&(this.bandwidth=c.playlist.attributes.BANDWIDTH*ri.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},t.handleAbort_=function(i){this.logger_("Aborting "+Ba(i)),this.mediaRequestsAborted+=1},t.handleProgress_=function(i,n){this.earlyAbortWhenNeeded_(n.stats),!this.checkForAbort_(n.requestId)&&this.trigger("progress")},t.handleTrackInfo_=function(i,n){this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)&&(this.checkForIllegalMediaSwitch(n)||(n=n||{},XB(this.currentMediaInfo_,n)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=n,this.currentMediaInfo_=n,this.logger_("trackinfo update",n),this.trigger("trackinfo")),!this.checkForAbort_(i.requestId)&&(this.pendingSegment_.trackInfo=n,this.hasEnoughInfoToAppend_()&&this.processCallQueue_())))},t.handleTimingInfo_=function(i,n,a,o){if(this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)){var l=this.pendingSegment_,u=MT(n);l[u]=l[u]||{},l[u][a]=o,this.logger_("timinginfo: "+n+" - "+a+" - "+o),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},t.handleCaptions_=function(i,n){var a=this;if(this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)){if(n.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,i,n));return}var l=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),u={};n.forEach(function(c){u[c.stream]=u[c.stream]||{startTime:1/0,captions:[],endTime:0};var h=u[c.stream];h.startTime=Math.min(h.startTime,c.startTime+l),h.endTime=Math.max(h.endTime,c.endTime+l),h.captions.push(c)}),Object.keys(u).forEach(function(c){var h=u[c],f=h.startTime,g=h.endTime,C=h.captions,p=a.inbandTextTracks_;a.logger_("adding cues from "+f+" -> "+g+" for "+c),$B(p,a.vhs_.tech_,c),wl(f,g,p[c]),jB({captionArray:C,inbandTextTracks:p,timestampOffset:l})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},t.handleId3_=function(i,n,a){if(this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)){var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,i,n,a));return}var l=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();qB(this.inbandTextTracks_,a,this.vhs_.tech_),HB({inbandTextTracks:this.inbandTextTracks_,metadataArray:n,timestampOffset:l,videoDuration:this.duration_()})}},t.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(i){return i()}),this.metadataQueue_.caption.forEach(function(i){return i()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},t.processCallQueue_=function(){var i=this.callQueue_;this.callQueue_=[],i.forEach(function(n){return n()})},t.processLoadQueue_=function(){var i=this.loadQueue_;this.loadQueue_=[],i.forEach(function(n){return n()})},t.hasEnoughInfoToLoad_=function(){if(this.loaderType_!=="audio")return!0;var i=this.pendingSegment_;return i?this.getCurrentMediaInfo_()?!RT({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:i.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1},t.getCurrentMediaInfo_=function(i){return i===void 0&&(i=this.pendingSegment_),i&&i.trackInfo||this.currentMediaInfo_},t.getMediaInfo_=function(i){return i===void 0&&(i=this.pendingSegment_),this.getCurrentMediaInfo_(i)||this.startingMediaInfo_},t.getPendingSegmentPlaylist=function(){return this.pendingSegment_?this.pendingSegment_.playlist:null},t.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var i=this.pendingSegment_,n=this.getCurrentMediaInfo_();if(!i||!n)return!1;var a=n.hasAudio,o=n.hasVideo,l=n.isMuxed;return!(o&&!i.videoTimingInfo||a&&!this.audioDisabled_&&!l&&!i.audioTimingInfo||RT({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:i.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},t.handleData_=function(i,n){if(this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,i,n));return}var a=this.pendingSegment_;if(this.setTimeMapping_(a.timeline),this.updateMediaSecondsLoaded_(a.part||a.segment),this.mediaSource_.readyState!=="closed"){if(i.map&&(i.map=this.initSegmentForMap(i.map,!0),a.segment.map=i.map),i.key&&this.segmentKey(i.key,!0),a.isFmp4=i.isFmp4,a.timingInfo=a.timingInfo||{},a.isFmp4)this.trigger("fmp4"),a.timingInfo.start=a[MT(n.type)].start;else{var o=this.getCurrentMediaInfo_(),l=this.loaderType_==="main"&&o&&o.hasVideo,u;l&&(u=a.videoTimingInfo.start),a.timingInfo.start=this.trueSegmentStart_({currentStart:a.timingInfo.start,playlist:a.playlist,mediaIndex:a.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:l,firstVideoFrameTimeForData:u,videoTimingInfo:a.videoTimingInfo,audioTimingInfo:a.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(a,n.type),this.updateSourceBufferTimestampOffset_(a),a.isSyncRequest){this.updateTimingInfoEnd_(a),this.syncController_.saveSegmentTimingInfo({segmentInfo:a,shouldSaveTimelineMapping:this.loaderType_==="main"});var c=this.chooseNextRequest_();if(c.mediaIndex!==a.mediaIndex||c.partIndex!==a.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}a.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(a,n)}}},t.updateAppendInitSegmentStatus=function(i,n){this.loaderType_==="main"&&typeof i.timestampOffset=="number"&&!i.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[n]!==i.playlist&&(this.appendInitSegment_[n]=!0)},t.getInitSegmentAndUpdateState_=function(i){var n=i.type,a=i.initSegment,o=i.map,l=i.playlist;if(o){var u=dh(o);if(this.activeInitSegmentId_===u)return null;a=this.initSegmentForMap(o,!0).bytes,this.activeInitSegmentId_=u}return a&&this.appendInitSegment_[n]?(this.playlistOfLastInitSegment_[n]=l,this.appendInitSegment_[n]=!1,this.activeInitSegmentId_=null,a):null},t.handleQuotaExceededError_=function(i,n){var a=this,o=i.segmentInfo,l=i.type,u=i.bytes,c=this.sourceUpdater_.audioBuffered(),h=this.sourceUpdater_.videoBuffered();c.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+$s(c).join(", ")),h.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+$s(h).join(", "));var f=c.length?c.start(0):0,g=c.length?c.end(c.length-1):0,C=h.length?h.start(0):0,p=h.length?h.end(h.length-1):0;if(g-f<=pl&&p-C<=pl){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. "+("Appended byte length: "+u.byteLength+", ")+("audio buffer: "+$s(c).join(", ")+", ")+("video buffer: "+$s(h).join(", ")+", ")),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:o,type:l,bytes:u}));var T=this.currentTime_(),A=T-pl;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+A),this.remove(0,A,function(){a.logger_("On QUOTA_EXCEEDED_ERR, retrying append in "+pl+"s"),a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=D.setTimeout(function(){a.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),a.quotaExceededErrorRetryTimeout_=null,a.processCallQueue_()},pl*1e3)},!0)},t.handleAppendError_=function(i,n){var a=i.segmentInfo,o=i.type,l=i.bytes;if(n){if(n.code===_2){this.handleQuotaExceededError_({segmentInfo:a,type:o,bytes:l});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error(o+" append of "+l.length+"b failed for segment "+("#"+a.mediaIndex+" in playlist "+a.playlist.id)),this.trigger("appenderror")}},t.appendToSourceBuffer_=function(i){var n=i.segmentInfo,a=i.type,o=i.initSegment,l=i.data,u=i.bytes;if(!u){var c=[l],h=l.byteLength;o&&(c.unshift(o),h+=o.byteLength),u=UB({bytes:h,segments:c})}this.sourceUpdater_.appendBuffer({segmentInfo:n,type:a,bytes:u},this.handleAppendError_.bind(this,{segmentInfo:n,type:a,bytes:u}))},t.handleSegmentTimingInfo_=function(i,n,a){if(!(!this.pendingSegment_||n!==this.pendingSegment_.requestId)){var o=this.pendingSegment_.segment,l=i+"TimingInfo";o[l]||(o[l]={}),o[l].transmuxerPrependedSeconds=a.prependedContentDuration||0,o[l].transmuxedPresentationStart=a.start.presentation,o[l].transmuxedDecodeStart=a.start.decode,o[l].transmuxedPresentationEnd=a.end.presentation,o[l].transmuxedDecodeEnd=a.end.decode,o[l].baseMediaDecodeTime=a.baseMediaDecodeTime}},t.appendData_=function(i,n){var a=n.type,o=n.data;if(!(!o||!o.byteLength)&&!(a==="audio"&&this.audioDisabled_)){var l=this.getInitSegmentAndUpdateState_({type:a,initSegment:n.initSegment,playlist:i.playlist,map:i.isFmp4?i.segment.map:null});this.appendToSourceBuffer_({segmentInfo:i,type:a,initSegment:l,data:o})}},t.loadSegment_=function(i){var n=this;if(this.state="WAITING",this.pendingSegment_=i,this.trimBackBuffer_(i),typeof i.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(function(){var a=vt({},i,{forceTimestampOffset:!0});vt(i,n.generateSegmentInfo_(a)),n.isPendingTimestampOffset_=!1,n.updateTransmuxerAndRequestSegment_(i)});return}this.updateTransmuxerAndRequestSegment_(i)},t.updateTransmuxerAndRequestSegment_=function(i){var n=this;this.shouldUpdateTransmuxerTimestampOffset_(i.timestampOffset)&&(this.gopBuffer_.length=0,i.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:i.timestampOffset}));var a=this.createSimplifiedSegmentObj_(i),o=this.isEndOfStream_(i.mediaIndex,i.playlist,i.partIndex),l=this.mediaIndex!==null,u=i.timeline!==this.currentTimeline_&&i.timeline>0,c=o||l&&u;this.logger_("Requesting "+Ba(i)),a.map&&!a.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),i.abortRequests=DB({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:a,abortFn:this.handleAbort_.bind(this,i),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",i.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",i.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:c,endedTimelineFn:function(){n.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(f){var g=f.message,C=f.level,p=f.stream;n.logger_(Ba(i)+" logged from transmuxer stream "+p+" as a "+C+": "+g)}})},t.trimBackBuffer_=function(i){var n=ZB(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);n>0&&this.remove(0,n)},t.createSimplifiedSegmentObj_=function(i){var n=i.segment,a=i.part,o={resolvedUri:a?a.resolvedUri:n.resolvedUri,byterange:a?a.byterange:n.byterange,requestId:i.requestId,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,part:i.part},l=i.playlist.segments[i.mediaIndex-1];if(l&&l.timeline===n.timeline&&(l.videoTimingInfo?o.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(o.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),n.key){var u=n.key.iv||new Uint32Array([0,0,0,i.mediaIndex+i.playlist.mediaSequence]);o.key=this.segmentKey(n.key),o.key.iv=u}return n.map&&(o.map=this.initSegmentForMap(n.map)),o},t.saveTransferStats_=function(i){this.mediaRequests+=1,i&&(this.mediaBytesTransferred+=i.bytesReceived,this.mediaTransferDuration+=i.roundTripTime)},t.saveBandwidthRelatedStats_=function(i,n){if(this.pendingSegment_.byteLength=n.bytesReceived,i<pc){this.logger_("Ignoring segment's bandwidth because its duration of "+i+(" is less than the min to record "+pc));return}this.bandwidth=n.bandwidth,this.roundTrip=n.roundTripTime},t.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")},t.segmentRequestFinished_=function(i,n,a){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,i,n,a));return}if(this.saveTransferStats_(n.stats),!!this.pendingSegment_&&n.requestId===this.pendingSegment_.requestId){if(i){if(this.pendingSegment_=null,this.state="READY",i.code===Zr.ABORTED)return;if(this.pause(),i.code===Zr.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(i),this.trigger("error");return}var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,n.stats),o.endOfAllRequests=n.endOfAllRequests,a.gopInfo&&(this.gopBuffer_=GB(this.gopBuffer_,a.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(o)}},t.setTimeMapping_=function(i){var n=this.syncController_.mappingForTimeline(i);n!==null&&(this.timeMapping_=n)},t.updateMediaSecondsLoaded_=function(i){typeof i.start=="number"&&typeof i.end=="number"?this.mediaSecondsLoaded+=i.end-i.start:this.mediaSecondsLoaded+=i.duration},t.shouldUpdateTransmuxerTimestampOffset_=function(i){return i===null?!1:this.loaderType_==="main"&&i!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&i!==this.sourceUpdater_.audioTimestampOffset()},t.trueSegmentStart_=function(i){var n=i.currentStart,a=i.playlist,o=i.mediaIndex,l=i.firstVideoFrameTimeForData,u=i.currentVideoTimestampOffset,c=i.useVideoTimingInfo,h=i.videoTimingInfo,f=i.audioTimingInfo;if(typeof n<"u")return n;if(!c)return f.start;var g=a.segments[o-1];return o===0||!g||typeof g.start>"u"||g.end!==l+u?l:h.start},t.waitForAppendsToComplete_=function(i){var n=this.getCurrentMediaInfo_(i);if(!n){this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),this.trigger("error");return}var a=n.hasAudio,o=n.hasVideo,l=n.isMuxed,u=this.loaderType_==="main"&&o,c=!this.audioDisabled_&&a&&!l;if(i.waitingOnAppends=0,!i.hasAppendedData_){!i.timingInfo&&typeof i.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),i.timingInfo={start:0},i.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(i),this.processMetadataQueue_()),this.checkAppendsDone_(i);return}u&&i.waitingOnAppends++,c&&i.waitingOnAppends++,u&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,i)),c&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,i))},t.checkAppendsDone_=function(i){this.checkForAbort_(i.requestId)||(i.waitingOnAppends--,i.waitingOnAppends===0&&this.handleAppendsDone_())},t.checkForIllegalMediaSwitch=function(i){var n=JB(this.loaderType_,this.getCurrentMediaInfo_(),i);return n?(this.error({message:n,blacklistDuration:1/0}),this.trigger("error"),!0):!1},t.updateSourceBufferTimestampOffset_=function(i){if(!(i.timestampOffset===null||typeof i.timingInfo.start!="number"||i.changedTimestampOffset||this.loaderType_!=="main")){var n=!1;i.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:i.segment.videoTimingInfo,audioTimingInfo:i.segment.audioTimingInfo,timingInfo:i.timingInfo}),i.changedTimestampOffset=!0,i.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(i.timestampOffset),n=!0),i.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(i.timestampOffset),n=!0),n&&this.trigger("timestampoffset")}},t.getSegmentStartTimeForTimestampOffsetCalculation_=function(i){var n=i.videoTimingInfo,a=i.audioTimingInfo,o=i.timingInfo;return this.useDtsForTimestampOffset_?n&&typeof n.transmuxedDecodeStart=="number"?n.transmuxedDecodeStart:a&&typeof a.transmuxedDecodeStart=="number"?a.transmuxedDecodeStart:o.start:o.start},t.updateTimingInfoEnd_=function(i){i.timingInfo=i.timingInfo||{};var n=this.getMediaInfo_(),a=this.loaderType_==="main"&&n&&n.hasVideo,o=a&&i.videoTimingInfo?i.videoTimingInfo:i.audioTimingInfo;o&&(i.timingInfo.end=typeof o.end=="number"?o.end:o.start+i.duration)},t.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}var i=this.pendingSegment_;this.updateTimingInfoEnd_(i),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});var n=i5(i,this.sourceType_);if(n&&(n.severity==="warn"?ne.log.warn(n.message):this.logger_(n.message)),this.recordThroughput_(i),this.pendingSegment_=null,this.state="READY",i.isSyncRequest&&(this.trigger("syncinfoupdate"),!i.hasAppendedData_)){this.logger_("Throwing away un-appended sync request "+Ba(i));return}this.logger_("Appended "+Ba(i)),this.addSegmentMetadataCue_(i),this.fetchAtBuffer_=!0,this.currentTimeline_!==i.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:i.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:i.timeline})),this.currentTimeline_=i.timeline,this.trigger("syncinfoupdate");var a=i.segment,o=i.part,l=a.end&&this.currentTime_()-a.end>i.playlist.targetDuration*3,u=o&&o.end&&this.currentTime_()-o.end>i.playlist.partTargetDuration*3;if(l||u){this.logger_("bad "+(l?"segment":"part")+" "+Ba(i)),this.resetEverything();return}var c=this.mediaIndex!==null;c&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=i.mediaIndex,this.partIndex=i.partIndex,this.isEndOfStream_(i.mediaIndex,i.playlist,i.partIndex)&&this.endOfStream(),this.trigger("appended"),i.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()},t.recordThroughput_=function(i){if(i.duration<pc){this.logger_("Ignoring segment's throughput because its duration of "+i.duration+(" is less than the min to record "+pc));return}var n=this.throughput.rate,a=Date.now()-i.endOfAllRequests+1,o=Math.floor(i.byteLength/a*8*1e3);this.throughput.rate+=(o-n)/++this.throughput.count},t.addSegmentMetadataCue_=function(i){if(this.segmentMetadataTrack_){var n=i.segment,a=n.start,o=n.end;if(!(!OT(a)||!OT(o))){wl(a,o,this.segmentMetadataTrack_);var l=D.WebKitDataCue||D.VTTCue,u={custom:n.custom,dateTimeObject:n.dateTimeObject,dateTimeString:n.dateTimeString,bandwidth:i.playlist.attributes.BANDWIDTH,resolution:i.playlist.attributes.RESOLUTION,codecs:i.playlist.attributes.CODECS,byteLength:i.byteLength,uri:i.uri,timeline:i.timeline,playlist:i.playlist.id,start:a,end:o},c=JSON.stringify(u),h=new l(a,o,c);h.value=u,this.segmentMetadataTrack_.addCue(h)}}},e})(ne.EventTarget);function Cn(){}var T2=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toUpperCase()})},r5=["video","audio"],xm=function(e,t){var r=t[e+"Buffer"];return r&&r.updating||t.queuePending[e]},n5=function(e,t){for(var r=0;r<t.length;r++){var i=t[r];if(i.type==="mediaSource")return null;if(i.type===e)return r}return null},gv=function s(e,t){if(t.queue.length!==0){var r=0,i=t.queue[r];if(i.type==="mediaSource"){!t.updating()&&t.mediaSource.readyState!=="closed"&&(t.queue.shift(),i.action(t),i.doneFn&&i.doneFn(),s("audio",t),s("video",t));return}if(e!=="mediaSource"&&!(!t.ready()||t.mediaSource.readyState==="closed"||xm(e,t))){if(i.type!==e){if(r=n5(e,t.queue),r===null)return;i=t.queue[r]}if(t.queue.splice(r,1),t.queuePending[e]=i,i.action(e,t),!i.doneFn){t.queuePending[e]=null,s(e,t);return}}}},b2=function(e,t){var r=t[e+"Buffer"],i=T2(e);r&&(r.removeEventListener("updateend",t["on"+i+"UpdateEnd_"]),r.removeEventListener("error",t["on"+i+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)},Wr=function(e,t){return e&&t&&Array.prototype.indexOf.call(e.sourceBuffers,t)!==-1},Ji={appendBuffer:function(e,t,r){return function(i,n){var a=n[i+"Buffer"];if(Wr(n.mediaSource,a)){n.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" bytes to "+i+"Buffer");try{a.appendBuffer(e)}catch(o){n.logger_("Error with code "+o.code+" "+(o.code===_2?"(QUOTA_EXCEEDED_ERR) ":"")+("when appending segment "+t.mediaIndex+" to "+i+"Buffer")),n.queuePending[i]=null,r(o)}}}},remove:function(e,t){return function(r,i){var n=i[r+"Buffer"];if(Wr(i.mediaSource,n)){i.logger_("Removing "+e+" to "+t+" from "+r+"Buffer");try{n.remove(e,t)}catch{i.logger_("Remove "+e+" to "+t+" from "+r+"Buffer failed")}}}},timestampOffset:function(e){return function(t,r){var i=r[t+"Buffer"];Wr(r.mediaSource,i)&&(r.logger_("Setting "+t+"timestampOffset to "+e),i.timestampOffset=e)}},callback:function(e){return function(t,r){e()}},endOfStream:function(e){return function(t){if(t.mediaSource.readyState==="open"){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(r){ne.log.warn("Failed to call media source endOfStream",r)}}}},duration:function(e){return function(t){t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(r){ne.log.warn("Failed to set media source duration",r)}}},abort:function(){return function(e,t){if(t.mediaSource.readyState==="open"){var r=t[e+"Buffer"];if(Wr(t.mediaSource,r)){t.logger_("calling abort on "+e+"Buffer");try{r.abort()}catch(i){ne.log.warn("Failed to abort on "+e+"Buffer",i)}}}}},addSourceBuffer:function(e,t){return function(r){var i=T2(e),n=zl(t);r.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource");var a=r.mediaSource.addSourceBuffer(n);a.addEventListener("updateend",r["on"+i+"UpdateEnd_"]),a.addEventListener("error",r["on"+i+"Error_"]),r.codecs[e]=t,r[e+"Buffer"]=a}},removeSourceBuffer:function(e){return function(t){var r=t[e+"Buffer"];if(b2(e,t),!!Wr(t.mediaSource,r)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(r)}catch(i){ne.log.warn("Failed to removeSourceBuffer "+e+"Buffer",i)}}}},changeType:function(e){return function(t,r){var i=r[t+"Buffer"],n=zl(e);if(Wr(r.mediaSource,i)&&r.codecs[t]!==e){r.logger_("changing "+t+"Buffer codec from "+r.codecs[t]+" to "+e);try{i.changeType(n),r.codecs[t]=e}catch(a){ne.log.warn("Failed to changeType on "+t+"Buffer",a)}}}}},Zi=function(e){var t=e.type,r=e.sourceUpdater,i=e.action,n=e.doneFn,a=e.name;r.queue.push({type:t,action:i,doneFn:n,name:a}),gv(t,r)},FT=function(e,t){return function(r){if(t.queuePending[e]){var i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[e+"Error_"])}gv(e,t)}},S2=(function(s){we(e,s);function e(r){var i;return i=s.call(this)||this,i.mediaSource=r,i.sourceopenListener_=function(){return gv("mediaSource",We(i))},i.mediaSource.addEventListener("sourceopen",i.sourceopenListener_),i.logger_=Or("SourceUpdater"),i.audioTimestampOffset_=0,i.videoTimestampOffset_=0,i.queue=[],i.queuePending={audio:null,video:null},i.delayedAudioAppendQueue_=[],i.videoAppendQueued_=!1,i.codecs={},i.onVideoUpdateEnd_=FT("video",We(i)),i.onAudioUpdateEnd_=FT("audio",We(i)),i.onVideoError_=function(n){i.videoError_=n},i.onAudioError_=function(n){i.audioError_=n},i.createdSourceBuffers_=!1,i.initializedEme_=!1,i.triggeredReady_=!1,i}var t=e.prototype;return t.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},t.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},t.hasInitializedAnyEme=function(){return this.initializedEme_},t.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},t.createSourceBuffers=function(i){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(i),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},t.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},t.addSourceBuffer=function(i,n){Zi({type:"mediaSource",sourceUpdater:this,action:Ji.addSourceBuffer(i,n),name:"addSourceBuffer"})},t.abort=function(i){Zi({type:i,sourceUpdater:this,action:Ji.abort(i),name:"abort"})},t.removeSourceBuffer=function(i){if(!this.canRemoveSourceBuffer()){ne.log.error("removeSourceBuffer is not supported!");return}Zi({type:"mediaSource",sourceUpdater:this,action:Ji.removeSourceBuffer(i),name:"removeSourceBuffer"})},t.canRemoveSourceBuffer=function(){return!ne.browser.IE_VERSION&&!ne.browser.IS_FIREFOX&&D.MediaSource&&D.MediaSource.prototype&&typeof D.MediaSource.prototype.removeSourceBuffer=="function"},e.canChangeType=function(){return D.SourceBuffer&&D.SourceBuffer.prototype&&typeof D.SourceBuffer.prototype.changeType=="function"},t.canChangeType=function(){return this.constructor.canChangeType()},t.changeType=function(i,n){if(!this.canChangeType()){ne.log.error("changeType is not supported!");return}Zi({type:i,sourceUpdater:this,action:Ji.changeType(n),name:"changeType"})},t.addOrChangeSourceBuffers=function(i){var n=this;if(!i||typeof i!="object"||Object.keys(i).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(i).forEach(function(a){var o=i[a];if(!n.hasCreatedSourceBuffers())return n.addSourceBuffer(a,o);n.canChangeType()&&n.changeType(a,o)})},t.appendBuffer=function(i,n){var a=this,o=i.segmentInfo,l=i.type,u=i.bytes;if(this.processedAppend_=!0,l==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([i,n]),this.logger_("delayed audio append of "+u.length+" until video append");return}var c=n;if(Zi({type:l,sourceUpdater:this,action:Ji.appendBuffer(u,o||{mediaIndex:-1},c),doneFn:n,name:"appendBuffer"}),l==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var h=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+h.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,h.forEach(function(f){a.appendBuffer.apply(a,f)})}},t.audioBuffered=function(){return Wr(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:ne.createTimeRange()},t.videoBuffered=function(){return Wr(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:ne.createTimeRange()},t.buffered=function(){var i=Wr(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,n=Wr(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return n&&!i?this.audioBuffered():i&&!n?this.videoBuffered():S3(this.audioBuffered(),this.videoBuffered())},t.setDuration=function(i,n){n===void 0&&(n=Cn),Zi({type:"mediaSource",sourceUpdater:this,action:Ji.duration(i),name:"duration",doneFn:n})},t.endOfStream=function(i,n){i===void 0&&(i=null),n===void 0&&(n=Cn),typeof i!="string"&&(i=void 0),Zi({type:"mediaSource",sourceUpdater:this,action:Ji.endOfStream(i),name:"endOfStream",doneFn:n})},t.removeAudio=function(i,n,a){if(a===void 0&&(a=Cn),!this.audioBuffered().length||this.audioBuffered().end(0)===0){a();return}Zi({type:"audio",sourceUpdater:this,action:Ji.remove(i,n),doneFn:a,name:"remove"})},t.removeVideo=function(i,n,a){if(a===void 0&&(a=Cn),!this.videoBuffered().length||this.videoBuffered().end(0)===0){a();return}Zi({type:"video",sourceUpdater:this,action:Ji.remove(i,n),doneFn:a,name:"remove"})},t.updating=function(){return!!(xm("audio",this)||xm("video",this))},t.audioTimestampOffset=function(i){return typeof i<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==i&&(Zi({type:"audio",sourceUpdater:this,action:Ji.timestampOffset(i),name:"timestampOffset"}),this.audioTimestampOffset_=i),this.audioTimestampOffset_},t.videoTimestampOffset=function(i){return typeof i<"u"&&this.videoBuffer&&this.videoTimestampOffset!==i&&(Zi({type:"video",sourceUpdater:this,action:Ji.timestampOffset(i),name:"timestampOffset"}),this.videoTimestampOffset_=i),this.videoTimestampOffset_},t.audioQueueCallback=function(i){this.audioBuffer&&Zi({type:"audio",sourceUpdater:this,action:Ji.callback(i),name:"callback"})},t.videoQueueCallback=function(i){this.videoBuffer&&Zi({type:"video",sourceUpdater:this,action:Ji.callback(i),name:"callback"})},t.dispose=function(){var i=this;this.trigger("dispose"),r5.forEach(function(n){i.abort(n),i.canRemoveSourceBuffer()?i.removeSourceBuffer(n):i[n+"QueueCallback"](function(){return b2(n,i)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},e})(ne.EventTarget),UT=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},$T=new Uint8Array(`
|
|
286
|
-
|
|
287
|
-
`.split("").map(function(s){return s.charCodeAt(0)})),s5=(function(s){we(e,s);function e(){return s.call(this,"Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")||this}return e})(lm(Error)),a5=(function(s){we(e,s);function e(r,i){var n;return i===void 0&&(i={}),n=s.call(this,r,i)||this,n.mediaSource_=null,n.subtitlesTrack_=null,n.loaderType_="subtitle",n.featuresNativeTextTracks_=r.featuresNativeTextTracks,n.loadVttJs=r.loadVttJs,n.shouldSaveSegmentTimingInfo_=!1,n}var t=e.prototype;return t.createTransmuxer_=function(){return null},t.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return ne.createTimeRanges();var i=this.subtitlesTrack_.cues,n=i[0].startTime,a=i[i.length-1].startTime;return ne.createTimeRanges([[n,a]])},t.initSegmentForMap=function(i,n){if(n===void 0&&(n=!1),!i)return null;var a=dh(i),o=this.initSegments_[a];if(n&&!o&&i.bytes){var l=$T.byteLength+i.bytes.byteLength,u=new Uint8Array(l);u.set(i.bytes),u.set($T,i.bytes.byteLength),this.initSegments_[a]=o={resolvedUri:i.resolvedUri,byterange:i.byterange,bytes:u}}return o||i},t.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},t.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},t.track=function(i){return typeof i>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=i,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)},t.remove=function(i,n){wl(i,n,this.subtitlesTrack_)},t.fillBuffer_=function(){var i=this,n=this.chooseNextRequest_();if(n){if(this.syncController_.timestampOffsetForTimeline(n.timeline)===null){var a=function(){i.state="READY",i.paused()||i.monitorBuffer_()};this.syncController_.one("timestampoffset",a),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(n)}},t.timestampOffsetForSegment_=function(){return null},t.chooseNextRequest_=function(){return this.skipEmptySegments_(s.prototype.chooseNextRequest_.call(this))},t.skipEmptySegments_=function(i){for(;i&&i.segment.empty;){if(i.mediaIndex+1>=i.playlist.segments.length){i=null;break}i=this.generateSegmentInfo_({playlist:i.playlist,mediaIndex:i.mediaIndex+1,startOfSegment:i.startOfSegment+i.duration,isSyncRequest:i.isSyncRequest})}return i},t.stopForError=function(i){this.error(i),this.state="READY",this.pause(),this.trigger("error")},t.segmentRequestFinished_=function(i,n,a){var o=this;if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(n.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(i){i.code===Zr.TIMEOUT&&this.handleTimeout_(),i.code===Zr.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(i);return}var l=this.pendingSegment_;this.saveBandwidthRelatedStats_(l.duration,n.stats),n.key&&this.segmentKey(n.key,!0),this.state="APPENDING",this.trigger("appending");var u=l.segment;if(u.map&&(u.map.bytes=n.map.bytes),l.bytes=n.bytes,typeof D.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(function(){return o.segmentRequestFinished_(i,n,a)},function(){return o.stopForError({message:"Error loading vtt.js"})});return}u.requested=!0;try{this.parseVTTCues_(l)}catch(c){this.stopForError({message:c.message});return}if(this.updateTimeMapping_(l,this.syncController_.timelines[l.timeline],this.playlist_),l.cues.length?l.timingInfo={start:l.cues[0].startTime,end:l.cues[l.cues.length-1].endTime}:l.timingInfo={start:l.startOfSegment,end:l.startOfSegment+l.duration},l.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}l.byteLength=l.bytes.byteLength,this.mediaSecondsLoaded+=u.duration,l.cues.forEach(function(c){o.subtitlesTrack_.addCue(o.featuresNativeTextTracks_?new D.VTTCue(c.startTime,c.endTime,c.text):c)}),zB(this.subtitlesTrack_),this.handleAppendsDone_()},t.handleData_=function(){},t.updateTimingInfoEnd_=function(){},t.parseVTTCues_=function(i){var n,a=!1;if(typeof D.WebVTT!="function")throw new s5;typeof D.TextDecoder=="function"?n=new D.TextDecoder("utf8"):(n=D.WebVTT.StringDecoder(),a=!0);var o=new D.WebVTT.Parser(D,D.vttjs,n);if(i.cues=[],i.timestampmap={MPEGTS:0,LOCAL:0},o.oncue=i.cues.push.bind(i.cues),o.ontimestampmap=function(c){i.timestampmap=c},o.onparsingerror=function(c){ne.log.warn("Error encountered when parsing cues: "+c.message)},i.segment.map){var l=i.segment.map.bytes;a&&(l=UT(l)),o.parse(l)}var u=i.bytes;a&&(u=UT(u)),o.parse(u),o.flush()},t.updateTimeMapping_=function(i,n,a){var o=i.segment;if(n){if(!i.cues.length){o.empty=!0;return}var l=i.timestampmap,u=l.MPEGTS/eh.ONE_SECOND_IN_TS-l.LOCAL+n.mapping;if(i.cues.forEach(function(f){f.startTime+=u,f.endTime+=u}),!a.syncInfo){var c=i.cues[0].startTime,h=i.cues[i.cues.length-1].startTime;a.syncInfo={mediaSequence:a.mediaSequence+i.mediaIndex,time:Math.min(c,h-o.duration)}}}},e})(km),o5=function(e,t){for(var r=e.cues,i=0;i<r.length;i++){var n=r[i];if(t>=n.adStartTime&&t<=n.adEndTime)return n}return null},l5=function(e,t,r){if(r===void 0&&(r=0),!!e.segments)for(var i=r,n,a=0;a<e.segments.length;a++){var o=e.segments[a];if(n||(n=o5(t,i+o.duration/2)),n){if("cueIn"in o){n.endTime=i,n.adEndTime=i,i+=o.duration,n=null;continue}if(i<n.endTime){i+=o.duration;continue}n.endTime+=o.duration}else if("cueOut"in o&&(n=new D.VTTCue(i,i+o.duration,o.cueOut),n.adStartTime=i,n.adEndTime=i+parseFloat(o.cueOut),t.addCue(n)),"cueOutCont"in o){var l=o.cueOutCont.split("/").map(parseFloat),u=l[0],c=l[1];n=new D.VTTCue(i,i+o.duration,""),n.adStartTime=i-u,n.adEndTime=n.adStartTime+c,t.addCue(n)}i+=o.duration}},u5=86400,jT=[{name:"VOD",run:function(e,t,r,i,n){if(r!==1/0){var a={time:0,segmentIndex:0,partIndex:null};return a}return null}},{name:"ProgramDateTime",run:function(e,t,r,i,n){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,o=null,l=ym(t);n=n||0;for(var u=0;u<l.length;u++){var c=t.endList||n===0?u:l.length-(u+1),h=l[c],f=h.segment,g=e.timelineToDatetimeMappings[f.timeline];if(!(!g||!f.dateTimeObject)){var C=f.dateTimeObject.getTime()/1e3,p=C+g;if(f.parts&&typeof h.partIndex=="number")for(var T=0;T<h.partIndex;T++)p+=f.parts[T].duration;var A=Math.abs(n-p);if(o!==null&&(A===0||o<A))break;o=A,a={time:p,segmentIndex:h.segmentIndex,partIndex:h.partIndex}}}return a}},{name:"Segment",run:function(e,t,r,i,n){var a=null,o=null;n=n||0;for(var l=ym(t),u=0;u<l.length;u++){var c=t.endList||n===0?u:l.length-(u+1),h=l[c],f=h.segment,g=h.part&&h.part.start||f&&f.start;if(f.timeline===i&&typeof g<"u"){var C=Math.abs(n-g);if(o!==null&&o<C)break;(!a||o===null||o>=C)&&(o=C,a={time:g,segmentIndex:h.segmentIndex,partIndex:h.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,r,i,n){var a=null;if(n=n||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var o=null,l=0;l<t.discontinuityStarts.length;l++){var u=t.discontinuityStarts[l],c=t.discontinuitySequence+l+1,h=e.discontinuities[c];if(h){var f=Math.abs(n-h.time);if(o!==null&&o<f)break;(!a||o===null||o>=f)&&(o=f,a={time:h.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,r,i,n){if(t.syncInfo){var a={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null};return a}return null}}],c5=(function(s){we(e,s);function e(r){var i;return i=s.call(this)||this,i.timelines=[],i.discontinuities=[],i.timelineToDatetimeMappings={},i.logger_=Or("SyncController"),i}var t=e.prototype;return t.getSyncPoint=function(i,n,a,o){var l=this.runStrategies_(i,n,a,o);return l.length?this.selectSyncPoint_(l,{key:"time",value:o}):null},t.getExpiredTime=function(i,n){if(!i||!i.segments)return null;var a=this.runStrategies_(i,n,i.discontinuitySequence,0);if(!a.length)return null;var o=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return o.segmentIndex>0&&(o.time*=-1),Math.abs(o.time+Bl({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:o.segmentIndex,endIndex:0}))},t.runStrategies_=function(i,n,a,o){for(var l=[],u=0;u<jT.length;u++){var c=jT[u],h=c.run(this,i,n,a,o);h&&(h.strategy=c.name,l.push({strategy:c.name,syncPoint:h}))}return l},t.selectSyncPoint_=function(i,n){for(var a=i[0].syncPoint,o=Math.abs(i[0].syncPoint[n.key]-n.value),l=i[0].strategy,u=1;u<i.length;u++){var c=Math.abs(i[u].syncPoint[n.key]-n.value);c<o&&(o=c,a=i[u].syncPoint,l=i[u].strategy)}return this.logger_("syncPoint for ["+n.key+": "+n.value+"] chosen with strategy"+(" ["+l+"]: [time:"+a.time+",")+(" segmentIndex:"+a.segmentIndex)+(typeof a.partIndex=="number"?",partIndex:"+a.partIndex:"")+"]"),a},t.saveExpiredSegmentInfo=function(i,n){var a=n.mediaSequence-i.mediaSequence;if(a>u5){ne.log.warn("Not saving expired segment info. Media sequence gap "+a+" is too large.");return}for(var o=a-1;o>=0;o--){var l=i.segments[o];if(l&&typeof l.start<"u"){n.syncInfo={mediaSequence:i.mediaSequence+o,time:l.start},this.logger_("playlist refresh sync: [time:"+n.syncInfo.time+","+(" mediaSequence: "+n.syncInfo.mediaSequence+"]")),this.trigger("syncinfoupdate");break}}},t.setDateTimeMappingForStart=function(i){if(this.timelineToDatetimeMappings={},i.segments&&i.segments.length&&i.segments[0].dateTimeObject){var n=i.segments[0],a=n.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[n.timeline]=-a}},t.saveSegmentTimingInfo=function(i){var n=i.segmentInfo,a=i.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(n,n.timingInfo,a),l=n.segment;o&&(this.saveDiscontinuitySyncInfo_(n),n.playlist.syncInfo||(n.playlist.syncInfo={mediaSequence:n.playlist.mediaSequence+n.mediaIndex,time:l.start}));var u=l.dateTimeObject;l.discontinuity&&a&&u&&(this.timelineToDatetimeMappings[l.timeline]=-(u.getTime()/1e3))},t.timestampOffsetForTimeline=function(i){return typeof this.timelines[i]>"u"?null:this.timelines[i].time},t.mappingForTimeline=function(i){return typeof this.timelines[i]>"u"?null:this.timelines[i].mapping},t.calculateSegmentTimeMapping_=function(i,n,a){var o=i.segment,l=i.part,u=this.timelines[i.timeline],c,h;if(typeof i.timestampOffset=="number")u={time:i.startOfSegment,mapping:i.startOfSegment-n.start},a&&(this.timelines[i.timeline]=u,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+i.timeline+": "+("[time: "+u.time+"] [mapping: "+u.mapping+"]"))),c=i.startOfSegment,h=n.end+u.mapping;else if(u)c=n.start+u.mapping,h=n.end+u.mapping;else return!1;return l&&(l.start=c,l.end=h),(!o.start||c<o.start)&&(o.start=c),o.end=h,!0},t.saveDiscontinuitySyncInfo_=function(i){var n=i.playlist,a=i.segment;if(a.discontinuity)this.discontinuities[a.timeline]={time:a.start,accuracy:0};else if(n.discontinuityStarts&&n.discontinuityStarts.length)for(var o=0;o<n.discontinuityStarts.length;o++){var l=n.discontinuityStarts[o],u=n.discontinuitySequence+o+1,c=l-i.mediaIndex,h=Math.abs(c);if(!this.discontinuities[u]||this.discontinuities[u].accuracy>h){var f=void 0;c<0?f=a.start-Bl({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:i.mediaIndex,endIndex:l}):f=a.end+Bl({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:i.mediaIndex+1,endIndex:l}),this.discontinuities[u]={time:f,accuracy:h}}}},t.dispose=function(){this.trigger("dispose"),this.off()},e})(ne.EventTarget),h5=(function(s){we(e,s);function e(){var r;return r=s.call(this)||this,r.pendingTimelineChanges_={},r.lastTimelineChanges_={},r}var t=e.prototype;return t.clearPendingTimelineChange=function(i){this.pendingTimelineChanges_[i]=null,this.trigger("pendingtimelinechange")},t.pendingTimelineChange=function(i){var n=i.type,a=i.from,o=i.to;return typeof a=="number"&&typeof o=="number"&&(this.pendingTimelineChanges_[n]={type:n,from:a,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[n]},t.lastTimelineChange=function(i){var n=i.type,a=i.from,o=i.to;return typeof a=="number"&&typeof o=="number"&&(this.lastTimelineChanges_[n]={type:n,from:a,to:o},delete this.pendingTimelineChanges_[n],this.trigger("timelinechange")),this.lastTimelineChanges_[n]},t.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},e})(ne.EventTarget),d5=l2(u2(function(){var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function e(V,R,O){return O={path:R,exports:{},require:function(U,E){return t(U,E??O.path)}},V(O,O.exports),O.exports}function t(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var r=e(function(V){function R(M,U){for(var E=0;E<U.length;E++){var P=U[E];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(M,P.key,P)}}function O(M,U,E){return U&&R(M.prototype,U),E&&R(M,E),M}V.exports=O,V.exports.default=V.exports,V.exports.__esModule=!0}),i=e(function(V){function R(O,M){return V.exports=R=Object.setPrototypeOf||function(E,P){return E.__proto__=P,E},V.exports.default=V.exports,V.exports.__esModule=!0,R(O,M)}V.exports=R,V.exports.default=V.exports,V.exports.__esModule=!0}),n=e(function(V){function R(O,M){O.prototype=Object.create(M.prototype),O.prototype.constructor=O,i(O,M)}V.exports=R,V.exports.default=V.exports,V.exports.__esModule=!0}),a=(function(){function V(){this.listeners={}}var R=V.prototype;return R.on=function(M,U){this.listeners[M]||(this.listeners[M]=[]),this.listeners[M].push(U)},R.off=function(M,U){if(!this.listeners[M])return!1;var E=this.listeners[M].indexOf(U);return this.listeners[M]=this.listeners[M].slice(0),this.listeners[M].splice(E,1),E>-1},R.trigger=function(M){var U=this.listeners[M];if(U)if(arguments.length===2)for(var E=U.length,P=0;P<E;++P)U[P].call(this,arguments[1]);else for(var Y=Array.prototype.slice.call(arguments,1),G=U.length,K=0;K<G;++K)U[K].apply(this,Y)},R.dispose=function(){this.listeners={}},R.pipe=function(M){this.on("data",function(U){M.push(U)})},V})();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function o(V){return V.subarray(0,V.byteLength-V[V.byteLength-1])}/*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */var l=function(){var R=[[[],[],[],[],[]],[[],[],[],[],[]]],O=R[0],M=R[1],U=O[4],E=M[4],P,Y,G,K=[],le=[],de,pe,se,ae,ce,he;for(P=0;P<256;P++)le[(K[P]=P<<1^(P>>7)*283)^P]=P;for(Y=G=0;!U[Y];Y^=de||1,G=le[G]||1)for(ae=G^G<<1^G<<2^G<<3^G<<4,ae=ae>>8^ae&255^99,U[Y]=ae,E[ae]=Y,se=K[pe=K[de=K[Y]]],he=se*16843009^pe*65537^de*257^Y*16843008,ce=K[ae]*257^ae*16843008,P=0;P<4;P++)O[P][Y]=ce=ce<<24^ce>>>8,M[P][ae]=he=he<<24^he>>>8;for(P=0;P<5;P++)O[P]=O[P].slice(0),M[P]=M[P].slice(0);return R},u=null,c=(function(){function V(O){u||(u=l()),this._tables=[[u[0][0].slice(),u[0][1].slice(),u[0][2].slice(),u[0][3].slice(),u[0][4].slice()],[u[1][0].slice(),u[1][1].slice(),u[1][2].slice(),u[1][3].slice(),u[1][4].slice()]];var M,U,E,P=this._tables[0][4],Y=this._tables[1],G=O.length,K=1;if(G!==4&&G!==6&&G!==8)throw new Error("Invalid aes key size");var le=O.slice(0),de=[];for(this._key=[le,de],M=G;M<4*G+28;M++)E=le[M-1],(M%G===0||G===8&&M%G===4)&&(E=P[E>>>24]<<24^P[E>>16&255]<<16^P[E>>8&255]<<8^P[E&255],M%G===0&&(E=E<<8^E>>>24^K<<24,K=K<<1^(K>>7)*283)),le[M]=le[M-G]^E;for(U=0;M;U++,M--)E=le[U&3?M:M-4],M<=4||U<4?de[U]=E:de[U]=Y[0][P[E>>>24]]^Y[1][P[E>>16&255]]^Y[2][P[E>>8&255]]^Y[3][P[E&255]]}var R=V.prototype;return R.decrypt=function(M,U,E,P,Y,G){var K=this._key[1],le=M^K[0],de=P^K[1],pe=E^K[2],se=U^K[3],ae,ce,he,ve=K.length/4-2,Ae,De=4,Me=this._tables[1],Ne=Me[0],Je=Me[1],Re=Me[2],Oe=Me[3],He=Me[4];for(Ae=0;Ae<ve;Ae++)ae=Ne[le>>>24]^Je[de>>16&255]^Re[pe>>8&255]^Oe[se&255]^K[De],ce=Ne[de>>>24]^Je[pe>>16&255]^Re[se>>8&255]^Oe[le&255]^K[De+1],he=Ne[pe>>>24]^Je[se>>16&255]^Re[le>>8&255]^Oe[de&255]^K[De+2],se=Ne[se>>>24]^Je[le>>16&255]^Re[de>>8&255]^Oe[pe&255]^K[De+3],De+=4,le=ae,de=ce,pe=he;for(Ae=0;Ae<4;Ae++)Y[(3&-Ae)+G]=He[le>>>24]<<24^He[de>>16&255]<<16^He[pe>>8&255]<<8^He[se&255]^K[De++],ae=le,le=de,de=pe,pe=se,se=ae},V})(),h=(function(V){n(R,V);function R(){var M;return M=V.call(this,a)||this,M.jobs=[],M.delay=1,M.timeout_=null,M}var O=R.prototype;return O.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},O.push=function(U){this.jobs.push(U),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},R})(a),f=function(R){return R<<24|(R&65280)<<8|(R&16711680)>>8|R>>>24},g=function(R,O,M){var U=new Int32Array(R.buffer,R.byteOffset,R.byteLength>>2),E=new c(Array.prototype.slice.call(O)),P=new Uint8Array(R.byteLength),Y=new Int32Array(P.buffer),G,K,le,de,pe,se,ae,ce,he;for(G=M[0],K=M[1],le=M[2],de=M[3],he=0;he<U.length;he+=4)pe=f(U[he]),se=f(U[he+1]),ae=f(U[he+2]),ce=f(U[he+3]),E.decrypt(pe,se,ae,ce,Y,he),Y[he]=f(Y[he]^G),Y[he+1]=f(Y[he+1]^K),Y[he+2]=f(Y[he+2]^le),Y[he+3]=f(Y[he+3]^de),G=pe,K=se,le=ae,de=ce;return P},C=(function(){function V(O,M,U,E){var P=V.STEP,Y=new Int32Array(O.buffer),G=new Uint8Array(O.byteLength),K=0;for(this.asyncStream_=new h,this.asyncStream_.push(this.decryptChunk_(Y.subarray(K,K+P),M,U,G)),K=P;K<Y.length;K+=P)U=new Uint32Array([f(Y[K-4]),f(Y[K-3]),f(Y[K-2]),f(Y[K-1])]),this.asyncStream_.push(this.decryptChunk_(Y.subarray(K,K+P),M,U,G));this.asyncStream_.push(function(){E(null,o(G))})}var R=V.prototype;return R.decryptChunk_=function(M,U,E,P){return function(){var Y=g(M,U,E);P.set(Y,M.byteOffset)}},r(V,null,[{key:"STEP",get:function(){return 32e3}}]),V})(),p;typeof window<"u"?p=window:typeof s<"u"?p=s:typeof self<"u"?p=self:p={};var T=p,A=function(R){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(R):R&&R.buffer instanceof ArrayBuffer},N=T.BigInt||Number;N("0x1"),N("0x100"),N("0x10000"),N("0x1000000"),N("0x100000000"),N("0x10000000000"),N("0x1000000000000"),N("0x100000000000000"),N("0x10000000000000000");var F=function(R){var O={};return Object.keys(R).forEach(function(M){var U=R[M];A(U)?O[M]={bytes:U.buffer,byteOffset:U.byteOffset,byteLength:U.byteLength}:O[M]=U}),O};self.onmessage=function(V){var R=V.data,O=new Uint8Array(R.encrypted.bytes,R.encrypted.byteOffset,R.encrypted.byteLength),M=new Uint32Array(R.key.bytes,R.key.byteOffset,R.key.byteLength/4),U=new Uint32Array(R.iv.bytes,R.iv.byteOffset,R.iv.byteLength/4);new C(O,M,U,function(E,P){self.postMessage(F({source:R.source,decrypted:P}),[P.buffer])})}})),f5=o2(d5),p5=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},gh=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Am=function(e,t){t.activePlaylistLoader=e,e.load()},m5=function(e,t){return function(){var r=t.segmentLoaders,i=r[e],n=r.main,a=t.mediaTypes[e],o=a.activeTrack(),l=a.getActiveGroup(),u=a.activePlaylistLoader,c=a.lastGroup_;if(!(l&&c&&l.id===c.id)&&(a.lastGroup_=l,a.lastTrack_=o,gh(i,a),!(!l||l.isMasterPlaylist))){if(!l.playlistLoader){u&&n.resetEverything();return}i.resyncLoader(),Am(l.playlistLoader,a)}}},g5=function(e,t){return function(){var r=t.segmentLoaders[e],i=t.mediaTypes[e];i.lastGroup_=null,r.abort(),r.pause()}},v5=function(e,t){return function(){var r=t.masterPlaylistLoader,i=t.segmentLoaders,n=i[e],a=i.main,o=t.mediaTypes[e],l=o.activeTrack(),u=o.getActiveGroup(),c=o.activePlaylistLoader,h=o.lastTrack_;if(!(h&&l&&h.id===l.id)&&(o.lastGroup_=u,o.lastTrack_=l,gh(n,o),!!u)){if(u.isMasterPlaylist){if(!l||!h||l.id===h.id)return;var f=t.vhs.masterPlaylistController_,g=f.selectPlaylist();if(f.media()===g)return;o.logger_("track change. Switching master audio from "+h.id+" to "+l.id),r.pause(),a.resetEverything(),f.fastQualityChange_(g);return}if(e==="AUDIO"){if(!u.playlistLoader){a.setAudio(!0),a.resetEverything();return}n.setAudio(!0),a.setAudio(!1)}if(c===u.playlistLoader){Am(u.playlistLoader,o);return}n.track&&n.track(l),n.resetEverything(),Am(u.playlistLoader,o)}}},vh={AUDIO:function(e,t){return function(){var r=t.segmentLoaders[e],i=t.mediaTypes[e],n=t.blacklistCurrentPlaylist;gh(r,i);var a=i.activeTrack(),o=i.activeGroup(),l=(o.filter(function(h){return h.default})[0]||o[0]).id,u=i.tracks[l];if(a===u){n({message:"Problem encountered loading the default audio track."});return}ne.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(var c in i.tracks)i.tracks[c].enabled=i.tracks[c]===u;i.onTrackChanged()}},SUBTITLES:function(e,t){return function(){var r=t.segmentLoaders[e],i=t.mediaTypes[e];ne.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),gh(r,i);var n=i.activeTrack();n&&(n.mode="disabled"),i.onTrackChanged()}}},VT={AUDIO:function(e,t,r){if(t){var i=r.tech,n=r.requestOptions,a=r.segmentLoaders[e];t.on("loadedmetadata",function(){var o=t.media();a.playlist(o,n),(!i.paused()||o.endList&&i.preload()!=="none")&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),n),i.paused()||a.load()}),t.on("error",vh[e](e,r))}},SUBTITLES:function(e,t,r){var i=r.tech,n=r.requestOptions,a=r.segmentLoaders[e],o=r.mediaTypes[e];t.on("loadedmetadata",function(){var l=t.media();a.playlist(l,n),a.track(o.activeTrack()),(!i.paused()||l.endList&&i.preload()!=="none")&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),n),i.paused()||a.load()}),t.on("error",vh[e](e,r))}},y5={AUDIO:function(e,t){var r=t.vhs,i=t.sourceType,n=t.segmentLoaders[e],a=t.requestOptions,o=t.master.mediaGroups,l=t.mediaTypes[e],u=l.groups,c=l.tracks,h=l.logger_,f=t.masterPlaylistLoader,g=fu(f.master);(!o[e]||Object.keys(o[e]).length===0)&&(o[e]={main:{default:{default:!0}}},g&&(o[e].main.default.playlists=f.master.playlists));for(var C in o[e]){u[C]||(u[C]=[]);for(var p in o[e][C]){var T=o[e][C][p],A=void 0;if(g?(h("AUDIO group '"+C+"' label '"+p+"' is a master playlist"),T.isMasterPlaylist=!0,A=null):i==="vhs-json"&&T.playlists?A=new Wa(T.playlists[0],r,a):T.resolvedUri?A=new Wa(T.resolvedUri,r,a):T.playlists&&i==="dash"?A=new Em(T.playlists[0],r,a,f):A=null,T=ne.mergeOptions({id:p,playlistLoader:A},T),VT[e](e,T.playlistLoader,t),u[C].push(T),typeof c[p]>"u"){var N=new ne.AudioTrack({id:p,kind:p5(T),enabled:!1,language:T.language,default:T.default,label:p});c[p]=N}}}n.on("error",vh[e](e,t))},SUBTITLES:function(e,t){var r=t.tech,i=t.vhs,n=t.sourceType,a=t.segmentLoaders[e],o=t.requestOptions,l=t.master.mediaGroups,u=t.mediaTypes[e],c=u.groups,h=u.tracks,f=t.masterPlaylistLoader;for(var g in l[e]){c[g]||(c[g]=[]);for(var C in l[e][g])if(!l[e][g][C].forced){var p=l[e][g][C],T=void 0;if(n==="hls")T=new Wa(p.resolvedUri,i,o);else if(n==="dash"){var A=p.playlists.filter(function(F){return F.excludeUntil!==1/0});if(!A.length)return;T=new Em(p.playlists[0],i,o,f)}else n==="vhs-json"&&(T=new Wa(p.playlists?p.playlists[0]:p.resolvedUri,i,o));if(p=ne.mergeOptions({id:C,playlistLoader:T},p),VT[e](e,p.playlistLoader,t),c[g].push(p),typeof h[C]>"u"){var N=r.addRemoteTextTrack({id:C,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:C},!1).track;h[C]=N}}}a.on("error",vh[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var r=t.tech,i=t.master.mediaGroups,n=t.mediaTypes[e],a=n.groups,o=n.tracks;for(var l in i[e]){a[l]||(a[l]=[]);for(var u in i[e][l]){var c=i[e][l][u];if(/^(?:CC|SERVICE)/.test(c.instreamId)){var h=r.options_.vhs&&r.options_.vhs.captionServices||{},f={label:u,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(h[f.instreamId]&&(f=ne.mergeOptions(f,h[f.instreamId])),f.default===void 0&&delete f.default,a[l].push(ne.mergeOptions({id:u},c)),typeof o[u]>"u"){var g=r.addRemoteTextTrack({id:f.instreamId,kind:"captions",default:f.default,language:f.language,label:f.label},!1).track;o[u]=g}}}}}},_5=function s(e,t){for(var r=0;r<e.length;r++)if(dv(t,e[r])||e[r].playlists&&s(e[r].playlists,t))return!0;return!1},T5=function(e,t){return function(r){var i=t.masterPlaylistLoader,n=t.mediaTypes[e].groups,a=i.media();if(!a)return null;var o=null;a.attributes[e]&&(o=n[a.attributes[e]]);var l=Object.keys(n);if(!o)if(e==="AUDIO"&&l.length>1&&fu(t.master))for(var u=0;u<l.length;u++){var c=n[l[u]];if(_5(c,a)){o=c;break}}else n.main?o=n.main:l.length===1&&(o=n[l[0]]);return typeof r>"u"?o:r===null||!o?null:o.filter(function(h){return h.id===r.id})[0]||null}},b5={AUDIO:function(e,t){return function(){var r=t.mediaTypes[e].tracks;for(var i in r)if(r[i].enabled)return r[i];return null}},SUBTITLES:function(e,t){return function(){var r=t.mediaTypes[e].tracks;for(var i in r)if(r[i].mode==="showing"||r[i].mode==="hidden")return r[i];return null}}},S5=function(e,t){var r=t.mediaTypes;return function(){var i=r[e].activeTrack();return i?r[e].activeGroup(i):null}},C5=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(C){y5[C](C,e)});var t=e.mediaTypes,r=e.masterPlaylistLoader,i=e.tech,n=e.vhs,a=e.segmentLoaders,o=a.AUDIO,l=a.main;["AUDIO","SUBTITLES"].forEach(function(C){t[C].activeGroup=T5(C,e),t[C].activeTrack=b5[C](C,e),t[C].onGroupChanged=m5(C,e),t[C].onGroupChanging=g5(C,e),t[C].onTrackChanged=v5(C,e),t[C].getActiveGroup=S5(C,e)});var u=t.AUDIO.activeGroup();if(u){var c=(u.filter(function(C){return C.default})[0]||u[0]).id;t.AUDIO.tracks[c].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();var h=t.AUDIO.getActiveGroup();h.playlistLoader?(l.setAudio(!1),o.setAudio(!0)):l.setAudio(!0)}r.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(C){return t[C].onGroupChanged()})}),r.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(C){return t[C].onGroupChanging()})});var f=function(){t.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"}),i.trigger({type:"usage",name:"hls-audio-change"})};i.audioTracks().addEventListener("change",f),i.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),n.on("dispose",function(){i.audioTracks().removeEventListener("change",f),i.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(var g in t.AUDIO.tracks)i.audioTracks().addTrack(t.AUDIO.tracks[g])},E5=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Cn,activeTrack:Cn,getActiveGroup:Cn,onGroupChanged:Cn,onTrackChanged:Cn,lastTrack_:null,logger_:Or("MediaGroups["+t+"]")}}),e},w5=120,yn,k5=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],x5=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},A5=function(e){var t=e.currentPlaylist,r=e.buffered,i=e.currentTime,n=e.nextPlaylist,a=e.bufferLowWaterLine,o=e.bufferHighWaterLine,l=e.duration,u=e.experimentalBufferBasedABR,c=e.log;if(!n)return ne.log.warn("We received no playlist to switch to. Please check your stream."),!1;var h="allowing switch "+(t&&t.id||"null")+" -> "+n.id;if(!t)return c(h+" as current playlist is not set"),!0;if(n.id===t.id)return!1;var f=!!za(r,i).length;if(!t.endList)return!f&&typeof t.partTargetDuration=="number"?(c("not "+h+" as current playlist is live llhls, but currentTime isn't in buffered."),!1):(c(h+" as current playlist is live"),!0);var g=uv(r,i),C=u?ri.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ri.MAX_BUFFER_LOW_WATER_LINE;if(l<C)return c(h+" as duration < max low water line ("+l+" < "+C+")"),!0;var p=n.attributes.BANDWIDTH,T=t.attributes.BANDWIDTH;if(p<T&&(!u||g<o)){var A=h+" as next bandwidth < current bandwidth ("+p+" < "+T+")";return u&&(A+=" and forwardBuffer < bufferHighWaterLine ("+g+" < "+o+")"),c(A),!0}if((!u||p>T)&&g>=a){var N=h+" as forwardBuffer >= bufferLowWaterLine ("+g+" >= "+a+")";return u&&(N+=" and next bandwidth > current bandwidth ("+p+" > "+T+")"),c(N),!0}return c("not "+h+" as no switching criteria met"),!1},I5=(function(s){we(e,s);function e(r){var i;i=s.call(this)||this;var n=r.src,a=r.handleManifestRedirects,o=r.withCredentials,l=r.tech,u=r.bandwidth,c=r.externVhs,h=r.useCueTags,f=r.blacklistDuration,g=r.enableLowInitialPlaylist,C=r.sourceType,p=r.cacheEncryptionKeys,T=r.experimentalBufferBasedABR,A=r.experimentalLeastPixelDiffSelector,N=r.captionServices;if(!n)throw new Error("A non-empty playlist URL or JSON manifest string is required");var F=r.maxPlaylistRetries;(F===null||typeof F>"u")&&(F=1/0),yn=c,i.experimentalBufferBasedABR=!!T,i.experimentalLeastPixelDiffSelector=!!A,i.withCredentials=o,i.tech_=l,i.vhs_=l.vhs,i.sourceType_=C,i.useCueTags_=h,i.blacklistDuration=f,i.maxPlaylistRetries=F,i.enableLowInitialPlaylist=g,i.useCueTags_&&(i.cueTagsTrack_=i.tech_.addTextTrack("metadata","ad-cues"),i.cueTagsTrack_.inBandMetadataTrackDispatchType=""),i.requestOptions_={withCredentials:o,handleManifestRedirects:a,maxPlaylistRetries:F,timeout:null},i.on("error",i.pauseLoading),i.mediaTypes_=E5(),i.mediaSource=new D.MediaSource,i.handleDurationChange_=i.handleDurationChange_.bind(We(i)),i.handleSourceOpen_=i.handleSourceOpen_.bind(We(i)),i.handleSourceEnded_=i.handleSourceEnded_.bind(We(i)),i.mediaSource.addEventListener("durationchange",i.handleDurationChange_),i.mediaSource.addEventListener("sourceopen",i.handleSourceOpen_),i.mediaSource.addEventListener("sourceended",i.handleSourceEnded_),i.seekable_=ne.createTimeRanges(),i.hasPlayed_=!1,i.syncController_=new c5(r),i.segmentMetadataTrack_=l.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,i.decrypter_=new f5,i.sourceUpdater_=new S2(i.mediaSource),i.inbandTextTracks_={},i.timelineChangeController_=new h5;var V={vhs:i.vhs_,parse708captions:r.parse708captions,useDtsForTimestampOffset:r.useDtsForTimestampOffset,captionServices:N,mediaSource:i.mediaSource,currentTime:i.tech_.currentTime.bind(i.tech_),seekable:function(){return i.seekable()},seeking:function(){return i.tech_.seeking()},duration:function(){return i.duration()},hasPlayed:function(){return i.hasPlayed_},goalBufferLength:function(){return i.goalBufferLength()},bandwidth:u,syncController:i.syncController_,decrypter:i.decrypter_,sourceType:i.sourceType_,inbandTextTracks:i.inbandTextTracks_,cacheEncryptionKeys:p,sourceUpdater:i.sourceUpdater_,timelineChangeController:i.timelineChangeController_,experimentalExactManifestTimings:r.experimentalExactManifestTimings};i.masterPlaylistLoader_=i.sourceType_==="dash"?new Em(n,i.vhs_,i.requestOptions_):new Wa(n,i.vhs_,i.requestOptions_),i.setupMasterPlaylistLoaderListeners_(),i.mainSegmentLoader_=new km(ne.mergeOptions(V,{segmentMetadataTrack:i.segmentMetadataTrack_,loaderType:"main"}),r),i.audioSegmentLoader_=new km(ne.mergeOptions(V,{loaderType:"audio"}),r),i.subtitleSegmentLoader_=new a5(ne.mergeOptions(V,{loaderType:"vtt",featuresNativeTextTracks:i.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(M,U){function E(){l.off("vttjserror",P),M()}function P(){l.off("vttjsloaded",E),U()}l.one("vttjsloaded",E),l.one("vttjserror",P),l.addWebVttScript_()})}}),r),i.setupSegmentLoaderListeners_(),i.experimentalBufferBasedABR&&(i.masterPlaylistLoader_.one("loadedplaylist",function(){return i.startABRTimer_()}),i.tech_.on("pause",function(){return i.stopABRTimer_()}),i.tech_.on("play",function(){return i.startABRTimer_()})),k5.forEach(function(O){i[O+"_"]=x5.bind(We(i),O)}),i.logger_=Or("MPC"),i.triggeredFmp4Usage=!1,i.tech_.preload()==="none"?(i.loadOnPlay_=function(){i.loadOnPlay_=null,i.masterPlaylistLoader_.load()},i.tech_.one("play",i.loadOnPlay_)):i.masterPlaylistLoader_.load(),i.timeToLoadedData__=-1,i.mainAppendsToLoadedData__=-1,i.audioAppendsToLoadedData__=-1;var R=i.tech_.preload()==="none"?"play":"loadstart";return i.tech_.one(R,function(){var O=Date.now();i.tech_.one("loadeddata",function(){i.timeToLoadedData__=Date.now()-O,i.mainAppendsToLoadedData__=i.mainSegmentLoader_.mediaAppends,i.audioAppendsToLoadedData__=i.audioSegmentLoader_.mediaAppends})}),i}var t=e.prototype;return t.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},t.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},t.appendsToLoadedData_=function(){var i=this.mainAppendsToLoadedData_(),n=this.audioAppendsToLoadedData_();return i===-1||n===-1?-1:i+n},t.timeToLoadedData_=function(){return this.timeToLoadedData__},t.checkABR_=function(i){i===void 0&&(i="abr");var n=this.selectPlaylist();n&&this.shouldSwitchToMedia_(n)&&this.switchMedia_(n,i)},t.switchMedia_=function(i,n,a){var o=this.media(),l=o&&(o.id||o.uri),u=i.id||i.uri;l&&l!==u&&(this.logger_("switch media "+l+" -> "+u+" from "+n),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+n})),this.masterPlaylistLoader_.media(i,a)},t.startABRTimer_=function(){var i=this;this.stopABRTimer_(),this.abrTimer_=D.setInterval(function(){return i.checkABR_()},250)},t.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(D.clearInterval(this.abrTimer_),this.abrTimer_=null)},t.getAudioTrackPlaylists_=function(){var i=this.master(),n=i&&i.playlists||[];if(!i||!i.mediaGroups||!i.mediaGroups.AUDIO)return n;var a=i.mediaGroups.AUDIO,o=Object.keys(a),l;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{var u=a.main||o.length&&a[o[0]];for(var c in u)if(u[c].default){l={label:c};break}}if(!l)return n;var h=[];for(var f in a)if(a[f][l.label]){var g=a[f][l.label];if(g.playlists&&g.playlists.length)h.push.apply(h,g.playlists);else if(g.uri)h.push(g);else if(i.playlists.length)for(var C=0;C<i.playlists.length;C++){var p=i.playlists[C];p.attributes&&p.attributes.AUDIO&&p.attributes.AUDIO===f&&h.push(p)}}return h.length?h:n},t.setupMasterPlaylistLoaderListeners_=function(){var i=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var n=i.masterPlaylistLoader_.media(),a=n.targetDuration*1.5*1e3;_m(i.masterPlaylistLoader_.master,i.masterPlaylistLoader_.media())?i.requestOptions_.timeout=0:i.requestOptions_.timeout=a,n.endList&&i.tech_.preload()!=="none"&&(i.mainSegmentLoader_.playlist(n,i.requestOptions_),i.mainSegmentLoader_.load()),C5({sourceType:i.sourceType_,segmentLoaders:{AUDIO:i.audioSegmentLoader_,SUBTITLES:i.subtitleSegmentLoader_,main:i.mainSegmentLoader_},tech:i.tech_,requestOptions:i.requestOptions_,masterPlaylistLoader:i.masterPlaylistLoader_,vhs:i.vhs_,master:i.master(),mediaTypes:i.mediaTypes_,blacklistCurrentPlaylist:i.blacklistCurrentPlaylist.bind(i)}),i.triggerPresenceUsage_(i.master(),n),i.setupFirstPlay(),!i.mediaTypes_.AUDIO.activePlaylistLoader||i.mediaTypes_.AUDIO.activePlaylistLoader.media()?i.trigger("selectedinitialmedia"):i.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){i.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){i.loadOnPlay_&&i.tech_.off("play",i.loadOnPlay_);var n=i.masterPlaylistLoader_.media();if(!n){i.excludeUnsupportedVariants_();var a;if(i.enableLowInitialPlaylist&&(a=i.selectInitialPlaylist()),a||(a=i.selectPlaylist()),!a||!i.shouldSwitchToMedia_(a))return;i.initialMedia_=a,i.switchMedia_(i.initialMedia_,"initial");var o=i.sourceType_==="vhs-json"&&i.initialMedia_.segments;if(!o)return;n=i.initialMedia_}i.handleUpdatedMediaPlaylist(n)}),this.masterPlaylistLoader_.on("error",function(){i.blacklistCurrentPlaylist(i.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){i.mainSegmentLoader_.abort(),i.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var n=i.masterPlaylistLoader_.media(),a=n.targetDuration*1.5*1e3;_m(i.masterPlaylistLoader_.master,i.masterPlaylistLoader_.media())?i.requestOptions_.timeout=0:i.requestOptions_.timeout=a,i.masterPlaylistLoader_.load(),i.mainSegmentLoader_.playlist(n,i.requestOptions_),i.mainSegmentLoader_.load(),i.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var n=i.masterPlaylistLoader_.media();if(n.lastExcludeReason_!=="playlist-unchanged"){var a=i.stuckAtPlaylistEnd_(n);a&&(i.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),i.tech_.trigger("playliststuck"))}}),this.masterPlaylistLoader_.on("renditiondisabled",function(){i.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),i.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){i.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),i.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},t.handleUpdatedMediaPlaylist=function(i){this.useCueTags_&&this.updateAdCues_(i),this.mainSegmentLoader_.playlist(i,this.requestOptions_),this.updateDuration(!i.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},t.triggerPresenceUsage_=function(i,n){var a=i.mediaGroups||{},o=!0,l=Object.keys(a.AUDIO);for(var u in a.AUDIO)for(var c in a.AUDIO[u]){var h=a.AUDIO[u][c];h.uri||(o=!1)}o&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(a.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),yn.Playlist.isAes(n)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),l.length&&Object.keys(a.AUDIO[l[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},t.shouldSwitchToMedia_=function(i){var n=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),o=this.bufferLowWaterLine(),l=this.bufferHighWaterLine(),u=this.tech_.buffered();return A5({buffered:u,currentTime:a,currentPlaylist:n,nextPlaylist:i,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},t.setupSegmentLoaderListeners_=function(){var i=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){i.checkABR_("bandwidthupdate"),i.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",function(){i.experimentalBufferBasedABR&&i.mainSegmentLoader_.load()}),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",function(){i.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){i.blacklistCurrentPlaylist(i.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){i.error=i.mainSegmentLoader_.error_,i.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){i.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){i.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),i.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){i.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){i.error=i.audioSegmentLoader_.error_,i.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){i.logger_("main segment loader ended"),i.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(a){i.experimentalBufferBasedABR||(i.delegateLoaders_("all",["abort"]),i.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},w5))});var n=function(){if(!i.sourceUpdater_.hasCreatedSourceBuffers())return i.tryToCreateSourceBuffers_();var o=i.getCodecsOrExclude_();o&&i.sourceUpdater_.addOrChangeSourceBuffers(o)};this.mainSegmentLoader_.on("trackinfo",n),this.audioSegmentLoader_.on("trackinfo",n),this.mainSegmentLoader_.on("fmp4",function(){i.triggeredFmp4Usage||(i.tech_.trigger({type:"usage",name:"vhs-fmp4"}),i.tech_.trigger({type:"usage",name:"hls-fmp4"}),i.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){i.triggeredFmp4Usage||(i.tech_.trigger({type:"usage",name:"vhs-fmp4"}),i.tech_.trigger({type:"usage",name:"hls-fmp4"}),i.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){i.logger_("audioSegmentLoader ended"),i.onEndOfStream()})},t.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},t.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},t.smoothQualityChange_=function(i){i===void 0&&(i=this.selectPlaylist()),this.fastQualityChange_(i)},t.fastQualityChange_=function(i){var n=this;if(i===void 0&&(i=this.selectPlaylist()),i===this.masterPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(i,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){ne.browser.IE_VERSION||ne.browser.IS_EDGE?n.tech_.setCurrentTime(n.tech_.currentTime()+.04):n.tech_.setCurrentTime(n.tech_.currentTime())})},t.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var i=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<i.start(0))return this.tech_.setCurrentTime(i.end(i.length-1))}},t.setupFirstPlay=function(){var i=this,n=this.masterPlaylistLoader_.media();if(!n||this.tech_.paused()||this.hasPlayed_)return!1;if(!n.endList){var a=this.seekable();if(!a.length)return!1;if(ne.browser.IE_VERSION&&this.tech_.readyState()===0)return this.tech_.one("loadedmetadata",function(){i.trigger("firstplay"),i.tech_.setCurrentTime(a.end(0)),i.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(a.end(0))}return this.hasPlayed_=!0,this.load(),!0},t.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var i=this.tech_.play();typeof i<"u"&&typeof i.then=="function"&&i.then(null,function(n){})}this.trigger("sourceopen")},t.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var i=this.inbandTextTracks_.metadataTrack_.cues;if(!(!i||!i.length)){var n=this.duration();i[i.length-1].endTime=isNaN(n)||Math.abs(n)===1/0?Number.MAX_VALUE:n}}},t.handleDurationChange_=function(){this.tech_.trigger("durationchange")},t.onEndOfStream=function(){var i=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var n=this.mainSegmentLoader_.getCurrentMediaInfo_();!n||n.hasVideo?i=i&&this.audioSegmentLoader_.ended_:i=this.audioSegmentLoader_.ended_}i&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},t.stuckAtPlaylistEnd_=function(i){var n=this.seekable();if(!n.length)return!1;var a=this.syncController_.getExpiredTime(i,this.duration());if(a===null)return!1;var o=yn.Playlist.playlistEnd(i,a),l=this.tech_.currentTime(),u=this.tech_.buffered();if(!u.length)return o-l<=Jr;var c=u.end(u.length-1);return c-l<=Jr&&o-c<=Jr},t.blacklistCurrentPlaylist=function(i,n){i===void 0&&(i={});var a=i.playlist||this.masterPlaylistLoader_.media();if(n=n||i.blacklistDuration||this.blacklistDuration,!a){this.error=i,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}a.playlistErrors_++;var o=this.masterPlaylistLoader_.master.playlists,l=o.filter(od),u=l.length===1&&l[0]===a;if(o.length===1&&n!==1/0)return ne.log.warn("Problem encountered with playlist "+a.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(u);if(u){var c=!1;o.forEach(function(A){if(A!==a){var N=A.excludeUntil;typeof N<"u"&&N!==1/0&&(c=!0,delete A.excludeUntil)}}),c&&(ne.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}var h;a.playlistErrors_>this.maxPlaylistRetries?h=1/0:h=Date.now()+n*1e3,a.excludeUntil=h,i.reason&&(a.lastExcludeReason_=i.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var f=this.selectPlaylist();if(!f){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}var g=i.internal?this.logger_:ne.log.warn,C=i.message?" "+i.message:"";g((i.internal?"Internal problem":"Problem")+" encountered with playlist "+a.id+"."+(C+" Switching to playlist "+f.id+".")),f.attributes.AUDIO!==a.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),f.attributes.SUBTITLES!==a.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var p=f.targetDuration/2*1e3||5*1e3,T=typeof f.lastRequest=="number"&&Date.now()-f.lastRequest<=p;return this.switchMedia_(f,"exclude",u||T)},t.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},t.delegateLoaders_=function(i,n){var a=this,o=[],l=i==="all";(l||i==="main")&&o.push(this.masterPlaylistLoader_);var u=[];(l||i==="audio")&&u.push("AUDIO"),(l||i==="subtitle")&&(u.push("CLOSED-CAPTIONS"),u.push("SUBTITLES")),u.forEach(function(c){var h=a.mediaTypes_[c]&&a.mediaTypes_[c].activePlaylistLoader;h&&o.push(h)}),["main","audio","subtitle"].forEach(function(c){var h=a[c+"SegmentLoader_"];h&&(i===c||i==="all")&&o.push(h)}),o.forEach(function(c){return n.forEach(function(h){typeof c[h]=="function"&&c[h]()})})},t.setCurrentTime=function(i){var n=za(this.tech_.buffered(),i);if(!(this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media())||!this.masterPlaylistLoader_.media().segments)return 0;if(n&&n.length)return i;this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),this.load()},t.duration=function(){if(!this.masterPlaylistLoader_)return 0;var i=this.masterPlaylistLoader_.media();return i?i.endList?this.mediaSource?this.mediaSource.duration:yn.Playlist.duration(i):1/0:0},t.seekable=function(){return this.seekable_},t.onSyncInfoUpdate_=function(){var i;if(this.masterPlaylistLoader_){var n=this.masterPlaylistLoader_.media();if(n){var a=this.syncController_.getExpiredTime(n,this.duration());if(a!==null){var o=this.masterPlaylistLoader_.master,l=yn.Playlist.seekable(n,a,yn.Playlist.liveEdgeDelay(o,n));if(l.length!==0&&!(this.mediaTypes_.AUDIO.activePlaylistLoader&&(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),a=this.syncController_.getExpiredTime(n,this.duration()),a===null||(i=yn.Playlist.seekable(n,a,yn.Playlist.liveEdgeDelay(o,n)),i.length===0)))){var u,c;this.seekable_&&this.seekable_.length&&(u=this.seekable_.end(0),c=this.seekable_.start(0)),i?i.start(0)>l.end(0)||l.start(0)>i.end(0)?this.seekable_=l:this.seekable_=ne.createTimeRanges([[i.start(0)>l.start(0)?i.start(0):l.start(0),i.end(0)<l.end(0)?i.end(0):l.end(0)]]):this.seekable_=l,!(this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===u&&this.seekable_.start(0)===c)&&(this.logger_("seekable updated ["+UE(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},t.updateDuration=function(i){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,i),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(i){var n=this.seekable();if(!n.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<n.end(n.length-1))&&this.sourceUpdater_.setDuration(n.end(n.length-1));return}var a=this.tech_.buffered(),o=yn.Playlist.duration(this.masterPlaylistLoader_.media());a.length>0&&(o=Math.max(o,a.end(a.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)},t.dispose=function(){var i=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(n){var a=i.mediaTypes_[n].groups;for(var o in a)a[o].forEach(function(l){l.playlistLoader&&l.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},t.master=function(){return this.masterPlaylistLoader_.master},t.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},t.areMediaTypesKnown_=function(){var i=!!this.mediaTypes_.AUDIO.activePlaylistLoader,n=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=i?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!n||!a)},t.getCodecsOrExclude_=function(){var i=this,n={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},a=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();n.video=n.main;var o=Fl(this.master(),a),l={},u=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(n.main.hasVideo&&(l.video=o.video||n.main.videoCodec||wM),n.main.isMuxed&&(l.video+=","+(o.audio||n.main.audioCodec||B_)),(n.main.hasAudio&&!n.main.isMuxed||n.audio.hasAudio||u)&&(l.audio=o.audio||n.main.audioCodec||n.audio.audioCodec||B_,n.audio.isFmp4=n.main.hasAudio&&!n.main.isMuxed?n.main.isFmp4:n.audio.isFmp4),!l.audio&&!l.video){this.blacklistCurrentPlaylist({playlist:a,message:"Could not determine codecs for playlist.",blacklistDuration:1/0});return}var c=function(A,N){return A?Cc(N):Ff(N)},h={},f;if(["video","audio"].forEach(function(T){if(l.hasOwnProperty(T)&&!c(n[T].isFmp4,l[T])){var A=n[T].isFmp4?"browser":"muxer";h[A]=h[A]||[],h[A].push(l[T]),T==="audio"&&(f=A)}}),u&&f&&a.attributes.AUDIO){var g=a.attributes.AUDIO;this.master().playlists.forEach(function(T){var A=T.attributes&&T.attributes.AUDIO;A===g&&T!==a&&(T.excludeUntil=1/0)}),this.logger_("excluding audio group "+g+" as "+f+' does not support codec(s): "'+l.audio+'"')}if(Object.keys(h).length){var C=Object.keys(h).reduce(function(T,A){return T&&(T+=", "),T+=A+' does not support codec(s): "'+h[A].join(",")+'"',T},"")+".";this.blacklistCurrentPlaylist({playlist:a,internal:!0,message:C,blacklistDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var p=[];if(["video","audio"].forEach(function(T){var A=(qr(i.sourceUpdater_.codecs[T]||"")[0]||{}).type,N=(qr(l[T]||"")[0]||{}).type;A&&N&&A.toLowerCase()!==N.toLowerCase()&&p.push('"'+i.sourceUpdater_.codecs[T]+'" -> "'+l[T]+'"')}),p.length){this.blacklistCurrentPlaylist({playlist:a,message:"Codec switching not supported: "+p.join(", ")+".",blacklistDuration:1/0,internal:!0});return}}return l},t.tryToCreateSourceBuffers_=function(){if(!(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers())&&this.areMediaTypesKnown_()){var i=this.getCodecsOrExclude_();if(i){this.sourceUpdater_.createSourceBuffers(i);var n=[i.video,i.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(n)}}},t.excludeUnsupportedVariants_=function(){var i=this,n=this.master().playlists,a=[];Object.keys(n).forEach(function(o){var l=n[o];if(a.indexOf(l.id)===-1){a.push(l.id);var u=Fl(i.master,l),c=[];u.audio&&!Ff(u.audio)&&!Cc(u.audio)&&c.push("audio codec "+u.audio),u.video&&!Ff(u.video)&&!Cc(u.video)&&c.push("video codec "+u.video),u.text&&u.text==="stpp.ttml.im1t"&&c.push("text codec "+u.text),c.length&&(l.excludeUntil=1/0,i.logger_("excluding "+l.id+" for unsupported: "+c.join(", ")))}})},t.excludeIncompatibleVariants_=function(i){var n=this,a=[],o=this.master().playlists,l=ph(qr(i)),u=DT(l),c=l.video&&qr(l.video)[0]||null,h=l.audio&&qr(l.audio)[0]||null;Object.keys(o).forEach(function(f){var g=o[f];if(!(a.indexOf(g.id)!==-1||g.excludeUntil===1/0)){a.push(g.id);var C=[],p=Fl(n.masterPlaylistLoader_.master,g),T=DT(p);if(!(!p.audio&&!p.video)){if(T!==u&&C.push('codec count "'+T+'" !== "'+u+'"'),!n.sourceUpdater_.canChangeType()){var A=p.video&&qr(p.video)[0]||null,N=p.audio&&qr(p.audio)[0]||null;A&&c&&A.type.toLowerCase()!==c.type.toLowerCase()&&C.push('video codec "'+A.type+'" !== "'+c.type+'"'),N&&h&&N.type.toLowerCase()!==h.type.toLowerCase()&&C.push('audio codec "'+N.type+'" !== "'+h.type+'"')}C.length&&(g.excludeUntil=1/0,n.logger_("blacklisting "+g.id+": "+C.join(" && ")))}}})},t.updateAdCues_=function(i){var n=0,a=this.seekable();a.length&&(n=a.start(0)),l5(i,this.cueTagsTrack_,n)},t.goalBufferLength=function(){var i=this.tech_.currentTime(),n=ri.GOAL_BUFFER_LENGTH,a=ri.GOAL_BUFFER_LENGTH_RATE,o=Math.max(n,ri.MAX_GOAL_BUFFER_LENGTH);return Math.min(n+i*a,o)},t.bufferLowWaterLine=function(){var i=this.tech_.currentTime(),n=ri.BUFFER_LOW_WATER_LINE,a=ri.BUFFER_LOW_WATER_LINE_RATE,o=Math.max(n,ri.MAX_BUFFER_LOW_WATER_LINE),l=Math.max(n,ri.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(n+i*a,this.experimentalBufferBasedABR?l:o)},t.bufferHighWaterLine=function(){return ri.BUFFER_HIGH_WATER_LINE},e})(ne.EventTarget),P5=function(e,t,r){return function(i){var n=e.master.playlists[t],a=hv(n),o=od(n);return typeof i>"u"?o:(i?delete n.disabled:n.disabled=!0,i!==o&&!a&&(r(),i?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),i)}},D5=function(e,t,r){var i=e.masterPlaylistController_,n=e.options_.smoothQualityChange,a=n?"smooth":"fast",o=i[a+"QualityChange_"].bind(i);if(t.attributes){var l=t.attributes.RESOLUTION;this.width=l&&l.width,this.height=l&&l.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Fl(i.master(),t),this.playlist=t,this.id=r,this.enabled=P5(e.playlists,t.id,o)},N5=function(e){e.representations=function(){var t=e.masterPlaylistController_.master(),r=fu(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return r?r.filter(function(i){return!hv(i)}).map(function(i,n){return new D5(e,i,i.id)}):[]}},HT=["seeking","seeked","pause","playing","error"],L5=(function(){function s(t){var r=this;this.masterPlaylistController_=t.masterPlaylistController,this.tech_=t.tech,this.seekable=t.seekable,this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta,this.media=t.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=Or("PlaybackWatcher"),this.logger_("initialize");var i=function(){return r.monitorCurrentTime_()},n=function(){return r.monitorCurrentTime_()},a=function(){return r.techWaiting_()},o=function(){return r.cancelTimer_()},l=this.masterPlaylistController_,u=["main","subtitle","audio"],c={};u.forEach(function(f){c[f]={reset:function(){return r.resetSegmentDownloads_(f)},updateend:function(){return r.checkSegmentDownloads_(f)}},l[f+"SegmentLoader_"].on("appendsdone",c[f].updateend),l[f+"SegmentLoader_"].on("playlistupdate",c[f].reset),r.tech_.on(["seeked","seeking"],c[f].reset)});var h=function(g){["main","audio"].forEach(function(C){l[C+"SegmentLoader_"][g]("appended",r.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){r.fixesBadSeeks_()&&(r.consecutiveUpdates=0,r.lastRecordedTime=r.tech_.currentTime(),h("off"))},this.clearSeekingAppendCheck_=function(){return h("off")},this.watchForBadSeeking_=function(){r.clearSeekingAppendCheck_(),h("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",a),this.tech_.on(HT,o),this.tech_.on("canplay",n),this.tech_.one("play",i),this.dispose=function(){r.clearSeekingAppendCheck_(),r.logger_("dispose"),r.tech_.off("waiting",a),r.tech_.off(HT,o),r.tech_.off("canplay",n),r.tech_.off("play",i),r.tech_.off("seeking",r.watchForBadSeeking_),r.tech_.off("seeked",r.clearSeekingAppendCheck_),u.forEach(function(f){l[f+"SegmentLoader_"].off("appendsdone",c[f].updateend),l[f+"SegmentLoader_"].off("playlistupdate",c[f].reset),r.tech_.off(["seeked","seeking"],c[f].reset)}),r.checkCurrentTimeTimeout_&&D.clearTimeout(r.checkCurrentTimeTimeout_),r.cancelTimer_()}}var e=s.prototype;return e.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&D.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=D.setTimeout(this.monitorCurrentTime_.bind(this),250)},e.resetSegmentDownloads_=function(r){var i=this.masterPlaylistController_[r+"SegmentLoader_"];this[r+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+r+" loader"),this[r+"StalledDownloads_"]=0,this[r+"Buffered_"]=i.buffered_()},e.checkSegmentDownloads_=function(r){var i=this.masterPlaylistController_,n=i[r+"SegmentLoader_"],a=n.buffered_(),o=E3(this[r+"Buffered_"],a);if(this[r+"Buffered_"]=a,o){this.resetSegmentDownloads_(r);return}this[r+"StalledDownloads_"]++,this.logger_("found #"+this[r+"StalledDownloads_"]+" "+r+" appends that did not increase buffer (possible stalled download)",{playlistId:n.playlist_&&n.playlist_.id,buffered:$s(a)}),!(this[r+"StalledDownloads_"]<10)&&(this.logger_(r+" loader stalled download exclusion"),this.resetSegmentDownloads_(r),this.tech_.trigger({type:"usage",name:"vhs-"+r+"-download-exclusion"}),r!=="subtitle"&&i.blacklistCurrentPlaylist({message:"Excessive "+r+" segment downloading detected."},1/0))},e.checkCurrentTime_=function(){if(!(this.tech_.paused()||this.tech_.seeking())){var r=this.tech_.currentTime(),i=this.tech_.buffered();if(this.lastRecordedTime===r&&(!i.length||r+Jr>=i.end(i.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&r===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):r===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=r)}},e.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},e.fixesBadSeeks_=function(){var r=this.tech_.seeking();if(!r)return!1;var i=this.seekable(),n=this.tech_.currentTime(),a=this.afterSeekableWindow_(i,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow),o;if(a){var l=i.end(i.length-1);o=l}if(this.beforeSeekableWindow_(i,n)){var u=i.start(0);o=u+(u===i.end(0)?0:Jr)}if(typeof o<"u")return this.logger_("Trying to seek outside of seekable at time "+n+" with "+("seekable range "+UE(i)+". Seeking to ")+(o+".")),this.tech_.setCurrentTime(o),!0;for(var c=this.masterPlaylistController_.sourceUpdater_,h=this.tech_.buffered(),f=c.audioBuffer?c.audioBuffered():null,g=c.videoBuffer?c.videoBuffered():null,C=this.media(),p=C.partTargetDuration?C.partTargetDuration:(C.targetDuration-ls)*2,T=[f,g],A=0;A<T.length;A++)if(T[A]){var N=uv(T[A],n);if(N<p)return!1}var F=dc(h,n);return F.length===0?!1:(o=F.start(0)+Jr,this.logger_("Buffered region starts ("+F.start(0)+") "+(" just beyond seek point ("+n+"). Seeking to "+o+".")),this.tech_.setCurrentTime(o),!0)},e.waiting_=function(){if(!this.techWaiting_()){var r=this.tech_.currentTime(),i=this.tech_.buffered(),n=za(i,r);if(n.length&&r+3<=n.end(0)){this.cancelTimer_(),this.tech_.setCurrentTime(r),this.logger_("Stopped at "+r+" while inside a buffered region "+("["+n.start(0)+" -> "+n.end(0)+"]. Attempting to resume ")+"playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"});return}}},e.techWaiting_=function(){var r=this.seekable(),i=this.tech_.currentTime();if(this.tech_.seeking()||this.timer_!==null)return!0;if(this.beforeSeekableWindow_(r,i)){var n=r.end(r.length-1);return this.logger_("Fell out of live window at time "+i+". Seeking to "+("live point (seekable end) "+n)),this.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var a=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),l=this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:i});if(l)return this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var u=dc(o,i);if(u.length>0){var c=u.start(0)-i;return this.logger_("Stopped at "+i+", setting timer for "+c+", seeking "+("to "+u.start(0))),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),c*1e3,i),!0}return!1},e.afterSeekableWindow_=function(r,i,n,a){if(a===void 0&&(a=!1),!r.length)return!1;var o=r.end(r.length-1)+Jr,l=!n.endList;return l&&a&&(o=r.end(r.length-1)+n.targetDuration*3),i>o},e.beforeSeekableWindow_=function(r,i){return!!(r.length&&r.start(0)>0&&i<r.start(0)-this.liveRangeSafeTimeDelta)},e.videoUnderflow_=function(r){var i=r.videoBuffered,n=r.audioBuffered,a=r.currentTime;if(i){var o;if(i.length&&n.length){var l=za(i,a-3),u=za(i,a),c=za(n,a);c.length&&!u.length&&l.length&&(o={start:l.end(0),end:c.end(0)})}else{var h=dc(i,a);h.length||(o=this.gapFromVideoUnderflow_(i,a))}return o?(this.logger_("Encountered a gap in video from "+o.start+" to "+o.end+". "+("Seeking to current time "+a)),!0):!1}},e.skipTheGap_=function(r){var i=this.tech_.buffered(),n=this.tech_.currentTime(),a=dc(i,n);this.cancelTimer_(),!(a.length===0||n!==r)&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",r,"nextRange start:",a.start(0)),this.tech_.setCurrentTime(a.start(0)+ls),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},e.gapFromVideoUnderflow_=function(r,i){for(var n=b3(r),a=0;a<n.length;a++){var o=n.start(a),l=n.end(a);if(i-o<4&&i-o>2)return{start:o,end:l}}return null},s})(),O5={errorInterval:30,getSource:function(e){var t=this.tech({IWillNotUseThisInPlugins:!0}),r=t.currentSource_||this.currentSource();return e(r)}},M5=function s(e,t){var r=0,i=0,n=ne.mergeOptions(O5,t);e.ready(function(){e.trigger({type:"usage",name:"vhs-error-reload-initialized"}),e.trigger({type:"usage",name:"hls-error-reload-initialized"})});var a=function(){i&&e.currentTime(i)},o=function(f){f!=null&&(i=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",a),e.src(f),e.trigger({type:"usage",name:"vhs-error-reload"}),e.trigger({type:"usage",name:"hls-error-reload"}),e.play())},l=function(){if(Date.now()-r<n.errorInterval*1e3){e.trigger({type:"usage",name:"vhs-error-reload-canceled"}),e.trigger({type:"usage",name:"hls-error-reload-canceled"});return}if(!n.getSource||typeof n.getSource!="function"){ne.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return r=Date.now(),n.getSource.call(e,o)},u=function h(){e.off("loadedmetadata",a),e.off("error",l),e.off("dispose",h)},c=function(f){u(),s(e,f)};e.on("error",l),e.on("dispose",u),e.reloadSourceOnError=c},R5=function(e){M5(this,e)},C2="2.16.3",B5="6.0.1",F5="0.22.1",U5="4.8.0",$5="3.1.3",hi={PlaylistLoader:Wa,Playlist:Hi,utils:X3,STANDARD_PLAYLIST_SELECTOR:LT,INITIAL_PLAYLIST_SELECTOR:FB,lastBandwidthSelector:LT,movingAverageBandwidthSelector:RB,comparePlaylistBandwidth:mv,comparePlaylistResolution:MB,xhr:e2()};Object.keys(ri).forEach(function(s){Object.defineProperty(hi,s,{get:function(){return ne.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),ri[s]},set:function(t){if(ne.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),typeof t!="number"||t<0){ne.log.warn("value of Vhs."+s+" must be greater than or equal to 0");return}ri[s]=t}})});var E2="videojs-vhs",w2=function(e,t){for(var r=t.media(),i=-1,n=0;n<e.length;n++)if(e[n].id===r.id){i=n;break}e.selectedIndex_=i,e.trigger({selectedIndex:i,type:"change"})},j5=function(e,t){t.representations().forEach(function(r){e.addQualityLevel(r)}),w2(e,t.playlists)};hi.canPlaySource=function(){return ne.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var V5=function(e,t,r){if(!e)return e;var i={};t&&t.attributes&&t.attributes.CODECS&&(i=ph(qr(t.attributes.CODECS))),r&&r.attributes&&r.attributes.CODECS&&(i.audio=r.attributes.CODECS);var n=zl(i.video),a=zl(i.audio),o={};for(var l in e)o[l]={},a&&(o[l].audioContentType=a),n&&(o[l].videoContentType=n),t.contentProtection&&t.contentProtection[l]&&t.contentProtection[l].pssh&&(o[l].pssh=t.contentProtection[l].pssh),typeof e[l]=="string"&&(o[l].url=e[l]);return ne.mergeOptions(e,o)},H5=function(e,t){return e.reduce(function(r,i){if(!i.contentProtection)return r;var n=t.reduce(function(a,o){var l=i.contentProtection[o];return l&&l.pssh&&(a[o]={pssh:l.pssh}),a},{});return Object.keys(n).length&&r.push(n),r},[])},q5=function(e){var t=e.player,r=e.sourceKeySystems,i=e.audioMedia,n=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var a=i?n.concat([i]):n,o=H5(a,Object.keys(r)),l=[],u=[];return o.forEach(function(c){u.push(new Promise(function(h,f){t.tech_.one("keysessioncreated",h)})),l.push(new Promise(function(h,f){t.eme.initializeMediaKeys({keySystems:c},function(g){if(g){f(g);return}h()})}))}),Promise.race([Promise.all(l),Promise.race(u)])},z5=function(e){var t=e.player,r=e.sourceKeySystems,i=e.media,n=e.audioMedia,a=V5(r,i,n);return a?(t.currentSource().keySystems=a,a&&!t.eme?(ne.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},k2=function(){if(!D.localStorage)return null;var e=D.localStorage.getItem(E2);if(!e)return null;try{return JSON.parse(e)}catch{return null}},W5=function(e){if(!D.localStorage)return!1;var t=k2();t=t?ne.mergeOptions(t,e):e;try{D.localStorage.setItem(E2,JSON.stringify(t))}catch{return!1}return t},G5=function(e){return e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(e.substring(e.indexOf(",")+1)):e};hi.supportsNativeHls=(function(){if(!ue||!ue.createElement)return!1;var s=ue.createElement("video");if(!ne.getTech("Html5").isSupported())return!1;var e=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return e.some(function(t){return/maybe|probably/i.test(s.canPlayType(t))})})();hi.supportsNativeDash=(function(){return!ue||!ue.createElement||!ne.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(ue.createElement("video").canPlayType("application/dash+xml"))})();hi.supportsTypeNatively=function(s){return s==="hls"?hi.supportsNativeHls:s==="dash"?hi.supportsNativeDash:!1};hi.isSupported=function(){return ne.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var K5=ne.getComponent("Component"),vv=(function(s){we(e,s);function e(r,i,n){var a;if(a=s.call(this,i,ne.mergeOptions(n.hls,n.vhs))||this,n.hls&&Object.keys(n.hls).length&&ne.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),typeof n.initialBandwidth=="number"&&(a.options_.bandwidth=n.initialBandwidth),a.logger_=Or("VhsHandler"),i.options_&&i.options_.playerId){var o=ne(i.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return ne.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),i.trigger({type:"usage",name:"hls-player-access"}),We(a)},configurable:!0}),o.hasOwnProperty("vhs")||Object.defineProperty(o,"vhs",{get:function(){return ne.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),i.trigger({type:"usage",name:"vhs-player-access"}),We(a)},configurable:!0}),o.hasOwnProperty("dash")||Object.defineProperty(o,"dash",{get:function(){return ne.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),We(a)},configurable:!0}),a.player_=o}if(a.tech_=i,a.source_=r,a.stats={},a.ignoreNextSeekingEvent_=!1,a.setOptions_(),a.options_.overrideNative&&i.overrideNativeAudioTracks&&i.overrideNativeVideoTracks)i.overrideNativeAudioTracks(!0),i.overrideNativeVideoTracks(!0);else if(a.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return a.on(ue,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(l){var u=ue.fullscreenElement||ue.webkitFullscreenElement||ue.mozFullScreenElement||ue.msFullscreenElement;u&&u.contains(a.tech_.el())?a.masterPlaylistController_.fastQualityChange_():a.masterPlaylistController_.checkABR_()}),a.on(a.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),a.on(a.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),a.on(a.tech_,"play",a.play),a}var t=e.prototype;return t.setOptions_=function(){var i=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects!==!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,typeof this.options_.blacklistDuration!="number"&&(this.options_.blacklistDuration=300),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){var n=k2();n&&n.bandwidth&&(this.options_.bandwidth=n.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),n&&n.throughput&&(this.options_.throughput=n.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=ri.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===ri.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach(function(a){typeof i.source_[a]<"u"&&(i.options_[a]=i.source_[a])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},t.src=function(i,n){var a=this;if(i){this.setOptions_(),this.options_.src=G5(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=hi,this.options_.sourceType=y1(n),this.options_.seekTo=function(u){a.tech_.setCurrentTime(u)},this.options_.smoothQualityChange&&ne.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new I5(this.options_);var o=ne.mergeOptions({liveRangeSafeTimeDelta:Jr},this.options_,{seekable:function(){return a.seekable()},media:function(){return a.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new L5(o),this.masterPlaylistController_.on("error",function(){var u=ne.players[a.tech_.options_.playerId],c=a.masterPlaylistController_.error;typeof c=="object"&&!c.code?c.code=3:typeof c=="string"&&(c={message:c,code:3}),u.error(c)});var l=this.options_.experimentalBufferBasedABR?hi.movingAverageBandwidthSelector(.55):hi.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):l.bind(this),this.masterPlaylistController_.selectInitialPlaylist=hi.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(c){this.masterPlaylistController_.selectPlaylist=c.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=c,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var c=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,h=D.navigator.connection||D.navigator.mozConnection||D.navigator.webkitConnection,f=1e7;if(this.options_.useNetworkInformationApi&&h){var g=h.downlink*1e3*1e3;g>=f&&c>=f?c=Math.max(c,g):c=g}return c},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=c,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var c=1/(this.bandwidth||1),h;this.throughput>0?h=1/this.throughput:h=0;var f=Math.floor(1/(c+h));return f},set:function(){ne.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return a.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return a.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return a.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return a.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return a.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return a.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return a.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return a.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return a.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return a.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return a.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return $s(a.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return a.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return a.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return a.tech_.name_},enumerable:!0},duration:{get:function(){return a.tech_.duration()},enumerable:!0},master:{get:function(){return a.playlists.master},enumerable:!0},playerDimensions:{get:function(){return a.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return $s(a.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return a.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){a.options_.useBandwidthFromLocalStorage&&W5({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){N5(a)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){a.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=D.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},t.createKeySessions_=function(){var i=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),q5({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:n&&n.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){i.logger_("created EME key session"),i.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(a){i.logger_("error while creating EME key session",a),i.player_.error({message:"Failed to initialize media keys for EME",code:3})})},t.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},t.setupEme_=function(){var i=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=z5({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:n&&n.media()});if(this.player_.tech_.on("keystatuschange",function(o){if(o.status==="output-restricted"){var l=i.masterPlaylistController_.master();if(!(!l||!l.playlists)){var u=[];if(l.playlists.forEach(function(h){h&&h.attributes&&h.attributes.RESOLUTION&&h.attributes.RESOLUTION.height>=720&&(!h.excludeUntil||h.excludeUntil<1/0)&&(h.excludeUntil=1/0,u.push(h))}),u.length){var c;(c=ne.log).warn.apply(c,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(u)),i.masterPlaylistController_.fastQualityChange_()}}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),ne.browser.IE_VERSION===11||!a){this.masterPlaylistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()},t.setupQualityLevels_=function(){var i=this,n=ne.players[this.tech_.options_.playerId];!n||!n.qualityLevels||this.qualityLevels_||(this.qualityLevels_=n.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){j5(i.qualityLevels_,i)}),this.playlists.on("mediachange",function(){w2(i.qualityLevels_,i.playlists)}))},e.version=function(){return{"@videojs/http-streaming":C2,"mux.js":B5,"mpd-parser":F5,"m3u8-parser":U5,"aes-decrypter":$5}},t.version=function(){return this.constructor.version()},t.canChangeType=function(){return S2.canChangeType()},t.play=function(){this.masterPlaylistController_.play()},t.setCurrentTime=function(i){this.masterPlaylistController_.setCurrentTime(i)},t.duration=function(){return this.masterPlaylistController_.duration()},t.seekable=function(){return this.masterPlaylistController_.seekable()},t.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&D.URL.revokeObjectURL&&(D.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),s.prototype.dispose.call(this)},t.convertToProgramTime=function(i,n){return iB({playlist:this.masterPlaylistController_.media(),time:i,callback:n})},t.seekToProgramTime=function(i,n,a,o){return a===void 0&&(a=!0),o===void 0&&(o=2),rB({programTime:i,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:n})},e})(K5),Ql={name:"videojs-http-streaming",VERSION:C2,canHandleSource:function(e,t){t===void 0&&(t={});var r=ne.mergeOptions(ne.options,t);return Ql.canPlayType(e.type,r)},handleSource:function(e,t,r){r===void 0&&(r={});var i=ne.mergeOptions(ne.options,r);return t.vhs=new vv(e,t,i),ne.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return ne.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=e2(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){var r=y1(e);if(!r)return"";var i=Ql.getOverrideNative(t),n=hi.supportsTypeNatively(r),a=!n||i;return a?"maybe":""},getOverrideNative:function(e){e===void 0&&(e={});var t=e,r=t.vhs,i=r===void 0?{}:r,n=t.hls,a=n===void 0?{}:n,o=!(ne.browser.IS_ANY_SAFARI||ne.browser.IS_IOS),l=i.overrideNative,u=l===void 0?o:l,c=a.overrideNative,h=c===void 0?!1:c;return h||u}},X5=function(){return Cc("avc1.4d400d,mp4a.40.2")};X5()&&ne.getTech("Html5").registerSourceHandler(Ql,0);ne.VhsHandler=vv;Object.defineProperty(ne,"HlsHandler",{get:function(){return ne.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),vv},configurable:!0});ne.VhsSourceHandler=Ql;Object.defineProperty(ne,"HlsSourceHandler",{get:function(){return ne.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Ql},configurable:!0});ne.Vhs=hi;Object.defineProperty(ne,"Hls",{get:function(){return ne.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),hi},configurable:!0});ne.use||(ne.registerComponent("Hls",hi),ne.registerComponent("Vhs",hi));ne.options.vhs=ne.options.vhs||{};ne.options.hls=ne.options.hls||{};if(!ne.getPlugin||!ne.getPlugin("reloadSourceOnError")){var Y5=ne.registerPlugin||ne.plugin;Y5("reloadSourceOnError",R5)}/*! @name videojs-contrib-quality-levels @version 2.0.9 @license Apache-2.0 */function Q5(s,e){s.prototype=Object.create(e.prototype),s.prototype.constructor=s,s.__proto__=e}function sp(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}var J5=(function s(e){var t=this;if(ne.browser.IS_IE8){t=ue.createElement("custom");for(var r in s.prototype)r!=="constructor"&&(t[r]=s.prototype[r])}return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:function(){return t.enabled_()},set:function(n){t.enabled_(n)}}),t}),yh=(function(s){Q5(e,s);function e(){var r;r=s.call(this)||this;var i=sp(sp(r));if(ne.browser.IS_IE8){i=ue.createElement("custom");for(var n in e.prototype)n!=="constructor"&&(i[n]=e.prototype[n])}return i.levels_=[],i.selectedIndex_=-1,Object.defineProperty(i,"selectedIndex",{get:function(){return i.selectedIndex_}}),Object.defineProperty(i,"length",{get:function(){return i.levels_.length}}),i||sp(r)}var t=e.prototype;return t.addQualityLevel=function(i){var n=this.getQualityLevelById(i.id);if(n)return n;var a=this.levels_.length;return n=new J5(i),""+a in this||Object.defineProperty(this,a,{get:function(){return this.levels_[a]}}),this.levels_.push(n),this.trigger({qualityLevel:n,type:"addqualitylevel"}),n},t.removeQualityLevel=function(i){for(var n=null,a=0,o=this.length;a<o;a++)if(this[a]===i){n=this.levels_.splice(a,1)[0],this.selectedIndex_===a?this.selectedIndex_=-1:this.selectedIndex_>a&&this.selectedIndex_--;break}return n&&this.trigger({qualityLevel:i,type:"removequalitylevel"}),n},t.getQualityLevelById=function(i){for(var n=0,a=this.length;n<a;n++){var o=this[n];if(o.id===i)return o}return null},t.dispose=function(){this.selectedIndex_=-1,this.levels_.length=0},e})(ne.EventTarget);yh.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(var Z5 in yh.prototype.allowedEvents_)yh.prototype["on"+Z5]=null;var x2="2.0.9",e8=ne.registerPlugin||ne.plugin,t8=function(e,t){var r=e.qualityLevels,i=new yh,n=function a(){i.dispose(),e.qualityLevels=r,e.off("dispose",a)};return e.on("dispose",n),e.qualityLevels=function(){return i},e.qualityLevels.VERSION=x2,i},A2=function(e){return t8(this,ne.mergeOptions({},e))};e8("qualityLevels",A2);A2.VERSION=x2;const i8={SMALL:450},r8=B.getPlugin("plugin");class n8 extends r8{constructor(e,t){super(e),this.options=t,this.configureMenuDimensions=this.configureMenuDimensions.bind(this),this.initialize()}initialize(){this.player.ready(this.configureMenuDimensions),this.player.one("play",this.configureMenuDimensions),this.player.on("resize",this.configureMenuDimensions),this.player.on("fullscreenchange",this.configureMenuDimensions),this.player.on("resizemenus",this.configureMenuDimensions),this.player.on("ready",this.configureMenuDimensions)}dispose(){this.player.off("resize",this.configureMenuDimensions),this.player.off("fullscreenchange",this.configureMenuDimensions),this.player.off("resizemenus",this.configureMenuDimensions),this.player.off("ready",this.configureMenuDimensions),super.dispose()}configureMenuDimensions(){const e=u=>{if(this.options.mobile)return;const c=this.player.getChild("collapserator"),h=c.getChild("volumePanel"),f=c.children_.indexOf(h);c.removeChild(h),c.addChild("volumePanel",{inline:u},f),this.player.trigger("volumechange")},t=this.player.isFullscreen();if(t&&!this.options.mobile){const u=this.player.whiteboardModePlugin().side;if(e(u!=="top"),u==="left"||u==="right"||u==="top"){const c=this.player.currentWidth();this.player.el().querySelectorAll(".vjs-menu").forEach(f=>{f.style.paddingTop=null,f.style.marginBottom=null,f.style.width=`calc(${c}px - 4em)`});return}}t||e(!0);const r=this.player.currentWidth(),n=this.player.currentHeight()/r*100,a=this.player.el().querySelector(".cv-collapsorator"),o=this.player.el().querySelectorAll(".vjs-menu");let l=a&&a.offsetHeight;if(!l){this.player.one("play",this.configureMenuDimensions);return}this.options.seekBarName==="CreateClipSeekBar"&&(l+=22),!(!o||!o.length)&&o.forEach(u=>{!t&&this.options.overflowControls?u.style.paddingTop="80%":u.style.paddingTop=`calc(${n}% - ${l}px)`,u.style.marginBottom=`${l}px`,u.style.width=null,u.querySelector(".vjs-menu-content")&&(r<=i8.SMALL?this.player.addClass("cv-player-small"):this.player.removeClass("cv-player-small"))})}}B.registerPlugin("configureMenuDimensionsPlugin",n8);const qT="cv-persisttest",pt={hasLocalStorage:()=>{try{return window.localStorage.setItem(qT,"cv-player-storage-test"),window.localStorage.removeItem(qT),!0}catch{return!1}},get:s=>window.localStorage.getItem(s),set:(s,e)=>{window.localStorage.setItem(s,e)},remove:s=>{window.localStorage.removeItem(s)}},s8=B.getPlugin("plugin"),zT="cvplayer-volume",WT="cvplayer-mute";class a8 extends s8{constructor(e){super(e),this.enabled=!0,this.player.ready(()=>this.initialize())}initialize(){if(this.player.options_.mobile){this.removeVolumeControl();return}pt.hasLocalStorage()&&(this.saveVolumeState=this.saveVolumeState.bind(this),this.player.on("volumechange",this.saveVolumeState),this.applyUserPreferences())}applyUserPreferences(){const e=pt.get(zT),t=pt.get(WT);e&&this.player.volume(+e),t&&this.player.muted(t==="true")}saveVolumeState(){this.enabled&&(pt.set(zT,this.player.volume().toString()),pt.set(WT,this.player.muted().toString()))}removeVolumeControl(){this.player.volume(1);const e=this.player.getChild("collapserator"),t=e.getChild("volumePanel");e.removeChild(t)}enable(){this.enabled=!0}disable(){this.enabled=!1}dispose(){this.player.off("volumechange",this.saveVolumeState),super.dispose()}}B.registerPlugin("persistVolumePlugin",a8);const o8=B.getPlugin("plugin"),GT="cvplayer-playback-rate";class l8 extends o8{constructor(e,t){super(e),this.options=t,this.player.dataLoaded(()=>this.initialize())}initialize(){var r;if(!pt.hasLocalStorage())return;this.savePlaybackRate=this.savePlaybackRate.bind(this),this.player.on("ratechange",this.savePlaybackRate),this.one("dispose",()=>{this.player.off("ratechange",this.savePlaybackRate)});const e=+pt.get(GT);((r=this.player.options_.playbackRates)==null?void 0:r.some(i=>i===e))&&(this.player.playbackRate(e),this.player.defaultPlaybackRate(e))}savePlaybackRate(){var t;const e=this.player.playbackRate().toString();pt.set(GT,e),(t=this.options.analyticsService)==null||t.logUserAction({rate:e},{actionType:Jt.Select,workflowPhase:ia.Complete,descriptor:ra.ChangeSpeed,entity:xi.PlaybackSpeed,eventVersion:qs.V3})}}B.registerPlugin("persistPlaybackRatePlugin",l8);const u8=B.getPlugin("plugin");class c8 extends u8{constructor(e){super(e),this.fullscreenBecauseOfRotate=!1,this.player.supportsFullScreen()&&(this.onRotate=this.onRotate.bind(this),this.onFullscreenChange=this.onFullscreenChange.bind(this),this.player.ready(()=>this.initialize()))}initialize(){this.player.on("fullscreenchange",this.onFullscreenChange),window.addEventListener("orientationchange",this.onRotate)}dispose(){this.player.off("fullscreenchange",this.onFullscreenChange),window.removeEventListener("orientationchange",this.onRotate)}onFullscreenChange(){this.player.isFullscreen()||(this.fullscreenBecauseOfRotate=!1)}onRotate(){const e=this.getAngle();if(e!==90&&e!==-90&&e!==270){this.fullscreenBecauseOfRotate&&this.player.isFullscreen()&&this.player.exitFullscreen();return}this.player.requestFullscreen(),this.fullscreenBecauseOfRotate=!0}getAngle(){var e,t;return typeof((t=(e=window.screen)==null?void 0:e.orientation)==null?void 0:t.angle)=="number"?window.screen.orientation.angle:0}}B.registerPlugin("fullscreenOnRotatePlugin",c8);const I2=`
|
|
288
|
-
<svg viewBox='0 0 434 71'>
|
|
289
|
-
<g>
|
|
290
|
-
<path fill='#FFFFFF' d='M114.44 56.57l3.5 3.5a32.87 32.87 0 0 1-25.16 11.26c-19.63 0-33.62-15.54-33.62-35.16C59.16 16.55 73.16 1 92.78 1a32.31 32.31 0 0 1 24.19 10.4l-3.6 3.3a27.32 27.32 0 0 0-20.59-8.74c-16.91 0-28.39 13.5-28.39 30.21s11.48 30.21 28.39 30.21a28.08 28.08 0 0 0 21.66-9.81zM126.64 1h4.55v70.22h-4.73L126.64 1zm17.3 10.6a3.7 3.7 0 1 1 0 7.4 3.7 3.7 0 0 1 0-7.4zm-2.41 15.07h4.81v44.56h-4.81V26.67zm48 33.15l3.33 3.15a21.8 21.8 0 0 1-17.31 8.61c-12.59 0-21.76-10-21.76-22.22 0-12.22 9.17-22.22 21.76-22.22a21.84 21.84 0 0 1 16.85 8l-3.43 3.06a17.15 17.15 0 0 0-13.42-6.3c-10.09 0-16.76 8.15-16.76 17.5s6.67 17.5 16.76 17.5a17.38 17.38 0 0 0 13.98-7.08zm14.99-9.33v20.74h-4.73V1.01h4.73v47.75l20.74-19.02h6.64l-21.56 19.84L234 71.23h-7.01l-22.47-20.74z'/>
|
|
291
|
-
<path fill='#F8981D' d='M304.09 19.4a5.56 5.56 0 1 1 0-11.12 5.56 5.56 0 0 1 0 11.12zm-5.56 7.27h11.11v44.56h-11.11V26.67zm61.42 22.15c0 .81 0 2.42-.09 4h-31.75c.8 3.77 5.2 8.61 11.93 8.61a17.11 17.11 0 0 0 11.66-4.31l5.38 8.16a27.23 27.23 0 0 1-17 6.1c-12.92 0-22.88-9.87-22.88-22.34s9.06-22.33 21.35-22.33c11.62-.04 21.4 9.02 21.4 22.11zm-10.77-3.76c-.18-3.68-3.58-8.62-10.67-8.62-6.91 0-10.05 4.85-10.4 8.62h21.07zM385.92 71h-6.42l-19.64-44.37h13.97l9.16 23.98 9.72-23.98h8.31l9.63 23.98 9.16-23.98h13.97L414.24 71h-6.52l-10.85-23.7L385.92 71zm-120.22.35h-6L226.11 1.01h17.01l19.42 44.18 18.08-44.18h16.91L265.7 71.35zM0 1l41 35L0 71V1z'/>
|
|
292
|
-
</g>
|
|
293
|
-
</svg>
|
|
294
|
-
`,h8=B.getComponent("Button");class P2 extends h8{constructor(e,t){super(e,t),this.update=BO(this.update.bind(this),1e3),e.on("timeupdate",this.update),e.one("dispose",()=>{e.off("timeupdate",this.update),this.el_.removeEventListener("click",this.pause)})}update(){const e=this.player_.currentTime();this.el_.href=this.options_.getExternalLink({currentTime:Math.round(e)})}buildCSSClass(){return"cv-open-externally-button"}createEl(){const t={innerHTML:I2,className:this.buildCSSClass()},r={type:"button",href:this.options_.getExternalLink({currentTime:0}),target:"_blank"},i=B.dom.createEl("a",t,r);return this.createControlTextEl(i),i.addEventListener("click",this.pause.bind(this)),i}pause(){this.player_.pause()}}P2.prototype.controlText_="Open in ClickView";B.registerComponent("OpenExternallyButton",P2);const d8=B.getPlugin("plugin");class f8 extends d8{constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){const e=this.player.getChild("collapserator"),t=e.getChild("customControlSpacer"),r=e.children_.indexOf(t);e.addChild("OpenExternallyButton",{getExternalLink:this.options.getExternalLink},r+1)}}B.registerPlugin("openExternallyPlugin",f8);const p8=B.getComponent("component");class m8 extends p8{constructor(e,t){super(e,t)}buildCSSClass(){return`cv-touch-control-ui ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}setUi(e,t){const r=e>0,i=r?"cv-touch-right":"cv-touch-left";this.el_.className=this.buildCSSClass()+" cv-ui-touch-active",this.el_.innerHTML=`
|
|
295
|
-
<div class='${i}'>
|
|
296
|
-
<div class='cv-touch-text'>
|
|
297
|
-
${r?"+":""}${e*10}s
|
|
298
|
-
</div>
|
|
299
|
-
</div>
|
|
300
|
-
`,window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.removeText()},t)}removeText(){this.el_.className=this.buildCSSClass(),this.el_.innerHTML=""}}B.registerComponent("TouchControls",m8);const g8=B.getPlugin("plugin"),ml=300;class v8 extends g8{constructor(e){super(e),this.doubleTouchCount=0,this.seekStartTime=0,this.directionModifier=0,this.bindFunctions(),this.player.ready(()=>this.initialize())}bindFunctions(){this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.reBindEventListeners=this.reBindEventListeners.bind(this),this.unBindEventListeners=this.unBindEventListeners.bind(this)}initialize(){this.player.addChild("TouchControls"),this.touchControls=this.player.getChild("TouchControls"),this.player.on("ready",this.reBindEventListeners),this.one("dispose",()=>{this.player.off("ready",this.reBindEventListeners)}),this.reBindEventListeners()}reBindEventListeners(){this.unBindEventListeners(),this.tech=this.player.tech(!0),this.tech.name()==="Html5"&&(this.tech.on("touchstart",this.onTouchStart),this.tech.on("touchend",this.onTouchEnd))}unBindEventListeners(){this.tech&&this.tech.name()==="Html5"&&(this.tech.off("touchstart",this.onTouchStart),this.tech.off("touchend",this.onTouchEnd))}dispose(){super.dispose(),this.unBindEventListeners()}onTouchStart(e){this.touchStartTime=e.timeStamp,this.userActive=this.player.userActive()}onTouchEnd(e){if(e.changedTouches.length){if(e.timeStamp-this.lastTouchTime<ml){this.onDoubleTouch(e),this.lastTouchTime=e.timeStamp;return}if(this.resetProperties(),this.lastTouchTime=e.timeStamp,e.timeStamp-this.touchStartTime<ml){window.setTimeout(()=>{this.doubleTouchCount||(this.player.paused()?this.player.play():this.userActive&&this.player.pause())},ml);return}}}resetProperties(){this.doubleTouchCount=0,this.seekStartTime=0,this.directionModifier=0}onDoubleTouch(e){const t=this.player.el().getBoundingClientRect(),r=t.left+t.width/2;if(this.doubleTouchCount===0&&(this.seekStartTime=this.player.currentTime(),e.changedTouches[0].pageX<r?this.directionModifier=-1:this.directionModifier=1),this.doubleTouchCount++,this.directionModifier<0){if(this.doubleTouchCount*10>this.seekStartTime+10)return;this.touchControls.setUi(-this.doubleTouchCount,ml*3),this.player.currentTime(this.player.currentTime()-10);return}const i=this.player.duration()-this.seekStartTime;this.doubleTouchCount*10>i+10||(this.touchControls.setUi(this.doubleTouchCount,ml*3),this.player.currentTime(this.player.currentTime()+10))}}B.registerPlugin("touchControls",v8);class y8{constructor(e,t){this.id=t.id,this.plugin=e,this.source=t,this.enabled=this.enabled.bind(this)}enabled(e){return e===void 0?this.plugin.currentSource===this.source:(e&&this.plugin.setSource(this.source.id),e)}}const _8=B.getPlugin("plugin");class T8 extends _8{constructor(e,t){super(e),this.options_=t,this.player.ready(()=>this.initialize())}initialize(){this.sources=[],this.qualityLevels=this.player.qualityLevels(),this.populateSources(this.options_.sources),this.onQualityChange=this.onQualityChange.bind(this),this.qualityLevels.on("change",this.onQualityChange),this.player.one("dispose",()=>{this.qualityLevels.off("change",this.onQualityChange)})}get currentSource(){return this._currentSource}onQualityChange(){const e=this.qualityLevels[this.qualityLevels.selectedIndex];this.player.trigger("cv-quality-change",e.id)}setSource(e){const t=this.getSourceById(e);if(t===null)return this.currentSource;const r=this.player.currentTime(),i=!this.player.paused();this._currentSource=t;const n=this.player.hasStarted();this.player.src({src:t.url,type:t.mimeType});const a=()=>{this.player.currentTime()!==r&&this.player.currentTime(r),i&&this.player.play(),n&&this.player.hasStarted(!0)};return this.player.one("loadedmetadata",a),this.trigger({event:"sourcechange",source:t}),this.sourceChangeUpdateQualityLevels(t),t}getSourceById(e){return this.sources.find(t=>t.id===e)}repopulateSources(e){let t=null;for(;this.qualityLevels.length;)this.qualityLevels[0].enabled&&(t=this.qualityLevels[0].id),this.qualityLevels.removeQualityLevel(this.qualityLevels[0]);this.sources=[],this.populateSources(e,t)}sortSources(e){return e.sort((t,r)=>t.id===r.id?0:+t.id>+r.id?-1:1)}populateSources(e,t=null){let r=null;e=this.sortSources(e),e.forEach(i=>{if(this.qualityLevels.addQualityLevel(new y8(this,i)),this.sources.push(i),this.trigger({event:"addsource",source:i}),t!==null){i.id===t&&(r=i);return}i.default&&(r=i)}),r===null&&(r=this.sources[0]),r!==null&&this.setSource(r.id)}sourceChangeUpdateQualityLevels(e){const t=this.qualityLevels;let r=-1;for(let i=0;i<t.length;i++)if(t[i].id===e.id){r=i;break}t.selectedIndex_=r,t.trigger({selectedIndex:r,type:"change"})}}B.registerPlugin("progressiveFiles",T8);class D2{static getKnownProfiles(){return["1080","720","480","360","240"]}static enableProfileOrNextBest(e,t){let r=e.getQualityLevelById(t);if(r||(r=this.getNextBestQuality(e,t)),!r)return null;for(let i=0;i<e.length;i++){const n=e[i];n.enabled=r.id===n.id}return r}static getNextBestQuality(e,t){const r=this.getKnownProfiles(),i=r.indexOf(t);if(i>=0){for(let n=i+1;n<r.length;n++){const a=r[n],o=e.getQualityLevelById(a);if(o)return o}for(let n=i-1;n>0;n--){const a=r[n],o=e.getQualityLevelById(a);if(o)return o}}return null}}class b8{constructor(e){this.name=e.name,this.playbackProfile=e.playbackProfile,this.address=new URL(e.httpsAddress)}getUrl(e){return e?this.address+"cache?file="+encodeURIComponent(e):null}async ping(){const t=new AbortController,r=setTimeout(()=>t.abort(),1e3);try{const n=await(await fetch(this.address+"ping",{method:"GET",mode:"cors",signal:t.signal})).text();return clearTimeout(r),n==="PONG"}catch{return!1}}}class S8{constructor(e){this.player=e,this.logger=B.log.createLogger("localcache")}async setSource(e,t){if(this.player.localCache&&(e==null?void 0:e.src)!==void 0){const r=await this.player.localCache().getActiveLocalCache();r!==null&&(this.logger.debug("Using Local Cache",r),e.src=r.getUrl(e.src))}t(null,e)}}B.use("*",s=>new S8(s));const N2='<?xml version="1.0" encoding="UTF-8"?><svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.9"><g id="Local-Cache" transform="translate(2.000000, 2.000000)"><rect id="Rectangle" fill="#FFFFFF" x="0" y="2.4" width="18.8" height="15.2"></rect><ellipse id="Oval" fill="#FFFFFF" cx="9.4" cy="2.4" rx="9.4" ry="2.4"></ellipse><ellipse id="Oval-Copy" fill="#FFFFFF" cx="9.4" cy="17.6" rx="9.4" ry="2.4"></ellipse><g id="Logo/Circle" transform="translate(2.500000, 3.000000)"><circle id="Oval" fill="#FFFFFF" cx="7" cy="7" r="7"></circle><polygon id="Fill-1" fill="#F8981D" points="4.66666667 2.33333333 4.66666667 11.4245258 10.0383286 6.87866667"></polygon></g></g></g></svg>',C8=B.getComponent("Component");class E8 extends C8{constructor(e,t){super(e,t),this.hide(),this.onLocalCacheChange=this.onLocalCacheChange.bind(this),e.ready(()=>{this.initialize()})}createEl(){return super.createEl("div",{className:"vjs-local-cache-indicator",innerHTML:`<div class="vjs-local-cache-indicator-icon">${N2}</div>`},{title:"Streaming from ClickView Local Cache"})}initialize(){this.localCachePlugin=this.player_.localCache(),this.localCachePlugin&&(this.localCachePlugin.on("localcachechanged",this.onLocalCacheChange),this.player_.on("dispose",()=>{this.localCachePlugin.off("localcachechanged",this.onLocalCacheChange)}),this.onLocalCacheChange())}async onLocalCacheChange(){await this.localCachePlugin.getActiveLocalCache()?this.show():this.hide()}}B.registerComponent("localCacheIndicator",E8);const w8=B.getPlugin("plugin");class k8 extends w8{constructor(e,t){if(super(e),this.logger_=B.log.createLogger("localcache"),t===void 0)throw Error("no options defined");this.localCaches_=t.localCacheAddresses.map(r=>new b8(r)),this.player.ready(()=>{this.initialize(),t.enabled&&this.enable()})}get isEnabled(){return this.enabled_}enable(){this.enabled_=!0,this.resetActiveLocalCache()}disable(){this.enabled_=!1}getActiveLocalCache(){return this.enabled_?this.activeLocalCache_:null}resetActiveLocalCache(){this.clearActiveLocalCache(),this.activeLocalCache_=this.getActiveLocalCacheInternal()}clearActiveLocalCache(){this.activeLocalCache_&&(this.activeLocalCache_=null,this.onLocalCacheChange(null))}removeLocalCache(e){this.localCaches_=this.localCaches_.filter(t=>t!==e)}dispose(){super.dispose()}initialize(){this.player.controlBar.addChild("localCacheIndicator")}async handleNetworkError(){const e=await this.getActiveLocalCache();return e&&await e.ping()&&this.removeLocalCache(e),this.resetActiveLocalCache(),await this.getActiveLocalCache(),this.resetSource(),!0}resetSource(){const e=this.player.qualityLevels();for(let t=0;t<e.length;t++)e[t].enabled&&(e[t].enabled=!0)}async getActiveLocalCacheInternal(){const e=[],t=async r=>{await r.ping()&&e.push(r)};if(await Promise.all(this.localCaches_.map(r=>t(r))),e.length>0){const r=e[0];return this.onLocalCacheChange(r),r}return null}onLocalCacheChange(e){this.logger_.debug("Local Cache changed",e),this.trigger("localcachechanged",{localCache:e});let t=!1;e&&e.playbackProfile&&(this.logger_.debug("Changing active profile for local cache",e.playbackProfile),D2.enableProfileOrNextBest(this.player.qualityLevels(),e.playbackProfile),t=!0),t||this.player.src(this.player.src())}}B.registerPlugin("localCache",k8);const x8=9e5,A8=B.getPlugin("plugin");class I8 extends A8{constructor(e,t){super(e),this.playerApi=t.playerApi,this.fileToken=t.fileToken,this.logger=B.log.createLogger("video-signature-expiry-plugin"),this.bindErrorHandlers()}bindErrorHandlers(){this.onError=this.onError.bind(this),this.player.on("error",this.onError)}dispose(){this.player.off("error",this.onError),super.dispose()}async onError(){const e=this.player.error().code;if(!(e!==MediaError.MEDIA_ERR_NETWORK&&e!==MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)){if(await this.player.localCache().getActiveLocalCache()){this.callErrorHandler(()=>this.player.localCache().handleNetworkError());return}this.callErrorHandler(()=>this.handleVideoSignatureExpiry())}}async handleVideoSignatureExpiry(){if(!this.playerApi||!this.fileToken||this.refetchedSourcesTimestamp+x8>Date.now())return!1;this.refetchedSourcesTimestamp=Date.now();let e=null;try{this.logger.debug("Detected expired mp4 urls, attempting to refetch");const t=`${this.playerApi.origin}/api/files?fileToken=${this.fileToken}`;e=await rm.get(t)}catch{return this.logger.error("Failed to refetch expired mp4 urls"),!1}return this.logger.debug("Mp4 urls successfully refetched"),this.player.progressiveFiles().repopulateSources(e.progressive.map(t=>({id:t.profile,mimeType:t.mimeType,url:t.url}))),this.fileToken=e.fileToken,!0}async callErrorHandler(e){const t=this.player.currentTime(),r=!this.player.paused(),i=()=>{this.player.currentTime(t),r&&this.player.play(),this.player.error(null)};this.player.one("loadedmetadata",i),!await e()&&this.player.off("loadedmetadata",i)}}B.registerPlugin("handleNetworkErrors",I8);const P8=B.getPlugin("plugin"),ap="cvplayer-show-subtitles",op="cvplayer-selected-language",KT="cvplayer-subtitle-size";class D8 extends P8{constructor(e,t){super(e),this.options=t,this.initialize()}initialize(){this.applyUserPreferences=this.applyUserPreferences.bind(this),this.player.textTracks().length&&(this.applyUserPreferences(),this.bindEventListeners())}applyUserPreferences(){let e=!!this.options.showSubtitles;const t=this.safeGet(ap);if(t==="true"&&(e=!0),t==="false"&&(e=!1),e){const i=this.guessWhichTrack();i&&(i.mode="showing",this.player.trigger("cv:languageselected"))}else this.hideSubtitles();let r=this.safeGet(KT);r||(r=this.options.subtitleSize),this.player.options_.mobile&&(r="medium"),r&&this.player.textTrackSettings.setSizeSetting(r)}safeGet(e){if(pt.hasLocalStorage())return pt.get(e)}onSelectedLanguageChange(){var t,r;const e=this.player.textTracks();for(let i=0;i<e.length;i++){const n=e[i];if(n.kind==="subtitles"&&n.mode==="showing"){pt.set(ap,"true"),pt.set(op,n.language),(t=this.options.analyticsService)==null||t.logUserAction({language:n.language},{actionType:Jt.Select,entity:xi.Subtitle,workflowPhase:ia.Complete,descriptor:Nv.On});return}}pt.set(ap,"false"),pt.remove(op),(r=this.options.analyticsService)==null||r.logUserAction({language:""},{actionType:Jt.Select,entity:xi.Subtitle,workflowPhase:ia.Complete,descriptor:Nv.Off,eventVersion:qs.V3})}bindEventListeners(){pt.hasLocalStorage()&&(this.onSelectedLanguageChange=this.onSelectedLanguageChange.bind(this),this.onChangeSubtitleSize=this.onChangeSubtitleSize.bind(this),this.player.on("cv:languageselected",this.onSelectedLanguageChange),this.player.on("changesubtitlesize",this.onChangeSubtitleSize),this.one("dispose",()=>{this.player.off("cv:languageselected",this.onSelectedLanguageChange),this.player.off("changesubtitlesize",this.onChangeSubtitleSize)}))}onChangeSubtitleSize(){const t=this.player.textTrackSettings.getSizeSetting();pt.set(KT,t)}guessWhichTrack(){const e=this.safeGet(op)||window.navigator.language,{language:t,country:r}=this.getLanguageParts(e);let i,n;const a=this.player.textTracks();for(let o=0;o<a.length;o++){const l=a[o];if(l.kind!=="subtitles")continue;const{language:u,country:c}=this.getLanguageParts(l.language);if(u===t&&(i=l,c||(n=l),c===r))return i}return n||i||null}getLanguageParts(e){const t=e.toLowerCase().split("-"),r=t[0],i=t[1];return{language:r,country:i}}hideSubtitles(){const e=this.player.textTracks();for(let t=0;t<e.length;t++){const r=e[t];if(r.kind!=="subtitles")return;r.mode="disabled"}}previewModeSubtitles(){const e=this.guessWhichTrack();e&&(e.mode="showing"),this.player.off("changesubtitlesize",this.onChangeSubtitleSize),this.player.textTrackSettings.setSizeSetting("large"),this.player.on("changesubtitlesize",this.onChangeSubtitleSize)}}B.registerPlugin("persistSubtitleSettingsPlugin",D8);const N8=B.getPlugin("plugin"),L8="cvplayer-playback-quality",O8="cvplayer-localcache-playback-quality",M8="1080";class R8 extends N8{constructor(e,t){super(e),this.options=t,this.player.ready(()=>this.initialize())}async initialize(){const e=await this.getActiveLocalCache();let t=e?this.options.playbackProfileLocalCache:this.options.playbackProfile;if(t||(t=M8),pt.hasLocalStorage()){const i=pt.get(this.getStorageKey(!!e));i&&(t=i)}const r=this.player.qualityLevels();e!=null&&e.playbackProfile||D2.enableProfileOrNextBest(r,t),pt.hasLocalStorage()&&(this.onQualityLevelsChange=this.onQualityLevelsChange.bind(this),r.on("change",this.onQualityLevelsChange),this.on("dispose",()=>{r.off("change",this.onQualityLevelsChange)}))}async onQualityLevelsChange(){var i;const e=await this.isLocalCacheActive(),t=this.player.qualityLevels(),r=t[t.selectedIndex];pt.set(this.getStorageKey(e),r.id),(i=this.options.analyticsService)==null||i.logUserAction({quality:r.id},{actionType:Jt.Select,workflowPhase:ia.Complete,descriptor:ra.ChangeResolution,entity:xi.Resolution,eventVersion:qs.V3})}async isLocalCacheActive(){return!!await this.player.localCache().getActiveLocalCache()}getActiveLocalCache(){return this.player.localCache().getActiveLocalCache()}getStorageKey(e){return e?O8:L8}}B.registerPlugin("persistQualitySettingsPlugin",R8);const L2=B.getComponent("Component");class B8 extends L2{constructor(e,t){super(e,t)}createEl(){return B.dom.createEl("div",{className:"cv-progress-reporter-item"})}update(){const e=this.options_.event,t=this.player_.duration(),i=(e.end.time-e.start.time)/t;this.el_.style.width=i*100+"%";const n=e.start.time/t;this.el_.style.left=n*100+"%"}}class F8 extends L2{constructor(){super(...arguments),this.events_=[]}update(){const e=this.children();for(let t=e.length;t>0;t--)this.removeChild(e[t]);this.events_.forEach(t=>{const r=new B8(this.player(),{event:t});this.addChild(r),r.update()})}addEvents(e){this.events_.push(...e),this.update()}createEl(){return B.dom.createEl("div",{className:"cv-progress-reporter-display"})}}const U8=B.getPlugin("plugin"),XT=5e3,$8="ArrowUpArrowUpArrowDownArrowDownArrowLeftArrowRightArrowLeftArrowRightba",Vt={PLAY:"play",PLAYING:"playing",PAUSE:"pause",SEEKING:"seeking",SEEK_START:"seekstart",SEEK_END:"seekend",ENDED:"ended",PAUSED_SEEK:"pausedseek",TIME_UPDATE:"timeupdate"};class j8 extends U8{constructor(e,t){super(e,t),this.eventBuffer=[],this.latestTime=0,this.lastPlayingTime=0,this.isPlaying=!1,this.isSeeking=!1,this.hasEnded=!1,this.shouldLogPlayOnTimeUpdate=!1,this.options=t,this.player.ready(()=>this.initialize())}initialize(){this.validateOptions(),this.bindListeners(),this.startInterval(),this.addEasterEgg()}validateOptions(){if(typeof this.options.onFlush!="function")throw new Error("Please provide the onFlush option")}bindListeners(){const e={[Vt.PLAY]:()=>this.onPlay(),[Vt.PAUSE]:()=>this.onPause(),[Vt.TIME_UPDATE]:()=>this.onTimeUpdate(),[Vt.SEEKING]:()=>this.onSeeking(),[Vt.ENDED]:()=>this.onEnded(),[Vt.PLAYING]:()=>this.onPlaying()},t=Object.keys(e);t.forEach(r=>this.player.on(r,e[r])),this.one("dispose",()=>{t.forEach(r=>this.player.off(r,e[r]))})}startInterval(){const e=this.options.interval||XT;this.interval=window.setInterval(()=>this.flushBuffer(),e),this.player.one("dispose",()=>window.clearInterval(this.interval))}addEasterEgg(){let e="",t;const r=u=>{e=e+u.key,e===$8&&this.addDisplay(),window.clearTimeout(t),t=window.setTimeout(()=>{e=""},500)};let i=!1,n;const a=()=>{i=!0,n=window.setTimeout(()=>{i&&this.addDisplay()},1e4)};function o(){i=!1,window.clearTimeout(n)}this.player.el().addEventListener("keyup",r);const l=this.player.getChild("Collapserator").getChild("PlayToggle");l.on("touchstart",a),l.on("touchend",o),this.player.one("dispose",()=>{var u,c;(c=(u=this.player)==null?void 0:u.el())==null||c.removeEventListener("keyup",r),l.off("touchstart",a),l.off("touchend",o)})}addDisplay(){this.progressReporterDisplay||(this.progressReporterDisplay=new F8(this.player),this.player.addChild(this.progressReporterDisplay),this.player.options_.inactivityTimeout=0,this.player.one("dispose",()=>{this.progressReporterDisplay=void 0}))}onPlay(){if(this.isPlaying=!0,this.isSeeking){this.logEvent(Vt.SEEK_END),this.isSeeking=!1;return}if(this.hasEnded){this.shouldLogPlayOnTimeUpdate=!0,this.hasEnded=!1;return}this.logEvent(Vt.PLAY)}onPause(){this.isSeeking||(this.pauseTimeout=window.setTimeout(()=>{this.isPlaying=!1,this.logEvent(Vt.PAUSE),delete this.pauseTimeout},50))}onTimeUpdate(){this.shouldLogPlayOnTimeUpdate&&(this.shouldLogPlayOnTimeUpdate=!1,this.logEvent(Vt.PLAY)),!(!this.isPlaying||this.isSeeking)&&this.logEvent(Vt.PLAYING)}onSeeking(){this.pauseTimeout&&(this.latestTime=this.previousLatestTime,window.clearTimeout(this.pauseTimeout),delete this.pauseTimeout),this.isPlaying||this.logEvent(Vt.PAUSED_SEEK),!(this.isSeeking||!this.isPlaying)&&(this.isSeeking=!0,this.logEvent(Vt.SEEK_START))}onEnded(){this.hasEnded=!0,this.logEvent(Vt.ENDED)}onPlaying(){this.isSeeking=!1,this.isPlaying=!0}logEvent(e){if(!this.player)return;let t=this.player.currentTime();e===Vt.SEEK_START&&(t=this.latestTime),this.previousLatestTime=this.latestTime,this.latestTime=this.player.currentTime(),this.eventBuffer.push({time:t,type:e})}shouldUseCarriedOverTime(e){return this.lastPlayingTime&&(e===Vt.PLAYING||e===Vt.PLAY)}shouldSaveCarriedOverTime(e){return e===Vt.PLAYING||e===Vt.PAUSE}shouldClearCarriedOverTime(e){return e===Vt.ENDED||e===Vt.PAUSED_SEEK}flushBuffer(){var r,i;const e=[];let t={};for(;this.eventBuffer.length;){const n=this.eventBuffer.shift();if(this.shouldClearCarriedOverTime(n.type)){delete this.lastPlayingTime;continue}if(!t.start){this.shouldUseCarriedOverTime(n.type)&&(n.time=this.lastPlayingTime,delete this.lastPlayingTime),t.start=n;continue}n.type===Vt.PLAYING&&this.eventBuffer.length>0||(this.shouldSaveCarriedOverTime(n.type)&&(this.lastPlayingTime=n.time),t.end=n,e.push(t),t={})}this.eventBuffer=[],e.length&&this.validateEvents(e)&&(this.options.onFlush(e),(r=this.player)==null||r.trigger("progressflush"),(i=this.progressReporterDisplay)==null||i.addEvents(e))}validateEvents(e){let t=0;e.forEach(i=>{t+=i.end.time-i.start.time});let r=this.options.interval||XT;return r=r/1e3,r+=.5,r=r*this.player.playbackRate(),t<r}}B.registerPlugin("progressReporterPlugin",j8);const V8=B.getComponent("Component");class H8 extends V8{createEl(){const e="span",t={innerHTML:'<span class="vjs-icon-placeholder"></span>',className:"cv-drag-handle vjs-control vjs-button"};return B.dom.createEl(e,t,{})}}const O2=["top","left","right","bottom"],YT={top:"Top",left:"Left",right:"Right",bottom:"Bottom"},M2=B.getComponent("Component");class q8 extends M2{constructor(e,t){super(e,t),this.bindEventListeners()}createEl(){return super.createEl("div",{},{class:`cv-drop-target cv-drop-${this.options_.side}`})}bindEventListeners(){const e=this.el(),t=n=>{n.preventDefault(),n.dataTransfer.dropEffect="move",this.addClass("cv-drag-over")},r=n=>{n.preventDefault(),this.removeClass("cv-drag-over"),this.player_.whiteboardModePlugin().setWhiteboardMode(this.options_.side)},i=()=>{this.removeClass("cv-drag-over")};e.addEventListener("dragover",t),e.addEventListener("drop",r),e.addEventListener("dragleave",i),this.on("dispose",()=>{e.removeEventListener("dragover",t),e.removeEventListener("drop",r),e.removeEventListener("dragleave",i)})}}class z8 extends M2{constructor(e,t){super(e,t),this.addChildren()}addChildren(){O2.forEach(e=>{this.addChild(new q8(this.player_,{side:e}))})}}const W8=B.getComponent("MenuItem");class G8 extends W8{constructor(e,t){super(e,t)}handleClick(){this.player_.whiteboardModePlugin().setWhiteboardMode(this.options_.side)}}const QT=B.getComponent("MenuButton");class K8 extends QT{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0}createItems(){const e=this.player_.whiteboardModePlugin().side,t=[new aa(this.player_,{label:"Video Controls"})];return O2.forEach(r=>{t.push(new G8(this.player_,{side:r,label:YT[r],selectable:!0,multiSelectable:!1,selected:r===e}))}),t}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}getCollabsibleName(){return"Video Controls"}getCollabsibleValue(){const e=this.player_.whiteboardModePlugin().side;return YT[e]}showInCollabsibleMenu(){return this.player_.whiteboardModePlugin().isEnabled()?this.player_.isFullscreen():!1}showCollapsibleMenu(){QT.prototype.handleClick.apply(this)}}const JT="cv-whiteboard-side",X8=B.getPlugin("plugin");class Y8 extends X8{constructor(e){super(e),this.side="bottom",this.enabled=!0,this.player.ready(()=>{this.initialize()})}initialize(){if(!this.player.options_.mobile){if(pt.hasLocalStorage()){const e=pt.get(JT);e&&(this.side=e)}this.initCollapserator(),this.initDragTargets(),this.initFullscreenListener()}}initCollapserator(){var a,o;if((o=(a=this.player).viewTranscriptPlugin)!=null&&o.call(a).isTranscriptOn())return;const e=this.player.getChild("collapserator");this.dragHandle=new H8(this.player),this.button=new K8(this.player),e.addChild(this.dragHandle),e.addChild(this.button),this.player.trigger("cv-updatecog");const t=()=>{this.player.isFullscreen()&&e.el().setAttribute("draggable","true")},r=()=>{this.player.isFullscreen()&&e.el().setAttribute("draggable","false")},i=l=>{this.player.isFullscreen()&&(this.player.addClass("cv-dragging"),l.dataTransfer.setData("text/plain","handle"))},n=()=>{this.player.isFullscreen()&&(this.player.removeClass("cv-dragging"),e.el().setAttribute("draggable","false"))};this.dragHandle.el().addEventListener("mousedown",t),this.dragHandle.el().addEventListener("mouseup",r),e.el().addEventListener("dragstart",i),e.el().addEventListener("dragend",n),this.on("dispose",()=>{this.dragHandle.el().removeEventListener("mousedown",t),this.dragHandle.el().removeEventListener("mouseup",r),e.el().removeEventListener("dragstart",i),e.el().removeEventListener("dragend",n)})}initDragTargets(){this.player.addChild(new z8(this.player))}initFullscreenListener(){this.update=this.update.bind(this),this.player.on("fullscreenchange",this.update),this.player.on("cv-transcript-toggle",this.update),this.one("dispose",()=>{this.player.off("fullscreenchange",this.update)})}setWhiteboardMode(e){this.side=e,this.button.update(),pt.hasLocalStorage()&&pt.set(JT,e),this.player.trigger("cv-whiteboard-change"),this.update()}setEnabled(e){this.enabled=e,this.update()}isEnabled(){return this.enabled}getSide(){return this.isEnabled()?this.side:"bottom"}update(){var t,r;if(this.player.removeClass("cv-whiteboard-top"),this.player.removeClass("cv-whiteboard-left"),this.player.removeClass("cv-whiteboard-right"),B.dom.removeClass(window.document.documentElement,"cv-whiteboard-html-font-size"),this.player.trigger("resizemenus"),this.player.trigger("cv-updatecog"),!this.isEnabled()){(t=this.dragHandle)==null||t.hide();return}(r=this.dragHandle)==null||r.show();const e=this.getSide();!this.player.isFullscreen()||e==="bottom"||(this.player.addClass(`cv-whiteboard-${e}`),B.dom.addClass(window.document.documentElement,"cv-whiteboard-html-font-size"))}}B.registerPlugin("whiteboardModePlugin",Y8);const Q8=B.getPlugin("plugin");class J8 extends Q8{constructor(e){super(e)}deferMenu(){const e={subtitles:this.buildSubtitles(),qualities:this.buildQualities(),playbackSpeeds:this.buildPlaybackSpeeds()};this.player.trigger("cv-defer-menus",e)}buildSubtitles(){const e=[];let t=!1;const r=this.player.textTracks();for(let i=0;i<r.length;i++){const n=r[i],a=n.mode==="showing";e.unshift({id:n.label,name:n.label,selected:a}),a&&(t=!0)}return e.push({id:null,name:"Off",selected:!t}),e}buildQualities(){const e=[],t=this.player.qualityLevels();for(let r=0;r<t.length;r++){const i=t[r];e.push({id:i.id,name:i.id+"p",selected:i.enabled})}return e}buildPlaybackSpeeds(){const e=this.player.playbackRate();return this.player.options_.playbackRates.map(t=>({id:t,name:t+"x"+(t===1?" (Normal)":""),selected:e===t}))}}B.registerPlugin("deferMenusPlugin",J8);const Z8="No skipping ahead!",_h="PreventScrubbingTooltip",R2=1e3,e6=B.getComponent("Component"),ZT="cv-prevent-scrubbing-tooltip-show",eb="cv-prevent-scrubbing-tooltip-remove-transition";class t6 extends e6{constructor(){super(...arguments),this.isShowing=!1}buildCSSClass(){return`cv-prevent-scrubbing-tooltip ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass(),innerText:Z8},r)}show(){this.isShowing||(this.player_.userActive(!0),this.addClass(ZT),this.isShowing=!0)}hide(e=!1){this.isShowing&&(e&&(this.addClass(eb),window.requestAnimationFrame(()=>{this.removeClass(eb)})),this.player_.userActive(!1),this.removeClass(ZT),this.isShowing=!1)}}B.registerComponent(_h,t6);const i6=B.getPlugin("plugin");class r6 extends i6{constructor(e,t){super(e),this.isEnabled=!1,this.isPreviewing=!1;const{furthestVisitedTime:r=0,isEnabled:i=!1}=t??{};this.playerCurrentTimeFn=this.player.currentTime.bind(e),this.player.currentTime=this.currentTime.bind(this),this.onTimeUpdate=this.onTimeUpdate.bind(this),this.furthestVisitedTime=r,this.isEnabled=i,i&&this.enable()}dispose(){this.player.currentTime=this.playerCurrentTimeFn,this.isEnabled&&(this.disable(),super.dispose())}togglePreview(e){if(e){if(this.configurePreview(),this.isEnabled)return;this.enable(),this.isPreviewing=!0}else this.disable(),this.isPreviewing=!1}configurePreview(){this.player.currentTime(0),this.furthestVisitedTime=0}enable(){this.player.on("timeupdate",this.onTimeUpdate),this.getProgressControl().addChild(_h),this.isEnabled=!0}disable(){this.player.off("timeupdate",this.onTimeUpdate),this.getProgressControl().removeChild(this.getPreventScrubbingTooltip()),this.isEnabled=!1}getProgressControl(){return this.player.controlBar.getChild("progressControl")}onTimeUpdate(){const e=this.playerCurrentTimeFn();e>this.furthestVisitedTime&&(this.furthestVisitedTime=e)}currentTime(e,...t){var n;if(typeof e!="number")return this.playerCurrentTimeFn(e,...t);if(!this.isEnabled){this.playerCurrentTimeFn(e,...t);return}const r=this.getPreventScrubbingTooltip(),i=(n=this.getSeekBar())==null?void 0:n.getChild("MouseTimeDisplay");if(e>this.furthestVisitedTime){r.show(),au(r.hide,R2,!1,r)(),i==null||i.hide(),this.playerCurrentTimeFn(this.furthestVisitedTime,t);return}i==null||i.show(),r.hide(!0),this.playerCurrentTimeFn(e,t)}getPreventScrubbingTooltip(){return this.getProgressControl().getChild(_h)}getSeekBar(){var e;return(e=this.player.controlBar.getChild("ProgressControl"))==null?void 0:e.getChild("SeekBar")}}B.registerPlugin("preventScrubbingPlugin",r6);const n6=B.getComponent("Button"),tb="cv-muted";class yv extends n6{constructor(e){super(e),this.update(),this.update=this.update.bind(this),e.on("volumechange",this.update),e.on("dispose",()=>e.off("volumechange",this.update))}handleClick(){this.player_.muted(!this.player_.muted()),this.update()}update(){this.player_.muted()?this.addClass(tb):this.removeClass(tb)}buildCSSClass(){return"cv-mute-button cv-muted"}}B.registerComponent("muteButton",yv);yv.prototype.controlText_="Mute";const s6=B.getComponent("Component");class B2 extends s6{constructor(e,t){super(e,t),this._onClickHandler=t.onClickHandler,this.bindEventListeners()}createEl(){return B.dom.createEl("div",{className:"cv-player-overlay"})}handleClick(e){typeof this._onClickHandler=="function"&&(e.stopImmediatePropagation(),this._onClickHandler())}dispose(){this.off("click",this.handleClick),super.dispose()}bindEventListeners(){this.on("click",this.handleClick)}}B.registerComponent("playerOverlay",B2);var F2=(s=>(s.Default="play",s.Hover="hover",s))(F2||{});const a6=B.getPlugin("plugin"),ib="cv-preview-mode";class o6 extends a6{constructor(e){super(e),this.buttonAdded=!1,this.mode=null}getMode(){return this.mode}setPlayerMode(e,t){const r=this.mode;if(this.mode=e,e==="hover"){this.buttonAdded||this.addButtons(t),this.player.addClass(ib),this.enableSubtites(),this.mute(),this.removeActivityTimeout(),this.player.trigger("resize");return}r==="hover"&&(this.player.removeClass(ib),this.disableSubtitles(),this.unmute(),this.restoreActivityTimeout(),this.player.trigger("resize"))}addButtons(e){const t=new yv(this.player),r=new B2(this.player,{onClickHandler:e});this.player.addChild(t),this.player.addChild(r),this.buttonAdded=!0}enableSubtites(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().previewModeSubtitles())}disableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().applyUserPreferences())}mute(){this.player.ready(()=>{this.player.persistVolumePlugin().disable(),this.player.muted(!0)})}unmute(){this.player.ready(()=>{this.player.persistVolumePlugin().applyUserPreferences(),this.player.persistVolumePlugin().enable()})}removeActivityTimeout(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}restoreActivityTimeout(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}}B.registerPlugin("playerModePlugin",o6);const Im=B.getComponent("Component"),l6=B.getComponent("ClickableComponent"),u6=`
|
|
301
|
-
<svg version="1.1" viewBox="0 0 24 24">
|
|
302
|
-
<path id="Heart-Filled" d="m18.833 5.9735c-0.78916-0.95022-1.8839-1.4735-3.0826-1.4735-1.6859 0-2.7532 1.0685-3.3517 1.9648-0.15528 0.2326-0.28738 0.46582-0.39828 0.68529-0.11091-0.21946-0.24297-0.45269-0.39828-0.68529-0.5985-0.89636-1.6658-1.9648-3.3517-1.9648-1.1987 0-2.2935 0.52333-3.0827 1.4735-0.75275 0.90644-1.1673 2.1204-1.1673 3.4183 0 1.4128 0.51978 2.7268 1.6358 4.1353 0.99741 1.2588 2.4323 2.5564 4.0939 4.0589 0.61916 0.5599 1.2594 1.1389 1.9411 1.7718l0.02047 0.01903c0.08837 0.08211 0.19856 0.12313 0.30875 0.12313s0.22038-0.04105 0.30875-0.12313l0.02047-0.01903c0.68166-0.63289 1.3219-1.2119 1.9412-1.7719 1.6615-1.5024 3.0964-2.8 4.0938-4.0588 1.116-1.4085 1.6358-2.7225 1.6358-4.1353 0-1.2979-0.41459-2.5119-1.1674-3.4183z"/>
|
|
303
|
-
</svg>
|
|
304
|
-
`,c6=`
|
|
305
|
-
<svg version="1.1" viewBox="0 0 24 24">
|
|
306
|
-
<path id="Shape" d="m18.959 5.9741c-0.76992-0.92705-1.9357-1.5351-3.1052-1.5351-1.6448 0-2.8808 0.74937-3.4647 1.6238-0.15149 0.22693-0.28074 0.55125-0.38894 0.76537-0.10821-0.21411-0.23718-0.53844-0.38871-0.76537-0.58391-0.87451-1.8205-1.6238-3.4653-1.6238-1.1695 0-2.2376 0.60808-3.0075 1.5351-0.7344 0.88434-1.1388 1.9712-1.1388 3.2374 0 1.3784 0.50711 3.0509 1.5959 4.4251 0.97309 1.2281 2.373 2.4941 3.9941 3.9599 0.60406 0.54625 1.2285 1.1104 1.8936 1.7278l0.01997 0.01934c0.08622 0.08011 0.38931 0.21727 0.49681 0.21727 0.1075 0 0.40992-0.13796 0.49614-0.21804l0.0201-0.0178c0.66504-0.61746 1.2897-1.1824 1.8939-1.7287 1.621-1.4658 3.0209-2.7317 3.994-3.9598 1.0888-1.3742 1.5955-3.0467 1.5955-4.4251 0-1.2663-0.30646-2.3531-1.0409-3.2374zm-5.337 10.688c-0.51948 0.47226-1.0567 0.95549-1.6218 1.4768-0.56507-0.52124-1.101-1.0059-1.6219-1.4769-3.1725-2.8689-5.2684-4.7641-5.2684-7.2556 0-1.0298 0.32333-1.9863 0.91044-2.6933 0.59385-0.71497 1.4183-1.1088 2.3213-1.1088 1.254 0 2.0645 0.81976 2.5237 1.5074 0.41187 0.61679 0.62678 1.2385 0.70006 1.4772 0.06131 0.19978 0.23683 0.33499 0.43482 0.33499s0.37351-0.1352 0.43482-0.33499c0.07329-0.23867 0.28821-0.86044 0.70006-1.4773 0.45914-0.68766 1.2698-1.5074 2.5237-1.5074 0.90309 0 1.7274 0.39377 2.3213 1.1088 0.58714 0.70695 0.91047 1.6634 0.91047 2.6933 0 2.4914-2.1035 4.3783-5.2685 7.2557z" stroke-width=".97562"/>
|
|
307
|
-
</svg>
|
|
308
|
-
`;class h6 extends Im{createEl(){return Im.prototype.createEl.call(this,"span",{className:"cv-favourite-button-svg",innerHTML:`<span class='cv-favourite-heart'>${u6}</span><span class='cv-favourite-outline'>${c6}</span>`})}}class U2 extends l6{constructor(e,t){super(e,t),this.isFavourited=t.isFavourited,this.renderIcon(),this.update()}renderIcon(){this.icon&&this.removeChild(this.icon),this.icon=new h6(this.player_),this.addChild(this.icon)}update(){this.isFavourited?this.addClass("cv-favourited"):this.removeClass("cv-favourited")}createEl(e,t,r){e="button",t={innerHTML:"",className:"cv-favourite-button",...t},r={type:"button",...r};const i=Im.prototype.createEl.call(this,e,t,r);return this.createControlTextEl(i),i}handleClick(){this.isFavourited=!this.isFavourited,this.update(),this.options_.onClick&&this.options_.onClick(this.isFavourited)}}U2.prototype.controlText_="Favourite";const d6=B.getPlugin("plugin");class f6 extends d6{setFavourite(e,t){if(this.initialized)return;const r=new U2(this.player,{isFavourited:e,onClick:t});this.player.addChild(r),this.initialized=!0}}B.registerPlugin("favouritePlugin",f6);const p6=B.getComponent("MenuButton"),m6=992,$2="Theatre mode (t)",j2="Default view (t)",rb="cv-theatre-mode-button";class g6 extends p6{constructor(e,t){super(e,t),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.updateControlText()}getCollabsibleName(){return""}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!(window.innerWidth<m6)}showCollapsibleMenu(){super.handleClick(null)}buildCSSClass(){return`cv-default-mode-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`cv-menu-big ${super.buildWrapperCSSClass()}`}handleClick(){this.player_.theatreModePlugin().toggleTheatreMode(void 0,{shouldLog:!0}),this.updateControlText()}updateControlText(){this.player().theatreModePlugin().getTheatreMode()?this.controlText(j2):this.controlText($2)}}B.registerComponent("theatreModeButton",g6);const v6=B.getPlugin("plugin"),nb=992;class y6 extends v6{constructor(e,t){super(e,t),this.options=t,this.bindListeners(),e.ready(()=>this.onReady())}bindListeners(){this.onResize=this.onResize.bind(this),this.onFullscreenChange=this.onFullscreenChange.bind(this),this.player.on("playerresize",this.onResize),this.player.on("fullscreenchange",this.onFullscreenChange)}onReady(){if(!this.options||window.innerWidth<nb||!this.getCollapserator())return;this.button=this.createButton();const t=this.options.theatreMode;t&&(this.toggleButton(!0),this.options.onRequestTheatreMode(t))}dispose(){this.player.off("playerresize",this.onResize),this.player.off("fullscreenchange",this.onFullscreenChange),super.dispose()}toggleTheatreMode(e,t){var n;if(!this.options)return;const r=this.options.theatreMode,i=e!==void 0?e:!r;if(this.options.onRequestTheatreMode(i),this.options.theatreMode=i,window.requestAnimationFrame(()=>this.player.trigger("resize")),!!this.button)return r!==i&&(t!=null&&t.shouldLog)&&((n=this.analyticsService)==null||n.logUserAction({id:this.options.playbackObject.videoId,name:this.options.playbackObject.title},{actionType:Jt.Click,descriptor:i?ra.EnableTheatreMode:ra.DisableTheatreMode,entity:xi.Video})),i?(r||this.player.fill(!0),this.toggleButton(!0),i):(r&&this.player.fluid(!0),this.toggleButton(!1),this.player.viewTranscriptPlugin&&this.player.viewTranscriptPlugin().toggleTranscript(!1,{shouldLog:!1}),i)}onResize(){var e,t;window.innerWidth<nb?(e=this.button)==null||e.hide():this.player.isFullscreen()||(this.button||(this.button=this.createButton()),(t=this.button)==null||t.show())}createButton(){const e=this.getCollapserator();return(e==null?void 0:e.getChild("theatreModeButton"))||e.addChild("theatreModeButton",{},e.children_.length-3),e==null?void 0:e.getChild("theatreModeButton")}onFullscreenChange(){var e,t;this.player.isFullscreen()?(e=this.button)==null||e.hide():(t=this.button)==null||t.show()}getCollapserator(){return this.player.getChild("collapserator")}getTheatreMode(){return this.options.theatreMode}registerAnalytics(e){this.analyticsService=e}toggleButton(e){var t;this.button&&(e?(this.button.addClass(rb),this.button.updateControlText($2),this.button.setActive(!0)):((t=this.button)==null||t.removeClass(rb),this.button.updateControlText(j2),this.button.setActive(!1)))}}B.registerPlugin("theatreModePlugin",y6);ik();rk();var lp,sb;function _6(){if(sb)return lp;sb=1;var s=!!(typeof window<"u"&&window.document&&window.document.createElement);return lp=s,lp}var T6=_6();const _v=qi(T6);nk();sk();ak();ok();lk();uk();ck();hk();var up,ab;function b6(){if(ab)return up;ab=1;var s="Expected a function",e=NaN,t="[object Symbol]",r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt,l=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,u=typeof self=="object"&&self&&self.Object===Object&&self,c=l||u||Function("return this")(),h=Object.prototype,f=h.toString,g=Math.max,C=Math.min,p=function(){return c.Date.now()};function T(O,M,U){var E,P,Y,G,K,le,de=0,pe=!1,se=!1,ae=!0;if(typeof O!="function")throw new TypeError(s);M=R(M)||0,N(U)&&(pe=!!U.leading,se="maxWait"in U,Y=se?g(R(U.maxWait)||0,M):Y,ae="trailing"in U?!!U.trailing:ae);function ce(Oe){var He=E,ot=P;return E=P=void 0,de=Oe,G=O.apply(ot,He),G}function he(Oe){return de=Oe,K=setTimeout(De,M),pe?ce(Oe):G}function ve(Oe){var He=Oe-le,ot=Oe-de,wt=M-He;return se?C(wt,Y-ot):wt}function Ae(Oe){var He=Oe-le,ot=Oe-de;return le===void 0||He>=M||He<0||se&&ot>=Y}function De(){var Oe=p();if(Ae(Oe))return Me(Oe);K=setTimeout(De,ve(Oe))}function Me(Oe){return K=void 0,ae&&E?ce(Oe):(E=P=void 0,G)}function Ne(){K!==void 0&&clearTimeout(K),de=0,E=le=P=K=void 0}function Je(){return K===void 0?G:Me(p())}function Re(){var Oe=p(),He=Ae(Oe);if(E=arguments,P=this,le=Oe,He){if(K===void 0)return he(le);if(se)return K=setTimeout(De,M),ce(le)}return K===void 0&&(K=setTimeout(De,M)),G}return Re.cancel=Ne,Re.flush=Je,Re}function A(O,M,U){var E=!0,P=!0;if(typeof O!="function")throw new TypeError(s);return N(U)&&(E="leading"in U?!!U.leading:E,P="trailing"in U?!!U.trailing:P),T(O,M,{leading:E,maxWait:M,trailing:P})}function N(O){var M=typeof O;return!!O&&(M=="object"||M=="function")}function F(O){return!!O&&typeof O=="object"}function V(O){return typeof O=="symbol"||F(O)&&f.call(O)==t}function R(O){if(typeof O=="number")return O;if(V(O))return e;if(N(O)){var M=typeof O.valueOf=="function"?O.valueOf():O;O=N(M)?M+"":M}if(typeof O!="string")return O===0?O:+O;O=O.replace(r,"");var U=n.test(O);return U||a.test(O)?o(O.slice(2),U?2:8):i.test(O)?e:+O}return up=A,up}var S6=b6();const ob=qi(S6);var cp,lb;function C6(){if(lb)return cp;lb=1;var s="Expected a function",e=NaN,t="[object Symbol]",r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt,l=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,u=typeof self=="object"&&self&&self.Object===Object&&self,c=l||u||Function("return this")(),h=Object.prototype,f=h.toString,g=Math.max,C=Math.min,p=function(){return c.Date.now()};function T(R,O,M){var U,E,P,Y,G,K,le=0,de=!1,pe=!1,se=!0;if(typeof R!="function")throw new TypeError(s);O=V(O)||0,A(M)&&(de=!!M.leading,pe="maxWait"in M,P=pe?g(V(M.maxWait)||0,O):P,se="trailing"in M?!!M.trailing:se);function ae(Re){var Oe=U,He=E;return U=E=void 0,le=Re,Y=R.apply(He,Oe),Y}function ce(Re){return le=Re,G=setTimeout(Ae,O),de?ae(Re):Y}function he(Re){var Oe=Re-K,He=Re-le,ot=O-Oe;return pe?C(ot,P-He):ot}function ve(Re){var Oe=Re-K,He=Re-le;return K===void 0||Oe>=O||Oe<0||pe&&He>=P}function Ae(){var Re=p();if(ve(Re))return De(Re);G=setTimeout(Ae,he(Re))}function De(Re){return G=void 0,se&&U?ae(Re):(U=E=void 0,Y)}function Me(){G!==void 0&&clearTimeout(G),le=0,U=K=E=G=void 0}function Ne(){return G===void 0?Y:De(p())}function Je(){var Re=p(),Oe=ve(Re);if(U=arguments,E=this,K=Re,Oe){if(G===void 0)return ce(K);if(pe)return G=setTimeout(Ae,O),ae(K)}return G===void 0&&(G=setTimeout(Ae,O)),Y}return Je.cancel=Me,Je.flush=Ne,Je}function A(R){var O=typeof R;return!!R&&(O=="object"||O=="function")}function N(R){return!!R&&typeof R=="object"}function F(R){return typeof R=="symbol"||N(R)&&f.call(R)==t}function V(R){if(typeof R=="number")return R;if(F(R))return e;if(A(R)){var O=typeof R.valueOf=="function"?R.valueOf():R;R=A(O)?O+"":O}if(typeof R!="string")return R===0?R:+R;R=R.replace(r,"");var M=n.test(R);return M||a.test(R)?o(R.slice(2),M?2:8):i.test(R)?e:+R}return cp=T,cp}var E6=C6();const ub=qi(E6);var hp,cb;function w6(){if(cb)return hp;cb=1;var s="Expected a function",e="__lodash_hash_undefined__",t="[object Function]",r="[object GeneratorFunction]",i=/[\\^$.*+?()[\]{}|]/g,n=/^\[object .+?Constructor\]$/,a=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,o=typeof self=="object"&&self&&self.Object===Object&&self,l=a||o||Function("return this")();function u(Te,ke){return Te==null?void 0:Te[ke]}function c(Te){var ke=!1;if(Te!=null&&typeof Te.toString!="function")try{ke=!!(Te+"")}catch{}return ke}var h=Array.prototype,f=Function.prototype,g=Object.prototype,C=l["__core-js_shared__"],p=(function(){var Te=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||"");return Te?"Symbol(src)_1."+Te:""})(),T=f.toString,A=g.hasOwnProperty,N=g.toString,F=RegExp("^"+T.call(A).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),V=h.splice,R=Oe(l,"Map"),O=Oe(Object,"create");function M(Te){var ke=-1,Fe=Te?Te.length:0;for(this.clear();++ke<Fe;){var Be=Te[ke];this.set(Be[0],Be[1])}}function U(){this.__data__=O?O(null):{}}function E(Te){return this.has(Te)&&delete this.__data__[Te]}function P(Te){var ke=this.__data__;if(O){var Fe=ke[Te];return Fe===e?void 0:Fe}return A.call(ke,Te)?ke[Te]:void 0}function Y(Te){var ke=this.__data__;return O?ke[Te]!==void 0:A.call(ke,Te)}function G(Te,ke){var Fe=this.__data__;return Fe[Te]=O&&ke===void 0?e:ke,this}M.prototype.clear=U,M.prototype.delete=E,M.prototype.get=P,M.prototype.has=Y,M.prototype.set=G;function K(Te){var ke=-1,Fe=Te?Te.length:0;for(this.clear();++ke<Fe;){var Be=Te[ke];this.set(Be[0],Be[1])}}function le(){this.__data__=[]}function de(Te){var ke=this.__data__,Fe=Ne(ke,Te);if(Fe<0)return!1;var Be=ke.length-1;return Fe==Be?ke.pop():V.call(ke,Fe,1),!0}function pe(Te){var ke=this.__data__,Fe=Ne(ke,Te);return Fe<0?void 0:ke[Fe][1]}function se(Te){return Ne(this.__data__,Te)>-1}function ae(Te,ke){var Fe=this.__data__,Be=Ne(Fe,Te);return Be<0?Fe.push([Te,ke]):Fe[Be][1]=ke,this}K.prototype.clear=le,K.prototype.delete=de,K.prototype.get=pe,K.prototype.has=se,K.prototype.set=ae;function ce(Te){var ke=-1,Fe=Te?Te.length:0;for(this.clear();++ke<Fe;){var Be=Te[ke];this.set(Be[0],Be[1])}}function he(){this.__data__={hash:new M,map:new(R||K),string:new M}}function ve(Te){return Re(this,Te).delete(Te)}function Ae(Te){return Re(this,Te).get(Te)}function De(Te){return Re(this,Te).has(Te)}function Me(Te,ke){return Re(this,Te).set(Te,ke),this}ce.prototype.clear=he,ce.prototype.delete=ve,ce.prototype.get=Ae,ce.prototype.has=De,ce.prototype.set=Me;function Ne(Te,ke){for(var Fe=Te.length;Fe--;)if(Oi(Te[Fe][0],ke))return Fe;return-1}function Je(Te){if(!zi(Te)||ot(Te))return!1;var ke=Ft(Te)||c(Te)?F:n;return ke.test(wt(Te))}function Re(Te,ke){var Fe=Te.__data__;return He(ke)?Fe[typeof ke=="string"?"string":"hash"]:Fe.map}function Oe(Te,ke){var Fe=u(Te,ke);return Je(Fe)?Fe:void 0}function He(Te){var ke=typeof Te;return ke=="string"||ke=="number"||ke=="symbol"||ke=="boolean"?Te!=="__proto__":Te===null}function ot(Te){return!!p&&p in Te}function wt(Te){if(Te!=null){try{return T.call(Te)}catch{}try{return Te+""}catch{}}return""}function Lt(Te,ke){if(typeof Te!="function"||ke&&typeof ke!="function")throw new TypeError(s);var Fe=function(){var Be=arguments,Ke=ke?ke.apply(this,Be):Be[0],nt=Fe.cache;if(nt.has(Ke))return nt.get(Ke);var ht=Te.apply(this,Be);return Fe.cache=nt.set(Ke,ht),ht};return Fe.cache=new(Lt.Cache||ce),Fe}Lt.Cache=ce;function Oi(Te,ke){return Te===ke||Te!==Te&&ke!==ke}function Ft(Te){var ke=zi(Te)?N.call(Te):"";return ke==t||ke==r}function zi(Te){var ke=typeof Te;return!!Te&&(ke=="object"||ke=="function")}return hp=Lt,hp}var k6=w6();const x6=qi(k6);var V2=(function(){if(typeof Map<"u")return Map;function s(e,t){var r=-1;return e.some(function(i,n){return i[0]===t?(r=n,!0):!1}),r}return(function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var r=s(this.__entries__,t),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(t,r){var i=s(this.__entries__,t);~i?this.__entries__[i][1]=r:this.__entries__.push([t,r])},e.prototype.delete=function(t){var r=this.__entries__,i=s(r,t);~i&&r.splice(i,1)},e.prototype.has=function(t){return!!~s(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,r){r===void 0&&(r=null);for(var i=0,n=this.__entries__;i<n.length;i++){var a=n[i];t.call(r,a[1],a[0])}},e})()})(),Pm=typeof window<"u"&&typeof document<"u"&&window.document===document,Th=(function(){return typeof globalThis<"u"&&globalThis.Math===Math?globalThis:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),A6=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Th):function(s){return setTimeout(function(){return s(Date.now())},1e3/60)}})(),I6=2;function P6(s,e){var t=!1,r=!1,i=0;function n(){t&&(t=!1,s()),r&&o()}function a(){A6(n)}function o(){var l=Date.now();if(t){if(l-i<I6)return;r=!0}else t=!0,r=!1,setTimeout(a,e);i=l}return o}var D6=20,N6=["top","right","bottom","left","width","height","size","weight"],L6=typeof MutationObserver<"u",O6=(function(){function s(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=P6(this.refresh.bind(this),D6)}return s.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},s.prototype.removeObserver=function(e){var t=this.observers_,r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},s.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},s.prototype.updateObservers_=function(){var e=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return e.forEach(function(t){return t.broadcastActive()}),e.length>0},s.prototype.connect_=function(){!Pm||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),L6?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},s.prototype.disconnect_=function(){!Pm||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},s.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=t===void 0?"":t,i=N6.some(function(n){return!!~r.indexOf(n)});i&&this.refresh()},s.getInstance=function(){return this.instance_||(this.instance_=new s),this.instance_},s.instance_=null,s})(),H2=(function(s,e){for(var t=0,r=Object.keys(e);t<r.length;t++){var i=r[t];Object.defineProperty(s,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return s}),Ao=(function(s){var e=s&&s.ownerDocument&&s.ownerDocument.defaultView;return e||Th}),q2=ld(0,0,0,0);function bh(s){return parseFloat(s)||0}function hb(s){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(r,i){var n=s["border-"+i+"-width"];return r+bh(n)},0)}function M6(s){for(var e=["top","right","bottom","left"],t={},r=0,i=e;r<i.length;r++){var n=i[r],a=s["padding-"+n];t[n]=bh(a)}return t}function R6(s){var e=s.getBBox();return ld(0,0,e.width,e.height)}function B6(s){var e=s.clientWidth,t=s.clientHeight;if(!e&&!t)return q2;var r=Ao(s).getComputedStyle(s),i=M6(r),n=i.left+i.right,a=i.top+i.bottom,o=bh(r.width),l=bh(r.height);if(r.boxSizing==="border-box"&&(Math.round(o+n)!==e&&(o-=hb(r,"left","right")+n),Math.round(l+a)!==t&&(l-=hb(r,"top","bottom")+a)),!U6(s)){var u=Math.round(o+n)-e,c=Math.round(l+a)-t;Math.abs(u)!==1&&(o-=u),Math.abs(c)!==1&&(l-=c)}return ld(i.left,i.top,o,l)}var F6=(function(){return typeof SVGGraphicsElement<"u"?function(s){return s instanceof Ao(s).SVGGraphicsElement}:function(s){return s instanceof Ao(s).SVGElement&&typeof s.getBBox=="function"}})();function U6(s){return s===Ao(s).document.documentElement}function $6(s){return Pm?F6(s)?R6(s):B6(s):q2}function j6(s){var e=s.x,t=s.y,r=s.width,i=s.height,n=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(n.prototype);return H2(a,{x:e,y:t,width:r,height:i,top:t,right:e+r,bottom:i+t,left:e}),a}function ld(s,e,t,r){return{x:s,y:e,width:t,height:r}}var V6=(function(){function s(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ld(0,0,0,0),this.target=e}return s.prototype.isActive=function(){var e=$6(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},s.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},s})(),H6=(function(){function s(e,t){var r=j6(t);H2(this,{target:e,contentRect:r})}return s})(),q6=(function(){function s(e,t,r){if(this.activeObservations_=[],this.observations_=new V2,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r}return s.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof Ao(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new V6(e)),this.controller_.addObserver(this),this.controller_.refresh())}},s.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof Ao(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},s.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},s.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},s.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(r){return new H6(r.target,r.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},s.prototype.clearActive=function(){this.activeObservations_.splice(0)},s.prototype.hasActive=function(){return this.activeObservations_.length>0},s})(),z2=typeof WeakMap<"u"?new WeakMap:new V2,W2=(function(){function s(e){if(!(this instanceof s))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=O6.getInstance(),r=new q6(e,t,this);z2.set(this,r)}return s})();["observe","unobserve","disconnect"].forEach(function(s){W2.prototype[s]=function(){var e;return(e=z2.get(this))[s].apply(e,arguments)}});var z6=(function(){return typeof Th.ResizeObserver<"u"?Th.ResizeObserver:W2})();dk();fk();pk();mk();gk();var $a=null,db=null;_v&&window.addEventListener("resize",function(){db!==window.devicePixelRatio&&(db=window.devicePixelRatio,$a=null)});function fb(){if($a===null){if(typeof document>"u")return $a=0,$a;var s=document.body,e=document.createElement("div");e.classList.add("simplebar-hide-scrollbar"),s.appendChild(e);var t=e.getBoundingClientRect().right;s.removeChild(e),$a=t}return $a}var Sh=function(e){var t=Array.prototype.reduce.call(e,function(r,i){var n=i.name.match(/data-simplebar-(.+)/);if(n){var a=n[1].replace(/\W+(.)/g,function(o,l){return l.toUpperCase()});switch(i.value){case"true":r[a]=!0;break;case"false":r[a]=!1;break;case void 0:r[a]=!0;break;default:r[a]=i.value}}return r},{});return t};function Zn(s){return!s||!s.ownerDocument||!s.ownerDocument.defaultView?window:s.ownerDocument.defaultView}function dp(s){return!s||!s.ownerDocument?document:s.ownerDocument}var zt=(function(){function s(t,r){var i=this;this.onScroll=function(){var n=Zn(i.el);i.scrollXTicking||(n.requestAnimationFrame(i.scrollX),i.scrollXTicking=!0),i.scrollYTicking||(n.requestAnimationFrame(i.scrollY),i.scrollYTicking=!0)},this.scrollX=function(){i.axis.x.isOverflowing&&(i.showScrollbar("x"),i.positionScrollbar("x")),i.scrollXTicking=!1},this.scrollY=function(){i.axis.y.isOverflowing&&(i.showScrollbar("y"),i.positionScrollbar("y")),i.scrollYTicking=!1},this.onMouseEnter=function(){i.showScrollbar("x"),i.showScrollbar("y")},this.onMouseMove=function(n){i.mouseX=n.clientX,i.mouseY=n.clientY,(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&i.onMouseMoveForAxis("x"),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&i.onMouseMoveForAxis("y")},this.onMouseLeave=function(){i.onMouseMove.cancel(),(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&i.onMouseLeaveForAxis("x"),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&i.onMouseLeaveForAxis("y"),i.mouseX=-1,i.mouseY=-1},this.onWindowResize=function(){i.scrollbarWidth=i.getScrollbarWidth(),i.hideNativeScrollbar()},this.hideScrollbars=function(){i.axis.x.track.rect=i.axis.x.track.el.getBoundingClientRect(),i.axis.y.track.rect=i.axis.y.track.el.getBoundingClientRect(),i.isWithinBounds(i.axis.y.track.rect)||(i.axis.y.scrollbar.el.classList.remove(i.classNames.visible),i.axis.y.isVisible=!1),i.isWithinBounds(i.axis.x.track.rect)||(i.axis.x.scrollbar.el.classList.remove(i.classNames.visible),i.axis.x.isVisible=!1)},this.onPointerEvent=function(n){var a,o;i.axis.x.track.rect=i.axis.x.track.el.getBoundingClientRect(),i.axis.y.track.rect=i.axis.y.track.el.getBoundingClientRect(),(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&(a=i.isWithinBounds(i.axis.x.track.rect)),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&(o=i.isWithinBounds(i.axis.y.track.rect)),(a||o)&&(n.preventDefault(),n.stopPropagation(),n.type==="mousedown"&&(a&&(i.axis.x.scrollbar.rect=i.axis.x.scrollbar.el.getBoundingClientRect(),i.isWithinBounds(i.axis.x.scrollbar.rect)?i.onDragStart(n,"x"):i.onTrackClick(n,"x")),o&&(i.axis.y.scrollbar.rect=i.axis.y.scrollbar.el.getBoundingClientRect(),i.isWithinBounds(i.axis.y.scrollbar.rect)?i.onDragStart(n,"y"):i.onTrackClick(n,"y"))))},this.drag=function(n){var a,o=i.axis[i.draggedAxis].track,l=o.rect[i.axis[i.draggedAxis].sizeAttr],u=i.axis[i.draggedAxis].scrollbar,c=i.contentWrapperEl[i.axis[i.draggedAxis].scrollSizeAttr],h=parseInt(i.elStyles[i.axis[i.draggedAxis].sizeAttr],10);n.preventDefault(),n.stopPropagation(),i.draggedAxis==="y"?a=n.pageY:a=n.pageX;var f=a-o.rect[i.axis[i.draggedAxis].offsetAttr]-i.axis[i.draggedAxis].dragOffset,g=f/(l-u.size),C=g*(c-h);i.draggedAxis==="x"&&(C=i.isRtl&&s.getRtlHelpers().isRtlScrollbarInverted?C-(l+u.size):C,C=i.isRtl&&s.getRtlHelpers().isRtlScrollingInverted?-C:C),i.contentWrapperEl[i.axis[i.draggedAxis].scrollOffsetAttr]=C},this.onEndDrag=function(n){var a=dp(i.el),o=Zn(i.el);n.preventDefault(),n.stopPropagation(),i.el.classList.remove(i.classNames.dragging),a.removeEventListener("mousemove",i.drag,!0),a.removeEventListener("mouseup",i.onEndDrag,!0),i.removePreventClickId=o.setTimeout(function(){a.removeEventListener("click",i.preventClick,!0),a.removeEventListener("dblclick",i.preventClick,!0),i.removePreventClickId=null})},this.preventClick=function(n){n.preventDefault(),n.stopPropagation()},this.el=t,this.minScrollbarWidth=20,this.options=Object.assign({},s.defaultOptions,{},r),this.classNames=Object.assign({},s.defaultOptions.classNames,{},this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,!s.instances.has(this.el)&&(this.recalculate=ob(this.recalculate.bind(this),64),this.onMouseMove=ob(this.onMouseMove.bind(this),64),this.hideScrollbars=ub(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=ub(this.onWindowResize.bind(this),64,{leading:!0}),s.getRtlHelpers=x6(s.getRtlHelpers),this.init())}s.getRtlHelpers=function(){var r=document.createElement("div");r.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';var i=r.firstElementChild;document.body.appendChild(i);var n=i.firstElementChild;i.scrollLeft=0;var a=s.getOffset(i),o=s.getOffset(n);i.scrollLeft=999;var l=s.getOffset(n);return{isRtlScrollingInverted:a.left!==o.left&&o.left-l.left!==0,isRtlScrollbarInverted:a.left!==o.left}},s.getOffset=function(r){var i=r.getBoundingClientRect(),n=dp(r),a=Zn(r);return{top:i.top+(a.pageYOffset||n.documentElement.scrollTop),left:i.left+(a.pageXOffset||n.documentElement.scrollLeft)}};var e=s.prototype;return e.init=function(){s.instances.set(this.el,this),_v&&(this.initDOM(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},e.initDOM=function(){var r=this;if(Array.prototype.filter.call(this.el.children,function(a){return a.classList.contains(r.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var i=document.createElement("div"),n=document.createElement("div");i.classList.add(this.classNames.track),n.classList.add(this.classNames.scrollbar),i.appendChild(n),this.axis.x.track.el=i.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=i.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},e.initListeners=function(){var r=this,i=Zn(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(o){r.el.addEventListener(o,r.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(o){r.el.addEventListener(o,r.onPointerEvent,{capture:!0,passive:!0})}),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),i.addEventListener("resize",this.onWindowResize);var n=!1,a=i.ResizeObserver||z6;this.resizeObserver=new a(function(){n&&r.recalculate()}),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),i.requestAnimationFrame(function(){n=!0}),this.mutationObserver=new i.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},e.recalculate=function(){var r=Zn(this.el);this.elStyles=r.getComputedStyle(this.el),this.isRtl=this.elStyles.direction==="rtl";var i=this.heightAutoObserverEl.offsetHeight<=1,n=this.heightAutoObserverEl.offsetWidth<=1,a=this.contentEl.offsetWidth,o=this.contentWrapperEl.offsetWidth,l=this.elStyles.overflowX,u=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var c=this.contentEl.scrollHeight,h=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=i?"auto":"100%",this.placeholderEl.style.width=n?a+"px":"auto",this.placeholderEl.style.height=c+"px";var f=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=h>a,this.axis.y.isOverflowing=c>f,this.axis.x.isOverflowing=l==="hidden"?!1:this.axis.x.isOverflowing,this.axis.y.isOverflowing=u==="hidden"?!1:this.axis.y.isOverflowing,this.axis.x.forceVisible=this.options.forceVisible==="x"||this.options.forceVisible===!0,this.axis.y.forceVisible=this.options.forceVisible==="y"||this.options.forceVisible===!0,this.hideNativeScrollbar();var g=this.axis.x.isOverflowing?this.scrollbarWidth:0,C=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&h>o-C,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&c>f-g,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},e.getScrollbarSize=function(r){if(r===void 0&&(r="y"),!this.axis[r].isOverflowing)return 0;var i=this.contentEl[this.axis[r].scrollSizeAttr],n=this.axis[r].track.el[this.axis[r].offsetSizeAttr],a,o=n/i;return a=Math.max(~~(o*n),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(a=Math.min(a,this.options.scrollbarMaxSize)),a},e.positionScrollbar=function(r){if(r===void 0&&(r="y"),!!this.axis[r].isOverflowing){var i=this.contentWrapperEl[this.axis[r].scrollSizeAttr],n=this.axis[r].track.el[this.axis[r].offsetSizeAttr],a=parseInt(this.elStyles[this.axis[r].sizeAttr],10),o=this.axis[r].scrollbar,l=this.contentWrapperEl[this.axis[r].scrollOffsetAttr];l=r==="x"&&this.isRtl&&s.getRtlHelpers().isRtlScrollingInverted?-l:l;var u=l/(i-a),c=~~((n-o.size)*u);c=r==="x"&&this.isRtl&&s.getRtlHelpers().isRtlScrollbarInverted?c+(n-o.size):c,o.el.style.transform=r==="x"?"translate3d("+c+"px, 0, 0)":"translate3d(0, "+c+"px, 0)"}},e.toggleTrackVisibility=function(r){r===void 0&&(r="y");var i=this.axis[r].track.el,n=this.axis[r].scrollbar.el;this.axis[r].isOverflowing||this.axis[r].forceVisible?(i.style.visibility="visible",this.contentWrapperEl.style[this.axis[r].overflowAttr]="scroll"):(i.style.visibility="hidden",this.contentWrapperEl.style[this.axis[r].overflowAttr]="hidden"),this.axis[r].isOverflowing?n.style.display="block":n.style.display="none"},e.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},e.onMouseMoveForAxis=function(r){r===void 0&&(r="y"),this.axis[r].track.rect=this.axis[r].track.el.getBoundingClientRect(),this.axis[r].scrollbar.rect=this.axis[r].scrollbar.el.getBoundingClientRect();var i=this.isWithinBounds(this.axis[r].scrollbar.rect);i?this.axis[r].scrollbar.el.classList.add(this.classNames.hover):this.axis[r].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[r].track.rect)?(this.showScrollbar(r),this.axis[r].track.el.classList.add(this.classNames.hover)):this.axis[r].track.el.classList.remove(this.classNames.hover)},e.onMouseLeaveForAxis=function(r){r===void 0&&(r="y"),this.axis[r].track.el.classList.remove(this.classNames.hover),this.axis[r].scrollbar.el.classList.remove(this.classNames.hover)},e.showScrollbar=function(r){r===void 0&&(r="y");var i=this.axis[r].scrollbar.el;this.axis[r].isVisible||(i.classList.add(this.classNames.visible),this.axis[r].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},e.onDragStart=function(r,i){i===void 0&&(i="y");var n=dp(this.el),a=Zn(this.el),o=this.axis[i].scrollbar,l=i==="y"?r.pageY:r.pageX;this.axis[i].dragOffset=l-o.rect[this.axis[i].offsetAttr],this.draggedAxis=i,this.el.classList.add(this.classNames.dragging),n.addEventListener("mousemove",this.drag,!0),n.addEventListener("mouseup",this.onEndDrag,!0),this.removePreventClickId===null?(n.addEventListener("click",this.preventClick,!0),n.addEventListener("dblclick",this.preventClick,!0)):(a.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},e.onTrackClick=function(r,i){var n=this;if(i===void 0&&(i="y"),!!this.options.clickOnTrack){var a=Zn(this.el);this.axis[i].scrollbar.rect=this.axis[i].scrollbar.el.getBoundingClientRect();var o=this.axis[i].scrollbar,l=o.rect[this.axis[i].offsetAttr],u=parseInt(this.elStyles[this.axis[i].sizeAttr],10),c=this.contentWrapperEl[this.axis[i].scrollOffsetAttr],h=i==="y"?this.mouseY-l:this.mouseX-l,f=h<0?-1:1,g=f===-1?c-u:c+u,C=function p(){if(f===-1){if(c>g){var T;c-=n.options.clickOnTrackSpeed,n.contentWrapperEl.scrollTo((T={},T[n.axis[i].offsetAttr]=c,T)),a.requestAnimationFrame(p)}}else if(c<g){var A;c+=n.options.clickOnTrackSpeed,n.contentWrapperEl.scrollTo((A={},A[n.axis[i].offsetAttr]=c,A)),a.requestAnimationFrame(p)}};C()}},e.getContentElement=function(){return this.contentEl},e.getScrollElement=function(){return this.contentWrapperEl},e.getScrollbarWidth=function(){try{return getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display==="none"||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:fb()}catch{return fb()}},e.removeListeners=function(){var r=this,i=Zn(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(n){r.el.removeEventListener(n,r.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(n){r.el.removeEventListener(n,r.onPointerEvent,{capture:!0,passive:!0})}),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),i.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},e.unMount=function(){this.removeListeners(),s.instances.delete(this.el)},e.isWithinBounds=function(r){return this.mouseX>=r.left&&this.mouseX<=r.left+r.width&&this.mouseY>=r.top&&this.mouseY<=r.top+r.height},e.findChild=function(r,i){var n=r.matches||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector;return Array.prototype.filter.call(r.children,function(a){return n.call(a,i)})[0]},s})();zt.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3};zt.instances=new WeakMap;zt.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.prototype.forEach.call(document.querySelectorAll("[data-simplebar]"),function(s){s.getAttribute("data-simplebar")!=="init"&&!zt.instances.has(s)&&new zt(s,Sh(s.attributes))})};zt.removeObserver=function(){this.globalObserver.disconnect()};zt.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),typeof MutationObserver<"u"&&(this.globalObserver=new MutationObserver(zt.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0})),document.readyState==="complete"||document.readyState!=="loading"&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))};zt.handleMutations=function(s){s.forEach(function(e){Array.prototype.forEach.call(e.addedNodes,function(t){t.nodeType===1&&(t.hasAttribute("data-simplebar")?!zt.instances.has(t)&&new zt(t,Sh(t.attributes)):Array.prototype.forEach.call(t.querySelectorAll("[data-simplebar]"),function(r){r.getAttribute("data-simplebar")!=="init"&&!zt.instances.has(r)&&new zt(r,Sh(r.attributes))}))}),Array.prototype.forEach.call(e.removedNodes,function(t){t.nodeType===1&&(t.hasAttribute('[data-simplebar="init"]')?zt.instances.has(t)&&zt.instances.get(t).unMount():Array.prototype.forEach.call(t.querySelectorAll('[data-simplebar="init"]'),function(r){zt.instances.has(r)&&zt.instances.get(r).unMount()}))})})};zt.getOptions=Sh;_v&&zt.initHtmlApi();const nr=B.getComponent("Menu"),G2=nr.prototype.createEl;nr.prototype.createEl=function(){const e=G2.call(this);return this.simpleBar=new zt(this.contentEl(),{autoHide:!1}),e};const W6=nr.prototype.contentEl;nr.prototype.contentEl=function(){return this.simpleBar?this.simpleBar.getContentElement():W6.call(this)};const G6=nr.prototype.dispose;nr.prototype.dispose=function(){this.simpleBar&&(this.simpleBar.unMount(),delete this.simpleBar),G6.call(this)};const K6=nr.prototype.addItem;nr.prototype.addItem=function(e){K6.call(this,e),this.simpleBar.recalculate()};const X6=nr.prototype.lockShowing;nr.prototype.lockShowing=function(){X6.call(this),this.simpleBar.recalculate()};nr.prototype.recalculateScrollBar=function(){this.simpleBar.recalculate()};const Y6=nr.prototype.handleBlur;nr.prototype.handleBlur=function(e){const t=e.relatedTarget||document.activeElement;this.el().contains(t)||Y6.call(this,e)};const pb="cv-active-button",Q6=B.getComponent("Menu"),J6=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},Z6=B.getComponent("Component"),Wo=B.getComponent("MenuButton");let eF=class extends Wo{createMenu(){const e=new Q6(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=B.dom.createEl("li",{className:"vjs-menu-title",innerHTML:J6(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;const r=new Z6(this.player_,{el:t});e.addItem(r)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}};const tF=Wo.prototype.pressButton;Wo.prototype.pressButton=function(){tF.call(this),this.inactivityTimeout=this.player_.cache_.inactivityTimeout,this.player_.cache_.inactivityTimeout=0,this.player_.options_.inactivityTimeout=0};const iF=Wo.prototype.unpressButton;Wo.prototype.unpressButton=function(){iF.call(this),this.player_.cache_.inactivityTimeout=this.inactivityTimeout,this.player_.options_.inactivityTimeout=this.inactivityTimeout,this.player_.reportUserActivity()};Wo.prototype.setActive=function(e){e?this.addClass(pb):this.removeClass(pb)};B.registerComponent("MenuButton",eF);const rF=B.getComponent("Component");class K2 extends rF{buildCSSClass(){return`cv-time-wrapper ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}}K2.prototype.options_={children:["currentTimeDisplay","remainingTimeDisplay"]};B.registerComponent("TimeWrapper",K2);const gl=B.getComponent("SeekBar");let nF=class extends gl{handleMouseDown(e){const t=this.player_.preventScrubbingPlugin();t.isEnabled&&this.getMouseTime(e)>t.furthestVisitedTime||(gl.prototype.handleMouseDown.call(this,e),this.player_.addClass("cv-disable-play-pause-feedback"))}handleMouseMove(e){gl.prototype.handleMouseMove.call(this,e),this.update()}getPercent(){const t=this.player_.currentTime()/this.player_.duration();return t>=1?1:t}handleMouseUp(e){gl.prototype.handleMouseUp.call(this,e),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.player_.removeClass("cv-disable-play-pause-feedback")},500)}clamp(e,t,r){return Math.min(Math.max(e,t),r)}getMouseTime(e){return this.clamp(gl.prototype.calculateDistance.call(this,e).x,0,1)*this.player_.duration()}};B.registerComponent("SeekBar",nF);const sF=B.getComponent("Component");class aF extends sF{buildCSSClass(){return`cv-chapter-bar-load-progress ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}update(e){this.el_.style.width=e*100+"%"}}const oF=B.getComponent("Component");class lF extends oF{buildCSSClass(){return`cv-chapter-bar-play-progress ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}update(e){e>0&&e<1?this.addClass("cv-current"):this.removeClass("cv-current"),this.el_.style.width=e*100+"%"}}const uF=B.getComponent("Component");class mb extends uF{constructor(e,t){super(e,t),this.playProgress=new lF(this.player_),this.addChild(this.playProgress),this.loadProgress=new aF(this.player_),this.addChild(this.loadProgress),this.update(),this.updateBuffered(0)}buildCSSClass(){return`cv-chapter-bar-item ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}getCurrentTime(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}update(){const e=this.player_.duration()||3600,t=this.options_.endTime-this.options_.startTime;if(e!==this.duration_){const i=t/e;this.el_.style.width=i*100+"%";const n=this.options_.startTime/e;this.el_.style.left=n*100+"%",this.duration_=e}const r=this.getCurrentTime();r<this.options_.startTime?this.playProgress.update(0):r>this.options_.endTime?this.playProgress.update(1):this.playProgress.update((r-this.options_.startTime)/t)}updateBuffered(e){const t=this.options_.endTime-this.options_.startTime;e<this.options_.startTime?this.loadProgress.update(0):e>this.options_.endTime?this.loadProgress.update(1):this.loadProgress.update((e-this.options_.startTime)/t)}}function X2(s){const e=s.buffered(),t=s.currentTime();let r=0;for(let i=0;i<e.length;i++){const n=e.start(i),a=e.end(i);if(n<=t&&a>=t){r=a;break}}return r}const cF=B.getComponent("Component");class hF extends cF{buildCSSClass(){return`cv-chapter-bar-items ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}update(){this.children_.forEach(e=>{e.update()})}updateBuffered(){this.children_.forEach(e=>{e.updateBuffered(X2(this.player_))})}}const dF=B.getComponent("SeekBar");class Tv extends dF{constructor(e,t){super(e,t),this.onDurationChange=this.onDurationChange.bind(this),this.createChapterItems=this.createChapterItems.bind(this),this.updateBuffered=this.updateBuffered.bind(this),Zt.useChapters(this.player_,this.createChapterItems),this.player_.on("durationchange",this.onDurationChange),this.player_.on("progress",this.updateBuffered),this.createChapterItems(),this.update()}dispose(){this.player_.off("durationchange",this.onDurationChange),this.player_.off("progress",this.updateBuffered),super.dispose()}createEl(){return B.dom.createEl("div",{className:"vjs-progress-holder cv-chapter-seek-bar"},{"aria-label":this.localize("Progress Bar"),role:"progressbar"})}onDurationChange(){this.createChapterItems(),this.update()}update(){const e=super.update();return this.chapterBarItems&&this.chapterBarItems.update(),e}updateBuffered(){this.chapterBarItems.updateBuffered()}bindUpdateListener(e){const t=()=>{this.createChapterItems(),this.updateBuffered()};e.addEventListener("cv:cuechange",t),this.player_.one("dispose",()=>e.removeEventListener("cv:cuechange",t))}createChapterItems(e){var r,i;e&&(this.track_||this.bindUpdateListener(e),this.track_=e);const t=new hF(this.player_);if((i=(r=this.track_)==null?void 0:r.cues)!=null&&i.length&&!this.options_.ignoreChapters)for(let n=0;n<this.track_.cues.length;n++){const a=this.track_.cues[n],o=a.startTime;let l=a.endTime;const u=this.player_.duration();u&&(n===this.track_.cues.length-1&&a.endTime<this.player_.duration()&&(l=this.player_.duration()),l>u&&(l=u));const c=new mb(this.player_,{startTime:o,endTime:l});if(t.addChild(c),u&&l===u)break}else t.addChild(new mb(this.player_,{startTime:0,endTime:this.player_.duration()||3600}));this.chapterBarItems&&this.removeChild(this.chapterBarItems),this.chapterBarItems=t,this.addChild(this.chapterBarItems)}}Tv.prototype.options_={children:["playProgressBar"],barName:"playProgressBar"};!B.browser.IS_IOS&&!B.browser.IS_ANDROID&&Tv.prototype.options_.children.splice(1,0,"mouseTimeDisplay");B.registerComponent("ChapterSeekBar",Tv);const fF=B.getComponent("ProgressControl"),gb="seekBar";class Y2 extends fF{constructor(){super(...arguments),this.seekBarName_=gb}setSeekBarName(e){this.seekBarName_=e}getChild(e){return(e==null?void 0:e.toLowerCase())===gb.toLowerCase()&&(e=this.seekBarName_),super.getChild(e)}}Y2.prototype.options_={children:[]};B.registerComponent("ProgressControl",Y2);function Q2(s,e=s){s=s<0?0:s;let t=Math.floor(s%60),r=Math.floor(s/60%60),i=Math.floor(s/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(i=r=t="-"),i=i>0||a>0?i+":":"",r=((i||n>=10)&&r<10?"0"+r:r)+":",t=t<10?"0"+t:t,i+r+t}const pF=B.getComponent("TimeTooltip");class mF extends pF{constructor(e,t){super(e,t),this.hasCustomChapterText=!1,Zt.useChapters(this.player_,r=>{this.track_=r})}createEl(){const e=super.createEl();return this.chapter_=B.dom.createEl("div"),e.appendChild(this.chapter_),this.time_=B.dom.createEl("div"),e.appendChild(this.time_),e}updateTime(e){const t=this.player_.duration();if(B.dom.textContent(this.time_,Q2(e,t)),!(!this.track_||this.hasCustomChapterText)){for(let r=0;r<this.track_.cues.length;r++){const i=this.track_.cues[r],n=i.endTime||t;if(i.startTime<=e&&n>=e){B.dom.textContent(this.chapter_,i.text);return}}B.dom.textContent(this.chapter_,"")}}clearChapterContent(){B.dom.textContent(this.chapter_,"")}updateText(e){B.dom.textContent(this.time_,e)}setCustomChapterText(e){this.hasCustomChapterText=!!e,B.dom.textContent(this.chapter_,e??"")}}B.registerComponent("TimeTooltip",mF);const gF=B.getComponent("Component");class bv extends gF{constructor(e,t){super(e,t)}setTrack(e){this.track_=e}createEl(){const e=super.createEl("div",{className:"cv-thumbnail-display"});return this.img_=B.dom.createEl("img"),e.appendChild(this.img_),e}enable(){this.addClass("cv-thumbnail-display-enabled")}disable(){this.removeClass("cv-thumbnail-display-enabled")}parseImageLink(e){const t=e.indexOf("#");if(t===-1)return{src:e,w:0,h:0,x:0,y:0};const r=e.substr(0,t),i=e.substr(t+1);if(i.substr(0,5)!=="xywh=")return{src:e,w:0,h:0,x:0,y:0};const n=this.getScale(),a=i.substr(5).split(",");return{src:r,w:parseInt(a[2])*n,h:parseInt(a[3])*n,x:parseInt(a[0])*n,y:parseInt(a[1])*n}}getScale(){let e=this.options_.scaleFactor;const t=this.player_.whiteboardModePlugin().side;return this.player_.isFullscreen()&&t!=="bottom"&&(e=e*2),e}update(e){var h,f;if(!((f=(h=this.track_)==null?void 0:h.cues)!=null&&f.length))return;const t=e;let r,i=0;for(;i<this.track_.cues.length;){const g=this.track_.cues[i];if(g.startTime<=t&&g.endTime>=t){r=this.parseImageLink(g.text);break}i++}if(!(r!=null&&r.src)){this.disable();return}this.enable();const{src:n,w:a,h:o,x:l,y:u}=r,c=this.getScale();this.img_.src=n,this.img_.style.left=-l+"px",this.img_.style.top=-u+"px",this.img_.style.transformOrigin="0 0",this.img_.style.transform=`scale(${c})`,this.el_.style.width=a+"px",this.el_.style.height=o+"px"}}bv.prototype.options_={scaleFactor:1};B.registerComponent("ThumbnailDisplay",bv);const vF=B.getComponent("MouseTimeDisplay"),vb="cv-mouse-time-display-force-show";class J2 extends vF{constructor(e,t){super(e,t),Zt.useMetadataTrack(this.player_,"thumbnails",r=>{this.getChild("ThumbnailDisplay").setTrack(r)}),this.update=this.update.bind(this),this.player_.on("durationchange",this.update),this.player_.one("dispose",()=>{this.player_.off("durationchange",this.update)})}update(e,t){this.requestAnimationFrame(()=>{const r=this.getChild("TimeTooltip"),i=this.getChild("ThumbnailDisplay"),n=t*this.player_.duration(),a=this.player_.preventScrubbingPlugin(),o=this.player_.controlBar.getChild("progressControl").getChild(_h);let l=!1;a.isEnabled&&(l=n>a.furthestVisitedTime),l?(this.hide(),o.show(),au(o.hide,R2,!1,o)()):(this.show(),o&&o.hide(!0),i.update(n),r.updateTime(n));const u=this.el_.getBoundingClientRect();this.el_.style.marginLeft=-(u.width/2)+"px";const c=e.width*t;c<u.width/2?this.el_.style.left=u.width/2+"px":c>e.width-u.width/2?this.el_.style.left=e.width-u.width/2+"px":this.el_.style.left=e.width*t+"px"})}forceShow(){this.addClass(vb)}removeForceShow(){this.removeClass(vb)}}J2.prototype.options_={children:["ThumbnailDisplay","TimeTooltip"]};B.registerComponent("MouseTimeDisplay",J2);const yb=B.getComponent("ChaptersTrackMenuItem");class yF extends yb{constructor(e,t){super(e,t),this.nonIconControl=!1,this.thumbnailDisplay=new bv(this.player_,{scaleFactor:.5}),this.el().insertBefore(this.thumbnailDisplay.el(),this.el().firstChild),Zt.useMetadataTrack(this.player_,"thumbnails",r=>{this.addClass("cv-has-thumbnails"),this.thumbnailDisplay.setTrack(r),this.thumbnailDisplay.update(this.options_.cue.startTime)})}update(){this.player_&&yb.prototype.update.call(this)}buildCSSClass(){return"vjs-menu-item cv-chapter-menu-item"}createEl(e,t,r){return this.nonIconControl=!0,super.createEl("li",Object.assign({className:this.buildCSSClass(),innerHTML:this.getInnerHTML(),tabIndex:-1},t),r)}getInnerHTML(){const e=this.player_.duration();return`<span class="vjs-menu-item-text cv-chapter-menu-item-text"><p>${this.localize(this.options_.label)}</p><p>(${Q2(this.options_.cue.startTime,e)})</p></span>`}}const _F=B.getComponent("ChaptersButton");class TF extends _F{constructor(e,t,r){super(e,t,r),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.update=this.update.bind(this),this.player_.on("cv-whiteboard-change",this.update),this.player_.on("fullscreenchange",this.update),this.player_.on("dispose",()=>{this.player_.off("cv-whiteboard-change",this.update),this.player_.off("fullscreenchange",this.update)})}buildCSSClass(){return`cv-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`cv-menu-big ${super.buildWrapperCSSClass()}`}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t||t.length<2)return e;for(let r=0,i=t.length;r<i;r++){const n=t[r],a=new yF(this.player_,{track:this.track_,cue:n});e.push(a)}return e}setTrack(e){if(super.setTrack(e),this.track_&&this.track_.kind==="chapters"){e.one("loadeddata",this.update);const t=()=>{this.update(),this.player_.trigger("resizemenus")};e.on("cv:cuechange",t),this.player_.one("dispose",()=>e.off("cv:cueupdate",t))}}update(e){super.update(e)}getCollabsibleName(){return"Chapters"}getCollabsibleValue(){const e=this.track_.activeCues[0];return(e==null?void 0:e.text)||""}showInCollabsibleMenu(){if(!this.track_)return!1;const e=this.track_.cues;return!(!e||!e.length)}showCollapsibleMenu(){this.handleClick(null)}}B.registerComponent("ChaptersButton",TF);const _b=B.getComponent("OffTextTrackMenuItem");let bF=class extends _b{handleClick(e){_b.prototype.handleClick.call(this,e),this.player_.trigger("cv:languageselected")}createEl(e,t,r){return super.createEl("li",{className:"vjs-menu-item",tabIndex:-1,...t,innerHTML:'<span class="vjs-menu-item-text">Off</span>'},r)}};B.registerComponent("OffTextTrackMenuItem",bF);const SF=B.getComponent("TextTrackButton"),CF=B.getComponent("TextTrackMenuItem"),EF=B.getComponent("OffTextTrackMenuItem");let wF=class extends SF{createItems(e=[],t=CF){let r;this.label_&&(r=`${this.label_} off`),e.push(new EF(this.player_,{kinds:this.kinds_,kind:this.kind_,label:r})),this.hideThreshold_+=1;const i=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<i.length;n++){const a=i[n];if(this.kinds_.indexOf(a.kind)>-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return this.player().trigger("resizemenus"),e}};B.registerComponent("TextTrackButton",wF);const Tb=B.getComponent("SubsCapsMenuItem");class kF extends Tb{handleClick(e){Tb.prototype.handleClick.call(this,e),this.player_.trigger("cv:languageselected")}}const xF=B.getComponent("TextTrackMenuItem");class AF extends xF{constructor(e){const t={};t.track={player:e,kind:"subtitle",label:"Search Captions",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="SubtitleSearchMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.addClass("cv-subtitle-search-menu-item"),this.controlText(", opens subtitle search"),this.toggleEnabled=this.toggleEnabled.bind(this);const r=this.player_.textTracks();r.addEventListener("selectedlanguagechange",this.toggleEnabled),this.player_.one("dispose",()=>{r.removeEventListener("selectedlanguagechange",this.toggleEnabled)}),this.toggleEnabled()}toggleEnabled(){var t;if(!this.player_)return;const e=Zt.getCurrentTextTrack(this.player_);if(!e){this.addClass("vjs-disabled");return}(t=e.cues)!=null&&t.length?this.removeClass("vjs-disabled"):(this.bindTrackEvents(e),this.addClass("vjs-disabled"))}bindTrackEvents(e){e.removeEventListener("loadeddata",this.toggleEnabled),e.addEventListener("loadeddata",this.toggleEnabled),this.player_.one("dispose",()=>{e.removeEventListener("loadeddata",this.toggleEnabled)})}handleClick(){var t;const e=Zt.getCurrentTextTrack(this.player_);(t=e==null?void 0:e.cues)!=null&&t.length&&this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("subtitleSearchButton").showCollapsibleMenu()})}}const IF=B.getComponent("TextTrackMenuItem");class PF extends IF{constructor(e){const t={};t.track={player:e,kind:"subtitle",label:"Caption Text Size",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="SubtitleSizeMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.addClass("cv-divider-after-menu-item"),this.addClass("cv-subtitle-size-menu-item"),this.controlText(", opens subtitle size settings")}handleClick(){this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("subtitleSizeButton").showCollapsibleMenu()})}}class DF extends t0{constructor(e){super(e)}get name(){return"FormatError"}}const NF={englishName:"Afar",nativeName:"Qafar"},LF={englishName:"Afrikaans",nativeName:"Afrikaans"},OF={englishName:"Aghem",nativeName:"Aghem"},MF={englishName:"Akan",nativeName:"Akan"},RF={englishName:"Amharic",nativeName:"�� ማáˆáŠ›"},BF={englishName:"Arabic",nativeName:"العربية"},FF={englishName:"Mapudungun",nativeName:"Mapudungun"},UF={englishName:"Assamese",nativeName:"অসমীয়া"},$F={englishName:"Asu",nativeName:"Kipare"},jF={englishName:"Asturian",nativeName:"asturianu"},VF={englishName:"Azerbaijani",nativeName:"azÉ™rbaycan dili"},HF={englishName:"Bashkir",nativeName:"Башҡорт"},qF={englishName:"Basaa",nativeName:"Æï¿½ s� a"},zF={englishName:"Belarusian",nativeName:"БеларуÑкаÑ"},WF={englishName:"Bemba",nativeName:"Ichibemba"},GF={englishName:"Bena",nativeName:"Hibena"},KF={englishName:"Bulgarian",nativeName:"българÑки"},XF={englishName:"Edo",nativeName:"Ẹ̀dó"},YF={englishName:"Bamanankan",nativeName:"bamanakan"},QF={englishName:"Bangla",nativeName:"বাংলা"},JF={englishName:"Tibetan",nativeName:"བོད་ཡིག"},ZF={englishName:"Breton",nativeName:"brezhoneg"},eU={englishName:"Bodo",nativeName:"बड़ो"},tU={englishName:"Bosnian",nativeName:"bosanski"},iU={englishName:"Blin",nativeName:"ብሊን"},rU={englishName:"Catalan",nativeName:"catal� "},nU={englishName:"Chechen",nativeName:"нохчийн"},sU={englishName:"Chiga",nativeName:"Rukiga"},aU={englishName:"Cherokee",nativeName:"á£áŽ³áŽ©"},oU={englishName:"Corsican",nativeName:"Corsu"},lU={englishName:"Czech",nativeName:"ÄeÅ¡tina"},uU={englishName:"Church Slavic",nativeName:"церковноÑловеÌнÑкїй"},cU={englishName:"Welsh",nativeName:"Cymraeg"},hU={englishName:"Danish",nativeName:"dansk"},dU={englishName:"Taita",nativeName:"Kitaita"},fU={englishName:"German",nativeName:"Deutsch"},pU={englishName:"Zarma",nativeName:"Zarmaciine"},mU={englishName:"Lower Sorbian",nativeName:"dolnoserbšćina"},gU={englishName:"Duala",nativeName:"duálá"},vU={englishName:"Divehi",nativeName:"Þ‹Þ¨ÞˆÞ¬Þ€Þ¨Þ„Þ¦ÞÞ°"},yU={englishName:"Jola-Fonyi",nativeName:"joola"},_U={englishName:"Dzongkha",nativeName:"རྫོང་à½"},TU={englishName:"Embu",nativeName:"KÄ©embu"},bU={englishName:"Ewe",nativeName:"EÊ‹egbe"},SU={englishName:"Greek",nativeName:"Ελληνικά"},CU={englishName:"English",nativeName:"English"},EU={englishName:"Esperanto",nativeName:"esperanto"},wU={englishName:"Spanish",nativeName:"español"},kU={englishName:"Estonian",nativeName:"eesti"},xU={englishName:"Basque",nativeName:"euskara"},AU={englishName:"Ewondo",nativeName:"ewondo"},IU={englishName:"Persian",nativeName:"ÙØ§Ø±Ø³Ù‰"},PU={englishName:"Fulah",nativeName:"Fulah"},DU={englishName:"Finnish",nativeName:"suomi"},NU={englishName:"Filipino",nativeName:"Filipino"},LU={englishName:"Faroese",nativeName:"føroyskt"},OU={englishName:"French",nativeName:"français"},MU={englishName:"Friulian",nativeName:"furlan"},RU={englishName:"Western Frisian",nativeName:"Frysk"},BU={englishName:"Irish",nativeName:"Gaeilge"},FU={englishName:"Scottish Gaelic",nativeName:"G� idhlig"},UU={englishName:"Galician",nativeName:"galego"},$U={englishName:"Guarani",nativeName:"Avañe’ẽ"},jU={englishName:"Alsatian",nativeName:"Elsässisch"},VU={englishName:"Gujarati",nativeName:"ગà«àªœàª°àª¾àª¤à«€"},HU={englishName:"Gusii",nativeName:"Ekegusii"},qU={englishName:"Manx",nativeName:"Gaelg"},zU={englishName:"Hausa",nativeName:"Hausa"},WU={englishName:"Hawaiian",nativeName:"ʻŌlelo HawaiÊ»i"},GU={englishName:"Hebrew",nativeName:"עברית"},KU={englishName:"Hindi",nativeName:"हिंदी"},XU={englishName:"Croatian",nativeName:"hrvatski"},YU={englishName:"Upper Sorbian",nativeName:"hornjoserbšćina"},QU={englishName:"Hungarian",nativeName:"magyar"},JU={englishName:"Armenian",nativeName:"Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶"},ZU={englishName:"Interlingua",nativeName:"interlingua"},e7={englishName:"Ibibio",nativeName:"Ibibio-Efik"},t7={englishName:"Indonesian",nativeName:"Indonesia"},i7={englishName:"Igbo",nativeName:"Igbo"},r7={englishName:"Yi",nativeName:"ꆈ�� ê±ê‚·"},n7={englishName:"Icelandic",nativeName:"Ãslenska"},s7={englishName:"Italian",nativeName:"italiano"},a7={englishName:"Inuktitut",nativeName:"Inuktitut"},o7={englishName:"Japanese",nativeName:"日本語"},l7={englishName:"Ngomba",nativeName:"Ndaꞌa"},u7={englishName:"Machame",nativeName:"Kimachame"},c7={englishName:"Javanese",nativeName:"Basa Jawa"},h7={englishName:"Georgian",nativeName:"ქáƒï¿½ï¿½ თული"},d7={englishName:"Kabyle",nativeName:"Taqbaylit"},f7={englishName:"Kamba",nativeName:"Kikamba"},p7={englishName:"Makonde",nativeName:"Chimakonde"},m7={englishName:"Kabuverdianu",nativeName:"kabuverdianu"},g7={englishName:"Koyra Chiini",nativeName:"Koyra ciini"},v7={englishName:"Kikuyu",nativeName:"Gikuyu"},y7={englishName:"Kazakh",nativeName:"қазақ тілі"},_7={englishName:"Kako",nativeName:"kakÉ”"},T7={englishName:"Greenlandic",nativeName:"kalaallisut"},b7={englishName:"Kalenjin",nativeName:"Kalenjin"},S7={englishName:"Khmer",nativeName:"ភាសាážáŸ’មែរ"},C7={englishName:"Kannada",nativeName:"ಕನà³à²¨à²¡"},E7={englishName:"Korean",nativeName:"한êµì–´"},w7={englishName:"Konkani",nativeName:"कोंकणी"},k7={englishName:"Kanuri",nativeName:"Kanuri"},x7={englishName:"Kashmiri",nativeName:"Ú©Ù²Ø´ÙØ±"},A7={englishName:"Shambala",nativeName:"Kishambaa"},I7={englishName:"Bafia",nativeName:"rikpa"},P7={englishName:"Ripuarian",nativeName:"Kölsch"},D7={englishName:"Central Kurdish",nativeName:"کوردیی ناوەڕاست"},N7={englishName:"Cornish",nativeName:"kernewek"},L7={englishName:"Kyrgyz",nativeName:"Кыргыз"},O7={englishName:"Latin",nativeName:"lingua latÄ«na"},M7={englishName:"Langi",nativeName:"Kɨlaangi"},R7={englishName:"Luxembourgish",nativeName:"Lëtzebuergesch"},B7={englishName:"Ganda",nativeName:"Luganda"},F7={englishName:"Lakota",nativeName:"Lakȟólʼiyapi"},U7={englishName:"Lingala",nativeName:"lingála"},$7={englishName:"Lao",nativeName:"ລາວ"},j7={englishName:"Northern Luri",nativeName:"لۊری شومالی"},V7={englishName:"Lithuanian",nativeName:"lietuvių"},H7={englishName:"Luba-Katanga",nativeName:"Tshiluba"},q7={englishName:"Luo",nativeName:"Dholuo"},z7={englishName:"Luyia",nativeName:"Luluhia"},W7={englishName:"Latvian",nativeName:"latvieÅ¡u"},G7={englishName:"Masai",nativeName:"Maa"},K7={englishName:"Meru",nativeName:"KÄ©mÄ©rÅ©"},X7={englishName:"Morisyen",nativeName:"kreol morisien"},Y7={englishName:"Malagasy",nativeName:"Malagasy"},Q7={englishName:"Makhuwa-Meetto",nativeName:"Makua"},J7={englishName:"Metaʼ",nativeName:"metaʼ"},Z7={englishName:"Maori",nativeName:"Reo MÄori"},e$={englishName:"Macedonian",nativeName:"македонÑки"},t$={englishName:"Malayalam",nativeName:"മലയാളം"},i$={englishName:"Mongolian",nativeName:"Монгол Ñ…Ñл"},r$={englishName:"Manipuri",nativeName:"মৈতৈলোনà§"},n$={englishName:"Mohawk",nativeName:"Kanien’kéha"},s$={englishName:"Marathi",nativeName:"मरा�� ी"},a$={englishName:"Malay",nativeName:"Bahasa Melayu"},o$={englishName:"Maltese",nativeName:"Malti"},l$={englishName:"Mundang",nativeName:"MUNDAÅŠ"},u$={englishName:"Burmese",nativeName:"ဗမာ"},c$={englishName:"Mazanderani",nativeName:"مازرونی"},h$={englishName:"Nama",nativeName:"Khoekhoegowab"},d$={englishName:"Norwegian BokmÃ¥l",nativeName:"norsk bokmÃ¥l"},f$={englishName:"North Ndebele",nativeName:"isiNdebele"},p$={englishName:"Nepali",nativeName:"नेपाली"},m$={englishName:"Dutch",nativeName:"Nederlands"},g$={englishName:"Kwasio",nativeName:"Kwasio"},v$={englishName:"Norwegian Nynorsk",nativeName:"nynorsk"},y$={englishName:"Ngiemboon",nativeName:"Shwóŋò ngiembɔɔn"},_$={englishName:"Norwegian",nativeName:"norsk"},T$={englishName:"N'ko",nativeName:"ß’ßžß"},b$={englishName:"South Ndebele",nativeName:"isiNdebele"},S$={englishName:"Sesotho sa Leboa",nativeName:"Sesotho sa Leboa"},C$={englishName:"Nuer",nativeName:"Thok Nath"},E$={englishName:"Nyankole",nativeName:"Runyankore"},w$={englishName:"Occitan",nativeName:"Occitan"},k$={englishName:"Oromo",nativeName:"Oromoo"},x$={englishName:"Odia",nativeName:"ଓàœà¬¿à¬†"},A$={englishName:"Ossetian",nativeName:"Ирон æвзаг"},I$={englishName:"Punjabi",nativeName:"ਪੰਜਾਬੀ"},P$={englishName:"Papiamento",nativeName:"Papiamentu"},D$={englishName:"Polish",nativeName:"polski"},N$={englishName:"Prussian",nativeName:"prÅ«siskan"},L$={englishName:"Dari",nativeName:"درى"},O$={englishName:"Pashto",nativeName:"پښتو"},M$={englishName:"Portuguese",nativeName:"português"},R$={englishName:"K'iche'",nativeName:"K'iche'"},B$={englishName:"Quechua",nativeName:"runasimi"},F$={englishName:"Romansh",nativeName:"rumantsch"},U$={englishName:"Rundi",nativeName:"Ikirundi"},$$={englishName:"Romanian",nativeName:"română"},j$={englishName:"Rombo",nativeName:"Kihorombo"},V$={englishName:"Russian",nativeName:"руÑÑкий"},H$={englishName:"Kinyarwanda",nativeName:"Kinyarwanda"},q$={englishName:"Rwa",nativeName:"Kiruwa"},z$={englishName:"Sanskrit",nativeName:"संसà¥à¤•ृत"},W$={englishName:"Sakha",nativeName:"Саха"},G$={englishName:"Samburu",nativeName:"Kisampur"},K$={englishName:"Sangu",nativeName:"Ishisangu"},X$={englishName:"Sindhi",nativeName:"سنڌي"},Y$={englishName:"Northern Sami",nativeName:"davvisámegiella"},Q$={englishName:"Sena",nativeName:"sena"},J$={englishName:"Koyraboro Senni",nativeName:"Koyraboro senni"},Z$={englishName:"Sango",nativeName:"Sängö"},e9={englishName:"Tachelhit",nativeName:"ⵜⴰⵛâµâµƒâµ‰âµœ"},t9={englishName:"Sinhala",nativeName:"සිංහල"},i9={englishName:"Slovak",nativeName:"slovenÄina"},r9={englishName:"Slovenian",nativeName:"slovenÅ¡Äina"},n9={englishName:"Sami (Southern)",nativeName:"Ã¥arjelsaemiengïele"},s9={englishName:"Sami (Lule)",nativeName:"julevusámegiella"},a9={englishName:"Sami (Inari)",nativeName:"anarâškielâ"},o9={englishName:"Sami (Skolt)",nativeName:"sää´mÇ©iõll"},l9={englishName:"Shona",nativeName:"chiShona"},u9={englishName:"Somali",nativeName:"Soomaali"},c9={englishName:"Albanian",nativeName:"shqip"},h9={englishName:"Serbian",nativeName:"srpski"},d9={englishName:"siSwati",nativeName:"Siswati"},f9={englishName:"Saho",nativeName:"Saho"},p9={englishName:"Sesotho",nativeName:"Sesotho"},m9={englishName:"Swedish",nativeName:"svenska"},g9={englishName:"Kiswahili",nativeName:"Kiswahili"},v9={englishName:"Syriac",nativeName:"ܣܘܪÜÜÜ"},y9={englishName:"Tamil",nativeName:"தமிழà¯"},_9={englishName:"Telugu",nativeName:"తెలà±à°—à±"},T9={englishName:"Teso",nativeName:"Kiteso"},b9={englishName:"Tajik",nativeName:"Тоҷикӣ"},S9={englishName:"Thai",nativeName:"ไทย"},C9={englishName:"Tigrinya",nativeName:"ትáŒáˆáŠ›"},E9={englishName:"Tigre",nativeName:"ትáŒáˆ¨"},w9={englishName:"Turkmen",nativeName:"Türkmen dili"},k9={englishName:"Setswana",nativeName:"Setswana"},x9={englishName:"Tongan",nativeName:"lea fakatonga"},A9={englishName:"Turkish",nativeName:"Türkçe"},I9={englishName:"Tsonga",nativeName:"Xitsonga"},P9={englishName:"Tatar",nativeName:"Татар"},D9={englishName:"Tasawaq",nativeName:"Tasawaq senni"},N9={englishName:"Central Atlas Tamazight",nativeName:"TamaziÉ£t n laá¹laá¹£"},L9={englishName:"Uyghur",nativeName:"ئۇيغۇرچە"},O9={englishName:"Ukrainian",nativeName:"українÑька"},M9={englishName:"Urdu",nativeName:"Ø§ÙØ±Ø¯Ùˆ"},R9={englishName:"Uzbek",nativeName:"o‘zbek"},B9={englishName:"Vai",nativeName:"ꕙꔤ"},F9={englishName:"Venda",nativeName:"Tshivenḓa"},U9={englishName:"Vietnamese",nativeName:"TiêÌng Việt"},$9={englishName:"Volapük",nativeName:"Volapük"},j9={englishName:"Vunjo",nativeName:"Kyivunjo"},V9={englishName:"Walser",nativeName:"Walser"},H9={englishName:"Wolaytta",nativeName:"ወላá‹á‰³á‰±"},q9={englishName:"Wolof",nativeName:"Wolof"},z9={englishName:"isiXhosa",nativeName:"isiXhosa"},W9={englishName:"Soga",nativeName:"Olusoga"},G9={englishName:"Yangben",nativeName:"nuasue"},K9={englishName:"Yiddish",nativeName:"ייִדיש"},X9={englishName:"Yoruba",nativeName:"Èdè Yorùbá"},Y9={englishName:"Standard Moroccan Tamazight",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ"},Q9={englishName:"Chinese",nativeName:"䏿–‡"},J9={englishName:"isiZulu",nativeName:"isiZulu"},Dm={aa:NF,"aa-dj":{englishName:"Afar (Djibouti)",nativeName:"Qafar (Yabuuti)"},"aa-er":{englishName:"Afar (Eritrea)",nativeName:"Qafar (Eretria)"},"aa-et":{englishName:"Afar (Ethiopia)",nativeName:"Qafar (Otobbia)"},af:LF,"af-na":{englishName:"Afrikaans (Namibia)",nativeName:"Afrikaans (Namibië)"},"af-za":{englishName:"Afrikaans (South Africa)",nativeName:"Afrikaans (Suid-Afrika)"},agq:OF,"agq-cm":{englishName:"Aghem (Cameroon)",nativeName:"Aghem (K� m� lûŋ)"},ak:MF,"ak-gh":{englishName:"Akan (Ghana)",nativeName:"Akan (Gaana)"},am:RF,"am-et":{englishName:"Amharic (Ethiopia)",nativeName:"�� ማáˆáŠ› (ኢትዮጵያ)"},ar:BF,"ar-001":{englishName:"Arabic (World)",nativeName:"العربية (العالم)"},"ar-ae":{englishName:"Arabic (United Arab Emirates)",nativeName:"العربية (الإمارات العربية Ø§Ù„Ù…ØªØØ¯Ø©)"},"ar-bh":{englishName:"Arabic (Bahrain)",nativeName:"العربية (Ø§Ù„Ø¨ØØ±ÙŠÙ†)"},"ar-dj":{englishName:"Arabic (Djibouti)",nativeName:"العربية (جيبوتي)"},"ar-dz":{englishName:"Arabic (Algeria)",nativeName:"العربية (الجزائر)"},"ar-eg":{englishName:"Arabic (Egypt)",nativeName:"العربية (مصر)"},"ar-er":{englishName:"Arabic (Eritrea)",nativeName:"العربية (إريتريا)"},"ar-il":{englishName:"Arabic (Israel)",nativeName:"العربية (إسرائيل)"},"ar-iq":{englishName:"Arabic (Iraq)",nativeName:"العربية (العراق)"},"ar-jo":{englishName:"Arabic (Jordan)",nativeName:"العربية (الأردن)"},"ar-km":{englishName:"Arabic (Comoros)",nativeName:"العربية (جزر القمر)"},"ar-kw":{englishName:"Arabic (Kuwait)",nativeName:"العربية (الكويت)"},"ar-lb":{englishName:"Arabic (Lebanon)",nativeName:"العربية (لبنان)"},"ar-ly":{englishName:"Arabic (Libya)",nativeName:"العربية (ليبيا)"},"ar-ma":{englishName:"Arabic (Morocco)",nativeName:"العربية (المملكة المغربية)"},"ar-mr":{englishName:"Arabic (Mauritania)",nativeName:"العربية (موريتانيا)"},"ar-om":{englishName:"Arabic (Oman)",nativeName:"العربية (عمان)"},"ar-ps":{englishName:"Arabic (Palestinian Authority)",nativeName:"العربية (السلطة الÙلسطينية)"},"ar-qa":{englishName:"Arabic (Qatar)",nativeName:"العربية (قطر)"},"ar-sa":{englishName:"Arabic (Saudi Arabia)",nativeName:"العربية (المملكة العربية السعودية)"},"ar-sd":{englishName:"Arabic (Sudan)",nativeName:"العربية (السودان)"},"ar-so":{englishName:"Arabic (Somalia)",nativeName:"العربية (الصومال)"},"ar-ss":{englishName:"Arabic (South Sudan)",nativeName:"العربية (جنوب السودان)"},"ar-sy":{englishName:"Arabic (Syria)",nativeName:"العربية (سوريا)"},"ar-td":{englishName:"Arabic (Chad)",nativeName:"العربية (تشاد)"},"ar-tn":{englishName:"Arabic (Tunisia)",nativeName:"العربية (تونس)"},"ar-ye":{englishName:"Arabic (Yemen)",nativeName:"العربية (اليمن)"},arn:FF,"arn-cl":{englishName:"Mapudungun (Chile)",nativeName:"Mapudungun (Chile)"},as:UF,"as-in":{englishName:"Assamese (India)",nativeName:"অসমীয়া (à¦à¦¾à§°à¦¤)"},asa:$F,"asa-tz":{englishName:"Asu (Tanzania)",nativeName:"Kipare (Tadhania)"},ast:jF,"ast-es":{englishName:"Asturian (Spain)",nativeName:"asturianu (España)"},az:VF,"az-cyrl":{englishName:"Azerbaijani (Cyrillic)",nativeName:"Ðзәрбајҹан дили"},"az-cyrl-az":{englishName:"Azerbaijani (Cyrillic, Azerbaijan)",nativeName:"Ðзәрбајҹан дили (Ðзәрбајҹан)"},"az-latn":{englishName:"Azerbaijani (Latin)",nativeName:"AzÉ™rbaycan dili"},"az-latn-az":{englishName:"Azerbaijani (Latin, Azerbaijan)",nativeName:"AzÉ™rbaycan dili (AzÉ™rbaycan)"},ba:HF,"ba-ru":{englishName:"Bashkir (Russia)",nativeName:"Башҡорт (� Ó™Ñәй)"},bas:qF,"bas-cm":{englishName:"Basaa (Cameroon)",nativeName:"Æï¿½ s� a (K� mɛ̀rûn)"},be:zF,"be-by":{englishName:"Belarusian (Belarus)",nativeName:"БеларуÑÐºÐ°Ñ (БеларуÑÑŒ)"},bem:WF,"bem-zm":{englishName:"Bemba (Zambia)",nativeName:"Ichibemba (Zambia)"},bez:GF,"bez-tz":{englishName:"Bena (Tanzania)",nativeName:"Hibena (Hutanzania)"},bg:KF,"bg-bg":{englishName:"Bulgarian (Bulgaria)",nativeName:"българÑки (БългариÑ)"},bin:XF,"bin-ng":{englishName:"Edo (Nigeria)",nativeName:"Ẹ̀dó (Nigeria)"},bm:YF,"bm-latn":{englishName:"Bamanankan (Latin)",nativeName:"bamanakan"},"bm-latn-ml":{englishName:"Bamanankan (Latin, Mali)",nativeName:"bamanakan (Mali)"},bn:QF,"bn-bd":{englishName:"Bangla (Bangladesh)",nativeName:"বাংলা (বাংলাদেশ)"},"bn-in":{englishName:"Bangla (India)",nativeName:"বাংলা (à¦à¦¾à¦°à¦¤)"},bo:JF,"bo-cn":{englishName:"Tibetan (China)",nativeName:"བོད་ཡིག (ཀྲུང་ཧà¾à¼‹à½˜à½²à¼‹à½‘མངས་སྤྱི་མà½à½´à½“་རྒྱལ་à½à½–à¼)"},"bo-in":{englishName:"Tibetan (India)",nativeName:"བོད་སà¾à½‘་ (རྒྱ་གར་)"},br:ZF,"br-fr":{englishName:"Breton (France)",nativeName:"brezhoneg (Frañs)"},brx:eU,"brx-in":{englishName:"Bodo (India)",nativeName:"बड़ो (à¤à¤¾à¤°à¤¤)"},bs:tU,"bs-cyrl":{englishName:"Bosnian (Cyrillic)",nativeName:"боÑанÑки"},"bs-cyrl-ba":{englishName:"Bosnian (Cyrillic, Bosnia and Herzegovina)",nativeName:"боÑанÑки (БоÑна и Херцеговина)"},"bs-latn":{englishName:"Bosnian (Latin)",nativeName:"bosanski"},"bs-latn-ba":{englishName:"Bosnian (Latin, Bosnia and Herzegovina)",nativeName:"bosanski (Bosna i Hercegovina)"},byn:iU,"byn-er":{englishName:"Blin (Eritrea)",nativeName:"ብሊን (ኤáˆá‰µáˆ«)"},ca:rU,"ca-ad":{englishName:"Catalan (Andorra)",nativeName:"catal� (Andorra)"},"ca-es":{englishName:"Catalan (Catalan)",nativeName:"catal� (catal� )"},"ca-es-valencia":{englishName:"Valencian (Spain)",nativeName:"valenci� (Espanya)"},"ca-fr":{englishName:"Catalan (France)",nativeName:"catal� (França)"},"ca-it":{englishName:"Catalan (Italy)",nativeName:"catal� (It� lia)"},ce:nU,"ce-ru":{englishName:"Chechen (Russia)",nativeName:"нохчийн (� оÑÑи)"},cgg:sU,"cgg-ug":{englishName:"Chiga (Uganda)",nativeName:"Rukiga (Uganda)"},chr:aU,"chr-cher":{englishName:"Cherokee",nativeName:"á£áŽ³áŽ©"},"chr-cher-us":{englishName:"Cherokee (Cherokee)",nativeName:"á£áŽ³áŽ© (á£áŽ³áŽ©)"},co:oU,"co-fr":{englishName:"Corsican (France)",nativeName:"Corsu (Francia)"},cs:lU,"cs-cz":{englishName:"Czech (Czech Republic)",nativeName:"ÄeÅ¡tina (ÄŒeská republika)"},cu:uU,"cu-ru":{englishName:"Church Slavic (Russia)",nativeName:"церковноÑловеÌнÑкїй (рѡÑÑÑ–Ìа)"},cy:cU,"cy-gb":{englishName:"Welsh (United Kingdom)",nativeName:"Cymraeg (Y Deyrnas Unedig)"},da:hU,"da-dk":{englishName:"Danish (Denmark)",nativeName:"dansk (Danmark)"},"da-gl":{englishName:"Danish (Greenland)",nativeName:"dansk (Grønland)"},dav:dU,"dav-ke":{englishName:"Taita (Kenya)",nativeName:"Kitaita (Kenya)"},de:fU,"de-at":{englishName:"German (Austria)",nativeName:"Deutsch (Österreich)"},"de-be":{englishName:"German (Belgium)",nativeName:"Deutsch (Belgien)"},"de-ch":{englishName:"German (Switzerland)",nativeName:"Deutsch (Schweiz)"},"de-de":{englishName:"German (Germany)",nativeName:"Deutsch (Deutschland)"},"de-li":{englishName:"German (Liechtenstein)",nativeName:"Deutsch (Liechtenstein)"},"de-lu":{englishName:"German (Luxembourg)",nativeName:"Deutsch (Luxemburg)"},dje:pU,"dje-ne":{englishName:"Zarma (Niger)",nativeName:"Zarmaciine (Nižer)"},dsb:mU,"dsb-de":{englishName:"Lower Sorbian (Germany)",nativeName:"dolnoserbšćina (Nimska)"},dua:gU,"dua-cm":{englishName:"Duala (Cameroon)",nativeName:"duálá (Cameroun)"},dv:vU,"dv-mv":{englishName:"Divehi (Maldives)",nativeName:"Þ‹Þ¨ÞˆÞ¬Þ€Þ¨Þ„Þ¦ÞÞ° (Þ‹Þ¨ÞˆÞ¬Þ€Þ¨ ÞƒÞ§Þ‡Þ°Þ–Þ¬)"},dyo:yU,"dyo-sn":{englishName:"Jola-Fonyi (Senegal)",nativeName:"joola (Senegal)"},dz:_U,"dz-bt":{englishName:"Dzongkha (Bhutan)",nativeName:"རྫོང་འ(�� བྲུག)"},ebu:TU,"ebu-ke":{englishName:"Embu (Kenya)",nativeName:"KÄ©embu (Kenya)"},ee:bU,"ee-gh":{englishName:"Ewe (Ghana)",nativeName:"EÊ‹egbe (Ghana nutome)"},"ee-tg":{englishName:"Ewe (Togo)",nativeName:"EÊ‹egbe (Togo nutome)"},el:SU,"el-cy":{englishName:"Greek (Cyprus)",nativeName:"Ελληνικά (ΚÏÏ€Ïος)"},"el-gr":{englishName:"Greek (Greece)",nativeName:"Ελληνικά (Ελλάδα)"},en:CU,"en-001":{englishName:"English (World)",nativeName:"English (World)"},"en-029":{englishName:"English (Caribbean)",nativeName:"English (Caribbean)"},"en-150":{englishName:"English (Europe)",nativeName:"English (Europe)"},"en-ag":{englishName:"English (Antigua and Barbuda)",nativeName:"English (Antigua and Barbuda)"},"en-ai":{englishName:"English (Anguilla)",nativeName:"English (Anguilla)"},"en-as":{englishName:"English (American Samoa)",nativeName:"English (American Samoa)"},"en-at":{englishName:"English (Austria)",nativeName:"English (Austria)"},"en-au":{englishName:"English (Australia)",nativeName:"English (Australia)"},"en-bb":{englishName:"English (Barbados)",nativeName:"English (Barbados)"},"en-be":{englishName:"English (Belgium)",nativeName:"English (Belgium)"},"en-bi":{englishName:"English (Burundi)",nativeName:"English (Burundi)"},"en-bm":{englishName:"English (Bermuda)",nativeName:"English (Bermuda)"},"en-bs":{englishName:"English (Bahamas)",nativeName:"English (Bahamas)"},"en-bw":{englishName:"English (Botswana)",nativeName:"English (Botswana)"},"en-bz":{englishName:"English (Belize)",nativeName:"English (Belize)"},"en-ca":{englishName:"English (Canada)",nativeName:"English (Canada)"},"en-cc":{englishName:"English (Cocos (Keeling) Islands)",nativeName:"English (Cocos (Keeling) Islands)"},"en-ch":{englishName:"English (Switzerland)",nativeName:"English (Switzerland)"},"en-ck":{englishName:"English (Cook Islands)",nativeName:"English (Cook Islands)"},"en-cm":{englishName:"English (Cameroon)",nativeName:"English (Cameroon)"},"en-cx":{englishName:"English (Christmas Island)",nativeName:"English (Christmas Island)"},"en-cy":{englishName:"English (Cyprus)",nativeName:"English (Cyprus)"},"en-de":{englishName:"English (Germany)",nativeName:"English (Germany)"},"en-dk":{englishName:"English (Denmark)",nativeName:"English (Denmark)"},"en-dm":{englishName:"English (Dominica)",nativeName:"English (Dominica)"},"en-er":{englishName:"English (Eritrea)",nativeName:"English (Eritrea)"},"en-fi":{englishName:"English (Finland)",nativeName:"English (Finland)"},"en-fj":{englishName:"English (Fiji)",nativeName:"English (Fiji)"},"en-fk":{englishName:"English (Falkland Islands)",nativeName:"English (Falkland Islands)"},"en-fm":{englishName:"English (Micronesia)",nativeName:"English (Micronesia)"},"en-gb":{englishName:"English (United Kingdom)",nativeName:"English (United Kingdom)"},"en-gd":{englishName:"English (Grenada)",nativeName:"English (Grenada)"},"en-gg":{englishName:"English (Guernsey)",nativeName:"English (Guernsey)"},"en-gh":{englishName:"English (Ghana)",nativeName:"English (Ghana)"},"en-gi":{englishName:"English (Gibraltar)",nativeName:"English (Gibraltar)"},"en-gm":{englishName:"English (Gambia)",nativeName:"English (Gambia)"},"en-gu":{englishName:"English (Guam)",nativeName:"English (Guam)"},"en-gy":{englishName:"English (Guyana)",nativeName:"English (Guyana)"},"en-hk":{englishName:"English (Hong Kong SAR)",nativeName:"English (Hong Kong SAR)"},"en-id":{englishName:"English (Indonesia)",nativeName:"English (Indonesia)"},"en-ie":{englishName:"English (Ireland)",nativeName:"English (Ireland)"},"en-il":{englishName:"English (Israel)",nativeName:"English (Israel)"},"en-im":{englishName:"English (Isle of Man)",nativeName:"English (Isle of Man)"},"en-in":{englishName:"English (India)",nativeName:"English (India)"},"en-io":{englishName:"English (British Indian Ocean Territory)",nativeName:"English (British Indian Ocean Territory)"},"en-je":{englishName:"English (Jersey)",nativeName:"English (Jersey)"},"en-jm":{englishName:"English (Jamaica)",nativeName:"English (Jamaica)"},"en-ke":{englishName:"English (Kenya)",nativeName:"English (Kenya)"},"en-ki":{englishName:"English (Kiribati)",nativeName:"English (Kiribati)"},"en-kn":{englishName:"English (Saint Kitts and Nevis)",nativeName:"English (Saint Kitts and Nevis)"},"en-ky":{englishName:"English (Cayman Islands)",nativeName:"English (Cayman Islands)"},"en-lc":{englishName:"English (Saint Lucia)",nativeName:"English (Saint Lucia)"},"en-lr":{englishName:"English (Liberia)",nativeName:"English (Liberia)"},"en-ls":{englishName:"English (Lesotho)",nativeName:"English (Lesotho)"},"en-mg":{englishName:"English (Madagascar)",nativeName:"English (Madagascar)"},"en-mh":{englishName:"English (Marshall Islands)",nativeName:"English (Marshall Islands)"},"en-mo":{englishName:"English (Macao SAR)",nativeName:"English (Macao SAR)"},"en-mp":{englishName:"English (Northern Mariana Islands)",nativeName:"English (Northern Mariana Islands)"},"en-ms":{englishName:"English (Montserrat)",nativeName:"English (Montserrat)"},"en-mt":{englishName:"English (Malta)",nativeName:"English (Malta)"},"en-mu":{englishName:"English (Mauritius)",nativeName:"English (Mauritius)"},"en-mw":{englishName:"English (Malawi)",nativeName:"English (Malawi)"},"en-my":{englishName:"English (Malaysia)",nativeName:"English (Malaysia)"},"en-na":{englishName:"English (Namibia)",nativeName:"English (Namibia)"},"en-nf":{englishName:"English (Norfolk Island)",nativeName:"English (Norfolk Island)"},"en-ng":{englishName:"English (Nigeria)",nativeName:"English (Nigeria)"},"en-nl":{englishName:"English (Netherlands)",nativeName:"English (Netherlands)"},"en-nr":{englishName:"English (Nauru)",nativeName:"English (Nauru)"},"en-nu":{englishName:"English (Niue)",nativeName:"English (Niue)"},"en-nz":{englishName:"English (New Zealand)",nativeName:"English (New Zealand)"},"en-pg":{englishName:"English (Papua New Guinea)",nativeName:"English (Papua New Guinea)"},"en-ph":{englishName:"English (Philippines)",nativeName:"English (Philippines)"},"en-pk":{englishName:"English (Pakistan)",nativeName:"English (Pakistan)"},"en-pn":{englishName:"English (Pitcairn Islands)",nativeName:"English (Pitcairn Islands)"},"en-pr":{englishName:"English (Puerto Rico)",nativeName:"English (Puerto Rico)"},"en-pw":{englishName:"English (Palau)",nativeName:"English (Palau)"},"en-rw":{englishName:"English (Rwanda)",nativeName:"English (Rwanda)"},"en-sb":{englishName:"English (Solomon Islands)",nativeName:"English (Solomon Islands)"},"en-sc":{englishName:"English (Seychelles)",nativeName:"English (Seychelles)"},"en-sd":{englishName:"English (Sudan)",nativeName:"English (Sudan)"},"en-se":{englishName:"English (Sweden)",nativeName:"English (Sweden)"},"en-sg":{englishName:"English (Singapore)",nativeName:"English (Singapore)"},"en-sh":{englishName:"English (St Helena, Ascension, Tristan da Cunha)",nativeName:"English (St Helena, Ascension, Tristan da Cunha)"},"en-si":{englishName:"English (Slovenia)",nativeName:"English (Slovenia)"},"en-sl":{englishName:"English (Sierra Leone)",nativeName:"English (Sierra Leone)"},"en-ss":{englishName:"English (South Sudan)",nativeName:"English (South Sudan)"},"en-sx":{englishName:"English (Sint Maarten)",nativeName:"English (Sint Maarten)"},"en-sz":{englishName:"English (Swaziland)",nativeName:"English (Swaziland)"},"en-tc":{englishName:"English (Turks and Caicos Islands)",nativeName:"English (Turks and Caicos Islands)"},"en-tk":{englishName:"English (Tokelau)",nativeName:"English (Tokelau)"},"en-to":{englishName:"English (Tonga)",nativeName:"English (Tonga)"},"en-tt":{englishName:"English (Trinidad and Tobago)",nativeName:"English (Trinidad and Tobago)"},"en-tv":{englishName:"English (Tuvalu)",nativeName:"English (Tuvalu)"},"en-tz":{englishName:"English (Tanzania)",nativeName:"English (Tanzania)"},"en-ug":{englishName:"English (Uganda)",nativeName:"English (Uganda)"},"en-um":{englishName:"English (U.S. Outlying Islands)",nativeName:"English (U.S. Outlying Islands)"},"en-us":{englishName:"English (United States)",nativeName:"English (United States)"},"en-vc":{englishName:"English (Saint Vincent and the Grenadines)",nativeName:"English (Saint Vincent and the Grenadines)"},"en-vg":{englishName:"English (British Virgin Islands)",nativeName:"English (British Virgin Islands)"},"en-vi":{englishName:"English (U.S. Virgin Islands)",nativeName:"English (U.S. Virgin Islands)"},"en-vu":{englishName:"English (Vanuatu)",nativeName:"English (Vanuatu)"},"en-ws":{englishName:"English (Samoa)",nativeName:"English (Samoa)"},"en-za":{englishName:"English (South Africa)",nativeName:"English (South Africa)"},"en-zm":{englishName:"English (Zambia)",nativeName:"English (Zambia)"},"en-zw":{englishName:"English (Zimbabwe)",nativeName:"English (Zimbabwe)"},eo:EU,"eo-001":{englishName:"Esperanto (World)",nativeName:"esperanto (World)"},es:wU,"es-419":{englishName:"Spanish (Latin America)",nativeName:"español (Latinoamérica)"},"es-ar":{englishName:"Spanish (Argentina)",nativeName:"español (Argentina)"},"es-bo":{englishName:"Spanish (Bolivia)",nativeName:"español (Bolivia)"},"es-cl":{englishName:"Spanish (Chile)",nativeName:"español (Chile)"},"es-co":{englishName:"Spanish (Colombia)",nativeName:"español (Colombia)"},"es-cr":{englishName:"Spanish (Costa Rica)",nativeName:"español (Costa Rica)"},"es-cu":{englishName:"Spanish (Cuba)",nativeName:"español (Cuba)"},"es-do":{englishName:"Spanish (Dominican Republic)",nativeName:"español (República Dominicana)"},"es-ec":{englishName:"Spanish (Ecuador)",nativeName:"español (Ecuador)"},"es-es":{englishName:"Spanish (Spain, International Sort)",nativeName:"español (España, alfabetización internacional)"},"es-gq":{englishName:"Spanish (Equatorial Guinea)",nativeName:"español (Guinea Ecuatorial)"},"es-gt":{englishName:"Spanish (Guatemala)",nativeName:"español (Guatemala)"},"es-hn":{englishName:"Spanish (Honduras)",nativeName:"español (Honduras)"},"es-mx":{englishName:"Spanish (Mexico)",nativeName:"español (México)"},"es-ni":{englishName:"Spanish (Nicaragua)",nativeName:"español (Nicaragua)"},"es-pa":{englishName:"Spanish (Panama)",nativeName:"español (Panamá)"},"es-pe":{englishName:"Spanish (Peru)",nativeName:"español (Perú)"},"es-ph":{englishName:"Spanish (Philippines)",nativeName:"español (Filipinas)"},"es-pr":{englishName:"Spanish (Puerto Rico)",nativeName:"español (Puerto Rico)"},"es-py":{englishName:"Spanish (Paraguay)",nativeName:"español (Paraguay)"},"es-sv":{englishName:"Spanish (El Salvador)",nativeName:"español (El Salvador)"},"es-us":{englishName:"Spanish (United States)",nativeName:"español (Estados Unidos)"},"es-uy":{englishName:"Spanish (Uruguay)",nativeName:"español (Uruguay)"},"es-ve":{englishName:"Spanish (Venezuela)",nativeName:"español (Venezuela)"},et:kU,"et-ee":{englishName:"Estonian (Estonia)",nativeName:"eesti (Eesti)"},eu:xU,"eu-es":{englishName:"Basque (Basque)",nativeName:"euskara (euskara)"},ewo:AU,"ewo-cm":{englishName:"Ewondo (Cameroon)",nativeName:"ewondo (KamÉ™rún)"},fa:IU,"fa-ir":{englishName:"Persian (Iran)",nativeName:"ÙØ§Ø±Ø³Ù‰ (ایران)"},ff:PU,"ff-cm":{englishName:"Fulah (Cameroon)",nativeName:"Pulaar (Kameruun)"},"ff-gn":{englishName:"Fulah (Guinea)",nativeName:"Pulaar (Gine)"},"ff-latn":{englishName:"Fulah",nativeName:"Fulah"},"ff-latn-sn":{englishName:"Fulah (Latin, Senegal)",nativeName:"Fulah (Sénégal)"},"ff-mr":{englishName:"Fulah (Mauritania)",nativeName:"Pulaar (Muritani)"},"ff-ng":{englishName:"Fulah (Nigeria)",nativeName:"Pulaar (Nigeria)"},fi:DU,"fi-fi":{englishName:"Finnish (Finland)",nativeName:"suomi (Suomi)"},fil:NU,"fil-ph":{englishName:"Filipino (Philippines)",nativeName:"Filipino (Pilipinas)"},fo:LU,"fo-dk":{englishName:"Faroese (Denmark)",nativeName:"føroyskt (Danmark)"},"fo-fo":{englishName:"Faroese (Faroe Islands)",nativeName:"føroyskt (Føroyar)"},fr:OU,"fr-029":{englishName:"French (Caribbean)",nativeName:"français (caraïbes)"},"fr-be":{englishName:"French (Belgium)",nativeName:"français (Belgique)"},"fr-bf":{englishName:"French (Burkina Faso)",nativeName:"français (Burkina Faso)"},"fr-bi":{englishName:"French (Burundi)",nativeName:"français (Burundi)"},"fr-bj":{englishName:"French (Benin)",nativeName:"français (Bénin)"},"fr-bl":{englishName:"French (Saint Barthélemy)",nativeName:"français (Saint-Barthélemy)"},"fr-ca":{englishName:"French (Canada)",nativeName:"français (Canada)"},"fr-cd":{englishName:"French (Congo DRC)",nativeName:"français (Congo, République démocratique du)"},"fr-cf":{englishName:"French (Central African Republic)",nativeName:"français (République centrafricaine)"},"fr-cg":{englishName:"French (Congo)",nativeName:"français (Congo)"},"fr-ch":{englishName:"French (Switzerland)",nativeName:"français (Suisse)"},"fr-ci":{englishName:"French (Côte d’Ivoire)",nativeName:"français (Côte d’Ivoire)"},"fr-cm":{englishName:"French (Cameroon)",nativeName:"français (Cameroun)"},"fr-dj":{englishName:"French (Djibouti)",nativeName:"français (Djibouti)"},"fr-dz":{englishName:"French (Algeria)",nativeName:"français (Algérie)"},"fr-fr":{englishName:"French (France)",nativeName:"français (France)"},"fr-ga":{englishName:"French (Gabon)",nativeName:"français (Gabon)"},"fr-gf":{englishName:"French (French Guiana)",nativeName:"français (Guyane française)"},"fr-gn":{englishName:"French (Guinea)",nativeName:"français (Guinée)"},"fr-gp":{englishName:"French (Guadeloupe)",nativeName:"français (Guadeloupe)"},"fr-gq":{englishName:"French (Equatorial Guinea)",nativeName:"français (Guinée équatoriale)"},"fr-ht":{englishName:"French (Haiti)",nativeName:"français (Haïti)"},"fr-km":{englishName:"French (Comoros)",nativeName:"français (Comores)"},"fr-lu":{englishName:"French (Luxembourg)",nativeName:"français (Luxembourg)"},"fr-ma":{englishName:"French (Morocco)",nativeName:"français (Maroc)"},"fr-mc":{englishName:"French (Monaco)",nativeName:"français (Monaco)"},"fr-mf":{englishName:"French (Saint Martin)",nativeName:"français (Saint-Martin)"},"fr-mg":{englishName:"French (Madagascar)",nativeName:"français (Madagascar)"},"fr-ml":{englishName:"French (Mali)",nativeName:"français (Mali)"},"fr-mq":{englishName:"French (Martinique)",nativeName:"français (Martinique)"},"fr-mr":{englishName:"French (Mauritania)",nativeName:"français (Mauritanie)"},"fr-mu":{englishName:"French (Mauritius)",nativeName:"français (Maurice)"},"fr-nc":{englishName:"French (New Caledonia)",nativeName:"français (Nouvelle-Calédonie)"},"fr-ne":{englishName:"French (Niger)",nativeName:"français (Niger)"},"fr-pf":{englishName:"French (French Polynesia)",nativeName:"français (Polynésie française)"},"fr-pm":{englishName:"French (Saint Pierre and Miquelon)",nativeName:"français (Saint-Pierre-et-Miquelon)"},"fr-re":{englishName:"French (Réunion)",nativeName:"français (La Réunion)"},"fr-rw":{englishName:"French (Rwanda)",nativeName:"français (Rwanda)"},"fr-sc":{englishName:"French (Seychelles)",nativeName:"français (Seychelles)"},"fr-sn":{englishName:"French (Senegal)",nativeName:"français (Sénégal)"},"fr-sy":{englishName:"French (Syria)",nativeName:"français (Syrie)"},"fr-td":{englishName:"French (Chad)",nativeName:"français (Tchad)"},"fr-tg":{englishName:"French (Togo)",nativeName:"français (Togo)"},"fr-tn":{englishName:"French (Tunisia)",nativeName:"français (Tunisie)"},"fr-vu":{englishName:"French (Vanuatu)",nativeName:"français (Vanuatu)"},"fr-wf":{englishName:"French (Wallis and Futuna)",nativeName:"français (Wallis-et-Futuna)"},"fr-yt":{englishName:"French (Mayotte)",nativeName:"français (Mayotte)"},fur:MU,"fur-it":{englishName:"Friulian (Italy)",nativeName:"furlan (Italie)"},fy:RU,"fy-nl":{englishName:"Western Frisian (Netherlands)",nativeName:"Frysk (Nederlân)"},ga:BU,"ga-ie":{englishName:"Irish (Ireland)",nativeName:"Gaeilge (Éire)"},gd:FU,"gd-gb":{englishName:"Scottish Gaelic (United Kingdom)",nativeName:"G� idhlig (An Rìoghachd Aonaichte)"},gl:UU,"gl-es":{englishName:"Galician (Galician)",nativeName:"galego (galego)"},gn:$U,"gn-py":{englishName:"Guarani (Paraguay)",nativeName:"Avañe’ẽ (Paraguái)"},gsw:jU,"gsw-ch":{englishName:"Alsatian (Switzerland)",nativeName:"Elsässisch (Schwiiz)"},"gsw-fr":{englishName:"Alsatian (France)",nativeName:"Elsässisch (Fr� nkrisch)"},"gsw-li":{englishName:"Alsatian (Liechtenstein)",nativeName:"Elsässisch (Liächteschtäi)"},gu:VU,"gu-in":{englishName:"Gujarati (India)",nativeName:"ગà«àªœàª°àª¾àª¤à«€ (àªàª¾àª°àª¤)"},guz:HU,"guz-ke":{englishName:"Gusii (Kenya)",nativeName:"Ekegusii (Kenya)"},gv:qU,"gv-im":{englishName:"Manx (Isle of Man)",nativeName:"Gaelg (Ellan Vannin)"},ha:zU,"ha-latn":{englishName:"Hausa (Latin)",nativeName:"Hausa"},"ha-latn-gh":{englishName:"Hausa (Latin, Ghana)",nativeName:"Hausa (Gana)"},"ha-latn-ne":{englishName:"Hausa (Latin, Niger)",nativeName:"Hausa (Nijar)"},"ha-latn-ng":{englishName:"Hausa (Latin, Nigeria)",nativeName:"Hausa (Najeriya)"},haw:WU,"haw-us":{englishName:"Hawaiian (United States)",nativeName:"ʻŌlelo HawaiÊ»i (Ê»Amelika Hui PÅ« Ê»Ia)"},he:GU,"he-il":{englishName:"Hebrew (Israel)",nativeName:"עברית (ישר×ל)"},hi:KU,"hi-in":{englishName:"Hindi (India)",nativeName:"हिंदी (à¤à¤¾à¤°à¤¤)"},hr:XU,"hr-ba":{englishName:"Croatian (Bosnia and Herzegovina)",nativeName:"hrvatski (Bosna i Hercegovina)"},"hr-hr":{englishName:"Croatian (Croatia)",nativeName:"hrvatski (Hrvatska)"},hsb:YU,"hsb-de":{englishName:"Upper Sorbian (Germany)",nativeName:"hornjoserbšćina (NÄ›mska)"},hu:QU,"hu-hu":{englishName:"Hungarian (Hungary)",nativeName:"magyar (Magyarország)"},hy:JU,"hy-am":{englishName:"Armenian (Armenia)",nativeName:"Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶ (Õ€Õ¡ÕµÕ¡Õ½Õ¿Õ¡Õ¶)"},ia:ZU,"ia-001":{englishName:"Interlingua (World)",nativeName:"interlingua (World)"},"ia-fr":{englishName:"Interlingua (France)",nativeName:"interlingua (Francia)"},ibb:e7,"ibb-ng":{englishName:"Ibibio (Nigeria)",nativeName:"Ibibio-Efik (Nigeria)"},id:t7,"id-id":{englishName:"Indonesian (Indonesia)",nativeName:"Indonesia (Indonesia)"},ig:i7,"ig-ng":{englishName:"Igbo (Nigeria)",nativeName:"Igbo (Nigeria)"},ii:r7,"ii-cn":{englishName:"Yi (China)",nativeName:"ꆈ�� ê±ê‚· (êꉸê“ꂱê‡ê‰¼ê‡©)"},is:n7,"is-is":{englishName:"Icelandic (Iceland)",nativeName:"Ãslenska (Ãsland)"},it:s7,"it-ch":{englishName:"Italian (Switzerland)",nativeName:"italiano (Svizzera)"},"it-it":{englishName:"Italian (Italy)",nativeName:"italiano (Italia)"},"it-sm":{englishName:"Italian (San Marino)",nativeName:"italiano (San Marino)"},iu:a7,"iu-cans":{englishName:"Inuktitut (Syllabics)",nativeName:"áƒá“„ᒃᑎá‘ᑦ"},"iu-cans-ca":{englishName:"Inuktitut (Syllabics, Canada)",nativeName:"áƒá“„ᒃᑎá‘ᑦ (ᑲᓇᑕᒥ)"},"iu-latn":{englishName:"Inuktitut (Latin)",nativeName:"Inuktitut"},"iu-latn-ca":{englishName:"Inuktitut (Latin, Canada)",nativeName:"Inuktitut (Kanatami)"},ja:o7,"ja-jp":{englishName:"Japanese (Japan)",nativeName:"日本語 (日本)"},jgo:l7,"jgo-cm":{englishName:"Ngomba (Cameroon)",nativeName:"Ndaꞌa (KamÉ›lûn)"},jmc:u7,"jmc-tz":{englishName:"Machame (Tanzania)",nativeName:"Kimachame (Tanzania)"},jv:c7,"jv-java":{englishName:"Javanese (Javanese)",nativeName:"ꦧꦱꦗꦮ"},"jv-java-id":{englishName:"Javanese (Javanese, Indonesia)",nativeName:"ꦧꦱꦗꦮ (Indonesia)"},"jv-latn":{englishName:"Javanese",nativeName:"Basa Jawa"},"jv-latn-id":{englishName:"Javanese (Indonesia)",nativeName:"Basa Jawa (Indonesia)"},ka:h7,"ka-ge":{englishName:"Georgian (Georgia)",nativeName:"ქáƒï¿½ï¿½ თული (სáƒáƒ¥áƒï¿½ï¿½ თველáƒ)"},kab:d7,"kab-dz":{englishName:"Kabyle (Algeria)",nativeName:"Taqbaylit (Lezzayer)"},kam:f7,"kam-ke":{englishName:"Kamba (Kenya)",nativeName:"Kikamba (Kenya)"},kde:p7,"kde-tz":{englishName:"Makonde (Tanzania)",nativeName:"Chimakonde (Tanzania)"},kea:m7,"kea-cv":{englishName:"Kabuverdianu (Cabo Verde)",nativeName:"kabuverdianu (Kabu Verdi)"},khq:g7,"khq-ml":{englishName:"Koyra Chiini (Mali)",nativeName:"Koyra ciini (Maali)"},ki:v7,"ki-ke":{englishName:"Kikuyu (Kenya)",nativeName:"Gikuyu (Kenya)"},kk:y7,"kk-kz":{englishName:"Kazakh (Kazakhstan)",nativeName:"қазақ тілі (ҚазақÑтан)"},kkj:_7,"kkj-cm":{englishName:"Kako (Cameroon)",nativeName:"kakÉ” (KamÉ›run)"},kl:T7,"kl-gl":{englishName:"Greenlandic (Greenland)",nativeName:"kalaallisut (Kalaallit Nunaat)"},kln:b7,"kln-ke":{englishName:"Kalenjin (Kenya)",nativeName:"Kalenjin (Emetab Kenya)"},km:S7,"km-kh":{englishName:"Khmer (Cambodia)",nativeName:"ភាសាážáŸ’មែរ (កម្ពុជា)"},kn:C7,"kn-in":{englishName:"Kannada (India)",nativeName:"ಕನà³à²¨à²¡ (à²à²¾à²°à²¤)"},ko:E7,"ko-kp":{englishName:"Korean (North Korea)",nativeName:"한êµì–´ (조�� 민주주ì˜ì¸ë¯¼ê³µí™”êµ)"},"ko-kr":{englishName:"Korean (Korea)",nativeName:"한êµì–´(대한민êµ)"},kok:w7,"kok-in":{englishName:"Konkani (India)",nativeName:"कोंकणी (à¤à¤¾à¤°à¤¤)"},kr:k7,"kr-ng":{englishName:"Kanuri (Nigeria)",nativeName:"Kanuri (Nigeria)"},ks:x7,"ks-arab":{englishName:"Kashmiri (Perso-Arabic)",nativeName:"Ú©Ù²Ø´ÙØ±"},"ks-arab-in":{englishName:"Kashmiri (Perso-Arabic)",nativeName:"Ú©Ù²Ø´ÙØ± (اَربی)"},"ks-deva":{englishName:"Kashmiri (Devanagari)",nativeName:"कॉशà¥à¤°"},"ks-deva-in":{englishName:"Kashmiri (Devanagari, India)",nativeName:"कॉशà¥à¤° (India)"},ksb:A7,"ksb-tz":{englishName:"Shambala (Tanzania)",nativeName:"Kishambaa (Tanzania)"},ksf:I7,"ksf-cm":{englishName:"Bafia (Cameroon)",nativeName:"rikpa (kamÉ›rún)"},ksh:P7,"ksh-de":{englishName:"Ripuarian (Germany)",nativeName:"Kölsch (Doütschland)"},ku:D7,"ku-arab":{englishName:"Central Kurdish",nativeName:"کوردیی ناوەڕاست"},"ku-arab-iq":{englishName:"Central Kurdish (Iraq)",nativeName:"کوردیی ناوەڕاست (کوردستان)"},"ku-arab-ir":{englishName:"Kurdish (Perso-Arabic, Iran)",nativeName:"کوردی (ئێران)"},kw:N7,"kw-gb":{englishName:"Cornish (United Kingdom)",nativeName:"kernewek (Rywvaneth Unys)"},ky:L7,"ky-kg":{englishName:"Kyrgyz (Kyrgyzstan)",nativeName:"Кыргыз (КыргызÑтан)"},la:O7,"la-001":{englishName:"Latin (World)",nativeName:"lingua latÄ«na (World)"},lag:M7,"lag-tz":{englishName:"Langi (Tanzania)",nativeName:"Kɨlaangi (TaansanÃa)"},lb:R7,"lb-lu":{englishName:"Luxembourgish (Luxembourg)",nativeName:"Lëtzebuergesch (Lëtzebuerg)"},lg:B7,"lg-ug":{englishName:"Ganda (Uganda)",nativeName:"Luganda (Yuganda)"},lkt:F7,"lkt-us":{englishName:"Lakota (United States)",nativeName:"Lakȟólʼiyapi (MÃlahaÅ‹ska TÈŸamákÈŸoÄhe)"},ln:U7,"ln-ao":{englishName:"Lingala (Angola)",nativeName:"lingála (Angóla)"},"ln-cd":{englishName:"Lingala (Congo DRC)",nativeName:"lingála (Repibiki demokratiki ya Kongó)"},"ln-cf":{englishName:"Lingala (Central African Republic)",nativeName:"lingála (Repibiki ya AfrÃka ya Káti)"},"ln-cg":{englishName:"Lingala (Congo)",nativeName:"lingála (Kongo)"},lo:$7,"lo-la":{englishName:"Lao (Laos)",nativeName:"ລາວ (ລາວ)"},lrc:j7,"lrc-iq":{englishName:"Northern Luri (Iraq)",nativeName:"لۊری شومالی (Iraq)"},"lrc-ir":{englishName:"Northern Luri (Iran)",nativeName:"لۊری شومالی (Iran)"},lt:V7,"lt-lt":{englishName:"Lithuanian (Lithuania)",nativeName:"lietuvių (Lietuva)"},lu:H7,"lu-cd":{englishName:"Luba-Katanga (Congo DRC)",nativeName:"Tshiluba (Ditunga wa Kongu)"},luo:q7,"luo-ke":{englishName:"Luo (Kenya)",nativeName:"Dholuo (Kenya)"},luy:z7,"luy-ke":{englishName:"Luyia (Kenya)",nativeName:"Luluhia (Kenya)"},lv:W7,"lv-lv":{englishName:"Latvian (Latvia)",nativeName:"latvieÅ¡u (Latvija)"},mas:G7,"mas-ke":{englishName:"Masai (Kenya)",nativeName:"Maa (Kenya)"},"mas-tz":{englishName:"Masai (Tanzania)",nativeName:"Maa (Tansania)"},mer:K7,"mer-ke":{englishName:"Meru (Kenya)",nativeName:"KÄ©mÄ©rÅ© (Kenya)"},mfe:X7,"mfe-mu":{englishName:"Morisyen (Mauritius)",nativeName:"kreol morisien (Moris)"},mg:Y7,"mg-mg":{englishName:"Malagasy (Madagascar)",nativeName:"Malagasy (Madagasikara)"},mgh:Q7,"mgh-mz":{englishName:"Makhuwa-Meetto (Mozambique)",nativeName:"Makua (Umozambiki)"},mgo:J7,"mgo-cm":{englishName:"Metaʼ (Cameroon)",nativeName:"metaʼ (Kamalun)"},mi:Z7,"mi-nz":{englishName:"Maori (New Zealand)",nativeName:"Reo MÄori (Aotearoa)"},mk:e$,"mk-mk":{englishName:"Macedonian (Macedonia, FYRO)",nativeName:"македонÑки (� епублика Македонија)"},ml:t$,"ml-in":{englishName:"Malayalam (India)",nativeName:"മലയാളം (ഇനàµà´¤àµà´¯)"},mn:i$,"mn-cyrl":{englishName:"Mongolian",nativeName:"монгол"},"mn-mn":{englishName:"Mongolian (Mongolia)",nativeName:"монгол (Монгол)"},"mn-mong":{englishName:"Mongolian (Traditional Mongolian)",nativeName:"� �� �� �� �� �� �� � � �� �� �� �"},"mn-mong-cn":{englishName:"Mongolian (Traditional Mongolian, China)",nativeName:"� �� �� �� �� �� �� � � �� �� �� � (� �� �� �� �� �� � � �� � �� �� � �� �� � �� � � �� �� �� �� � �� � � � �� � � � �� �� �� �)"},"mn-mong-mn":{englishName:"Mongolian (Traditional Mongolian, Mongolia)",nativeName:"� �� �� �� �� �� �� � � �� �� �� � (� �� �� �� �� �� �� � � �� �� �� �)"},mni:r$,"mni-in":{englishName:"Manipuri (India)",nativeName:"মৈতৈলোনৠ(India)"},moh:n$,"moh-ca":{englishName:"Mohawk (Mohawk)",nativeName:"Kanien'kéha"},mr:s$,"mr-in":{englishName:"Marathi (India)",nativeName:"मरा�� ी (à¤à¤¾à¤°à¤¤)"},ms:a$,"ms-bn":{englishName:"Malay (Brunei)",nativeName:"Bahasa Melayu (Brunei)"},"ms-my":{englishName:"Malay (Malaysia)",nativeName:"Bahasa Melayu (Malaysia)"},"ms-sg":{englishName:"Malay (Singapore)",nativeName:"Bahasa Melayu (Singapura)"},mt:o$,"mt-mt":{englishName:"Maltese (Malta)",nativeName:"Malti (Malta)"},mua:l$,"mua-cm":{englishName:"Mundang (Cameroon)",nativeName:"MUNDAÅŠ (kameruÅ‹)"},my:u$,"my-mm":{englishName:"Burmese (Myanmar)",nativeName:"ဗမာ (မြန်မာ)"},mzn:c$,"mzn-ir":{englishName:"Mazanderani (Iran)",nativeName:"مازرونی (ایران)"},naq:h$,"naq-na":{englishName:"Nama (Namibia)",nativeName:"Khoekhoegowab (Namibiab)"},nb:d$,"nb-no":{englishName:"Norwegian BokmÃ¥l (Norway)",nativeName:"norsk bokmÃ¥l (Norge)"},"nb-sj":{englishName:"Norwegian BokmÃ¥l (Svalbard and Jan Mayen)",nativeName:"norsk bokmÃ¥l (Svalbard og Jan Mayen)"},nd:f$,"nd-zw":{englishName:"North Ndebele (Zimbabwe)",nativeName:"isiNdebele (Zimbabwe)"},ne:p$,"ne-in":{englishName:"Nepali (India)",nativeName:"नेपाली (à¤à¤¾à¤°à¤¤)"},"ne-np":{englishName:"Nepali (Nepal)",nativeName:"नेपाली (नेपाल)"},nl:m$,"nl-aw":{englishName:"Dutch (Aruba)",nativeName:"Nederlands (Aruba)"},"nl-be":{englishName:"Dutch (Belgium)",nativeName:"Nederlands (België)"},"nl-bq":{englishName:"Dutch (Bonaire, Sint Eustatius and Saba)",nativeName:"Nederlands (Bonaire, Sint Eustatius en Saba)"},"nl-cw":{englishName:"Dutch (Curaçao)",nativeName:"Nederlands (Curaçao)"},"nl-nl":{englishName:"Dutch (Netherlands)",nativeName:"Nederlands (Nederland)"},"nl-sr":{englishName:"Dutch (Suriname)",nativeName:"Nederlands (Suriname)"},"nl-sx":{englishName:"Dutch (Sint Maarten)",nativeName:"Nederlands (Sint-Maarten)"},nmg:g$,"nmg-cm":{englishName:"Kwasio (Cameroon)",nativeName:"Kwasio (Kamerun)"},nn:v$,"nn-no":{englishName:"Norwegian Nynorsk (Norway)",nativeName:"nynorsk (Noreg)"},nnh:y$,"nnh-cm":{englishName:"Ngiemboon (Cameroon)",nativeName:"Shwóŋò ngiembɔɔn (K� malûm)"},no:_$,nqo:T$,"nqo-gn":{englishName:"N'ko (Guinea)",nativeName:"ß’ßžß (ߖߌ߬ߣß߬ ߞߊ߲ߓßß²)"},nr:b$,"nr-za":{englishName:"South Ndebele (South Africa)",nativeName:"isiNdebele (South Africa)"},nso:S$,"nso-za":{englishName:"Sesotho sa Leboa (South Africa)",nativeName:"Sesotho sa Leboa (Afrika Borwa)"},nus:C$,"nus-ss":{englishName:"Nuer (South Sudan)",nativeName:"Thok Nath (South Sudan)"},nyn:E$,"nyn-ug":{englishName:"Nyankole (Uganda)",nativeName:"Runyankore (Uganda)"},oc:w$,"oc-fr":{englishName:"Occitan (France)",nativeName:"Occitan (França)"},om:k$,"om-et":{englishName:"Oromo (Ethiopia)",nativeName:"Oromoo (Itoophiyaa)"},"om-ke":{englishName:"Oromo (Kenya)",nativeName:"Oromoo (Keeniyaa)"},or:x$,"or-in":{englishName:"Odia (India)",nativeName:"ଓàœà¬¿à¬† (à¬à¬¾à¬°à¬¤)"},os:A$,"os-ge":{englishName:"Ossetian (Georgia)",nativeName:"Ирон æвзаг (ГуырдзыÑтон)"},"os-ru":{englishName:"Ossetian (Russia)",nativeName:"Ирон æвзаг (УӕрӕÑе)"},pa:I$,"pa-arab":{englishName:"Punjabi",nativeName:"پنجابی"},"pa-arab-pk":{englishName:"Punjabi (Pakistan)",nativeName:"پنجابی (پاکستان)"},"pa-in":{englishName:"Punjabi (India)",nativeName:"ਪੰਜਾਬੀ (à¨à¨¾à¨°à¨¤)"},pap:P$,"pap-029":{englishName:"Papiamento (Caribbean)",nativeName:"Papiamentu (Caribbean)"},pl:D$,"pl-pl":{englishName:"Polish (Poland)",nativeName:"polski (Polska)"},prg:N$,"prg-001":{englishName:"Prussian (World)",nativeName:"prÅ«siskan (swÄ«tai)"},prs:L$,"prs-af":{englishName:"Dari (Afghanistan)",nativeName:"درى (Ø§ÙØºØ§Ù†Ø³ØªØ§Ù†)"},ps:O$,"ps-af":{englishName:"Pashto (Afghanistan)",nativeName:"پښتو (Ø§ÙØºØ§Ù†Ø³ØªØ§Ù†)"},pt:M$,"pt-ao":{englishName:"Portuguese (Angola)",nativeName:"português (Angola)"},"pt-br":{englishName:"Portuguese (Brazil)",nativeName:"português (Brasil)"},"pt-cv":{englishName:"Portuguese (Cabo Verde)",nativeName:"português (Cabo Verde)"},"pt-gw":{englishName:"Portuguese (Guinea-Bissau)",nativeName:"português (Guiné-Bissau)"},"pt-mo":{englishName:"Portuguese (Macao SAR)",nativeName:"português (RAE de Macau)"},"pt-mz":{englishName:"Portuguese (Mozambique)",nativeName:"português (Moçambique)"},"pt-pt":{englishName:"Portuguese (Portugal)",nativeName:"português (Portugal)"},"pt-st":{englishName:"Portuguese (São Tomé and PrÃncipe)",nativeName:"português (São Tomé e PrÃncipe)"},"pt-tl":{englishName:"Portuguese (Timor-Leste)",nativeName:"português (Timor-Leste)"},quc:R$,"quc-latn":{englishName:"K'iche'",nativeName:"K'iche'"},"quc-latn-gt":{englishName:"K'iche' (Guatemala)",nativeName:"K'iche' (Guatemala)"},quz:B$,"quz-bo":{englishName:"Quechua (Bolivia)",nativeName:"runasimi (Qullasuyu)"},"quz-ec":{englishName:"Quichua (Ecuador)",nativeName:"runa shimi (Ecuador Suyu)"},"quz-pe":{englishName:"Quechua (Peru)",nativeName:"runasimi (Peru)"},rm:F$,"rm-ch":{englishName:"Romansh (Switzerland)",nativeName:"rumantsch (Svizra)"},rn:U$,"rn-bi":{englishName:"Rundi (Burundi)",nativeName:"Ikirundi (Uburundi)"},ro:$$,"ro-md":{englishName:"Romanian (Moldova)",nativeName:"română (Republica Moldova)"},"ro-ro":{englishName:"Romanian (Romania)",nativeName:"română (România)"},rof:j$,"rof-tz":{englishName:"Rombo (Tanzania)",nativeName:"Kihorombo (Tanzania)"},ru:V$,"ru-by":{englishName:"Russian (Belarus)",nativeName:"руÑÑкий (БеларуÑÑŒ)"},"ru-kg":{englishName:"Russian (Kyrgyzstan)",nativeName:"руÑÑкий (КиргизиÑ)"},"ru-kz":{englishName:"Russian (Kazakhstan)",nativeName:"руÑÑкий (КазахÑтан)"},"ru-md":{englishName:"Russian (Moldova)",nativeName:"руÑÑкий (Молдова)"},"ru-ru":{englishName:"Russian (Russia)",nativeName:"руÑÑкий (� оÑÑиÑ)"},"ru-ua":{englishName:"Russian (Ukraine)",nativeName:"руÑÑкий (Украина)"},rw:H$,"rw-rw":{englishName:"Kinyarwanda (Rwanda)",nativeName:"Kinyarwanda (Rwanda)"},rwk:q$,"rwk-tz":{englishName:"Rwa (Tanzania)",nativeName:"Kiruwa (Tanzania)"},sa:z$,"sa-in":{englishName:"Sanskrit (India)",nativeName:"संसà¥à¤•ृत (à¤à¤¾à¤°à¤¤à¤®à¥)"},sah:W$,"sah-ru":{englishName:"Sakha (Russia)",nativeName:"Саха (� оÑÑиÑ)"},saq:G$,"saq-ke":{englishName:"Samburu (Kenya)",nativeName:"Kisampur (Kenya)"},sbp:K$,"sbp-tz":{englishName:"Sangu (Tanzania)",nativeName:"Ishisangu (Tansaniya)"},sd:X$,"sd-arab":{englishName:"Sindhi",nativeName:"سنڌي"},"sd-arab-pk":{englishName:"Sindhi (Pakistan)",nativeName:"سنڌي (پاکستان)"},"sd-deva":{englishName:"Sindhi (Devanagari)",nativeName:"सिनà¥à¤§à¥€"},"sd-deva-in":{englishName:"Sindhi (Devanagari, India)",nativeName:"सिनà¥à¤§à¥€ (India)"},se:Y$,"se-fi":{englishName:"Sami, Northern (Finland)",nativeName:"davvisámegiella (Suopma)"},"se-no":{englishName:"Sami, Northern (Norway)",nativeName:"davvisámegiella (Norga)"},"se-se":{englishName:"Sami, Northern (Sweden)",nativeName:"davvisámegiella (Ruoŧŧa)"},seh:Q$,"seh-mz":{englishName:"Sena (Mozambique)",nativeName:"sena (Moçambique)"},ses:J$,"ses-ml":{englishName:"Koyraboro Senni (Mali)",nativeName:"Koyraboro senni (Maali)"},sg:Z$,"sg-cf":{englishName:"Sango (Central African Republic)",nativeName:"Sängö (Ködörösêse tî Bêafrîka)"},shi:e9,"shi-latn":{englishName:"Tachelhit (Latin)",nativeName:"Tashelḥiyt"},"shi-latn-ma":{englishName:"Tachelhit (Latin, Morocco)",nativeName:"Tashelḥiyt (lmÉ£rib)"},"shi-tfng":{englishName:"Tachelhit (Tifinagh)",nativeName:"ⵜⴰⵛâµâµƒâµ‰âµœ"},"shi-tfng-ma":{englishName:"Tachelhit (Tifinagh, Morocco)",nativeName:"ⵜⴰⵛâµâµƒâµ‰âµœ (âµâµŽâµ–ⵔⵉⴱ)"},si:t9,"si-lk":{englishName:"Sinhala (Sri Lanka)",nativeName:"සිංහල (à·à·Šâ€à¶»à·“ ලංකà·à·€)"},sk:i9,"sk-sk":{englishName:"Slovak (Slovakia)",nativeName:"slovenÄina (Slovensko)"},sl:r9,"sl-si":{englishName:"Slovenian (Slovenia)",nativeName:"slovenÅ¡Äina (Slovenija)"},sma:n9,"sma-no":{englishName:"Sami, Southern (Norway)",nativeName:"Ã¥arjelsaemiengïele (Nöörje)"},"sma-se":{englishName:"Sami, Southern (Sweden)",nativeName:"Ã¥arjelsaemiengïele (Sveerje)"},smj:s9,"smj-no":{englishName:"Sami, Lule (Norway)",nativeName:"julevusámegiella (Vuodna)"},"smj-se":{englishName:"Sami, Lule (Sweden)",nativeName:"julevusámegiella (Svierik)"},smn:a9,"smn-fi":{englishName:"Sami, Inari (Finland)",nativeName:"anarâškielâ (Suomâ)"},sms:o9,"sms-fi":{englishName:"Sami, Skolt (Finland)",nativeName:"sää´mÇ©iõll (Lää´ddjânnam)"},sn:l9,"sn-latn":{englishName:"Shona (Latin)",nativeName:"chiShona (Latin)"},"sn-latn-zw":{englishName:"Shona (Latin, Zimbabwe)",nativeName:"chiShona (Zimbabwe)"},so:u9,"so-dj":{englishName:"Somali (Djibouti)",nativeName:"Soomaali (Jabuuti)"},"so-et":{englishName:"Somali (Ethiopia)",nativeName:"Soomaali (Itoobiya)"},"so-ke":{englishName:"Somali (Kenya)",nativeName:"Soomaali (Kiiniya)"},"so-so":{englishName:"Somali (Somalia)",nativeName:"Soomaali (Soomaaliya)"},sq:c9,"sq-al":{englishName:"Albanian (Albania)",nativeName:"shqip (Shqipëri)"},"sq-mk":{englishName:"Albanian (Macedonia, FYRO)",nativeName:"shqip (Republika e Maqedonisë)"},"sq-xk":{englishName:"Albanian (Kosovo)",nativeName:"shqip (Kosovë)"},sr:h9,"sr-cyrl":{englishName:"Serbian (Cyrillic)",nativeName:"ÑрпÑки"},"sr-cyrl-ba":{englishName:"Serbian (Cyrillic, Bosnia and Herzegovina)",nativeName:"ÑрпÑки (БоÑна и Херцеговина)"},"sr-cyrl-me":{englishName:"Serbian (Cyrillic, Montenegro)",nativeName:"ÑрпÑки (Црна Гора)"},"sr-cyrl-rs":{englishName:"Serbian (Cyrillic, Serbia)",nativeName:"ÑрпÑки (Србија)"},"sr-cyrl-xk":{englishName:"Serbian (Cyrillic, Kosovo)",nativeName:"ÑрпÑки (КоÑово)"},"sr-latn":{englishName:"Serbian (Latin)",nativeName:"srpski"},"sr-latn-ba":{englishName:"Serbian (Latin, Bosnia and Herzegovina)",nativeName:"srpski (Bosna i Hercegovina)"},"sr-latn-me":{englishName:"Serbian (Latin, Montenegro)",nativeName:"srpski (Crna Gora)"},"sr-latn-rs":{englishName:"Serbian (Latin, Serbia)",nativeName:"srpski (Srbija)"},"sr-latn-xk":{englishName:"Serbian (Latin, Kosovo)",nativeName:"srpski (Kosovo)"},ss:d9,"ss-sz":{englishName:"siSwati (Swaziland)",nativeName:"siSwati (Swaziland)"},"ss-za":{englishName:"siSwati (South Africa)",nativeName:"siSwati (South Africa)"},ssy:f9,"ssy-er":{englishName:"Saho (Eritrea)",nativeName:"Saho (Eretria)"},st:p9,"st-ls":{englishName:"Sesotho (Lesotho)",nativeName:"Sesotho (Lesotho)"},"st-za":{englishName:"Sesotho (South Africa)",nativeName:"Sesotho (South Africa)"},sv:m9,"sv-ax":{englishName:"Swedish (Ã…land Islands)",nativeName:"svenska (Ã…land)"},"sv-fi":{englishName:"Swedish (Finland)",nativeName:"svenska (Finland)"},"sv-se":{englishName:"Swedish (Sweden)",nativeName:"svenska (Sverige)"},sw:g9,"sw-cd":{englishName:"Kiswahili (Congo DRC)",nativeName:"Kiswahili (Jamhuri ya Kidemokrasia ya Kongo)"},"sw-ke":{englishName:"Kiswahili (Kenya)",nativeName:"Kiswahili (Kenya)"},"sw-tz":{englishName:"Kiswahili (Tanzania)",nativeName:"Kiswahili (Tanzania)"},"sw-ug":{englishName:"Kiswahili (Uganda)",nativeName:"Kiswahili (Uganda)"},syr:v9,"syr-sy":{englishName:"Syriac (Syria)",nativeName:"ܣܘܪÜÜÜ (ܣܘܪÜÜ)"},ta:y9,"ta-in":{englishName:"Tamil (India)",nativeName:"தமிழ௠(இநà¯à®¤à®¿à®¯à®¾)"},"ta-lk":{englishName:"Tamil (Sri Lanka)",nativeName:"தமிழ௠(இலஙà¯à®•ை)"},"ta-my":{englishName:"Tamil (Malaysia)",nativeName:"தமிழ௠(மலேசியா)"},"ta-sg":{englishName:"Tamil (Singapore)",nativeName:"தமிழ௠(சிஙà¯à®•பà¯à®ªà¯‚à®°à¯)"},te:_9,"te-in":{englishName:"Telugu (India)",nativeName:"తెలà±à°—à± (à°à°¾à°°à°¤ దేశం)"},teo:T9,"teo-ke":{englishName:"Teso (Kenya)",nativeName:"Kiteso (Kenia)"},"teo-ug":{englishName:"Teso (Uganda)",nativeName:"Kiteso (Uganda)"},tg:b9,"tg-cyrl":{englishName:"Tajik (Cyrillic)",nativeName:"Тоҷикӣ"},"tg-cyrl-tj":{englishName:"Tajik (Cyrillic, Tajikistan)",nativeName:"Тоҷикӣ (ТоҷикиÑтон)"},th:S9,"th-th":{englishName:"Thai (Thailand)",nativeName:"ไทย (ไทย)"},ti:C9,"ti-er":{englishName:"Tigrinya (Eritrea)",nativeName:"ትáŒáˆáŠ› (ኤáˆá‰µáˆ«)"},"ti-et":{englishName:"Tigrinya (Ethiopia)",nativeName:"ትáŒáˆáŠ› (ኢትዮጵያ)"},tig:E9,"tig-er":{englishName:"Tigre (Eritrea)",nativeName:"ትáŒáˆ¨ (ኤáˆá‰µáˆ«)"},tk:w9,"tk-tm":{englishName:"Turkmen (Turkmenistan)",nativeName:"Türkmen dili (Türkmenistan)"},tn:k9,"tn-bw":{englishName:"Setswana (Botswana)",nativeName:"Setswana (Botswana)"},"tn-za":{englishName:"Setswana (South Africa)",nativeName:"Setswana (Aforika Borwa)"},to:x9,"to-to":{englishName:"Tongan (Tonga)",nativeName:"lea fakatonga (Tonga)"},tr:A9,"tr-cy":{englishName:"Turkish (Cyprus)",nativeName:"Türkçe (Kıbrıs)"},"tr-tr":{englishName:"Turkish (Turkey)",nativeName:"Türkçe (Türkiye)"},ts:I9,"ts-za":{englishName:"Xitsonga (South Africa)",nativeName:"Xitsonga (South Africa)"},tt:P9,"tt-ru":{englishName:"Tatar (Russia)",nativeName:"Татар (� оÑÑиÑ)"},twq:D9,"twq-ne":{englishName:"Tasawaq (Niger)",nativeName:"Tasawaq senni (Nižer)"},tzm:N9,"tzm-arab":{englishName:"Central Atlas Tamazight (Arabic)",nativeName:"أطلس المركزية التامازيتية"},"tzm-arab-ma":{englishName:"Central Atlas Tamazight (Arabic, Morocco)",nativeName:"أطلس المركزية التامازيتية (Morocco)"},"tzm-latn":{englishName:"Central Atlas Tamazight (Latin)",nativeName:"TamaziÉ£t n laá¹laá¹£"},"tzm-latn-dz":{englishName:"Central Atlas Tamazight (Latin, Algeria)",nativeName:"TamaziÉ£t n laá¹laá¹£ (Djazaïr)"},"tzm-latn-ma":{englishName:"Central Atlas Tamazight (Latin, Morocco)",nativeName:"TamaziÉ£t n laá¹laá¹£ (Meṛṛuk)"},"tzm-tfng":{englishName:"Central Atlas Tamazight (Tifinagh)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ"},"tzm-tfng-ma":{englishName:"Central Atlas Tamazight (Tifinagh, Morocco)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ (âµâµŽâµ–ⵔⵉⴱ)"},ug:L9,"ug-cn":{englishName:"Uyghur (China)",nativeName:"ئۇيغۇرچە (Ø¬Û‡ÚØ®Û‡Ø§ خەلق جۇمھۇرىيىتى)"},uk:O9,"uk-ua":{englishName:"Ukrainian (Ukraine)",nativeName:"українÑька (Україна)"},ur:M9,"ur-in":{englishName:"Urdu (India)",nativeName:"اردو (بھارت)"},"ur-pk":{englishName:"Urdu (Pakistan)",nativeName:"Ø§ÙØ±Ø¯Ùˆ (پاکستان)"},uz:R9,"uz-arab":{englishName:"Uzbek (Perso-Arabic)",nativeName:"اوزبیک"},"uz-arab-af":{englishName:"Uzbek (Perso-Arabic, Afghanistan)",nativeName:"اوزبیک (Ø§ÙØºØ§Ù†Ø³ØªØ§Ù†)"},"uz-cyrl":{englishName:"Uzbek (Cyrillic)",nativeName:"Ўзбек"},"uz-cyrl-uz":{englishName:"Uzbek (Cyrillic, Uzbekistan)",nativeName:"Ўзбек (ЎзбекиÑтон)"},"uz-latn":{englishName:"Uzbek (Latin)",nativeName:"o‘zbek"},"uz-latn-uz":{englishName:"Uzbek (Latin, Uzbekistan)",nativeName:"o‘zbek (OÊ»zbekiston)"},vai:B9,"vai-latn":{englishName:"Vai (Latin)",nativeName:"Vai"},"vai-latn-lr":{englishName:"Vai (Latin, Liberia)",nativeName:"Vai (Laibhiya)"},"vai-vaii":{englishName:"Vai (Vai)",nativeName:"ꕙꔤ"},"vai-vaii-lr":{englishName:"Vai (Vai, Liberia)",nativeName:"ꕙꔤ (ꕞꔤꔫꕩ)"},ve:F9,"ve-za":{englishName:"Venda (South Africa)",nativeName:"Tshivenḓa (South Africa)"},vi:U9,"vi-vn":{englishName:"Vietnamese (Vietnam)",nativeName:"TiêÌng Việt (Việt Nam)"},vo:$9,"vo-001":{englishName:"Volapük (World)",nativeName:"Volapük (World)"},vun:j9,"vun-tz":{englishName:"Vunjo (Tanzania)",nativeName:"Kyivunjo (Tanzania)"},wae:V9,"wae-ch":{englishName:"Walser (Switzerland)",nativeName:"Walser (Schwiz)"},wal:H9,"wal-et":{englishName:"Wolaytta (Ethiopia)",nativeName:"ወላá‹á‰³á‰± (ኢትዮጵያ)"},wo:q9,"wo-sn":{englishName:"Wolof (Senegal)",nativeName:"Wolof (Senegaal)"},xh:z9,"xh-za":{englishName:"isiXhosa (South Africa)",nativeName:"isiXhosa (eMzantsi Afrika)"},xog:W9,"xog-ug":{englishName:"Soga (Uganda)",nativeName:"Olusoga (Yuganda)"},yav:G9,"yav-cm":{englishName:"Yangben (Cameroon)",nativeName:"nuasue (Kemelún)"},yi:K9,"yi-001":{englishName:"Yiddish (World)",nativeName:"ייִדיש (וועלט)"},yo:X9,"yo-bj":{englishName:"Yoruba (Benin)",nativeName:"Èdè Yorùbá (OrÃlÉ›Ìède Bɛ̀nɛ̀)"},"yo-ng":{englishName:"Yoruba (Nigeria)",nativeName:"Èdè Yorùbá (OrÃlẹÌède N� ìjÃrÃ� )"},zgh:Y9,"zgh-tfng":{englishName:"Standard Moroccan Tamazight (Tifinagh)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ"},"zgh-tfng-ma":{englishName:"Standard Moroccan Tamazight (Tifinagh, Morocco)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ (âµâµŽâµ–ⵔⵉⴱ)"},zh:Q9,"zh-cn":{englishName:"Chinese (Simplified, China)",nativeName:"䏿–‡(ä¸å›½)"},"zh-hans":{englishName:"Chinese (Simplified)",nativeName:"䏿–‡(简体)"},"zh-hans-hk":{englishName:"Chinese (Simplified Han, Hong Kong SAR)",nativeName:"䏿–‡ (香港特别行政区)"},"zh-hans-mo":{englishName:"Chinese (Simplified Han, Macao SAR)",nativeName:"䏿–‡ (澳门特别行政区)"},"zh-hant":{englishName:"Chinese (Traditional)",nativeName:"䏿–‡(ç¹é«”)"},"zh-hk":{englishName:"Chinese (Traditional, Hong Kong SAR)",nativeName:"䏿–‡(香港特別行政å€)"},"zh-mo":{englishName:"Chinese (Traditional, Macao SAR)",nativeName:"䏿–‡(澳門特別行政å€)"},"zh-sg":{englishName:"Chinese (Simplified, Singapore)",nativeName:"䏿–‡(新�� å¡)"},"zh-tw":{englishName:"Chinese (Traditional, Taiwan)",nativeName:"䏿–‡(å°ç£)"},zu:J9,"zu-za":{englishName:"isiZulu (South Africa)",nativeName:"isiZulu (i-South Africa)"},"zh-chs":{englishName:"Chinese (Simplified) Legacy",nativeName:"䏿–‡(简体) 旧版"},"zh-cht":{englishName:"Chinese (Traditional) Legacy",nativeName:"䏿–‡(ç¹é«”) 舊版"}};function Ch(s){return Dm[s.toLowerCase()]}function bb(s){const e=s.indexOf("-");if(e===-1)return Ch(s);const t=s.substring(0,e);return Ch(t)}function Z9(s){const e={},t=s.toLowerCase();for(const r in Dm){const i=Dm[r];i.englishName.toLowerCase().indexOf(t)>-1&&(e[r]=i)}return e}const Ac={getEnglishName(s){var e;return(e=bb(s))==null?void 0:e.englishName},getNativeName(s){var e;return(e=bb(s))==null?void 0:e.nativeName},getFullEnglishName(s){var e;return(e=Ch(s))==null?void 0:e.englishName},getFullNativeName(s){var e;return(e=Ch(s))==null?void 0:e.nativeName},getEnglishNameContains(s){return Z9(s)},VERSION:"1.2.0"},ej={ALLOWED_TAGS:["i","b","u","ruby","rt"]},tj="en-US",ij="English",rj="subtitles",fp=new Map,Nm={getLanguagesOptions:s=>s?s.map(e=>({label:s.length>1?Ac.getFullEnglishName(e.language):Ac.getEnglishName(e.language),value:e.language,id:e.id,url:e.src})).sort((e,t)=>{const r=e.value.includes(Jl)?1:0;return(t.value.includes(Jl)?1:0)-r}):[],transformVtt:s=>{if(!s)return[];const e=[],t=new lo.WebVTT.Parser(window,lo.WebVTT.StringDecoder()),r=[];if(t.oncue=function(i){r.push(i)},t.onparsingerror=function(i){e.push(i)},t.parse(s),t.flush(),e.length>0){const i=e.map(n=>n.message).join(", ");Rm.throw(new DF(`Failed to parse WebVTT format: ${i}`))}return r},createTextTrackList:(s,e)=>{const t=document.createElement("video"),r=t.addTextTrack(rj,e?Ac.getEnglishName(e):ij,e||tj);return s.forEach(i=>{r.addCue(i)}),t.textTracks},transformVttToTextTrackList:(s,e,t)=>{const r=`${t}-${e}`;if(fp.has(r))return fp.get(r);if(!s)return null;const i=Nm.transformVtt(s),n=Nm.createTextTrackList(i,e);return fp.set(r,n),n},sanitizeCueText:s=>vk.sanitize(s,ej)},Sb="transcript-selected-language",Jl="en";function Cb(s){var e,t;return((e=s.find(r=>r.language.includes(Jl)))==null?void 0:e.language)||((t=s[0])==null?void 0:t.language)}function Fa(s,e,t){let r=t.initialDeps??[],i;return()=>{var n,a,o,l;let u;t.key&&((n=t.debug)!=null&&n.call(t))&&(u=Date.now());const c=s();if(!(c.length!==r.length||c.some((g,C)=>r[C]!==g)))return i;r=c;let f;if(t.key&&((a=t.debug)!=null&&a.call(t))&&(f=Date.now()),i=e(...c),t.key&&((o=t.debug)!=null&&o.call(t))){const g=Math.round((Date.now()-u)*100)/100,C=Math.round((Date.now()-f)*100)/100,p=C/16,T=(A,N)=>{for(A=String(A);A.length<N;)A=" "+A;return A};console.info(`%c⏱ ${T(C,5)} /${T(g,5)} ms`,`
|
|
309
|
-
font-size: .6rem;
|
|
310
|
-
font-weight: bold;
|
|
311
|
-
color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(l=t==null?void 0:t.onChange)==null||l.call(t,i),i}}function pp(s,e){if(s===void 0)throw new Error("Unexpected undefined");return s}const nj=(s,e)=>Math.abs(s-e)<1,sj=(s,e,t)=>{let r;return function(...i){s.clearTimeout(r),r=s.setTimeout(()=>e.apply(this,i),t)}},aj=s=>s,oj=s=>{const e=Math.max(s.startIndex-s.overscan,0),t=Math.min(s.endIndex+s.overscan,s.count-1),r=[];for(let i=e;i<=t;i++)r.push(i);return r},lj=(s,e)=>{const t=s.scrollElement;if(!t)return;const r=s.targetWindow;if(!r)return;const i=a=>{const{width:o,height:l}=a;e({width:Math.round(o),height:Math.round(l)})};if(i(t.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const n=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){i({width:u.inlineSize,height:u.blockSize});return}}i(t.getBoundingClientRect())};s.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return n.observe(t,{box:"border-box"}),()=>{n.unobserve(t)}},Eb={passive:!0},wb=typeof window>"u"?!0:"onscrollend"in window,uj=(s,e)=>{const t=s.scrollElement;if(!t)return;const r=s.targetWindow;if(!r)return;let i=0;const n=s.options.useScrollendEvent&&wb?()=>{}:sj(r,()=>{e(i,!1)},s.options.isScrollingResetDelay),a=c=>()=>{const{horizontal:h,isRtl:f}=s.options;i=h?t.scrollLeft*(f&&-1||1):t.scrollTop,n(),e(i,c)},o=a(!0),l=a(!1);l(),t.addEventListener("scroll",o,Eb);const u=s.options.useScrollendEvent&&wb;return u&&t.addEventListener("scrollend",l,Eb),()=>{t.removeEventListener("scroll",o),u&&t.removeEventListener("scrollend",l)}},cj=(s,e,t)=>{if(e!=null&&e.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return Math.round(s.getBoundingClientRect()[t.options.horizontal?"width":"height"])},hj=(s,{adjustments:e=0,behavior:t},r)=>{var i,n;const a=s+e;(n=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||n.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:t})};class dj{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(i=>{i.forEach(n=>{const a=()=>{this._measureElement(n.target,n)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),t=null},observe:i=>{var n;return(n=r())==null?void 0:n.observe(i,{box:"border-box"})},unobserve:i=>{var n;return(n=r())==null?void 0:n.unobserve(i)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,i])=>{typeof i>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:aj,rangeExtractor:oj,onChange:()=>{},measureElement:cj,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,t)},this.maybeNotify=Fa(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,n)=>{this.scrollAdjustments=0,this.scrollDirection=n?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=n,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const i=new Map,n=new Map;for(let a=r-1;a>=0;a--){const o=t[a];if(i.has(o.lane))continue;const l=n.get(o.lane);if(l==null||o.end>l.end?n.set(o.lane,o):o.end<l.end&&i.set(o.lane,!0),i.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort((a,o)=>a.end===o.end?a.index-o.index:a.end-o.end)[0]:void 0},this.getMeasurementOptions=Fa(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,r,i,n,a)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:i,getItemKey:n,enabled:a}),{key:!1}),this.getMeasurements=Fa(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:i,getItemKey:n,enabled:a},o)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(c=>{this.itemSizeCache.set(c.key,c.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,l);for(let c=l;c<t;c++){const h=n(c),f=this.options.lanes===1?u[c-1]:this.getFurthestMeasurement(u,c),g=f?f.end+this.options.gap:r+i,C=o.get(h),p=typeof C=="number"?C:this.options.estimateSize(c),T=g+p,A=f?f.lane:c%this.options.lanes;u[c]={index:c,start:g,size:p,end:T,key:h,lane:A}}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Fa(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,i,n)=>this.range=t.length>0&&r>0?fj({measurements:t,outerSize:r,scrollOffset:i,lanes:n}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Fa(()=>{let t=null,r=null;const i=this.calculateRange();return i&&(t=i.startIndex,r=i.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,i,n,a)=>n===null||a===null?[]:t({startIndex:n,endIndex:a,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,i=t.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const i=this.indexFromElement(t),n=this.measurementsCache[i];if(!n)return;const a=n.key,o=this.elementsCache.get(a);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(a,t)),t.isConnected&&this.resizeItem(i,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const i=this.measurementsCache[t];if(!i)return;const n=this.itemSizeCache.get(i.key)??i.size,a=r-n;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,a,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,i)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(i))});return}this._measureElement(t,void 0)},this.getVirtualItems=Fa(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const i=[];for(let n=0,a=t.length;n<a;n++){const o=t[n],l=r[o];i.push(l)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return pp(r[Z2(0,r.length-1,i=>pp(r[i]).start,t)])},this.getOffsetForAlignment=(t,r,i=0)=>{const n=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+n?"end":"start"),r==="center"?t+=(i-n)/2:r==="end"&&(t-=n);const o=this.options.horizontal?"scrollWidth":"scrollHeight",u=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[o]:this.scrollElement[o]:0)-n;return Math.max(Math.min(u,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const i=this.measurementsCache[t];if(!i)return;const n=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(i.end>=a+n-this.options.scrollPaddingEnd)r="end";else if(i.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];const o=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,i.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(t,{align:r="start",behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:i})},this.scrollToIndex=(t,{align:r="auto",behavior:i}={})=>{t=Math.max(0,Math.min(t,this.options.count-1)),this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const n=this.getOffsetForIndex(t,r);if(!n)return;const[a,o]=n;this._scrollToOffset(a,{adjustments:void 0,behavior:i}),i!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(t))){const[u]=pp(this.getOffsetForIndex(t,o));nj(u,this.getScrollOffset())||this.scrollToIndex(t,{align:o,behavior:i})}else this.scrollToIndex(t,{align:o,behavior:i})}))},this.scrollBy=(t,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let i;return r.length===0?i=this.options.paddingStart:i=this.options.lanes===1?((t=r[r.length-1])==null?void 0:t.end)??0:Math.max(...r.slice(-this.options.lanes).map(n=>n.end)),Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:r,behavior:i})=>{this.options.scrollToFn(t,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const Z2=(s,e,t,r)=>{for(;s<=e;){const i=(s+e)/2|0,n=t(i);if(n<r)s=i+1;else if(n>r)e=i-1;else return i}return s>0?s-1:0};function fj({measurements:s,outerSize:e,scrollOffset:t,lanes:r}){const i=s.length-1;let a=Z2(0,i,l=>s[l].start,t),o=a;for(;o<i&&s[o].end<t+e;)o++;return r>1&&(a=Math.max(0,a-a%r),o=Math.min(i,o+(r-1-o%r))),{startIndex:a,endIndex:o}}const kb=typeof document<"u"?gi.useLayoutEffect:gi.useEffect;function pj(s){const e=gi.useReducer(()=>({}),{})[1],t={...s,onChange:(i,n)=>{var a;n?yk.flushSync(e):e(),(a=s.onChange)==null||a.call(s,i,n)}},[r]=gi.useState(()=>new dj(t));return r.setOptions(t),kb(()=>r._didMount(),[]),kb(()=>r._willUpdate()),r}function mj(s){return pj({observeElementRect:lj,observeElementOffset:uj,scrollToFn:hj,...s})}function gj(s){function e(r){const i=Array.from((r==null?void 0:r.activeCues)||[]);if(!i.length)return;const n=s.cuesToDisplay.findIndex(a=>a.startTime===_k.last(i).startTime);if(n===-1){s.setCurrentCueIndex(null);return}s.setCurrentCueIndex(n)}at.useEffect(()=>{s.hasStarted&&e(s.currentTranscriptTrack)},[s.hasStarted]);function t(){e(s.currentTranscriptTrack)}at.useEffect(()=>(s.currentTranscriptTrack&&s.currentTranscriptTrack.addEventListener("cuechange",t),()=>{var r;return(r=s.currentTranscriptTrack)==null?void 0:r.removeEventListener("cuechange",t)}),[s.currentTranscriptTrack])}function vj(s,e,t){function r(i){t&&t.scrollToIndex(i,{align:"start"})}return at.useEffect(()=>{!e||typeof s!="number"||r(s)},[s,e,t]),r}const xb=/\n/g;function yj({cuesToDisplay:s,resetHighlightedCues:e,setHighlightedCues:t,scrollToCue:r}){const[i,n]=at.useState(""),[a,o]=at.useState(null),[l,u]=at.useState(0),[,c]=at.useTransition();function h(p){n(p),l!==0&&u(0),c(()=>{f(p)})}function f(p){if(!p.length){o(null),e();return}const T=new RegExp(p.replace(xb," "),"gi"),A=[];let N=0;const F=s.map((V,R)=>{const O=V.text,M=O.replace(xb," ").matchAll(T);if(M.length===0)return Object.assign(V,{nodes:[{text:O,searchResultIndex:null}]});const U=[];let E=0;return M.forEach((P,Y)=>{const G=P[0],K=P.index;K>E&&U.push({text:O.substring(E,K),searchResultIndex:null}),U.push({text:G,searchResultIndex:N}),N++,A.push({cueIndex:R,cueMatchIndex:Y}),E=K+G.length}),E<O.length&&U.push({text:O.substring(E),searchResultIndex:null}),Object.assign(V,{nodes:U})});o(A),t(F),A.length&&r(A[0].cueIndex)}function g(p){const T=a[p];T&&(u(p),r(T.cueIndex))}function C(){o(null),n(""),u(0),e()}return{isSearching:a!==null,searchQuery:i,onSearch:h,jumpToSearchResult:g,totalSearchResults:a==null?void 0:a.length,currentSearchResultIndex:l,resetSearchResults:C}}function _j(s){return te.jsx("svg",{...s,children:te.jsx("path",{fill:"currentColor",d:"M4 5.5A1.5 1.5 0 0 1 5.5 4h9A1.5 1.5 0 0 1 16 5.5v1a.5.5 0 0 1-1 0v-1a.5.5 0 0 0-.5-.5h-9a.5.5 0 0 0-.5.5V15a.5.5 0 0 0 .5.5h1a.5.5 0 0 1 0 1h-1A1.5 1.5 0 0 1 4 15zM7.5 9A1.5 1.5 0 0 1 9 7.5h9.5A1.5 1.5 0 0 1 20 9v9.5a1.5 1.5 0 0 1-1.5 1.5H9a1.5 1.5 0 0 1-1.5-1.5zM9 8.5a.5.5 0 0 0-.5.5v9.5a.5.5 0 0 0 .5.5h9.5a.5.5 0 0 0 .5-.5V9a.5.5 0 0 0-.5-.5z"})})}const Tj="_hide_i94hz_1",bj="_show_i94hz_4",Ab={hide:Tj,show:bj},Sj="shared.copyContentIconButton",Ib=Kt.encloseNamespace(Sj);function Cj(s){const[e,t]=at.useState(!1);return at.useEffect(()=>{if(!e)return;const r=window.setTimeout(()=>{t(!1)},1e3);return()=>window.clearTimeout(r)},[e]),te.jsx(u0,{title:Ib(e?"copied":"copy"),spanHack:!0,spanHackClassName:s.tooltipClassName||"",children:te.jsx(Hs,{"aria-label":"Copy to clipboard",className:s.visible?Ab.show:Ab.hide,onClick:r=>{r.stopPropagation(),navigator.clipboard.writeText(s.copyableContent).then(()=>{var i;t(!0),(i=s.onClick)==null||i.call(s)})},children:te.jsx(rs,{svg:_j,size:s0.Small})})})}const Ej="_timePoint_1jw83_1",wj="_wide_1jw83_6",kj="_item_1jw83_9",xj="_inPlayer_1jw83_9",vl={timePoint:Ej,wide:wj,item:kj,inPlayer:xj};function Aj(s){const e=s.currentTimePoint===s.timePoint,[t,r]=c0(),i=f0.ToDisplayDuration(s.timePoint*1e3);return te.jsxs("section",{...s.isAuthenticated&&{role:"button"},className:`d-flex p-2 align-items-center cursor-pointer rounded text-dark ${s.inPlayer?vl.inPlayer:""} ${s.isAuthenticated?"cursor-pointer":""} ${vl.item} ${e?"bg-gray-100":""}`,id:s.timePoint.toString(),onClick:()=>{s.onClick(),En.logUserAction({...s.analyticsData,cueIndex:s.cueIndex},{...s.analyticsOptions,descriptor:Tk.TranscriptTimepoint,actionType:Jt.Click})},ref:t,children:[te.jsx("p",{className:"mb-0 d-flex flex-column align-items-center",children:te.jsx("time",{dateTime:`PT${s.timePoint}S`,"aria-label":`time-stamp-${i}`,className:`bg-light-blue text-info rounded-pill d-inline py-1 text-center ${vl.timePoint} ${s.wideTimeTag?vl.wide:""} ${e?"bg-white":""}`,children:i})}),te.jsx("p",{className:"ms-3 w-100 mb-0",children:s.nodes.map((n,a)=>{const o=Nm.sanitizeCueText(n.text);return n.searchResultIndex===null?te.jsx("span",{dangerouslySetInnerHTML:{__html:o}},a):te.jsx("mark",{className:`${vl.mark} ${n.searchResultIndex===s.currentSearchResultIndex?"bg-orange":"bg-yellow"}`,dangerouslySetInnerHTML:{__html:o}},a)})}),te.jsx(Cj,{copyableContent:s.transcript,visible:r,onClick:()=>{En.logUserAction({...s.analyticsData,cueIndex:s.cueIndex},{...s.analyticsOptions,actionType:Jt.Copy})}})]})}function Ij(s){var r;const e=s.cuesToDisplay.some(i=>i.startTime>=3600),t=new Map;return s.chapters.forEach((i,n)=>{const a=s.cuesToDisplay.findIndex(o=>o.startTime>i.startTime);t.set(a,n)}),te.jsx("article",{"aria-label":"transcript",className:"w-100 position-relative",style:{height:s.virtualizer.getTotalSize()},children:te.jsx("div",{className:"w-100 position-absolute top-0 start-0",style:{transform:`translateY(${((r=s.items[0])==null?void 0:r.start)??0}px)`},children:s.items.map(i=>{var u;const n=i.index,a=s.cuesToDisplay[n];let o=!1,l="";return t.has(n)&&(o=!0,l=s.chapters[t.get(n)].name),te.jsxs("section",{className:s.inPlayer?"":"px-3",ref:s.virtualizer.measureElement,"data-index":n,children:[o&&te.jsx("h3",{className:`${t.get(n)!==0?"mt-2":""} my-2 h6 ${s.inPlayer?"px-2":""}`,children:te.jsx("span",{children:l})}),te.jsx(Aj,{timePoint:a.startTime,transcript:a.text,nodes:a.nodes,onClick:()=>s.onClickTranscriptionItem(a),currentTimePoint:(u=s.timepoint)==null?void 0:u.startTime,currentSearchResultIndex:s.currentSearchResultIndex,wideTimeTag:!!e,inPlayer:s.inPlayer,analyticsOptions:s.analyticsOptions,analyticsData:s.analyticsData,cueIndex:n,isAuthenticated:s.isAuthenticated})]},a.startTime)})})})}function Pj(s){return te.jsx("svg",{...s,children:te.jsx("path",{d:"m12.733 8.305 5.963 5.906a1.046 1.046 0 0 1 0 1.473l-.01.011a1.034 1.034 0 0 1-1.467 0L12 10.526l-5.22 5.17a1.034 1.034 0 0 1-1.465 0l-.011-.012a1.046 1.046 0 0 1 0-1.473l5.963-5.906a1.034 1.034 0 0 1 1.466 0",fill:"currentColor"})})}const Dj="_inputWithoutHighlight_1bbmu_1",Nj="_inputFocus_1bbmu_5",Lj="_inputBlur_1bbmu_9",Oj="_cursor_1bbmu_13",mc={inputWithoutHighlight:Dj,inputFocus:Nj,inputBlur:Lj,cursor:Oj},Mj="playPage.transcriptSearchBar",gc=Kt.encloseNamespace(Mj);function Rj(s){const e=at.useRef(null),[t,r]=at.useState(!1);function i(C){En.logUserAction({...s.analyticsData,query:C},{...s.analyticsOptions,actionType:Jt.Search,descriptor:C?Hu.SearchTranscript:Hu.ResetResults})}const n=at.useCallback(Sp.debounce(C=>i(C),500),[]);function a(){En.logUserAction({...s.analyticsData,query:s.query},{...s.analyticsOptions,actionType:Jt.Search,descriptor:Hu.NextResult}),s.currentSearchResultIndex===s.totalSearchResults-1?s.jumpToSearchResult(0):s.jumpToSearchResult(s.currentSearchResultIndex+1)}function o(){En.logUserAction({...s.analyticsData,query:s.query},{...s.analyticsOptions,actionType:Jt.Search,descriptor:Hu.PreviousResult}),s.currentSearchResultIndex===0?s.jumpToSearchResult(s.totalSearchResults-1):s.jumpToSearchResult(s.currentSearchResultIndex-1)}function l(C){n(C.target.value),s.onSearch(C.target.value)}function u(C){var p;C.keepFocus||(p=e.current)==null||p.focus(),a()}function c(C){var p;C.keepFocus||(p=e.current)==null||p.focus(),o()}function h(){var C;i(""),(C=e.current)==null||C.focus(),s.onSearch("")}function f(C){C.key==="Enter"&&(C.preventDefault(),C.shiftKey?o():a())}function g(C){if(C==="focus"){r(!0);return}r(!1)}return te.jsxs("div",{className:bk("form-control py-0 px-1 d-flex align-items-center",t?mc.inputFocus:mc.inputBlur,mc.cursor),onClick:()=>{var C;return(C=e.current)==null?void 0:C.focus()},role:"search",children:[te.jsx("div",{"aria-hidden":"true",children:te.jsx(rs,{svg:Sk})}),te.jsx("input",{className:`form-control border-0 px-1 ${mc.inputWithoutHighlight}`,value:s.query,onChange:l,autoComplete:"off",placeholder:gc("searchPlaceholder"),ref:e,onKeyDown:f,onFocus:()=>g("focus"),onBlur:()=>g("blur")}),!!s.query&&te.jsxs("div",{className:"d-flex align-items-center",children:[te.jsx("div",{children:s.totalSearchResults?`${s.currentSearchResultIndex+1}/${s.totalSearchResults}`:"0/0"}),te.jsx(Hs,{"aria-label":gc("previousResult"),onClick:()=>c({keepFocus:!1}),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&c({keepFocus:!0})},children:te.jsx(rs,{svg:Pj})}),te.jsx(Hs,{"aria-label":gc("nextResult"),onClick:()=>u({keepFocus:!1}),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&u({keepFocus:!0})},children:te.jsx(rs,{svg:sx})}),te.jsx(Hs,{"aria-label":gc("clearSearch"),onClick:h,children:te.jsx(rs,{svg:h0})})]})]})}const Bj="shared.playPageTranscription";Kt.encloseNamespace(Bj);function Fj(s){return s.map(e=>Object.assign(e,{nodes:[{text:e.text,searchResultIndex:null}]}))}const Uj="_languageSelect_1ws0w_1",Pb={languageSelect:Uj};function $j(s){var n,a;const e=(n=s.languageOptions[0])==null?void 0:n.label,t=s.track.src,r=Ck();async function i(){En.logUserAction(s.analyticsData,{...s.analyticsOptions,actionType:Jt.Download});try{await lx.downloadBlob(t,`Subtitles-${s.selectedLanguage}.vtt`)}catch{r.error("Error downloading transcript")}}return te.jsxs("div",{className:"d-flex px-1 mb-3",children:[te.jsx(Rj,{query:s.searchQuery,currentSearchResultIndex:s.currentSearchResultIndex,onSearch:s.onSearch,totalSearchResults:s.totalSearchResults,jumpToSearchResult:s.jumpToSearchResult,analyticsData:s.analyticsData,analyticsOptions:s.analyticsOptions}),te.jsx(u0,{spanHack:!0,title:s.languageOptions.length>1?"":`Only available in ${e}`,children:te.jsxs(qu,{children:[te.jsx(qu.Toggle,{className:`text-dark ${Pb.languageSelect}`,id:"language-select",disabled:((a=s.languageOptions)==null?void 0:a.length)<=1,variant:"outline-dark",children:te.jsx(rs,{svg:ox})}),te.jsx(qu.Menu,{className:Pb.menu,"aria-labelledby":"language-select",children:s.languageOptions.map((o,l)=>te.jsx(qu.Item,{onClick:()=>{var u;(u=s.onChangeLanguage)==null||u.call(s,o.value),En.logUserAction({...s.analyticsData,language:o.value,previousLanguageName:s.selectedLanguage},{...s.analyticsOptions,actionType:Jt.Select})},className:"cursor-pointer",active:o.value===s.selectedLanguage,children:o.label},l))})]})}),te.jsx(d0,{svg:ax,onClick:i,className:"position-relative d-flex align-items-center text-dark"})]})}const jj=B.getComponent("Component");class Vj extends jj{constructor(e,t){super(e,t)}dispose(){setImmediate(()=>{var e;(e=this.root)==null||e.unmount()}),super.dispose()}}const Hj={tagName:"div"};function ud(s,e=Hj){if(!s)throw new Error("componentCtor is required");class t extends Vj{createEl(){const i=B.dom.createEl(e.tagName,e.properties,e.attributes),n=Ek.createRoot(i);return n.render(s(this.player_,this.options_)),this.root=n,i}}return t}function qj(s){const e=pt.get(Sb)||Cb(s.allTracks);function t(){return s.allTracks.find(ce=>ce.language===e)||s.allTracks.find(ce=>ce.language===Cb(s.allTracks))}const[r,i]=at.useState(()=>t()),[n,a]=at.useState(e),[o,l]=at.useState(-1),[u,c]=at.useState(!0),[h,f]=at.useState([]),g=at.useMemo(()=>Array.from((r==null?void 0:r.cues)||[]),[n]),C={videoId:s.playbackObject.videoId,videoName:s.playbackObject.title,language:n},p={location:Ir.Player,entity:xi.Transcript},T=s.player.hasStarted();gj({currentTranscriptTrack:r,cuesToDisplay:g,setCurrentCueIndex:l,hasStarted:T});const A=at.useRef(),N=mj({count:h.length,getScrollElement:()=>{var ce;return(ce=A.current)==null?void 0:ce.view},estimateSize:()=>40,enabled:h.length>0}),F=N.getVirtualItems(),V=vj(o,u,N),{isSearching:R,searchQuery:O,totalSearchResults:M,jumpToSearchResult:U,onSearch:E,currentSearchResultIndex:P,resetSearchResults:Y}=yj({cuesToDisplay:g,resetHighlightedCues:de,setHighlightedCues:f,scrollToCue:V}),G=s.player.paused(),[K,le]=c0();at.useEffect(()=>{c(!le&&!R&&T&&!G)},[le,R,T,G]);function de(){f(Fj(g))}at.useEffect(()=>{de()},[g]);function pe(){s.toggleTranscript(!1)}function se(ce){i(s.allTracks.find(he=>he.language===ce)),a(ce),pt.set(Sb,ce),Y()}function ae(ce){var he;(he=s.setStartTime)==null||he.call(s,ce.startTime)}return!r||!g.length?te.jsx(te.Fragment,{}):te.jsxs("div",{ref:K,className:`cv-transcript py-3 px-2 ${s.showTranscript?"cv-open":""}`,children:[te.jsxs("div",{className:"text-dark d-flex justify-content-between px-1",children:[te.jsx("h3",{children:"Transcript"}),te.jsx(d0,{svg:h0,onClick:pe,ariaLabel:"Close transcript"})]}),te.jsx($j,{selectedLanguage:n,languageOptions:s.languageOptions,onChangeLanguage:se,track:r,onSearch:E,searchQuery:O,currentSearchResultIndex:P,totalSearchResults:M,jumpToSearchResult:U,analyticsData:C,analyticsOptions:p}),te.jsx("div",{className:"cv-transcript-list-wrapper text-dark",children:te.jsx(wk,{ref:A,children:te.jsx(Ij,{timepoint:g[o],onClickTranscriptionItem:ae,cuesToDisplay:h,chapters:s.chapters,currentSearchResultIndex:P,inPlayer:!0,virtualizer:N,items:F,analyticsOptions:p,analyticsData:C,isAuthenticated:!1})})})]})}B.registerComponent("Transcript",ud((s,e)=>te.jsx(qj,{player:s,...e})));const zj=B.getPlugin("plugin"),ew=992;class Wj extends zj{constructor(e){super(e),this.allClickViewTracks=[],this.player=e,this.bindListeners(),e.ready(()=>this.initialize())}bindListeners(){this.onResize=this.onResize.bind(this),Zt.useMetadataTracks(this.player,"transcript",()=>this.player.trigger("resizemenus")),this.player.on("playerresize",this.onResize)}dispose(){this.player.off("playerresize",this.onResize),super.dispose()}initialize(){Zt.useMetadataTracks(this.player,"transcript",this.onTranscriptLoaded.bind(this)),Zt.useChapters(this.player,this.onChaptersLoaded.bind(this))}onChaptersLoaded(e){this.chapterTrack=e}onTranscriptLoaded(e){const t=e.isClickViewProduced;!this.allClickViewTracks.find(r=>r.language===e.language)&&t&&this.allClickViewTracks.push(e),this.languageOptions=this.buildOptions(this.allClickViewTracks)}buildOptions(e){return e.map(t=>({label:Ac.getFullEnglishName(t.language),value:t.language})).sort((t,r)=>{const i=t.value.includes(Jl)?1:0;return(r.value.includes(Jl)?1:0)-i})}buildComponentProps(e,t,r){var n;const i=Array.from(((n=this.chapterTrack)==null?void 0:n.cues)||[]).map(a=>({endTimestamp:a.endTime,startTime:a.startTime,name:a.text}));return{showTranscript:e,languageOptions:this.languageOptions,toggleTranscript:a=>t(a,{shouldLog:!0}),allTracks:this.allClickViewTracks,setStartTime:r,chapters:i,playbackObject:this.playbackObject}}addChildren(e){if(this.component)return this.component.show(),this.component;const t=this.toggleTranscript.bind(this),r=this.setStartTime.bind(this),i=this.buildComponentProps(e,t,r);this.component=this.player.addChild("Transcript",i)}toggleTranscript(e,t){var i,n,a;const r=e!==void 0?e:!this.showTranscript;this.showTranscript=r,r?((i=this.player.theatreModePlugin())==null||i.toggleTheatreMode(!0,{shouldLog:!1}),this.addChildren(!0),this.player.addClass("cv-transcript-plugin")):((n=this.component)==null||n.hide(),this.player.removeClass("cv-transcript-plugin")),this.player.whiteboardModePlugin&&this.player.whiteboardModePlugin().setEnabled(!r),this.player.trigger("cv-transcript-toggle",r),this.player.trigger("resizemenus"),this.player.trigger("playerresize"),t!=null&&t.shouldLog&&((a=this.analyticsService)==null||a.logUserAction({videoId:this.playbackObject.videoId,videoName:this.playbackObject.title},{actionType:Jt.Click,descriptor:r?ra.ShowTranscript:ra.HideTranscript,entity:xi.Transcript}))}setStartTime(e){this.player.currentTime(e)}isTranscriptOn(){return!!this.showTranscript}onResize(){if(window.innerWidth<ew){this.player.addClass("hide-transcript");return}this.showTranscript&&this.player.removeClass("hide-transcript")}registerAnalytics(e,t){this.analyticsService=e,this.playbackObject=t}}B.registerPlugin("viewTranscriptPlugin",Wj);const Gj=B.getComponent("TextTrackMenuItem");class tw extends Gj{constructor(e){const t={};t.track={player:e,kind:"subtitle",label:"Video Transcript",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="TranscriptMenuItem",super(e,t),this.transcriptOn=this.player_.viewTranscriptPlugin&&this.player_.viewTranscriptPlugin().isTranscriptOn(),this.bindEventListeners()}bindEventListeners(){const e=this.toggleListener.bind(this),t=this.onResize.bind(this);this.player_.on("cv-transcript-toggle",e),this.player_.on("playerresize",t),this.on("dispose",()=>{this.player_.off("cv-transcript-toggle",e),this.player_.off("playerresize",t)})}onResize(){const e=window.innerWidth<ew;this.item&&(this.item.style.display=e?"none":"block")}handleToggleListener(){this.transcriptOn?this.toggleOff():this.toggleOn()}toggleListener(e,t){var r,i;t?(this.transcriptOn=!0,B.dom.addClass(this.toggleEl,"on")):(this.transcriptOn=!1,(i=(r=B.dom).removeClass)==null||i.call(r,this.toggleEl,"on"))}toggleOn(){var e,t;this.transcriptOn=!0,B.dom.addClass(this.toggleEl,"on"),this.player_.viewTranscriptPlugin&&((t=(e=this.player_.viewTranscriptPlugin())==null?void 0:e.toggleTranscript)==null||t.call(e,!0,{shouldLog:!0})),this.player_.whiteboardModePlugin&&this.player_.whiteboardModePlugin().setEnabled(!1)}toggleOff(){var e,t,r,i;this.transcriptOn=!1,(t=(e=B.dom).removeClass)==null||t.call(e,this.toggleEl,"on"),this.player_.viewTranscriptPlugin&&((i=(r=this.player_.viewTranscriptPlugin())==null?void 0:r.toggleTranscript)==null||i.call(r,!1,{shouldLog:!0}))}createEl(e,t,r){this.handlerBound||(this.handleToggleListener=this.handleToggleListener.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggleListener),this.toggleEl=B.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggleListener);const i=`
|
|
312
|
-
<span class="vjs-menu-item-text">Video Transcript</span>
|
|
313
|
-
<span class="cv-toggle-container"></span>
|
|
314
|
-
<span class="vjs-control-text" aria-live="polite">, opens transcript</span>
|
|
315
|
-
`;return this.item=B.dom.createEl("li",{className:"vjs-menu-item cv-transcript-toggle",innerHTML:i,tabIndex:-1},r),this.item.children[1].appendChild(this.toggleEl),this.item}}B.registerComponent("ToggleTranscriptMenuItem",tw);const Kj=B.getComponent("TextTrackButton"),Db=B.getComponent("SubsCapsButton");class Xj extends Db{constructor(e,t){super(e,t),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-subs-caps-menu-button",this.onSelectedLanguageChange=this.onSelectedLanguageChange.bind(this),this.player_.on("cv:languageselected",this.onSelectedLanguageChange),this.player_.one("dispose",()=>this.player_.off("cv:languageselected",this.onSelectedLanguageChange))}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}createItems(){const e=[];if(!this.player_.options_.mobile){const t=this.player().textTracks(),r=Array.from(t||[]).some(n=>n.kind==="subtitles");this.player_.options_.allowTranscript&&!!r&&this.player_.viewTranscriptPlugin&&e.push(new tw(this.player_)),this.player_.options_.allowTranscript||e.push(new AF(this.player_)),e.push(new PF(this.player_)),this.hideThreshold_=e.length}return this.player().trigger("resizemenus"),Kj.prototype.createItems.call(this,e,kF)}onSelectedLanguageChange(){const e=this.player_.textTracks();for(let t=0;t<e.length;t++){const r=e[t];if(r.kind==="subtitles"&&r.mode==="showing"){this.setActive(!0);return}}this.setActive(!1)}getCollabsibleName(){return"Subtitles"}getCollabsibleValue(){const e=this.player_.textTracks();for(let t=0;t<e.length;t++){const r=e[t];if(this.kinds_.indexOf(r.kind)>-1&&r.mode==="showing")return r.label}return"Off"}showInCollabsibleMenu(){const e=this.player_.textTracks();for(let t=0;t<e.length;t++){const r=e[t];if(this.kinds_.indexOf(r.kind)>-1)return!0}return!1}showCollapsibleMenu(){Db.prototype.handleClick.apply(this)}}B.registerComponent("SubsCapsButton",Xj);const Yj=`<span class='vjs-local-cache-indicator-icon' title='Streaming from ClickView Local Cache'>${N2}</span>`,Qj=B.getComponent("MenuItem");class Jj extends Qj{constructor(e,t){super(e,t),this.qualityId=t.qualityId;const r=e.qualityLevels(),i=this.handleQualityChange.bind(this);r.on("change",i),e.one("dispose",()=>{r.off("change",i)}),this.handleLocalCacheChange=this.handleLocalCacheChange.bind(this),this.player_.ready(()=>{this.player_&&(this.player_.on("localcachechanged",this.handleLocalCacheChange),this.player_.one("dispose",()=>{var n;(n=this.player_)==null||n.off("localcachechanged",this.handleLocalCacheChange)}),this.handleLocalCacheChange())})}async handleLocalCacheChange(){const t=await this.player_.localCache().getActiveLocalCache();if(!(t!=null&&t.playbackProfile)){this.show(),this.enable(),this.setLabel(this.options_.label);return}t.playbackProfile!==this.qualityId?this.disable():this.setLabel(this.options_.label+Yj)}setLabel(e){const t=this.$(".vjs-menu-item-text");t&&(t.innerHTML=e)}buildCSSClass(){return"vjs-menu-item cv-quality-menu-item"}handleClick(){const e=this.player_.qualityLevels();for(let t=0;t<e.length;t++){const r=e[t];r.enabled=r.id===this.qualityId}}handleQualityChange(){if(!this.player_)return;const e=this.player_.qualityLevels(),t=e[e.selectedIndex],r=t&&t.id===this.qualityId;r!==this.isSelected_&&this.selected(r)}}const Nb={144:"144p (Preview)",240:"240p",360:"360p",480:"480p",720:"720p",1080:"1080p"},Lb=B.getComponent("MenuButton");class Zj extends Lb{constructor(e,t){super(e,t),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-quality-menu-button";const r=this.player_.qualityLevels(),i=this.update.bind(this);r.on("addqualitylevel",i),r.on("removequalitylevel",i),e.one("dispose",()=>{r.removeEventListener("addqualitylevel",i),r.removeEventListener("removequalitylevel",i)})}buildCSSClass(){return`cv-quality-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`cv-menu-small vjs-quality-button cv-has-left-icons ${super.buildWrapperCSSClass()}`}createItems(){const e=[],t=this.player_.qualityLevels();e.push(new aa(this.player_,{label:"Quality"}));for(let r=0;r<t.length;r++){const i=t[r];if(!i)continue;const n=Nb[i.id];n&&e.push(new Jj(this.player_,{qualityId:i.id,label:n,selectable:!0,multiSelectable:!1}))}return e}getCollabsibleName(){return"Quality"}getCollabsibleValue(){const e=this.player_.qualityLevels(),t=e[e.selectedIndex];return t?Nb[t.id]:""}showInCollabsibleMenu(){return!!this.player_.qualityLevels().length}showCollapsibleMenu(){Lb.prototype.handleClick.apply(this)}}B.registerComponent("QualityButton",Zj);const eV=B.getComponent("Menu"),Ob=B.getComponent("MenuButton"),tV=B.getComponent("PlaybackRateMenuItem"),Mb=B.getComponent("PlaybackRateMenuButton");class iV extends Mb{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-playback-rate-menu-button"}createEl(...e){return Ob.prototype.createEl.apply(this,...e)}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}createMenu(){const e=new eV(this.player(),{menuButton:this});e.addItem(new aa(this.player_,{label:"Playback speed"}));const t=this.playbackRates();if(t)for(let r=0;r<t.length;r++){let i=t[r]+"x";t[r]===1&&(i+=" (Normal)"),e.addItem(new tV(this.player(),{rate:i}))}return e}handleClick(...e){return Ob.prototype.handleClick.apply(this,...e)}updateLabel(...e){return this.setupLabelEl(),Mb.prototype.updateLabel.apply(this,...e)}setupLabelEl(){if(this.labelEl_)return;const e=this.$("button");e&&(this.labelEl_=B.dom.createEl("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),e.appendChild(this.labelEl_))}getCollabsibleName(){return"Playback speed"}getCollabsibleValue(){return this.player().playbackRate()+"x"}showInCollabsibleMenu(){return!!this.playbackRates()}showCollapsibleMenu(){this.handleClick(null)}}B.registerComponent("PlaybackRateMenuButton",iV);const rV=B.getComponent("TextTrackSettings"),Ic={backgroundColor:"#000",backgroundOpacity:"1",color:"#FFF",edgeStyle:void 0,fontFamily:"proportionalSansSerif",fontPercent:1,textOpacity:"1",windowColor:"#000",windowOpacity:"0"},Rb={small:Ic,medium:{...Ic,fontPercent:1.5},large:{...Ic,fontPercent:2}};class nV extends rV{setSizeSetting(e){this.size_=e,this.player_.getChild("textTrackDisplay").updateDisplay();const r=this.player_.getChild("collapserator").getChild("subtitleSizeButton");this.player_.trigger("changesubtitlesize",this.size_),window.requestAnimationFrame(()=>{r.update(),this.player_.trigger("resizemenus")})}getSizeSetting(){return this.size_||"small"}getValues(){return Rb[this.size_]?Rb[this.size_]:Ic}}B.registerComponent("TextTrackSettings",nV);const sV="cv-video-wrapper",Pc=B.getComponent("Player");class iw extends Pc{constructor(e,t){super(e,t),this._dataLoaded=!1,t.mobile&&this.addClass("cv-mobile-player");const r=()=>this._dataLoaded=!0;this.on("cv-playback-data-loaded",r),this.on("dispose",()=>this.off("cv-playback-data-loaded",r))}dataLoaded(e){if(this._dataLoaded){e();return}this.one("cv-playback-data-loaded",e),this.one("dispose",()=>{this.off("cv-playback-data-loaded",e)})}lock(e){this.callback_=e}unlock(){delete this.callback_}currentTime(e,t){if(typeof e!="number"||!this.callback_||t)return super.currentTime(e);this.callback_(()=>{this.unlock(),this.currentTime(e)})}play(){if(!this.callback_)return super.play();this.callback_(()=>{this.unlock(),this.play()})}createEl(){const e=super.createEl();return this.videoContainer||(this.videoContainer=B.dom.createEl("div",{className:sV}),e.appendChild(this.videoContainer)),Array.from(e.childNodes).forEach(t=>t!==this.videoContainer&&this.videoContainer.appendChild(t)),e}addChild(e,t={},r=this.children_.length){const i=super.addChild(e,t,r),n=i.el();return n&&this.videoContainer.appendChild(n),i}updateStyleEl_(){if(Pc.prototype.updateStyleEl_.call(this),!this.options_.fluid)return;const e=this.el_.parentNode;if(!e||!this.options_.setMaxHeight)return;let t=this.aspectRatio();if((t===void 0||t==="auto")&&(this.videoWidth()>0?t=this.videoWidth()+":"+this.videoHeight():t="16:9"),this.player_.playerModePlugin().getMode()===F2.Hover){e.style.removeProperty("maxWidth"),e.style.removeProperty("margin");return}const r=t.split(":"),i=+r[1]/+r[0];e.style.maxWidth=85/i+"vh",e.style.margin="0 auto"}listenForUserActivity_(){Pc.prototype.listenForUserActivity_.call(this);const e=this.getChild("collapserator");e.on("mouseenter",()=>{this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout,this.player().options_.inactivityTimeout=0}),e.on("mouseleave",()=>{this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})}}iw.prototype.options_={...Pc.prototype.options_,setMaxHeight:!0};B.registerComponent("player",iw);const aV=B.getComponent("Component");class oV extends aV{constructor(e,t){super(e,t),this.player_.addClass("cv-disable-play-pause-feedback"),this.onFirstPlay=this.onFirstPlay.bind(this),this.player_.one("play",this.onFirstPlay)}dispose(){this.player_.off("play",this.onFirstPlay)}onFirstPlay(){window.setTimeout(()=>{this.player_.isDisposed()||this.player_.removeClass("cv-disable-play-pause-feedback")},500)}createEl(){return B.dom.createEl("div",{className:"cv-play-pause-feedback"})}}B.registerComponent("PlayPauseFeedback",oV);const vc=B.getComponent("PlayToggle"),rw="Play (space)",lV="Pause (space)";let nw=class extends vc{handlePlay(){vc.prototype.handlePlay.call(this),this.controlText(lV)}handlePause(){vc.prototype.handlePause.call(this),this.controlText(rw)}handleClick(e){vc.prototype.handleClick.call(this,e),this.player_.addClass("cv-disable-play-pause-feedback"),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.player_.removeClass("cv-disable-play-pause-feedback")},500)}};B.registerComponent("PlayToggle",nw);nw.prototype.controlText_=rw;const Bb=B.getComponent("TextTrackDisplay"),uV=.025;class cV extends Bb{constructor(e,t){super(e,t),this.bindListeners()}bindListeners(){this.onResize=this.onResize.bind(this),this.player_.on("resize",this.onResize)}onResize(){this.updateDisplay()}updateDisplayState(e){Bb.prototype.updateDisplayState.call(this,e);const t=this.player_.textTrackSettings.getValues(),r=e.activeCues;let i=r.length;for(;i--;){const n=r[i];if(!n)continue;const a=n.displayState;if(t.fontPercent&&t.fontPercent!==1){const l=this.el().getBoundingClientRect().width*uV*100/100;a.style.fontSize=l*t.fontPercent+"px"}}}}B.registerComponent("TextTrackDisplay",cV);const hV=B.getComponent("Component");class dV extends hV{createEl(){return B.dom.createEl("div",{className:"cv-control-bar-gradient-container",innerHTML:'<div class="cv-control-bar-gradient"></div>'})}}B.registerComponent("ControlBarGradient",dV);const fV=B.getComponent("Component");class pV extends fV{constructor(e,t){super(e,t),this.options_=t}createEl(){let e=this.options_.title;if(!this.options_.seriesName)return super.createEl("h1",{innerHTML:e});const t=this.buildSeasonEpisodeString();return t?(e=`<div class='cv-splash-series'>${this.options_.seriesName.toUpperCase()} ${t}</div>`+e,super.createEl("h1",{innerHTML:e})):(e=`<div class='cv-splash-series'>${this.options_.seriesName.toUpperCase()}</div>`+e,super.createEl("h1",{innerHTML:e}))}buildSeasonEpisodeString(){if(!this.options_.seasonNumber||!this.options_.episodeNumber)return"";const e=this.padNumber(this.options_.seasonNumber,2),t=this.padNumber(this.options_.episodeNumber,2);return`S${e} • E${t}`}padNumber(e,t){let r=e.toString();if(r.length>=t)return r;for(t=t-r.length;t>0;)r="0"+r,t--;return r}}function mV(s){return s?(t=>{switch(!0){case t<32:return"cv-rating-purple";case t<48:return"cv-rating-green";case t<80:return"cv-rating-blue";case t<96:return"cv-rating-red";case t<128:return"cv-rating-pink";case t>=128:return"cv-rating-yellow";default:return""}})(s):""}const gV=B.getComponent("Component");class vV extends gV{constructor(e,t){super(e,t),this.options_=t}buildCSSClass(){return`cv-splash-rating ${mV(this.options_.ratingValue)}`}createEl(e,t,r){return this.options_.ratingCode?super.createEl(e,{...t,className:this.buildCSSClass(),innerHTML:this.options_.ratingCode},r):null}}const yV=B.getComponent("Component");class _V extends yV{constructor(e,t){if(super(e,t),!t.embed)return this;this.addChild(new pV(e,t)),this.addChild(new vV(e,t))}createEl(){return B.dom.createEl("div",{className:"cv-splash-metadata"})}}const TV=B.getComponent("posterImage");class bV extends TV{constructor(e,t){super(e,t),this.addChild(new _V(e,t))}createEl(){let e="<div class='cv-splash-mask'></div>";return this.options_.embed&&(e+=`<div class='cv-splash-logo'>${I2}</div>`),B.dom.createEl("div",{className:"vjs-poster cv-embed-splash cv-embed-splash-black",tabIndex:-1,innerHTML:e})}setSrc(e){let t="";e&&(t=`url("${e}")`),this.el_.style.backgroundImage=t}}B.registerComponent("posterImage",bV);const SV=B.getComponent("ErrorDisplay");class CV extends SV{constructor(e,t){super(e,t),this.el().prepend(this.getErrorImage())}getErrorImage(){return B.dom.createEl("div",{className:"cv-error-image",innerHTML:`
|
|
316
|
-
<svg viewBox="0 0 301 185" xmlns="http://www.w3.org/2000/svg">
|
|
317
|
-
<path d="M267.393 36.6514V167.906C267.393 168.182 267.169 168.406 266.893 168.406H32C31.7239 168.406 31.5 168.182 31.5 167.906V36.6514C31.5 36.3752 31.7239 36.1514 32 36.1514H80.5C80.7761 36.1514 81 36.3752 81 36.6514V57.7196C81 58.7622 82.0375 59.4868 83.0164 59.1279L95.7377 54.4634C95.9961 54.3687 96.2825 54.5006 96.3785 54.7585L102.094 70.1194C102.677 71.6866 105 71.2685 105 69.5964V48.4925C105 47.7632 104.475 47.1396 103.757 47.0146L94.2479 45.3609C93.9436 45.308 93.7596 44.9946 93.8616 44.7031L96.7376 36.4862C96.8077 36.2856 96.997 36.1514 97.2095 36.1514H266.893C267.169 36.1514 267.393 36.3752 267.393 36.6514Z" stroke="white"/>
|
|
318
|
-
<path d="M163.296 101.777L149.437 90.1217C148.275 89.1441 146.5 89.9705 146.5 91.4894V113.664C146.5 115.141 148.191 115.98 149.367 115.087L163.226 104.569C164.139 103.876 164.173 102.515 163.296 101.777Z" stroke="white" stroke-linecap="round"/>
|
|
319
|
-
<path d="M295.53 23.0783L277.524 26.2801L283.252 32.7192L274.855 38.9079L292.861 35.7061L287.133 29.2671L295.53 23.0783Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
|
320
|
-
<path d="M268.06 2.91764L254.192 14.8403L262.401 17.4661L258.324 27.0679L272.192 15.1453L263.983 12.5194L268.06 2.91764Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
|
321
|
-
</svg>
|
|
322
|
-
`})}}B.registerComponent("ErrorDisplay",CV);const Fb=B.getComponent("FullscreenToggle"),sw="Fullscreen (f)";class aw extends Fb{handleFullscreenChange(){Fb.prototype.handleFullscreenChange.call(this),this.controlText(sw)}}B.registerComponent("FullscreenToggle",aw);aw.prototype.controlText_=sw;const EV=B.getComponent("MuteToggle"),ow="Mute (m)",wV="Unmute (m)";class lw extends EV{updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?wV:ow;this.controlText_!==t&&this.controlText(t)}}B.registerComponent("MuteToggle",lw);lw.prototype.controlText_=ow;const kV=B.getComponent("Player"),xV=s=>s.indexOf("#")===0?s.slice(1):s,AV=3;let yl;const wh=class wh{constructor(e,t){if(this.streamLogged=!1,this.options=B.obj.merge({},wh.options_,t),this.options.playerApi===null)throw new Error("PlayerApi required");this.initialize(),this.createEl(e),this.buildVideoJs(),this.options.splash&&this.setupSplash(this.options.splash),this.bindEventListeners(),this.setupSeekBar(),this.fetchConfig(),this.logStream=this.logStream.bind(this),this.player.ready(()=>{this._configurePlugins(),this.options.setup&&this.options.setup(this.options,this.player),this.fetch().catch(r=>this.handleFetchError(r))})}initialize(){}_configurePlugins(){this.player.configureMenuDimensionsPlugin({mobile:this.options.mobile,overflowControls:this.options.overflowControls,seekBarName:this.getSeekBarName()}),this.player.progressReporterPlugin({onFlush:this.onFlushProgress=this.onFlushProgress.bind(this)}),this.player.persistVolumePlugin(),!this.options.mobile&&this.options.allowFullscreen&&this.player.fullscreenOnRotatePlugin(),this.player.touchControls(),this.options.getExternalLink&&this.player.openExternallyPlugin({getExternalLink:this.options.getExternalLink}),this.configurePlugins()}configurePlugins(){}onFlushProgress(e){var t;(t=this.analyticsService)==null||t.logVideoProgress(e)}buildVideoJs(){return this.player=B(this.el,this.getPlayerOptions())}getInactivityTimeout(){if(typeof this.options.inactivityTimeout=="number")return this.options.inactivityTimeout;let e=500;return(this.options.mobile||B.browser.IS_IOS||B.browser.IS_ANDROID)&&(e=3e3),e}getFluid(){return!(this.options.theatreMode||this.options.embed||this.options.mobile)}getFill(){return!!(this.options.theatreMode||this.options.embed||this.options.mobile)}getPlayerOptions(){let e=kV.prototype.options_.children;return e=e.filter(t=>!(t==="bigPlayButton"||t==="posterImage")),{controls:this.options.controls,fluid:this.getFluid(),fill:this.getFill(),inactivityTimeout:this.getInactivityTimeout(),controlBar:{children:["timeWrapper","progressControl"]},children:[...e,{name:"collapserator",children:XO.filter(t=>!(t==="fullscreenToggle"&&!this.options.allowFullscreen))},"playPauseFeedback","controlBarGradient"],userActions:{hotkeys:t=>nM(t,this.player,this.options)},playbackRates:this.options.playbackRates,techOrder:["html5"],html5:{nativeTextTracks:!1},playsinline:!0,aspectRatio:this.options.aspectRatio,mobile:this.options.mobile,allowTheatreMode:this.options.allowTheatreMode,deferMenus:this.options.deferMenus,muted:this.options.muted,devicesConfig:this.options.devicesConfig}}async getPlaybackObject(){if(this.options.offlinePlaybackObject)return this.options.offlinePlaybackObject;let e=this.options.fetch;if(this.options.fetch===void 0&&(e=r=>{const i=`${this.options.playerApi.origin}/api/playback?viewKey=${r}`;return rm.get(i)}),!this.options.viewKey)throw new Error("Please specify a viewKey or a fetch function");const t=await e(this.options.viewKey);if(!t)throw new Error("Error fetching playback object");return t}setChaptersInternal(e,t){let r=Zt.getTrack(this.player,"chapters",null);r||(r=this.player.addTextTrack("chapters")),[...r.cues.cues_].forEach(n=>r.removeCue(n)),e.forEach(n=>{r.addCue({startTime:n.timestamp,endTime:n.endTimestamp,text:n.name})}),t&&r.trigger({type:"cv:cuechange",target:r}),r.trigger({type:"loadeddata",target:r})}setChapters(e){this.setChaptersInternal(e,!0)}setPlayerMode(e,t){this.player.playerModePlugin().setPlayerMode(e,t)}setFavourite(e,t){this.player.favouritePlugin().setFavourite(e,t)}async fetch(){var i,n,a;const e=await this.getPlaybackObject();if(this.isDisposed())return;const t=e.mediaType==="MasterClip",r=(i=e.additionalData)==null?void 0:i.clipData;((a=(n=e.chapters)==null?void 0:n.list)==null?void 0:a.length)>0&&!t&&!r&&this.setChaptersInternal(e.chapters.list,!1),this.player.localCache({localCacheAddresses:e.localCacheAddresses??[],enabled:this.options.enableLocalCache??!0}),this.player.progressiveFiles({sources:e.files.progressive.map(o=>({id:o.profile,mimeType:o.mimeType,url:o.url}))}),this.player.handleNetworkErrors({playerApi:this.options.playerApi,fileToken:e.files.fileToken}),e.subtitles.list.length>0&&e.subtitles.list.forEach(o=>{if(o.mimeType!=="text/vtt")return;const l=this.player.addRemoteTextTrack({kind:"subtitles",src:o.url,language:o.language,label:o.label},!0);if(Zt.sanitizeTrack(l.track,this.player),this.options.allowTranscript){const u=this.player.addRemoteTextTrack({kind:"metadata",src:o.url+(o.url.includes("?")?"&":"?")+"fullSentences=true",language:o.language,label:"transcript"},!0);u.track.isClickViewProduced=o.isClickViewProduced,Zt.sanitizeTrack(u.track,this.player)}}),e.posterUrl&&this.player.poster(Bm.createUrl(e.posterUrl,{size:Fm.Large})),this.setupSplash({title:e.title,posterUrl:e.posterUrl,episodeNumber:e.episodeNumber,ratingCode:e.ratingCode,seasonNumber:e.seasonNumber,seriesName:e.seriesName}),this.additionalSetup(e),this.handleAutoplay(e),this.options.startTime&&(this.player.currentTime(this.options.startTime),this.player.one("canplay",()=>{this.player.currentTime(this.options.startTime)})),this.player.trigger("cv-playback-data-loaded",e)}handleFetchError(e){var r;let t=e.message;e instanceof im&&((r=e.response)==null?void 0:r.type)===h1.PhysicallyChapteredVideo&&(t="Video cannot be played because it is either corrupt or damaged."),this.player.error(t),this.options.onError&&this.options.onError(e)}async fetchConfig(){if(yl||this.options.fetch||this.options.offlinePlaybackObject)return;const e=`${this.options.playerApi.origin}/api/config`;yl=await rm.get(e),!this.isDisposed()&&this.trigger("config:loaded")}additionalSetup(e){var r;this.player.whiteboardModePlugin(),this.player.deferMenusPlugin();const t=this.options.enableLocalCache&&!!((r=e.localCacheAddresses)!=null&&r.length);yl?this.setupAnalyticsService(e,t):this.one("config:loaded",()=>this.setupAnalyticsService(e,t)),this.analyticsService||!this.isAnalyticsEnabled()?this.setupAnalyticsDependentPlugins(e):this.one("analytics:loaded",()=>this.setupAnalyticsDependentPlugins(e))}setupAnalyticsService(e,t){this.options.eventLogging&&(this.analyticsService=new YO({player:this.player,collectionApiUrls:yl.collectionApi.urls,collectionApiClientId:yl.collectionApi.clientId,productVersion:aM.version,authSessionId:e.viewerAuthSessionId,videoId:e.videoId,mediaId:e.mediaId,userId:e.viewerId,shareId:e.shareId,customerId:e.viewerCustomerId,mediaType:e.mediaType,playerType:this.getAnalyticsPlayerType(),isEmbedded:this.options.embed,isUsingLocalCache:t,additionalAnalyticsData:this.getAdditionalAnalyticsData(e),regionName:e.instanceRegion||this.options.sharerInstanceRegion||kk.CvApSoutheast1}),this.on("timeupdate",this.logStream),this.trigger("analytics:loaded"))}setupAnalyticsDependentPlugins(e){var t,r,i,n;this.player.persistSubtitleSettingsPlugin({showSubtitles:(t=e.settings)==null?void 0:t.showSubtitles,subtitleSize:(r=e.settings)==null?void 0:r.playbackSubtitleSizeDefault,analyticsService:this.analyticsService}),this.player.persistQualitySettingsPlugin({playbackProfile:(i=e.settings)==null?void 0:i.playbackProfile,playbackProfileLocalCache:(n=e.settings)==null?void 0:n.playbackProfileLocalCache,analyticsService:this.analyticsService}),this.player.persistPlaybackRatePlugin({analyticsService:this.analyticsService})}getAdditionalAnalyticsData(e){return{}}isAnalyticsEnabled(){return this.options.fetch||this.options.offlinePlaybackObject?!1:this.options.eventLogging}handleAutoplay(e){this.options.autoplay&&this.player.ready(()=>{this.player.play().catch(()=>{this.isDisposed()||this.showSplash()})})}logStream(){this.analyticsService&&(this.player.currentTime()<AV||this.streamLogged||(this.analyticsService.logStream(),this.streamLogged=!0,this.off("timeupdate",this.logStream)))}getAnalyticsPlayerType(){return"player"}createEl(e){let t;typeof e=="string"?(e=xV(e),t=B.dom.$("#"+e)):t=e;let r="video-js";return this.getPlayerClassName()&&(r+=` ${this.getPlayerClassName()}`),this.el=B.dom.createEl("video",{},{class:r}),t.appendChild(this.el),this.el}getPlayerClassName(){return""}on(e,t){this.player.on(e,t)}one(e,t){this.player.one(e,t)}off(e,t){this.player.off(e,t)}trigger(e,t){return this.player.trigger(e,t)}dispose(){this.player.dispose()}ready(e){this.player.ready(e)}isDisposed(){return this.player.isDisposed()}play(){this.player.play()}pause(){this.player.pause()}isPaused(){return this.player.paused()}currentTime(e){return this.player.currentTime(e)}muted(e){return this.player.muted(e)}duration(){return this.player.duration()}isFullscreen(){return this.player.isFullscreen()}requestFullscreen(){this.player.requestFullscreen()}exitFullscreen(){this.player.exitFullscreen()}playbackRate(e){return this.player.playbackRate(e)}quality(e){const t=this.player.qualityLevels();for(let r=0;r<t.length;r++){const i=t[r];if(e){i.enabled=i.id===e.toString();continue}if(i.enabled)return i.id}}subtitles(e){const t=this.player.textTracks();for(let r=0;r<t.length;r++){const i=t[r];if(i.kind==="subtitles"){if(e!==void 0){i.label===e?i.mode="showing":i.mode="disabled";continue}if(i.mode==="showing")return i.label}}}bindEventListeners(){const e=r=>r.preventDefault();if(this.showSplash=this.showSplash.bind(this),this.hideSplash=this.hideSplash.bind(this),this.player.on("ended",this.showSplash),this.player.on("play",this.hideSplash),this.player.tech(!0).on("contextmenu",e),this.player.one("dispose",()=>{this.off("ended",this.showSplash),this.off("play",this.hideSplash),this.player.tech(!0).off("contextmenu",e)}),!this.options.hotkeyElQuerySelector)return;const t=B.dom.$(this.options.hotkeyElQuerySelector);t&&(this.player.on(t,"keydown",this.player.handleKeyDown),this.player.one("dispose",()=>{this.player.off(t,"keydown",this.player.handleKeyDown)}))}setupSeekBar(){const e=this.getSeekBarName(),t=this.player.controlBar.getChild("progressControl");t.addChild(e,this.getSeekBarOptions()),t.setSeekBarName(e)}setupSplash(e){this._splashAdded||(this._splashAdded=!0,this.player.addChild("posterImage",{embed:this.options.embed,...e}),this.player.addChild("bigPlayButton"),this.options.autoplay?this.hideSplash():this.showSplash())}showSplash(){this.player.hasStarted(!1),this.player.getChild("posterImage").show(),this.player.getChild("bigPlayButton").show()}hideSplash(){this.player.getChild("posterImage").hide(),this.player.getChild("bigPlayButton").hide()}getSeekBarOptions(){return{}}getSeekBarName(){return"ChapterSeekBar"}};wh.options_={viewKey:null,controls:!0,playbackRates:[.25,.5,.75,1,1.25,1.5,1.75,2],playerApi:new URL("http://localhost:52000"),enableLocalCache:!0,eventLogging:!0,allowFullscreen:!0};let Lm=wh;const IV=B.getPlugin("plugin"),PV=10;class DV extends IV{constructor(e,t){if(super(e),t.startTime===void 0)throw Error("Invalid clip start");if(t.endTime===void 0)throw Error("Invalid clip end");if(t.startTime>t.endTime)throw Error("Clip start cannot be greater than clip end");this._clipStart=parseFloat(t.startTime.toPrecision(4)),this._clipEnd=parseFloat(t.endTime.toPrecision(4)),this.playerEndedFn=this.player.ended.bind(e),this.playerDurationFn=this.player.duration.bind(e),this.playerCurrentTimeFn=this.player.currentTime.bind(e),this.playerbufferedFn=this.player.buffered.bind(e),this.player.ended=this.ended.bind(this),this.player.duration=this.duration.bind(this),this.player.currentTime=this.currentTime.bind(this),this.player.buffered=this.buffered.bind(this),this.initialize(),this.player.ready(()=>{this.player.trigger("durationchange")})}get clipStart(){const e=this.playerDurationFn();return this._clipStart>e?e:this._clipStart}get clipEnd(){const e=this.playerDurationFn();return e<=0?this._clipEnd:this._clipEnd>e?e:this._clipEnd}dispose(){this.player.off("timeupdate",this.onTimeUpdate),this.player.off("play",this.onPlay),this.player.ended=this.playerEndedFn,this.player.duration=this.playerDurationFn,this.player.currentTime=this.playerCurrentTimeFn,this.player.buffered=this.playerbufferedFn,this.player.trigger("durationchange"),super.dispose()}initialize(){this.onTimeUpdate=this.onTimeUpdate.bind(this),this.onPlay=this.onPlay.bind(this),this.player.on("timeupdate",this.onTimeUpdate),this.player.on("play",this.onPlay)}onPlay(){this._isEnded&&this.player.currentTime(0)}onTimeUpdate(){const e=this.getCurrentTime(!1);if(e>this.clipEnd){this._isEnded||(this.player.pause(),this.player.trigger("ended"),this._isEnded=!0);return}this._isEnded=!1,e<this.clipStart-PV&&this.playerCurrentTimeFn(this.clipStart,!0)}ended(){return this.getCurrentTime(!1)>this.clipEnd}duration(e){return e&&e>0&&(this.playerDurationFn()?console.info("The duration of the player has already been set. This is a no-op."):this.playerDurationFn(e)),this.clipEnd-this.clipStart}currentTime(e,...t){if(typeof e!="number")return this.getCurrentTime(!0);const r=e+this.clipStart;this.playerCurrentTimeFn(r,t)}getCurrentTime(e){const t=this.playerCurrentTimeFn();let r=0;return t>=this.clipStart&&(r=t-this.clipStart),this.player.getCache().currentTime=r,e?r:t}buffered(){const e=this.playerbufferedFn(),t=[];for(let r=0;r<e.length;r++)t[r]=[Math.max(0,e.start(r)-this.clipStart),Math.min(Math.max(0,e.end(r)-this.clipStart),this.player.duration())];return B.createTimeRanges(t)}}B.registerPlugin("clipPlugin",DV);const NV=B.getComponent("Button");class uw extends NV{constructor(){super(...arguments),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0}buildCSSClass(){return"cv-create-clip-button"}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){super.handleClick(null)}}uw.prototype.controlText_="Create clip";B.registerComponent("CreateClipButton",uw);const LV=B.getPlugin("plugin");class OV extends LV{constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){var r;const e=this.player.getChild("collapserator"),t=(r=e==null?void 0:e.children())==null?void 0:r.findIndex(i=>i.name()==="CustomControlSpacer");!t||t===-1||e.addChild("CreateClipButton",{clickHandler:this.options.onClick},t+1)}}B.registerPlugin("createClipButtonPlugin",OV);const MV=B.getComponent("PictureInPictureToggle");class RV extends MV{handlePictureInPictureEnabledChange(){this.enable()}}B.registerComponent("PictureInPictureToggle",RV);const BV=B.getComponent("PlayToggle"),FV=B.getPlugin("plugin"),UV=800;class $V extends FV{constructor(e,t){super(e,t),this.options=t,this.bindFunctions(),e.ready(()=>this.initialize())}bindFunctions(){this.requestPictureInPicture=this.requestPictureInPicture.bind(this),this.exitPictureInPicture=this.exitPictureInPicture.bind(this),this.onPlayerResize=this.onPlayerResize.bind(this),this.playerRequestPictureInPictureFn=this.player.requestPictureInPicture,this.playerExitPictureInPictureFn=this.player.exitPictureInPicture,this.player.requestPictureInPicture=this.requestPictureInPicture,this.player.exitPictureInPicture=this.exitPictureInPicture}initialize(){const e=this.player.getChild("collapserator");let t=e.children().findIndex(r=>{var i;return((i=r.name())==null?void 0:i.toLowerCase())==="fullscreentoggle"});t===-1&&(t=e.children().length-1),this.toggle=e.addChild("pictureInPictureToggle",{},t),this.toggle.enable(),this.player.on("playerresize",this.onPlayerResize),this.player.on("dispose",()=>{var r;(r=this.player)==null||r.off("playerresize",this.onPlayerResize)})}togglePictureInPicture(e){if(e===this.player.isInPictureInPicture())return;const t=e?"enterpictureinpicture":"leavepictureinpicture";this.player.isInPictureInPicture(e),this.player.trigger(t),e?this.addPipStyles():this.removePipStyles()}onPlayerResize(){var t,r;if(this.player.isInPictureInPicture())return;const e=this.player.el().getBoundingClientRect();e.width!==0&&(e.width<UV?(t=this.toggle)==null||t.hide():(r=this.toggle)==null||r.show())}addPipStyles(){this.player.addClass("cv-picture-in-picture"),this.playToggle=new BV(this.player),this.playToggle.addClass("cv-pip-play-toggle"),this.player.addChild(this.playToggle),this.player.paused()?this.playToggle.handlePause():this.playToggle.handlePlay()}removePipStyles(){this.player.removeClass("cv-picture-in-picture"),this.player.removeChild(this.playToggle),delete this.playToggle}requestPictureInPicture(){var e;this.togglePictureInPicture(!0),typeof((e=this.options)==null?void 0:e.onRequestPictureInPicture)=="function"&&this.options.onRequestPictureInPicture(!0)}async exitPictureInPicture(){this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles()}dispose(){this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,super.dispose()}}B.registerPlugin("pictureInPicture",$V);const jV=B.getComponent("Component");class VV extends jV{constructor(e,t){super(e,t),this.hasBuffered=!1,this.hasPlayed=!1,this.eventsService=$l,this.pointOfInterest=t.pointOfInterest,this.onMouseOver=this.onMouseOver.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onGlancePointOfInterestMouseEnter=this.onGlancePointOfInterestMouseEnter.bind(this),this.onGlancePointOfInterestMouseLeave=this.onGlancePointOfInterestMouseLeave.bind(this),this.initialize()}initialize(){this.setPosition(),this.bindListeners()}buildCSSClass(){return`cv-point-of-interest-indicator ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}bindListeners(){this.on("mouseover",this.onMouseOver),this.on("mouseleave",this.onMouseLeave),this.eventsService.subscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.subscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}dispose(){this.eventsService.unsubscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.unsubscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}getPointOfInterestTime(){return this.pointOfInterest.startTime}setPosition(){const e=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/e*100+"%"}updateBuffered(e){const t=this.getPointOfInterestTime()<=e;if(t===this.hasBuffered)return;this.hasBuffered=t;const r="cv-point-of-interest-indicator-buffered";this.hasBuffered?this.addClass(r):this.removeClass(r)}updatePlaybackProgress(e){const t=this.getPointOfInterestTime()<=e;if(t===this.hasPlayed)return;this.hasPlayed=t;const r="cv-point-of-interest-indicator-played";t?this.addClass(r):this.removeClass(r)}toggleVisibility(e){const t="cv-point-of-interest-indicator-hidden";e?this.removeClass(t):this.addClass(t)}onMouseOver(){this.setTimeTooltipText(),this.eventsService.trigger("player:poi:mouseover",this.pointOfInterest)}onMouseLeave(){this.clearTimeTooltipText(),this.eventsService.trigger("player:poi:mouseleave")}onGlancePointOfInterestMouseEnter(e){e.id===this.pointOfInterest.id&&(this.addClass("cv-point-of-interest-indicator-highlight"),this.setTimeTooltipTime(),this.setTimeTooltipText(),this.positionMouseTimeDisplay(),this.showMouseTimeDisplay())}onGlancePointOfInterestMouseLeave(){this.removeClass("cv-point-of-interest-indicator-highlight"),this.hideMouseTimeDisplay()}setTimeTooltipText(){var e;(e=this.getTimeTooltip())==null||e.setCustomChapterText(this.pointOfInterest.description)}clearTimeTooltipText(){var e;(e=this.getTimeTooltip())==null||e.setCustomChapterText()}setTimeTooltipTime(){const e=this.getTimeTooltip();e==null||e.updateTime(this.getPointOfInterestTime())}positionMouseTimeDisplay(){var i,n;const e=(i=this.getSeekBar())==null?void 0:i.el();if(!e)return;const t=B.dom.findPosition(e),r=this.getPointOfInterestTime()/this.player().duration();(n=this.getMouseTimeDisplay())==null||n.update(t,r)}showMouseTimeDisplay(){var e;(e=this.getMouseTimeDisplay())==null||e.forceShow()}hideMouseTimeDisplay(){var e;(e=this.getMouseTimeDisplay())==null||e.removeForceShow()}getSeekBar(){var e;return(e=this.player().controlBar.getChild("ProgressControl"))==null?void 0:e.getChild("SeekBar")}getMouseTimeDisplay(){var e;return(e=this.getSeekBar())==null?void 0:e.getChild("MouseTimeDisplay")}getTimeTooltip(){var e;return(e=this.getMouseTimeDisplay())==null?void 0:e.getChild("TimeTooltip")}}const HV=B.getComponent("MenuItem");class cw extends HV{constructor(e,t){super(e,t),this.pointsOfInterestVisible=t.pointsOfInterestVisible,this.toggle(this.pointsOfInterestVisible)}handleToggle(){this.toggle(!this.pointsOfInterestVisible)}toggle(e){e?this.toggleOn():this.toggleOff()}toggleOn(){B.dom.addClass(this.toggleEl,"on"),B.dom.setAttribute(this.toggleEl,"aria-checked","true"),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}toggleOff(){B.dom.removeClass(this.toggleEl,"on"),B.dom.setAttribute(this.toggleEl,"aria-checked","false"),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}handleClick(e){e.stopImmediatePropagation()}createEl(e,t,r){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=B.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),B.dom.setAttribute(this.toggleEl,"id","poi-toggle"),B.dom.setAttribute(this.toggleEl,"role","switch"),this.toggleEl.addEventListener("click",this.handleToggle);const n=super.createEl(e,{className:"vjs-menu-item cv-cog-menu-item cv-poi-toggle",innerHTML:`
|
|
323
|
-
<span for="poi-toggle" class="vjs-menu-item-text">Points of Interest</span>
|
|
324
|
-
<span class="cv-toggle-container"></span>`},r);return n.children[1].appendChild(this.toggleEl),n}}B.registerComponent("PointsOfInterestMenuItem",cw);const qV=B.getPlugin("plugin"),Ub="cvplayer-points-of-interest";class zV extends qV{constructor(e,t){super(e),this.pointOfInterestIndicators=[],this.enabled=!0,this.pointsOfInterest=t==null?void 0:t.pointsOfInterest,this.initialize=this.initialize.bind(this),this.updateBuffered=this.updateBuffered.bind(this),this.updatePlaybackProgress=this.updatePlaybackProgress.bind(this),this.player.one("loadedmetadata",()=>this.player.ready(this.initialize))}initialize(){this.pointsOfInterest&&(pt.hasLocalStorage()&&pt.get(Ub)==="false"&&(this.enabled=!1),this.setupTrack(),this.createPointOfInterestIndicators(),this.addMenuItem(),this.bindListeners())}bindListeners(){this.player.on("progress",this.updateBuffered),this.player.on("timeupdate",this.updatePlaybackProgress),this.player.on("dispose",()=>{var e,t;(e=this.player)==null||e.off("progress",this.updateBuffered),(t=this.player)==null||t.off("timeupdate",this.updatePlaybackProgress)})}togglePointsOfInterest(e){pt.set(Ub,e.toString()),this.pointOfInterestIndicators.forEach(t=>t.toggleVisibility(e))}setupTrack(){const e=this.player.addTextTrack("metadata","pointsofinterest");this.pointsOfInterest.forEach(t=>{e.addCue({startTime:t.startTime,endTime:t.endTime,text:t.description})}),e.trigger({type:"loadeddata",target:e})}createPointOfInterestIndicators(){var t;const e=(t=this.player.controlBar.getChild("ProgressControl"))==null?void 0:t.getChild("SeekBar");this.pointsOfInterest.forEach(r=>{const i=new VV(this.player,{pointOfInterest:r});this.pointOfInterestIndicators.push(i),e.addChild(i)})}addMenuItem(){var t;((t=this.player.getChild("collapserator"))==null?void 0:t.getChild("cogButton")).addItem({ctor:cw,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}updateBuffered(){this.pointOfInterestIndicators.forEach(e=>e.updateBuffered(X2(this.player)))}updatePlaybackProgress(){this.pointOfInterestIndicators.forEach(e=>e.updatePlaybackProgress(this.player.currentTime()))}}B.registerPlugin("pointsOfInterestPlugin",zV);var Os=(s=>(s.None="None",s.Complete="Complete",s.Incomplete="Incomplete",s))(Os||{});const WV=B.getComponent("Button");class hw extends WV{constructor(e,t){super(e,t),this.update()}update(){this.options_.activityStatus===Os.Complete?this.addClass("cv-activity-completed"):this.removeClass("cv-activity-completed")}handleClick(...e){this.options_.activityStatus=this.getToggledActivityStatus(),this.update(),this.options_.clickHandler&&this.options_.clickHandler.call(this,e)}buildCSSClass(){return"cv-activity-status-button"}getToggledActivityStatus(){if(this.options_.activityStatus===Os.None||this.options_.activityStatus===Os.Incomplete)return Os.Complete;if(this.options_.activityStatus===Os.Complete)return Os.Incomplete}}hw.prototype.controlText_="Complete";const GV=B.getPlugin("plugin");class KV extends GV{setActivityStatus(e,t){e!==this.activityStatus&&(this.activityStatus=e,this.onToggleStatus=t,this.player.ready(()=>{this.renderActivityStatusButton()}))}renderActivityStatusButton(){this.button&&this.player.removeChild(this.button),this.button=new hw(this.player,{activityStatus:this.activityStatus,clickHandler:this.onToggleStatus}),this.player.addChild(this.button)}}B.registerPlugin("activityStatusPlugin",KV);const XV=B.getComponent("Component");class $b extends XV{constructor(e,t){super(e,t),this.initialize()}initialize(){this.setPosition()}buildCSSClass(){return`cv-range-indicator ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,className:this.buildCSSClass()},r)}setPosition(){const e=this.player().duration();this.el_.style.left=this.options_.time/e*100+"%"}}const YV=B.getComponent("ClickableComponent");class jb extends YV{constructor(e,t){super(e,t)}buildCSSClass(){return`cv-replay-view-button ${super.buildCSSClass()}`}createEl(e,t,r){return super.createEl(e,{...t,innerHTML:`<span class="${this.options_.iconClassName}"></span><span>${this.options_.label}</span>`,className:this.buildCSSClass()},r)}handleClick(){this.options_.onPress()}}const QV=B.getComponent("Component");class JV extends QV{constructor(e,t){super(e,t)}buildCSSClass(){return`cv-replay-view ${super.buildCSSClass()}`}createEl(e,t,r){const i=super.createEl(e,{...t,className:this.buildCSSClass()},r),n=B.dom.createEl("h5",{innerHTML:this.localize("This clip has finished"),className:"cv-replay-heading"}),a=B.dom.createEl("div",{className:"cv-button-container"}),o=new jb(this.player_,{label:this.localize("Replay clip"),iconClassName:"cv-replay-icon",onPress:this.options_.onReplayPress}),l=new jb(this.player_,{label:this.localize("Continue watching"),iconClassName:"cv-continue-icon",onPress:this.options_.onContinuePress});return i.appendChild(n),i.appendChild(a),a.appendChild(o.el()),a.appendChild(l.el()),i}}const ZV=B.getPlugin("plugin");class eH extends ZV{constructor(e,t){if(super(e,t),this.startTime=parseFloat(t.startTime.toPrecision(4)),this.endTime=parseFloat(t.endTime.toPrecision(4)),this.dismissed=!1,this.startTime>this.endTime)throw Error("Range start cannot be greater than range end");this.bindFunctions(),this.initialize()}bindFunctions(){this.onReady=this.onReady.bind(this),this.onTimeUpdateOrSeeked=this.onTimeUpdateOrSeeked.bind(this),this.onReplayPress=this.onReplayPress.bind(this),this.onContinuePress=this.onContinuePress.bind(this)}initialize(){this.player.one("loadedmetadata",()=>this.player.ready(this.onReady)),this.player.on("timeupdate",this.onTimeUpdateOrSeeked),this.player.on("seeked",this.onTimeUpdateOrSeeked)}onReady(){this.addCssClasses(),this.showRangeIndicators(),this.addMaskToProgressBar()}onTimeUpdateOrSeeked(){if(this.dismissed)return;const e=this.player.currentTime();if(e<this.startTime){this.player.currentTime(this.startTime);return}if(e>this.endTime){this.showReplayView(),this.disablePlayToggle(),this.player.pause(),this.player.currentTime(this.endTime);return}}onReplayPress(){this.player.currentTime(this.startTime),this.player.play(),this.hideReplayView(),this.enablePlayToggle()}onContinuePress(){this.dismissed=!0,this.player.play(),this.hideRangeIndicators(),this.removeMaskFromProgressBar(),this.hideReplayView(),this.enablePlayToggle(),this.removeCssClasses()}showRangeIndicators(){var t;const e=(t=this.player.controlBar.getChild("ProgressControl"))==null?void 0:t.getChild("SeekBar");this.startTimeIndicator||(this.startTimeIndicator=new $b(this.player,{time:this.startTime}),e==null||e.addChild(this.startTimeIndicator)),this.endTimeIndicator||(this.endTimeIndicator=new $b(this.player,{time:this.endTime}),e==null||e.addChild(this.endTimeIndicator))}hideRangeIndicators(){var e,t;(e=this.startTimeIndicator)==null||e.hide(),(t=this.endTimeIndicator)==null||t.hide()}addMaskToProgressBar(){var r;const e=(r=this.player.controlBar.getChild("ProgressControl"))==null?void 0:r.getChild("SeekBar"),t=e==null?void 0:e.el().getElementsByClassName("cv-chapter-bar-items");if(t&&t.length){const i=t[0],n=this.player.duration(),a=this.startTime/n*100,o=100-this.endTime/n*100,l=-5;i.style.clipPath=`inset(${l}em ${o}% ${l}em ${a}%)`}}removeMaskFromProgressBar(){var r;const e=(r=this.player.controlBar.getChild("ProgressControl"))==null?void 0:r.getChild("SeekBar"),t=e==null?void 0:e.el().getElementsByClassName("cv-chapter-bar-items");if(t&&t.length){const i=t[0];i.style.clipPath=""}}showReplayView(){this.replayView||(this.replayView=new JV(this.player,{onContinuePress:this.onContinuePress,onReplayPress:this.onReplayPress}),this.player.addChild(this.replayView)),this.replayView.show()}hideReplayView(){var e;(e=this.replayView)==null||e.hide()}getPlayToggle(){const e=this.player.getChild("collapserator");return e==null?void 0:e.getChild("PlayToggle")}enablePlayToggle(){const e=this.getPlayToggle();e&&e.enable()}disablePlayToggle(){const e=this.getPlayToggle();e&&e.disable()}addCssClasses(){this.player.addClass("cv-range-indicator-plugin")}removeCssClasses(){this.player.removeClass("cv-range-indicator-plugin")}dispose(){var e,t,r;this.removeCssClasses(),this.player.off("timeupdate",this.onTimeUpdateOrSeeked),this.player.off("seeked",this.onTimeUpdateOrSeeked),(e=this.startTimeIndicator)==null||e.dispose(),(t=this.endTimeIndicator)==null||t.dispose(),(r=this.replayView)==null||r.dispose(),super.dispose()}}B.registerPlugin("rangeIndicatorPlugin",eH);const tH=B.getComponent("MenuItem");let iH=class extends tH{constructor(e,t){super(e,t),this.onLoopVideoChange=this.onLoopVideoChange.bind(this),this.player_.on("cv:loopvideo",this.onLoopVideoChange),this.onLoopVideoChange(null,this.player_.loopVideoPlugin().loop())}onLoopVideoChange(e,t){t?this.toggleOn():this.toggleOff()}handleToggle(){const e=this.player_.loopVideoPlugin().loop();this.player_.loopVideoPlugin().loop(!e)}toggleOn(){B.dom.addClass(this.toggleEl,"on")}toggleOff(){B.dom.removeClass(this.toggleEl,"on")}handleClick(e){e.stopImmediatePropagation()}createEl(e,t,r){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=B.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);const n=super.createEl(e,{className:"vjs-menu-item cv-cog-menu-item cv-loop-video-toggle",innerHTML:`
|
|
325
|
-
<span class="vjs-menu-item-text">Loop video</span>
|
|
326
|
-
<span class="cv-toggle-container"></span>`},r);return n.children[1].appendChild(this.toggleEl),n}dispose(){this.player_.off("cv:loopvideo",this.onLoopVideoChange),super.dispose()}};B.registerComponent("LoopVideoMenuItem",iH);const rH=B.getPlugin("plugin");B.getComponent("MenuItem");const nH=B.getComponent("LoopVideoMenuItem");class sH extends rH{constructor(e,t){super(e),t.allowLoop&&this.player.ready(()=>this.addButton()),this.onEnded=this.onEnded.bind(this),this.player.on("ended",this.onEnded)}addButton(){var t;((t=this.player.getChild("collapserator"))==null?void 0:t.getChild("cogButton")).addItem({ctor:nH,name:"LoopVideoMenuItem"})}onEnded(){this.player.loop()&&this.player.play()}loop(e){var t,r,i;if(typeof e!="boolean")return this.player.loop();e&&((i=(r=(t=this.player).nextVideoPlugin)==null?void 0:r.call(t))==null||i.setShouldPlayNext(!1,!1)),this.player.trigger("cv:loopvideo",e),this.player.loop(e)}dispose(){this.player.off("ended",this.onEnded),super.dispose()}}B.registerPlugin("loopVideoPlugin",sH);const dw={generateRandomId:()=>{var s,e;return((e=(s=window.crypto)==null?void 0:s.randomUUID)==null?void 0:e.call(s))??Math.random().toString()}};class aH extends Lm{constructor(e,t){super(e,t)}getPlayerOptions(){var t;const e=super.getPlayerOptions();return this.options.allowTranscript&&(e.allowTranscript=!0),(t=e.devicesConfig)!=null&&t.canUserCastToDevices?{...e,techOrder:["devices",...e.techOrder],devices:{instanceId:dw.generateRandomId()}}:e}configurePlugins(){var e;try{this.options.onClickCreateClip&&this.player.createClipButtonPlugin({onClick:this.options.onClickCreateClip}),this.options.onRequestPictureInPicture&&this.player.pictureInPicture({onRequestPictureInPicture:this.options.onRequestPictureInPicture}),(e=this.options.pointsOfInterest)!=null&&e.length&&this.player.pointsOfInterestPlugin({pointsOfInterest:this.options.pointsOfInterest}),this.player.loopVideoPlugin({allowLoop:this.options.allowLoop})}catch(t){console.log("failed to register plugins",t)}}setNextVideo(e,t,r){if(!this.player.nextVideoPlugin)return;this.player.nextVideoPlugin().setNextVideo(e,t,r)}togglePictureInPicture(e){const t=this.player.pictureInPicture();t&&t.togglePictureInPicture(e)}toggleTheatreMode(e){const t=this.player.theatreModePlugin();t&&t.toggleTheatreMode(e,{shouldLog:!0})}toggleTranscript(e){if(!this.player.viewTranscriptPlugin)return;const t=this.player.viewTranscriptPlugin();t&&t.toggleTranscript(e)}hasStarted(){return this.player.hasStarted()}async additionalSetup(e){if(this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin({onRequestTheatreMode:this.options.onRequestTheatreMode,theatreMode:this.options.theatreMode,playbackObject:e}),super.additionalSetup(e),this.options.showResources&&e.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:e.resources.list,imageCdnUrl:this.options.imageCdnUrl}),e.mediaType==="MasterClip"){const t=e.additionalData;if(t===null)throw Error("Invalid clip data");this.player.clipPlugin({startTime:t.startTime,endTime:t.endTime})}e.mediaType==="MasterVideo"&&this.options.startTime&&this.options.endTime&&this.player.rangeIndicatorPlugin({startTime:this.options.startTime,endTime:this.options.endTime})}setupAnalyticsDependentPlugins(e){var t;super.setupAnalyticsDependentPlugins(e),this.options.allowTranscript&&this.player.viewTranscriptPlugin().registerAnalytics(this.analyticsService,e),this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin().registerAnalytics(this.analyticsService),(t=this.options.devicesConfig)!=null&&t.canUserCastToDevices&&this.player.devicesPlugin&&this.player.devicesPlugin({...this.options.devicesConfig,userId:parseInt(e.viewerId),title:e.title,analyticsService:this.analyticsService})}setActivityStatus(e,t){this.player.activityStatusPlugin().setActivityStatus(e,t)}useCurrentTranscript(e,t){Zt.useMetadataTracks(this.player,"transcript",e,t)}useChapters(e){Zt.useChapters(this.player,e)}}function oH(s){return new Proxy(s,{get(e,t,r){if(!(t!=="off"&&e.isDisposed()))return Reflect.get(e,t,r)}})}var _l={},mp={exports:{}},gp={exports:{}},vp={exports:{}},Vb;function lH(){if(Vb)return vp.exports;Vb=1;var s=vp.exports={type:r,isArray:n,isFunction:i,isPlainObject:o,each:a,extend:l,noop:function(){}},e=Object.prototype.toString,t={};"Boolean Number String Function Array Date RegExp Object".split(" ").forEach(function(u){t["[object "+u+"]"]=u.toLowerCase()});function r(u){return u==null?String(u):t[e.call(u)]||"object"}function i(u){return s.type(u)==="function"}function n(u){return s.type(u)==="array"}function a(u,c,h){var f,g=0,C=u.length,p=C===void 0||i(u);if(h)if(p){for(f in u)if(c.apply(u[f],h)===!1)break}else for(;g<C&&c.apply(u[g++],h)!==!1;);else if(p){for(f in u)if(c.call(u[f],f,u[f])===!1)break}else for(;g<C&&c.call(u[g],g,u[g++])!==!1;);return u}function o(u){return!(!u||s.type(u)!=="object")}function l(){var u,c,h,f,g,C,p=arguments[0]||{},T=1,A=arguments.length,N=!1;for(typeof p=="boolean"&&(N=p,p=arguments[1]||{},T=2),typeof p!="object"&&!s.isFunction(p)&&(p={}),A===T&&(p=this,--T);T<A;T++)if((u=arguments[T])!=null)for(c in u)h=p[c],f=u[c],p!==f&&(N&&f&&(s.isPlainObject(f)||(g=s.isArray(f)))?(g?(g=!1,C=h&&s.isArray(h)?h:[]):C=h&&s.isPlainObject(h)?h:{},p[c]=s.extend(N,C,f)):f!==void 0&&(p[c]=f));return p}return vp.exports}var Hb;function uH(){if(Hb)return gp.exports;Hb=1;var s=gp.exports=lH(),e=/\s+/,t={};function r(i){var n=t[i]={};return s.each(i.split(e),function(a,o){n[o]=!0}),n}return s.Callbacks=function(i){i=typeof i=="string"?t[i]||r(i):s.extend({},i);var n,a,o,l,u,c,h=[],f=!i.once&&[],g=function(p){for(n=i.memory&&p,a=!0,c=l||0,l=0,u=h.length,o=!0;h&&c<u;c++)if(h[c].apply(p[0],p[1])===!1&&i.stopOnFalse){n=!1;break}o=!1,h&&(f?f.length&&g(f.shift()):n?h=[]:C.disable())},C={add:function(){if(h){var p=h.length;(function T(A){s.each(A,function(N,F){var V=s.type(F);V==="function"?(!i.unique||!C.has(F))&&h.push(F):F&&F.length&&V!=="string"&&T(F)})})(arguments),o?u=h.length:n&&(l=p,g(n))}return this},remove:function(){return h&&s.each(arguments,function(p,T){for(var A;(A=s.inArray(T,h,A))>-1;)h.splice(A,1),o&&(A<=u&&u--,A<=c&&c--)}),this},has:function(p){return s.inArray(p,h)>-1},empty:function(){return h=[],this},disable:function(){return h=f=n=void 0,this},disabled:function(){return!h},lock:function(){return f=void 0,n||C.disable(),this},locked:function(){return!f},fireWith:function(p,T){return T=T||[],T=[p,T.slice?T.slice():T],h&&(!a||f)&&(o?f.push(T):g(T)),this},fire:function(){return C.fireWith(this,arguments),this},fired:function(){return!!a}};return C},gp.exports}var qb;function cH(){if(qb)return mp.exports;qb=1;/*!
|
|
327
|
-
* jquery-deferred
|
|
328
|
-
* Copyright(c) 2011 Hidden <zzdhidden@gmail.com>
|
|
329
|
-
* MIT Licensed
|
|
330
|
-
*/var s=mp.exports=uH(),e=Array.prototype.slice;return s.extend({Deferred:function(t){var r=[["resolve","done",s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory")]],i="pending",n={state:function(){return i},always:function(){return a.done(arguments).fail(arguments),this},then:function(){var o=arguments;return s.Deferred(function(l){s.each(r,function(u,c){var h=c[0],f=o[u];a[c[1]](s.isFunction(f)?function(){var g=f.apply(this,arguments);g&&s.isFunction(g.promise)?g.promise().done(l.resolve).fail(l.reject).progress(l.notify):l[h+"With"](this===a?l:this,[g])}:l[h])}),o=null}).promise()},promise:function(o){return o!=null?s.extend(o,n):n}},a={};return n.pipe=n.then,s.each(r,function(o,l){var u=l[2],c=l[3];n[l[1]]=u.add,c&&u.add(function(){i=c},r[o^1][2].disable,r[2][2].lock),a[l[0]]=u.fire,a[l[0]+"With"]=u.fireWith}),n.promise(a),t&&t.call(a,a),a},when:function(t){var r=0,i=e.call(arguments),n=i.length,a=n!==1||t&&s.isFunction(t.promise)?n:0,o=a===1?t:s.Deferred(),l=function(f,g,C){return function(p){g[f]=this,C[f]=arguments.length>1?e.call(arguments):p,C===u?o.notifyWith(g,C):--a||o.resolveWith(g,C)}},u,c,h;if(n>1)for(u=new Array(n),c=new Array(n),h=new Array(n);r<n;r++)i[r]&&s.isFunction(i[r].promise)?i[r].promise().done(l(r,h,i)).fail(o.reject).progress(l(r,c,u)):--a;return a||o.resolveWith(h,i),o.promise()}}),mp.exports}var yp,zb;function hH(){return zb||(zb=1,yp=cH()),yp}var _p={exports:{}};/**
|
|
331
|
-
* @preserve jquery-param (c) 2015 KNOWLEDGECODE | MIT
|
|
332
|
-
*/var Wb;function dH(){return Wb||(Wb=1,(function(s){(function(e){var t=function(r){var i=[],n=/\[\]$/,a=function(u){return Object.prototype.toString.call(u)==="[object Array]"},o=function(u,c){c=typeof c=="function"?c():c===null||c===void 0?"":c,i[i.length]=encodeURIComponent(u)+"="+encodeURIComponent(c)},l=function(u,c){var h,f,g;if(u)if(a(c))for(h=0,f=c.length;h<f;h++)n.test(u)?o(u,c[h]):l(u+"["+(typeof c[h]=="object"?h:"")+"]",c[h]);else if(c&&String(c)==="[object Object]")for(g in c)l(u+"["+g+"]",c[g]);else o(u,c);else if(a(c))for(h=0,f=c.length;h<f;h++)o(c[h].name,c[h].value);else for(g in c)l(g,c[g]);return i};return l("",r).join("&").replace(/%20/g,"+")};s.exports=t})()})(_p)),_p.exports}var Tp,Gb;function fH(){if(Gb)return Tp;Gb=1;var s=hH(),e=dH(),t=function(a){var o=a.events||{};return a&&a===a.window?{0:a,load:function(u){return a.addEventListener("load",u,!1)},bind:function(u,c){return a.addEventListener(u,c,!1)},unbind:function(u,c){return a.removeEventListener(u,c,!1)}}:{0:a,unbind:function(u,c){var h=o[u]||[];if(c){var f=h.indexOf(c);f!==-1&&h.splice(f,1)}else h=[];o[u]=h,a.events=o},bind:function(u,c){var h=o[u]||[];o[u]=h.concat(c),a.events=o},triggerHandler:function(u,c){var h=this,f=o[u]||[];f.forEach(function(g){c&&c[0]&&c[0].type===void 0?c=[{type:u}].concat(c||[]):c=c||[],g.apply(h,c)})}}},r=function(){try{return new window.XMLHttpRequest}catch{}},i=function(a){var o=r();a.xhrFields&&a.xhrFields.withCredentials&&(o.withCredentials=!0),o.onreadystatechange=function(){if(o.readyState===4)if(o.status===200&&!o._hasError)try{a.success&&a.success(JSON.parse(o.responseText))}catch{a.error&&a.error(o)}else a.error&&a.error(o)},o.withCredentials=a.xhrFields.withCredentials;var l="_="+new Date().getTime();return a.url.indexOf("?")===-1?a.url+="?"+l:a.url.indexOf("_=")===-1?a.url+="&"+l:a.url=a.url.replace(/_=\d+/,l),o.open(a.type,a.url),o.setRequestHeader("content-type",a.contentType),a.headers&&Object.keys(a.headers).forEach(function(u){var c=a.headers[u];o.setRequestHeader(u,c)}),o.send(a.data.data&&"data="+encodeURIComponent(a.data.data)),{abort:function(c){return o.abort(c)}}};return Tp=s.extend(t,s,{defaultAjaxHeaders:null,ajax:i,inArray:function(a,o){return a.indexOf(o)!==-1},trim:function(a){return a&&a.trim()},isEmptyObject:function(a){return!a||Object.keys(a).length===0},makeArray:function(a){return[].slice.call(a,0)},param:function(a){return e(a)},support:{cors:(function(){var n=r();return!!n&&"withCredentials"in n})()}}),Tp}var Kb;function pH(){if(Kb)return _l;Kb=1,Object.defineProperty(_l,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e=fH();/*!
|
|
333
|
-
* ASP.NET SignalR JavaScript Library 2.4.1
|
|
334
|
-
* http://signalr.net/
|
|
335
|
-
*
|
|
336
|
-
* Copyright (c) .NET Foundation. All rights reserved.
|
|
337
|
-
* Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
338
|
-
*
|
|
339
|
-
*/return(function(t,r,i){var n={nojQuery:"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",noTransportOnInit:"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",errorOnNegotiate:"Error during negotiation request.",stoppedWhileLoading:"The connection was stopped during page load.",stoppedWhileNegotiating:"The connection was stopped during the negotiate request.",errorParsingNegotiateResponse:"Error parsing negotiate response.",errorRedirectionExceedsLimit:"Negotiate redirection limit exceeded.",errorDuringStartRequest:"Error during start request. Stopping the connection.",errorFromServer:"Error message received from the server: '{0}'.",stoppedDuringStartRequest:"The connection was stopped during the start request.",errorParsingStartResponse:"Error parsing start response: '{0}'. Stopping the connection.",invalidStartResponse:"Invalid start response: '{0}'. Stopping the connection.",protocolIncompatible:"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.",aspnetCoreSignalrServer:"Detected a connection attempt to an ASP.NET Core SignalR Server. This client only supports connecting to an ASP.NET SignalR Server. See https://aka.ms/signalr-core-differences for details.",sendFailed:"Send failed.",parseFailed:"Failed at parsing response: {0}",longPollFailed:"Long polling request failed.",eventSourceFailedToConnect:"EventSource failed to connect.",eventSourceError:"Error raised by EventSource",webSocketClosed:"WebSocket closed.",pingServerFailedInvalidResponse:"Invalid ping response when pinging server: '{0}'.",pingServerFailed:"Failed to ping server.",pingServerFailedStatusCode:"Failed to ping server. Server responded with status code {0}, stopping the connection.",pingServerFailedParse:"Failed to parse ping server response, stopping the connection.",noConnectionTransport:"Connection is in an invalid state, there is no transport active.",webSocketsInvalidState:"The Web Socket transport is in an invalid state, transitioning into reconnecting.",reconnectTimeout:"Couldn't reconnect within the configured timeout of {0} ms, disconnecting.",reconnectWindowTimeout:"The client has been inactive since {0} and it has exceeded the inactivity timeout of {1} ms. Stopping the connection.",jsonpNotSupportedWithAccessToken:"The JSONP protocol does not support connections that require a Bearer token to connect, such as the Azure SignalR Service."};if(typeof t!="function")throw new Error(n.nojQuery);var a,o,l=r.document.readyState==="complete",u=t(r),c="__Negotiate Aborted__",h={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},f={processData:!0,timeout:null,async:!0,global:!1,cache:!1},g=function(M,U){if(U!==!1){var E;typeof r.console>"u"||(E="["+new Date().toTimeString()+"] SignalR: "+M,r.console.debug?r.console.debug(E):r.console.log&&r.console.log(E))}},C=function(M,U,E){return U===M.state?(M.state=E,t(M).triggerHandler(h.onStateChanged,[{oldState:U,newState:E}]),!0):!1},p=function(M){return M.state===a.connectionState.disconnected},T=function(M){return M._.keepAliveData.activated&&M.transport.supportsKeepAlive(M)},A=function(M){var U,E;M._.configuredStopReconnectingTimeout||(E=function(Y){var G=a._.format(a.resources.reconnectTimeout,Y.disconnectTimeout);Y.log(G),t(Y).triggerHandler(h.onError,[a._.error(G,"TimeoutException")]),Y.stop(!1,!1)},M.reconnecting(function(){var P=this;P.state===a.connectionState.reconnecting&&(U=r.setTimeout(function(){E(P)},P.disconnectTimeout))}),M.stateChanged(function(P){P.oldState===a.connectionState.reconnecting&&r.clearTimeout(U)}),M._.configuredStopReconnectingTimeout=!0)};a=function(M,U,E){return new a.fn.init(M,U,E)},a._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:(function(){var O,M;return r.navigator.appName==="Microsoft Internet Explorer"&&(M=/MSIE ([0-9]+\.[0-9]+)/.exec(r.navigator.userAgent),M&&(O=r.parseFloat(M[1]))),O})(),error:function(M,U,E){var P=new Error(M);return P.source=U,typeof E<"u"&&(P.context=E),P},transportError:function(M,U,E,P){var Y=this.error(M,E,P);return Y.transport=U?U.name:i,Y},format:function(){for(var M=arguments[0],U=0;U<arguments.length-1;U++)M=M.replace("{"+U+"}",arguments[U+1]);return M},firefoxMajorVersion:function(M){var U=M.match(/Firefox\/(\d+)/);return!U||!U.length||U.length<2?0:parseInt(U[1],10)},configurePingInterval:function(M){var U=M._.config,E=function(Y){t(M).triggerHandler(h.onError,[Y])};U&&!M._.pingIntervalId&&U.pingInterval&&(M._.pingIntervalId=r.setInterval(function(){a.transports._logic.pingServer(M).fail(E)},U.pingInterval))}},a.events=h,a.resources=n,a.ajaxDefaults=f,a.changeState=C,a.isDisconnecting=p,a.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4},a.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'><\/script>.")}},typeof u.on=="function"?u.on("load",function(){l=!0}):u.load(function(){l=!0});function N(O,M){if(t.isArray(O)){for(var U=O.length-1;U>=0;U--){var E=O[U];(t.type(E)!=="string"||!a.transports[E])&&(M.log("Invalid transport: "+E+", removing it from the transports list."),O.splice(U,1))}O.length===0&&(M.log("No transports remain within the specified transport array."),O=null)}else if(!a.transports[O]&&O!=="auto")M.log("Invalid transport: "+O.toString()+"."),O=null;else if(O==="auto"&&a._.ieVersion<=8)return["longPolling"];return O}function F(O){if(O==="http:")return 80;if(O==="https:")return 443}function V(O,M){return M.match(/:\d+$/)?M:M+":"+F(O)}function R(O,M){var U=this,E=[];U.tryBuffer=function(P){return O.state===t.signalR.connectionState.connecting?(E.push(P),!0):!1},U.drain=function(){if(O.state===t.signalR.connectionState.connected)for(;E.length>0;)M(E.shift())},U.clear=function(){E=[]}}a.fn=a.prototype={init:function(M,U,E){var P=t(this);this.url=M,this.qs=U,this.lastError=null,this._={keepAliveData:{},connectingMessageBuffer:new R(this,function(Y){P.triggerHandler(h.onReceived,[Y])}),lastMessageAt:new Date().getTime(),lastActiveAt:new Date().getTime(),beatInterval:5e3,beatHandle:null,totalTransportConnectTimeout:0,redirectQs:null},typeof E=="boolean"&&(this.logging=E)},_parseResponse:function(M){var U=this;return M&&(typeof M=="string"?U.json.parse(M):M)},_originalJson:r.JSON,json:r.JSON,isCrossDomain:function(M,U){var E;return M=t.trim(M),U=U||r.location,M.indexOf("http")!==0?!1:(E=r.document.createElement("a"),E.href=M,E.protocol+V(E.protocol,E.host)!==U.protocol+V(U.protocol,U.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:a.connectionState.disconnected,clientProtocol:"2.1",supportedProtocols:["1.5","2.0","2.1"],negotiateRedirectSupportedProtocols:["2.0","2.1"],reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,reconnectWindow:3e4,keepAliveWarnAt:2/3,start:function(M,U){var E=this,P={pingInterval:3e5,waitForPageLoad:!0,transport:"auto",jsonp:!1},Y,G=E._deferral||t.Deferred(),K=r.document.createElement("a"),le=function(ae,ce){ae.url===ce&&ae.baseUrl||(ae.url=ce,K.href=ae.url,!K.protocol||K.protocol===":"?(ae.protocol=r.document.location.protocol,ae.host=K.host||r.document.location.host):(ae.protocol=K.protocol,ae.host=K.host),ae.baseUrl=ae.protocol+"//"+ae.host,ae.wsProtocol=ae.protocol==="https:"?"wss://":"ws://",ae.url.indexOf("//")===0&&(ae.url=r.location.protocol+ae.url,ae.log("Protocol relative URL detected, normalizing it to '"+ae.url+"'.")),ae.isCrossDomain(ae.url)&&(ae.log("Auto detected cross domain url."),P.transport==="auto"&&(P.transport=["webSockets","serverSentEvents","longPolling"]),typeof ae.withCredentials>"u"&&(ae.withCredentials=!0),t.support.cors||(ae.ajaxDataType="jsonp",ae.log("Using jsonp because this browser doesn't support CORS.")),ae.contentType=a._.defaultContentType))};if(E.lastError=null,E._deferral=G,!E.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if(t.type(M)==="function"?U=M:t.type(M)==="object"&&(t.extend(P,M),t.type(P.callback)==="function"&&(U=P.callback)),P.transport=N(P.transport,E),!P.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");if(E._.config=P,!l&&P.waitForPageLoad===!0)return E._.deferredStartHandler=function(){E.start(M,U)},u.bind("load",E._.deferredStartHandler),G.promise();if(E.state===a.connectionState.connecting)return G.promise();if(C(E,a.connectionState.disconnected,a.connectionState.connecting)===!1)return G.resolve(E),G.promise();A(E),P.transport==="auto"&&P.jsonp===!0&&(P.transport="longPolling"),E.withCredentials=P.withCredentials,E._originalUrl=E.url,E.ajaxDataType=P.jsonp?"jsonp":"text",le(E,E.url),t(E).bind(h.onStart,function(se,ae){t.type(U)==="function"&&U.call(E),G.resolve(E)}),E._.initHandler=a.transports._logic.initHandler(E),Y=function(ae,ce){var he=a._.error(n.noTransportOnInit);if(ce=ce||0,ce>=ae.length){ce===0?E.log("No transports supported by the server were selected."):ce===1?E.log("No fallback transports were selected."):E.log("Fallback transports exhausted."),t(E).triggerHandler(h.onError,[he]),G.reject(he),E.stop();return}if(E.state!==a.connectionState.disconnected){var ve=ae[ce],Ae=a.transports[ve],De=function(){Y(ae,ce+1)};E.transport=Ae;try{E._.initHandler.start(Ae,function(){var Me=a._.firefoxMajorVersion(r.navigator.userAgent)>=11,Ne=!0;E.log("The start request succeeded. Transitioning to the connected state."),T(E)&&a.transports._logic.monitorKeepAlive(E),a.transports._logic.startHeartbeat(E),a._.configurePingInterval(E),C(E,a.connectionState.connecting,a.connectionState.connected)||E.log("WARNING! The connection was not in the connecting state."),E._.connectingMessageBuffer.drain(),t(E).triggerHandler(h.onStart),u.bind("unload",function(){E.log("Window unloading, stopping the connection."),E.stop(Ne)}),Me&&u.bind("beforeunload",function(){r.setTimeout(function(){E.stop(Ne)},0)})},De)}catch(Me){E.log(Ae.name+" transport threw '"+Me.message+"' when attempting to start."),De()}}};var de=E.url+"/negotiate",pe=function(ae,ce){var he=a._.error(n.errorOnNegotiate,ae,ce._.negotiateRequest);t(ce).triggerHandler(h.onError,he),G.reject(he),ce.stop()};return t(E).triggerHandler(h.onStarting),de=a.transports._logic.prepareQueryString(E,de),E.log("Negotiating with '"+de+"'."),E._.negotiateRequest=(function(){var se,ae=0,ce=100,he,ve,Ae=[],De=[],Me=function(Re,Oe){var He=a.transports._logic.prepareQueryString(Re,Re.url+"/negotiate");Re.log("Negotiating with '"+He+"'.");var ot={url:He,error:function(Lt,Oi){Oi!==c?pe(Lt,Re):G.reject(a._.error(n.stoppedWhileNegotiating,null,Re._.negotiateRequest))},success:Oe};return Re.accessToken&&(ot.headers={Authorization:"Bearer "+Re.accessToken}),a.transports._logic.ajax(Re,ot)},Ne=function Je(Re){try{se=E._parseResponse(Re)}catch(He){pe(a._.error(n.errorParsingNegotiateResponse,He),E);return}if(se.availableTransports){ve=a._.error(n.aspnetCoreSignalrServer),t(E).triggerHandler(h.onError,[ve]),G.reject(ve);return}if(!se.ProtocolVersion||E.supportedProtocols.indexOf(se.ProtocolVersion)===-1){ve=a._.error(a._.format(n.protocolIncompatible,E.clientProtocol,se.ProtocolVersion)),t(E).triggerHandler(h.onError,[ve]),G.reject(ve);return}if(E.negotiateRedirectSupportedProtocols.indexOf(se.ProtocolVersion)!==-1){if(se.Error){ve=a._.error(a._.format(n.errorFromServer,se.Error)),t(E).triggerHandler(h.onError,[ve]),G.reject(ve);return}else if(se.RedirectUrl){if(ae===ce){pe(a._.error(n.errorRedirectionExceedsLimit),E);return}P.transport==="auto"&&(P.transport=["webSockets","serverSentEvents","longPolling"]),E.log("Received redirect to: "+se.RedirectUrl),E.accessToken=se.AccessToken;var Oe=se.RedirectUrl.split("?",2);if(le(E,Oe[0]),E._.redirectQs=Oe.length===2?Oe[1]:null,E.ajaxDataType==="jsonp"&&E.accessToken){pe(a._.error(n.jsonpNotSupportedWithAccessToken),E);return}ae++,Me(E,Je);return}}he=E._.keepAliveData,E.appRelativeUrl=se.Url,E.id=se.ConnectionId,E.token=se.ConnectionToken,E.webSocketServerUrl=se.WebSocketServerUrl,E._.pollTimeout=se.ConnectionTimeout*1e3+1e4,E.disconnectTimeout=se.DisconnectTimeout*1e3,E._.totalTransportConnectTimeout=E.transportConnectTimeout+se.TransportConnectTimeout*1e3,se.KeepAliveTimeout?(he.activated=!0,he.timeout=se.KeepAliveTimeout*1e3,he.timeoutWarning=he.timeout*E.keepAliveWarnAt,E._.beatInterval=(he.timeout-he.timeoutWarning)/3):he.activated=!1,E.reconnectWindow=E.disconnectTimeout+(he.timeout||0),t.each(a.transports,function(He){if(He.indexOf("_")===0||He==="webSockets"&&!se.TryWebSockets)return!0;De.push(He)}),t.isArray(P.transport)?t.each(P.transport,function(He,ot){t.inArray(ot,De)>=0&&Ae.push(ot)}):P.transport==="auto"?Ae=De:t.inArray(P.transport,De)>=0&&Ae.push(P.transport),Y(Ae)};return Me(E,Ne)})(),G.promise()},starting:function(M){var U=this;return t(U).bind(h.onStarting,function(E,P){M.call(U)}),U},send:function(M){var U=this;if(U.state===a.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(U.state===a.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return U.transport.send(U,M),U},received:function(M){var U=this;return t(U).bind(h.onReceived,function(E,P){M.call(U,P)}),U},stateChanged:function(M){var U=this;return t(U).bind(h.onStateChanged,function(E,P){M.call(U,P)}),U},error:function(M){var U=this;return t(U).bind(h.onError,function(E,P,Y){U.lastError=P,M.call(U,P,Y)}),U},disconnected:function(M){var U=this;return t(U).bind(h.onDisconnect,function(E,P){M.call(U)}),U},connectionSlow:function(M){var U=this;return t(U).bind(h.onConnectionSlow,function(E,P){M.call(U)}),U},reconnecting:function(M){var U=this;return t(U).bind(h.onReconnecting,function(E,P){M.call(U)}),U},reconnected:function(M){var U=this;return t(U).bind(h.onReconnect,function(E,P){M.call(U)}),U},stop:function(M,U){var E=this,P=E._deferral;if(E._.deferredStartHandler&&u.unbind("load",E._.deferredStartHandler),delete E._.config,delete E._.deferredStartHandler,!l&&(!E._.config||E._.config.waitForPageLoad===!0)){E.log("Stopping connection prior to negotiate."),P&&P.reject(a._.error(n.stoppedWhileLoading));return}if(E.state!==a.connectionState.disconnected)return E.log("Stopping connection."),r.clearTimeout(E._.beatHandle),r.clearInterval(E._.pingIntervalId),E.transport&&(E.transport.stop(E),U!==!1&&E.transport.abort(E,M),T(E)&&a.transports._logic.stopMonitoringKeepAlive(E),E.transport=null),E._.negotiateRequest&&(E._.negotiateRequest.abort(c),delete E._.negotiateRequest),E._.initHandler&&E._.initHandler.stop(),delete E._deferral,delete E.messageId,delete E.groupsToken,delete E.id,delete E._.pingIntervalId,delete E._.lastMessageAt,delete E._.lastActiveAt,E._.connectingMessageBuffer.clear(),t(E).unbind(h.onStart),delete E.accessToken,delete E.protocol,delete E.host,delete E.baseUrl,delete E.wsProtocol,delete E.contentType,E.url=E._originalUrl,E._.redirectQs=null,C(E,E.state,a.connectionState.disconnected),t(E).triggerHandler(h.onDisconnect),E},log:function(M){g(M,this.logging)}},a.fn.init.prototype=a.fn,a.noConflict=function(){return t.connection===a&&(t.connection=o),a},t.connection&&(o=t.connection),t.connection=t.signalR=a})(e,window),(function(t,r,i){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l="__Start Aborted__",u;n.transports={};function c(C){C._.keepAliveData.monitoring&&h(C),u.markActive(C)&&(C._.beatHandle=r.setTimeout(function(){c(C)},C._.beatInterval))}function h(C){var p=C._.keepAliveData,T;C.state===n.connectionState.connected&&(T=new Date().getTime()-C._.lastMessageAt,T>=p.timeout?(C.log("Keep alive timed out. Notifying transport that connection has been lost."),C.transport.lostConnection(C)):T>=p.timeoutWarning?p.userNotified||(C.log("Keep alive has been missed, connection may be dead/slow."),t(C).triggerHandler(a.onConnectionSlow),p.userNotified=!0):p.userNotified=!1)}function f(C,p){var T=C.url+p;return C.transport&&(T+="?transport="+C.transport.name),u.prepareQueryString(C,T)}function g(C){this.connection=C,this.startRequested=!1,this.startCompleted=!1,this.connectionStopped=!1}g.prototype={start:function(p,T,A){var N=this,F=N.connection,V=!1;if(N.startRequested||N.connectionStopped){F.log("WARNING! "+p.name+" transport cannot be started. Initialization ongoing or completed.");return}F.log(p.name+" transport starting."),p.start(F,function(){V||N.initReceived(p,T)},function(R){return V||(V=!0,N.transportFailed(p,R,A)),!N.startCompleted||N.connectionStopped}),N.transportTimeoutHandle=r.setTimeout(function(){V||(V=!0,F.log(p.name+" transport timed out when trying to connect."),N.transportFailed(p,i,A))},F._.totalTransportConnectTimeout)},stop:function(){this.connectionStopped=!0,r.clearTimeout(this.transportTimeoutHandle),n.transports._logic.tryAbortStartRequest(this.connection)},initReceived:function(p,T){var A=this,N=A.connection;if(A.startRequested){N.log("WARNING! The client received multiple init messages.");return}A.connectionStopped||(A.startRequested=!0,r.clearTimeout(A.transportTimeoutHandle),N.log(p.name+" transport connected. Initiating start request."),n.transports._logic.ajaxStart(N,function(){A.startCompleted=!0,T()}))},transportFailed:function(p,T,A){var N=this.connection,F=N._deferral,V;this.connectionStopped||(r.clearTimeout(this.transportTimeoutHandle),this.startRequested?this.startCompleted||(V=n._.error(n.resources.errorDuringStartRequest,T),N.log(p.name+" transport failed during the start request. Stopping the connection."),t(N).triggerHandler(a.onError,[V]),F&&F.reject(V),N.stop()):(p.stop(N),N.log(p.name+" transport failed to connect. Attempting to fall back."),A()))}},u=n.transports._logic={ajax:function(p,T){return t.ajax(t.extend(!0,{},t.signalR.ajaxDefaults,{type:"GET",data:{},xhrFields:{withCredentials:p.withCredentials},contentType:p.contentType,dataType:p.ajaxDataType},T))},pingServer:function(p){var T,A,N=t.Deferred();return p.transport?(T=p.url+"/ping",T=u.addQs(T,p.qs),A=u.ajax(p,{url:T,headers:p.accessToken?{Authorization:"Bearer "+p.accessToken}:{},success:function(V){var R;try{R=p._parseResponse(V)}catch(O){N.reject(n._.transportError(n.resources.pingServerFailedParse,p.transport,O,A)),p.stop();return}R.Response==="pong"?N.resolve():N.reject(n._.transportError(n._.format(n.resources.pingServerFailedInvalidResponse,V),p.transport,null,A))},error:function(V){V.status===401||V.status===403?(N.reject(n._.transportError(n._.format(n.resources.pingServerFailedStatusCode,V.status),p.transport,V,A)),p.stop()):N.reject(n._.transportError(n.resources.pingServerFailed,p.transport,V,A))}})):N.reject(n._.transportError(n.resources.noConnectionTransport,p.transport)),N.promise()},prepareQueryString:function(p,T){var A;return A=u.addQs(T,"clientProtocol="+p.clientProtocol),typeof p._.redirectQs=="string"?A=u.addQs(A,p._.redirectQs):A=u.addQs(A,p.qs),p.token&&(A+="&connectionToken="+r.encodeURIComponent(p.token)),p.data&&(A+="&connectionData="+r.encodeURIComponent(p.data)),A},addQs:function(p,T){var A=p.indexOf("?")!==-1?"&":"?",N;if(!T)return p;if((typeof T>"u"?"undefined":s(T))==="object")return p+A+t.param(T);if(typeof T=="string")return N=T.charAt(0),(N==="?"||N==="&")&&(A=""),p+A+T;throw new Error("Query string property must be either a string or object.")},getUrl:function(p,T,A,N,F){var V=T==="webSockets"?"":p.baseUrl,R=V+p.appRelativeUrl,O="transport="+T;return!F&&p.groupsToken&&(O+="&groupsToken="+r.encodeURIComponent(p.groupsToken)),A?(N?R+="/poll":R+="/reconnect",!F&&p.messageId&&(O+="&messageId="+r.encodeURIComponent(p.messageId))):R+="/connect",R+="?"+O,R=u.prepareQueryString(p,R),p.transport&&p.accessToken&&(p.transport.name==="serverSentEvents"||p.transport.name==="webSockets")&&(R+="&access_token="+r.encodeURIComponent(p.accessToken)),F||(R+="&tid="+Math.floor(Math.random()*11)),R},maximizePersistentResponse:function(p){return{MessageId:p.C,Messages:p.M,Initialized:typeof p.S<"u",ShouldReconnect:typeof p.T<"u",LongPollDelay:p.L,GroupsToken:p.G,Error:p.E}},updateGroups:function(p,T){T&&(p.groupsToken=T)},stringifySend:function(p,T){return typeof T=="string"||typeof T>"u"||T===null?T:p.json.stringify(T)},ajaxSend:function(p,T){var A=u.stringifySend(p,T),N=f(p,"/send"),F,V=function(O,M){t(M).triggerHandler(a.onError,[n._.transportError(n.resources.sendFailed,M.transport,O,F),T])};return F=u.ajax(p,{url:N,type:p.ajaxDataType==="jsonp"?"GET":"POST",contentType:n._.defaultContentType,headers:p.accessToken?{Authorization:"Bearer "+p.accessToken}:{},data:{data:A},success:function(O){var M;if(O){try{M=p._parseResponse(O)}catch(U){V(U,p),p.stop();return}u.triggerReceived(p,M)}},error:function(O,M){M==="abort"||M==="parsererror"||V(O,p)}}),F},ajaxAbort:function(p,T){if(!(typeof p.transport>"u")){T=typeof T>"u"?!0:T;var A=f(p,"/abort");u.ajax(p,{url:A,async:T,timeout:1e3,type:"POST",headers:p.accessToken?{Authorization:"Bearer "+p.accessToken}:{},dataType:"text"}),p.log("Fired ajax abort async = "+T+".")}},ajaxStart:function(p,T){var A=function(V){var R=p._deferral;R&&R.reject(V)},N=function(V){p.log("The start request failed. Stopping the connection."),t(p).triggerHandler(a.onError,[V]),A(V),p.stop()};p._.startRequest=u.ajax(p,{url:f(p,"/start"),headers:p.accessToken?{Authorization:"Bearer "+p.accessToken}:{},success:function(V,R,O){var M;try{M=p._parseResponse(V)}catch(U){N(n._.error(n._.format(n.resources.errorParsingStartResponse,V),U,O));return}M.Response==="started"?T():N(n._.error(n._.format(n.resources.invalidStartResponse,V),null,O))},error:function(V,R,O){R!==l?N(n._.error(n.resources.errorDuringStartRequest,O,V)):(p.log("The start request aborted because connection.stop() was called."),A(n._.error(n.resources.stoppedDuringStartRequest,null,V)))}})},tryAbortStartRequest:function(p){p._.startRequest&&(p._.startRequest.abort(l),delete p._.startRequest)},tryInitialize:function(p,T,A){T.Initialized&&A?A():T.Initialized&&p.log("WARNING! The client received an init message after reconnecting.")},triggerReceived:function(p,T){p._.connectingMessageBuffer.tryBuffer(T)||t(p).triggerHandler(a.onReceived,[T])},processMessages:function(p,T,A){var N;if(T&&typeof T.I<"u"){u.triggerReceived(p,T);return}if(u.markLastMessage(p),T){if(N=u.maximizePersistentResponse(T),N.Error){p.log("Received an error message from the server: "+T.E),t(p).triggerHandler(n.events.onError,[n._.error(T.E,"ServerError")]),p.stop(!1,!1);return}u.updateGroups(p,N.GroupsToken),N.MessageId&&(p.messageId=N.MessageId),N.Messages&&(t.each(N.Messages,function(F,V){u.triggerReceived(p,V)}),u.tryInitialize(p,N,A))}},monitorKeepAlive:function(p){var T=p._.keepAliveData;T.monitoring?p.log("Tried to monitor keep alive but it's already being monitored."):(T.monitoring=!0,u.markLastMessage(p),p._.keepAliveData.reconnectKeepAliveUpdate=function(){u.markLastMessage(p)},t(p).bind(a.onReconnect,p._.keepAliveData.reconnectKeepAliveUpdate),p.log("Now monitoring keep alive with a warning timeout of "+T.timeoutWarning+", keep alive timeout of "+T.timeout+" and disconnecting timeout of "+p.disconnectTimeout))},stopMonitoringKeepAlive:function(p){var T=p._.keepAliveData;T.monitoring&&(T.monitoring=!1,t(p).unbind(a.onReconnect,p._.keepAliveData.reconnectKeepAliveUpdate),p._.keepAliveData={},p.log("Stopping the monitoring of the keep alive."))},startHeartbeat:function(p){p._.lastActiveAt=new Date().getTime(),c(p)},markLastMessage:function(p){p._.lastMessageAt=new Date().getTime()},markActive:function(p){return u.verifyLastActive(p)?(p._.lastActiveAt=new Date().getTime(),!0):!1},isConnectedOrReconnecting:function(p){return p.state===n.connectionState.connected||p.state===n.connectionState.reconnecting},ensureReconnectingState:function(p){return o(p,n.connectionState.connected,n.connectionState.reconnecting)===!0&&t(p).triggerHandler(a.onReconnecting),p.state===n.connectionState.reconnecting},clearReconnectTimeout:function(p){p&&p._.reconnectTimeout&&(r.clearTimeout(p._.reconnectTimeout),delete p._.reconnectTimeout)},verifyLastActive:function(p){if(new Date().getTime()-p._.lastActiveAt>=p.reconnectWindow){var T=n._.format(n.resources.reconnectWindowTimeout,new Date(p._.lastActiveAt),p.reconnectWindow);return p.log(T),t(p).triggerHandler(a.onError,[n._.error(T,"TimeoutException")]),p.stop(!1,!1),!1}return!0},reconnect:function(p,T){var A=n.transports[T];if(u.isConnectedOrReconnecting(p)&&!p._.reconnectTimeout){if(!u.verifyLastActive(p))return;p._.reconnectTimeout=r.setTimeout(function(){u.verifyLastActive(p)&&(A.stop(p),u.ensureReconnectingState(p)&&(p.log(T+" reconnecting."),A.start(p)))},p.reconnectDelay)}},handleParseFailure:function(p,T,A,N,F){var V=n._.transportError(n._.format(n.resources.parseFailed,T),p.transport,A,F);N&&N(V)?p.log("Failed to parse server response while attempting to connect."):(t(p).triggerHandler(a.onError,[V]),p.stop())},initHandler:function(p){return new g(p)},foreverFrame:{count:0,connections:{}}}})(e,window),(function(t,r,i){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l=n.transports._logic;n.transports.webSockets={name:"webSockets",supportsKeepAlive:function(){return!0},send:function(c,h){var f=l.stringifySend(c,h);try{c.socket.send(f)}catch(g){t(c).triggerHandler(a.onError,[n._.transportError(n.resources.webSocketsInvalidState,c.transport,g,c.socket),h])}},start:function(c,h,f){var g,C=!1,p=this,T=!h,A=t(c);if(!r.WebSocket){f();return}c.socket||(c.webSocketServerUrl?g=c.webSocketServerUrl:g=c.wsProtocol+c.host,g+=l.getUrl(c,this.name,T),c.log("Connecting to websocket endpoint '"+g+"'."),c.socket=new r.WebSocket(g),c.socket.onopen=function(){C=!0,c.log("Websocket opened."),l.clearReconnectTimeout(c),o(c,n.connectionState.reconnecting,n.connectionState.connected)===!0&&A.triggerHandler(a.onReconnect)},c.socket.onclose=function(N){var F;this===c.socket&&(C&&typeof N.wasClean<"u"&&N.wasClean===!1?(F=n._.transportError(n.resources.webSocketClosed,c.transport,N),c.log("Unclean disconnect from websocket: "+(N.reason||"[no reason given]."))):c.log("Websocket closed."),(!f||!f(F))&&(F&&t(c).triggerHandler(a.onError,[F]),p.reconnect(c)))},c.socket.onmessage=function(N){var F;try{F=c._parseResponse(N.data)}catch(V){l.handleParseFailure(c,N.data,V,f,N);return}F&&l.processMessages(c,F,h)})},reconnect:function(c){l.reconnect(c,this.name)},lostConnection:function(c){this.reconnect(c)},stop:function(c){l.clearReconnectTimeout(c),c.socket&&(c.log("Closing the Websocket."),c.socket.close(),c.socket=null)},abort:function(c,h){l.ajaxAbort(c,h)}}})(e,window),(function(t,r,i){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l=n.transports._logic,u=function(h){r.clearTimeout(h._.reconnectAttemptTimeoutHandle),delete h._.reconnectAttemptTimeoutHandle};n.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:function(){return!0},timeOut:3e3,start:function(h,f,g){var C=this,p=!1,T=t(h),A=!f,N;if(h.eventSource&&(h.log("The connection already has an event source. Stopping it."),h.stop()),!r.EventSource){g&&(h.log("This browser doesn't support SSE."),g());return}N=l.getUrl(h,this.name,A);try{h.log("Attempting to connect to SSE endpoint '"+N+"'."),h.eventSource=new r.EventSource(N,{withCredentials:h.withCredentials})}catch(F){h.log("EventSource failed trying to connect with error "+F.Message+"."),g?g():(T.triggerHandler(a.onError,[n._.transportError(n.resources.eventSourceFailedToConnect,h.transport,F)]),A&&C.reconnect(h));return}A&&(h._.reconnectAttemptTimeoutHandle=r.setTimeout(function(){p===!1&&h.eventSource.readyState!==r.EventSource.OPEN&&C.reconnect(h)},C.timeOut)),h.eventSource.addEventListener("open",function(F){h.log("EventSource connected."),u(h),l.clearReconnectTimeout(h),p===!1&&(p=!0,o(h,n.connectionState.reconnecting,n.connectionState.connected)===!0&&T.triggerHandler(a.onReconnect))},!1),h.eventSource.addEventListener("message",function(F){var V;if(F.data!=="initialized"){try{V=h._parseResponse(F.data)}catch(R){l.handleParseFailure(h,F.data,R,g,F);return}l.processMessages(h,V,f)}},!1),h.eventSource.addEventListener("error",function(F){var V=n._.transportError(n.resources.eventSourceError,h.transport,F);this===h.eventSource&&(g&&g(V)||(h.log("EventSource readyState: "+h.eventSource.readyState+"."),F.eventPhase===r.EventSource.CLOSED?(h.log("EventSource reconnecting due to the server connection ending."),C.reconnect(h)):(h.log("EventSource error."),T.triggerHandler(a.onError,[V]))))},!1)},reconnect:function(h){l.reconnect(h,this.name)},lostConnection:function(h){this.reconnect(h)},send:function(h,f){l.ajaxSend(h,f)},stop:function(h){u(h),l.clearReconnectTimeout(h),h&&h.eventSource&&(h.log("EventSource calling close()."),h.eventSource.close(),h.eventSource=null,delete h.eventSource)},abort:function(h,f){l.ajaxAbort(h,f)}}})(e,window),(function(t,r,i){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l=n.transports._logic,u=function(){var f=r.document.createElement("iframe");return f.setAttribute("style","position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;"),f},c=(function(){var h=null,f=1e3,g=0;return{prevent:function(){n._.ieVersion<=8&&(g===0&&(h=r.setInterval(function(){var p=u();r.document.body.appendChild(p),r.document.body.removeChild(p),p=null},f)),g++)},cancel:function(){g===1&&r.clearInterval(h),g>0&&g--}}})();n.transports.foreverFrame={name:"foreverFrame",supportsKeepAlive:function(){return!0},iframeClearThreshold:50,start:function(f,g,C){if(f.accessToken){C&&(f.log("Forever Frame does not support connections that require a Bearer token to connect, such as the Azure SignalR Service."),C());return}var p=this,T=l.foreverFrame.count+=1,A,N=u(),F=function(){f.log("Forever frame iframe finished loading and is no longer receiving messages."),(!C||!C())&&p.reconnect(f)};if(r.EventSource){C&&(f.log("Forever Frame is not supported by SignalR on browsers with SSE support."),C());return}N.setAttribute("data-signalr-connection-id",f.id),c.prevent(),A=l.getUrl(f,this.name),A+="&frameId="+T,r.document.documentElement.appendChild(N),f.log("Binding to iframe's load event."),N.addEventListener?N.addEventListener("load",F,!1):N.attachEvent&&N.attachEvent("onload",F),N.src=A,l.foreverFrame.connections[T]=f,f.frame=N,f.frameId=T,g&&(f.onSuccess=function(){f.log("Iframe transport started."),g()})},reconnect:function(f){var g=this;l.isConnectedOrReconnecting(f)&&l.verifyLastActive(f)&&r.setTimeout(function(){if(l.verifyLastActive(f)&&f.frame&&l.ensureReconnectingState(f)){var C=f.frame,p=l.getUrl(f,g.name,!0)+"&frameId="+f.frameId;f.log("Updating iframe src to '"+p+"'."),C.src=p}},f.reconnectDelay)},lostConnection:function(f){this.reconnect(f)},send:function(f,g){l.ajaxSend(f,g)},receive:function(f,g){var C,p,T;if(f.json!==f._originalJson&&(g=f._originalJson.stringify(g)),T=f._parseResponse(g),l.processMessages(f,T,f.onSuccess),f.state===t.signalR.connectionState.connected&&(f.frameMessageCount=(f.frameMessageCount||0)+1,f.frameMessageCount>n.transports.foreverFrame.iframeClearThreshold&&(f.frameMessageCount=0,C=f.frame.contentWindow||f.frame.contentDocument,C&&C.document&&C.document.body)))for(p=C.document.body;p.firstChild;)p.removeChild(p.firstChild)},stop:function(f){var g=null;if(c.cancel(),f.frame){if(f.frame.stop)f.frame.stop();else try{g=f.frame.contentWindow||f.frame.contentDocument,g.document&&g.document.execCommand&&g.document.execCommand("Stop")}catch(C){f.log("Error occurred when stopping foreverFrame transport. Message = "+C.message+".")}f.frame.parentNode===r.document.documentElement&&r.document.documentElement.removeChild(f.frame),delete l.foreverFrame.connections[f.frameId],f.frame=null,f.frameId=null,delete f.frame,delete f.frameId,delete f.onSuccess,delete f.frameMessageCount,f.log("Stopping forever frame.")}},abort:function(f,g){l.ajaxAbort(f,g)},getConnection:function(f){return l.foreverFrame.connections[f]},started:function(f){o(f,n.connectionState.reconnecting,n.connectionState.connected)===!0&&t(f).triggerHandler(a.onReconnect)}}})(e,window),(function(t,r,i){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l=t.signalR.isDisconnecting,u=n.transports._logic;n.transports.longPolling={name:"longPolling",supportsKeepAlive:function(){return!1},reconnectDelay:3e3,start:function(h,f,g){var C=this,p=function(){p=t.noop,h.log("LongPolling connected."),f?f():h.log("WARNING! The client received an init message after reconnecting.")},T=function(O){return g(O)?(h.log("LongPolling failed to connect."),!0):!1},A=h._,N=0,F=function(O){r.clearTimeout(A.reconnectTimeoutId),A.reconnectTimeoutId=null,o(O,n.connectionState.reconnecting,n.connectionState.connected)===!0&&(O.log("Raising the reconnect event"),t(O).triggerHandler(a.onReconnect))},V=36e5;h.pollXhr&&(h.log("Polling xhr requests already exists, aborting."),h.stop()),h.messageId=null,A.reconnectTimeoutId=null,A.pollTimeoutId=r.setTimeout(function(){(function R(O,M){var U=O.messageId,E=U===null,P=!E,Y=!M,G=u.getUrl(O,C.name,P,Y,!0),K={};O.messageId&&(K.messageId=O.messageId),O.groupsToken&&(K.groupsToken=O.groupsToken),l(O)!==!0&&(h.log("Opening long polling request to '"+G+"'."),O.pollXhr=u.ajax(h,{xhrFields:{onprogress:function(){u.markLastMessage(h)}},url:G,type:"POST",contentType:n._.defaultContentType,data:K,timeout:h._.pollTimeout,headers:h.accessToken?{Authorization:"Bearer "+h.accessToken}:{},success:function(de){var pe,se=0,ae,ce;h.log("Long poll complete."),N=0;try{pe=h._parseResponse(de)}catch(he){u.handleParseFailure(O,de,he,T,O.pollXhr);return}A.reconnectTimeoutId!==null&&F(O),pe&&(ae=u.maximizePersistentResponse(pe)),u.processMessages(O,pe,p),ae&&t.type(ae.LongPollDelay)==="number"&&(se=ae.LongPollDelay),l(O)!==!0&&(ce=ae&&ae.ShouldReconnect,!(ce&&!u.ensureReconnectingState(O))&&(se>0?A.pollTimeoutId=r.setTimeout(function(){R(O,ce)},se):R(O,ce)))},error:function(de,pe){var se=n._.transportError(n.resources.longPollFailed,h.transport,de,O.pollXhr);if(r.clearTimeout(A.reconnectTimeoutId),A.reconnectTimeoutId=null,pe==="abort"){h.log("Aborted xhr request.");return}if(!T(se)){if(N++,h.state!==n.connectionState.reconnecting&&(h.log("An error occurred using longPolling. Status = "+pe+". Response = "+de.responseText+"."),t(O).triggerHandler(a.onError,[se])),(h.state===n.connectionState.connected||h.state===n.connectionState.reconnecting)&&!u.verifyLastActive(h)||!u.ensureReconnectingState(O))return;A.pollTimeoutId=r.setTimeout(function(){R(O,!0)},C.reconnectDelay)}}}),P&&M===!0&&(A.reconnectTimeoutId=r.setTimeout(function(){F(O)},Math.min(1e3*(Math.pow(2,N)-1),V))))})(h)},250)},lostConnection:function(h){h.pollXhr&&h.pollXhr.abort("lostConnection")},send:function(h,f){u.ajaxSend(h,f)},stop:function(h){r.clearTimeout(h._.pollTimeoutId),r.clearTimeout(h._.reconnectTimeoutId),delete h._.pollTimeoutId,delete h._.reconnectTimeoutId,h.pollXhr&&(h.pollXhr.abort(),h.pollXhr=null,delete h.pollXhr)},abort:function(h,f){u.ajaxAbort(h,f)}}})(e,window),(function(t,r,i){var n=0,a=".hubProxy",o=t.signalR;function l(T){return T+a}function u(T,A,N){var F,V=T.length,R=[];for(F=0;F<V;F+=1)T.hasOwnProperty(F)&&(R[F]=A.call(N,T[F],F,T));return R}function c(T){return t.isFunction(T)||t.type(T)==="undefined"?null:T}function h(T){for(var A in T)if(T.hasOwnProperty(A))return!0;return!1}function f(T,A){var N=T._.invocationCallbacks,F;h(N)&&T.log("Clearing hub invocation callbacks with error: "+A+"."),T._.invocationCallbackId=0,delete T._.invocationCallbacks,T._.invocationCallbacks={};for(var V in N)F=N[V],F.method.call(F.scope,{E:A})}function g(T){return t.isFunction(T)&&T.toString().slice(0,256).indexOf("// Call the client hub method")>=0}function C(T,A){return new C.fn.init(T,A)}C.fn=C.prototype={init:function(A,N){this.state={},this.connection=A,this.hubName=N,this._={callbackMap:{}}},constructor:C,hasSubscriptions:function(){return h(this._.callbackMap)},on:function(A,N,F){var V=this,R=V._.callbackMap,O=!F&&g(N);F=F||N,F._signalRGuid||(F._signalRGuid=n++),A=A.toLowerCase();var M=R[A];M||(M=[],R[A]=M);for(var U,E=0;E<M.length;E++)(M[E].guid===F._signalRGuid||O&&M[E].isFromOldGeneratedHubProxy)&&(U=M[E]);U||(U={guid:F._signalRGuid,eventHandlers:[],isFromOldGeneratedHubProxy:O},R[A].push(U));var P=function(G,K){N.apply(V,K)};return U.eventHandlers.push(P),t(V).bind(l(A),P),V},off:function(A,N,F){var V=this,R=V._.callbackMap,O,M=!F&&g(N);if(F=F||N,A=A.toLowerCase(),O=R[A],O)if(N){for(var U,E=0;E<O.length;E++)(O[E].guid===F._signalRGuid||M&&O[E].isFromOldGeneratedHubProxy)&&(U=O[E]);if(U){for(var P=0;P<U.eventHandlers.length;P++)t(V).unbind(l(A),U.eventHandlers[P]);O.splice(E,1),O.length===0&&delete R[A]}}else N||(t(V).unbind(l(A)),delete R[A]);return V},invoke:function(A){var N=this,F=N.connection,V=t.makeArray(arguments).slice(1),R=u(V,c),O={H:N.hubName,M:A,A:R,I:F._.invocationCallbackId},M=t.Deferred(),U=function(P){var Y=N._maximizeHubResponse(P),G,K;t.extend(N.state,Y.State),Y.Progress?M.notifyWith?M.notifyWith(N,[Y.Progress.Data]):F._.progressjQueryVersionLogged||(F.log("A hub method invocation progress update was received but the version of jQuery in use ("+t.prototype.jquery+") does not support progress updates. Upgrade to jQuery 1.7+ to receive progress notifications."),F._.progressjQueryVersionLogged=!0):Y.Error?(Y.StackTrace&&F.log(Y.Error+`
|
|
340
|
-
`+Y.StackTrace+"."),G=Y.IsHubException?"HubException":"Exception",K=o._.error(Y.Error,G),K.data=Y.ErrorData,F.log(N.hubName+"."+A+" failed to execute. Error: "+K.message),M.rejectWith(N,[K])):(F.log("Invoked "+N.hubName+"."+A),M.resolveWith(N,[Y.Result]))};return F._.invocationCallbacks[F._.invocationCallbackId.toString()]={scope:N,method:U},F._.invocationCallbackId+=1,t.isEmptyObject(N.state)||(O.S=N.state),F.log("Invoking "+N.hubName+"."+A),F.send(O),M.promise()},_maximizeHubResponse:function(A){return{State:A.S,Result:A.R,Progress:A.P?{Id:A.P.I,Data:A.P.D}:null,Id:A.I,IsHubException:A.H,Error:A.E,StackTrace:A.T,ErrorData:A.D}}},C.fn.init.prototype=C.fn;function p(T,A){var N={qs:null,logging:!1,useDefaultPath:!0};return t.extend(N,A),(!T||N.useDefaultPath)&&(T=(T||"")+"/signalr"),new p.fn.init(T,N)}p.fn=p.prototype=t.connection(),p.fn.init=function(T,A){var N={qs:null,logging:!1,useDefaultPath:!0},F=this;t.extend(N,A),t.signalR.fn.init.call(F,T,N.qs,N.logging),F.proxies={},F._.invocationCallbackId=0,F._.invocationCallbacks={},F.received(function(V){var R,O,M,U,E,P;V&&(typeof V.P<"u"?(M=V.P.I.toString(),U=F._.invocationCallbacks[M],U&&U.method.call(U.scope,V)):typeof V.I<"u"?(M=V.I.toString(),U=F._.invocationCallbacks[M],U&&(F._.invocationCallbacks[M]=null,delete F._.invocationCallbacks[M],U.method.call(U.scope,V))):(R=this._maximizeClientHubInvocation(V),F.log("Triggering client hub event '"+R.Method+"' on hub '"+R.Hub+"'."),E=R.Hub.toLowerCase(),P=R.Method.toLowerCase(),O=this.proxies[E],t.extend(O.state,R.State),t(O).triggerHandler(l(P),[R.Args])))}),F.error(function(V,R){var O,M;R&&(O=R.I,M=F._.invocationCallbacks[O],M&&(F._.invocationCallbacks[O]=null,delete F._.invocationCallbacks[O],M.method.call(M.scope,{E:V})))}),F.reconnecting(function(){F.transport&&F.transport.name==="webSockets"&&f(F,"Connection started reconnecting before invocation result was received.")}),F.disconnected(function(){f(F,"Connection was disconnected before invocation result was received.")})},p.fn._maximizeClientHubInvocation=function(T){return{Hub:T.H,Method:T.M,Args:T.A,State:T.S}},p.fn._registerSubscribedHubs=function(){var T=this;T._subscribedToHubs||(T._subscribedToHubs=!0,T.starting(function(){var A=[];t.each(T.proxies,function(N){this.hasSubscriptions()&&(A.push({name:N}),T.log("Client subscribed to hub '"+N+"'."))}),A.length===0&&T.log("No hubs have been subscribed to. The client will not receive data from hubs. To fix, declare at least one client side function prior to connection start for each hub you wish to subscribe to."),T.data=T.json.stringify(A)}))},p.fn.createHubProxy=function(T){T=T.toLowerCase();var A=this.proxies[T];return A||(A=C(this,T),this.proxies[T]=A),this._registerSubscribedHubs(),A},p.fn.init.prototype=p.fn,t.hubConnection=p})(e),(function(t,r){t.signalR.version="2.4.1"})(e),_l.hubConnection=e.hubConnection,_l.signalR=e.signalR,_l}var mH=pH(),er=(s=>(s.AppleTv="apple-tv",s.Vivi="vivi",s))(er||{}),ea=(s=>(s.Available="available",s.Offline="offline",s.Busy="busy",s))(ea||{});const gH=class Om{constructor(e,t){this[Symbol.toStringTag]=e[Symbol.toStringTag],this.innerPromise=e,this.onTimeout=t,this.bindFunctions()}bindFunctions(){this.timeout=this.timeout.bind(this),this.then=this.then.bind(this),this.catch=this.catch.bind(this),this.finally=this.finally.bind(this)}timeout(e){return new Promise((t,r)=>{this.then(t).catch(r).finally(()=>clearTimeout(i));const i=setTimeout(()=>{var n;(n=this.onTimeout)==null||n.call(this),r(new Error("Promise timed out"))},e)})}then(e,t){return this.innerPromise.then(e,t)}catch(e){return this.innerPromise.catch(e)}finally(e){return this.innerPromise.finally(e)}static reject(e){return new Om(Promise.reject(e))}static fromPromise(e){return new Om(e)}};let Mm=gH;class vH{constructor(){this.callbacks=[],this.predicates=[],this.controller=new AbortController,this.signal=this.controller.signal,this.trigger=this.trigger.bind(this),this.on=this.on.bind(this),this.one=this.one.bind(this),this.off=this.off.bind(this),this.dispose=this.dispose.bind(this),this.isDisposed=this.isDisposed.bind(this)}trigger(e){this.callbacks.forEach((t,r)=>{const i=this.predicates[r];i&&!i(e)||t(e)})}on(e){this.isDisposed()&&console.warn("This EventChannel instance been disposed - this is a no-op");const t=this.callbacks.length;this.callbacks[t]=e,this.predicates[t]=()=>!0;const r=()=>{this.off(e)};return{off:r,filter:n=>(this.predicates[t]=n,r)}}one(e=()=>!0){if(this.isDisposed())return Mm.reject(new Error("This EventChannel instance has been disposed"));let t;return new Mm(new Promise((r,i)=>{t=this.on(a=>{this.signal.removeEventListener("abort",n),t(),r(a)}).filter(e);const n=()=>{t(),i(new Error("Aborted while waiting for message"))};this.signal.addEventListener("abort",n,{once:!0})}),()=>{t()})}off(e){const t=this.callbacks.indexOf(e);t!==-1&&(this.callbacks.splice(t,1),this.predicates.splice(t,1))}dispose(){this.callbacks.length=0,this.predicates.length=0,this.controller.abort()}isDisposed(){return this.signal.aborted}}class pu{constructor(){this.channels={},this.trigger=this.trigger.bind(this),this.on=this.on.bind(this),this.one=this.one.bind(this),this.off=this.off.bind(this),this.dispose=this.dispose.bind(this),this.getChannel=this.getChannel.bind(this)}trigger(e,t){this.getChannel(e).trigger(t)}on(e,t){return this.getChannel(e).on(t)}one(e,t){return this.getChannel(e).one(t)}off(e,t){this.getChannel(e).off(t)}dispose(){this.trigger("dispose",gt.void),Object.values(this.channels).forEach(e=>e.dispose()),this.channels={}}getChannel(e){return this.channels[e]||(this.channels[e]=new vH),this.channels[e]}}const gt={void:void 0};class Sv{constructor(){this.bindFunctions()}bindFunctions(){this.schedule=this.schedule.bind(this),this.every=this.every.bind(this),this.trigger=this.trigger.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this)}schedule(e){return this.task=e,this}every(e){return this.intervalInMilliseconds=e,this}trigger(){var e;return(e=this.task)==null||e.call(this,this),this}start(){return this.intervalId||(this.intervalId=setInterval(()=>this.trigger(),this.intervalInMilliseconds)),this}stop(){return this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this}}function yH(s,e){return s._lastModified||(s._lastModified={}),new Proxy(s,{set:(t,r,i,n)=>{const a=s._lastModified[r.toString()];return a&&Date.now()<a+e?!0:Reflect.set(t,r,i,n)}})}function _H(s){return s._lastModified||(s._lastModified={}),new Proxy(s,{set:(e,t,r,i)=>(s._lastModified[t.toString()]=Date.now(),Reflect.set(e,t,r,i))})}const Eh={withDebouncedSetters:yH,withTimestampedSetters:_H};var kl=(s=>(s[s.Offline=0]="Offline",s[s.Online=1]="Online",s[s.Locked=2]="Locked",s[s.Suspended=3]="Suspended",s))(kl||{}),Zl=(s=>(s[s.PlaybackStatusChange=0]="PlaybackStatusChange",s[s.PositionChange=1]="PositionChange",s))(Zl||{}),pi=(s=>(s.Begin="BEGIN",s.Play="PLAY",s.Pause="PAUSE",s.Load="LOAD",s.Scan="SCAN",s.Stop="STOP",s))(pi||{});const TH=2e3;class bH{constructor(e,t){return this.title=e,this.device=t,this.locked=!1,this.position=0,this.playbackStatus=pi.Load,this.debounced=Eh.withDebouncedSetters(this,TH),Eh.withTimestampedSetters(this)}}class SH extends pu{constructor(e,t){super(),this.client=e,this.localState=new bH(t.title,t.device),this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleDisconnected=this.handleDisconnected.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handlePlaybackChange=this.handlePlaybackChange.bind(this),this.handlePositionChange=this.handlePositionChange.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}initialize(){this.client.on("dispose",this.dispose),this.client.on("disconnected",this.handleDisconnected),this.client.on("message",this.handleAllVideoMessages)}dispose(){this.client.off("dispose",this.dispose),this.client.off("disconnected",this.handleDisconnected),this.client.off("message",this.handleAllVideoMessages),this.client.stop(this.getDevice().id).catch(e=>console.error(e)),super.dispose()}handleDisconnected(){this.trigger("error",new Error("The connection to the Apple TV has been lost and cannot be recovered"))}handleAllVideoMessages(e){if(e.deviceId!==this.getDevice().id)return;const t=this.localState.debounced;switch(e.event){case Zl.PlaybackStatusChange:this.handlePlaybackChange(t,e);break;case Zl.PositionChange:this.handlePositionChange(t,e);break}}handlePlaybackChange(e,t){e.playbackStatus!==t.params.playbackStatus&&(e.playbackStatus=t.params.playbackStatus,this.trigger("playingchange",gt.void),e.playbackStatus===pi.Stop&&this.dispose())}handlePositionChange(e,t){e.position!==t.params.position&&(e.position=t.params.position,this.trigger("positionchange",gt.void))}async loadSource(){try{if(this.localState.locked)return;await this.client.lock(this.getDevice().id),this.localState.locked=!0,await this.client.loadVideo(this.getDevice().id),this.trigger("sourceloaded",gt.void)}catch(e){console.error(e),this.trigger("error",new Error("Could not load video on Apple TV device"))}}play(){this.localState.locked&&this.localState.playbackStatus!==pi.Play&&(this.localState.playbackStatus=pi.Play,this.client.play(this.getDevice().id),this.trigger("playingchange",gt.void))}pause(){this.localState.locked&&this.localState.playbackStatus!==pi.Pause&&(this.localState.playbackStatus=pi.Pause,this.client.pause(this.getDevice().id),this.trigger("playingchange",gt.void))}seek(e){this.localState.locked&&this.localState.position!==e&&(this.localState.position=e,this.client.seek(this.getDevice().id,e),this.trigger("positionchange",gt.void))}setVolume(){console.info("Setting the volume is not supported on Apple TV")}setMuted(){console.info("Muting is not supported on Apple TV")}setSubtitles(){console.info("Subtitles are not supported on Apple TV")}isPlaying(){return this.localState.playbackStatus===pi.Play||this.localState.playbackStatus===pi.Begin||this.localState.playbackStatus===pi.Load}isPlaybackFinished(){return this.localState.playbackStatus===pi.Stop}getPosition(){return this.localState.position}getDuration(){}getVolume(){return 1}getMuted(){return!1}getSubtitles(){}getDevice(){return this.localState.device}getTitle(){return this.localState.title}}const CH=2e4,EH=500,wH="DeviceUserHub",kH=5e3;class js extends pu{constructor(e){super(),this.options=e,this.accessToken=void 0,this.devices=[],this.heartbeat=new Sv,this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.connect=this.connect.bind(this),this.subscribe=this.subscribe.bind(this),this.tryFixConnection=this.tryFixConnection.bind(this),this.invoke=this.invoke.bind(this),this.invokeDebounced=au(this.invoke,EH,!0),this.handleDeviceList=this.handleDeviceList.bind(this),this.handleDeviceStateChange=this.handleDeviceStateChange.bind(this),this.handleDevicePaired=this.handleDevicePaired.bind(this),this.handleDeviceUnpaired=this.handleDeviceUnpaired.bind(this),this.handlePlayStatusChange=this.handlePlayStatusChange.bind(this),this.handleTimeSync=this.handleTimeSync.bind(this),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.bind(this),this.lock=this.lock.bind(this),this.loadVideo=this.loadVideo.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.stop=this.stop.bind(this),this.pair=this.pair.bind(this),this.unpair=this.unpair.bind(this),this.renameDevice=this.renameDevice.bind(this)}async initialize(){try{this.accessToken=await this.options.fetchAccessToken(),this.connection=mH.hubConnection(this.accessToken.host,{logging:!1}),this.hubProxy=this.connection.createHubProxy(wH),this.hubProxy.on("DeviceList",this.handleDeviceList),this.hubProxy.on("DeviceStateChange",this.handleDeviceStateChange),this.hubProxy.on("Paired",this.handleDevicePaired),this.hubProxy.on("Unpaired",this.handleDeviceUnpaired),this.hubProxy.on("PlayStatusChange",this.handlePlayStatusChange),this.hubProxy.on("TimeSync",this.handleTimeSync),await this.connect(),await this.subscribe(this.accessToken.token),this.heartbeat.schedule(this.tryFixConnection).every(kH).start()}catch(e){console.error(e),this.trigger("error",new Error("Could not connect to Online API"))}}async connect(){return new Promise((e,t)=>{this.connection.start({jsonp:!1,withCredentials:!1}).done(()=>e()).fail(()=>t(new Error("Could not connect to SignalR hub")))})}async subscribe(e){if(!await this.invoke("Subscribe",e))throw new Error("The subscription request was rejected by Online API")}async tryFixConnection(){if(this.connection.state===4)try{this.heartbeat.stop(),this.accessToken=await this.options.fetchAccessToken(),await this.connect(),await this.subscribe(this.accessToken.token)}catch(e){console.warn(e),console.warn("Could not reconnect to Online API")}finally{this.heartbeat.start()}}async invoke(e,...t){const r=new Promise((i,n)=>{var a;((a=this.hubProxy)==null?void 0:a.invoke(e,...t)).done(i).fail(n)});return Mm.fromPromise(r).timeout(CH)}handleDeviceList(e){this.devices=e.filter(t=>t.type!=="vivi").map(js.convertToGenericDevice),this.trigger("deviceschange",gt.void)}handleDeviceStateChange(e){const t=this.devices.findIndex(r=>r.id===e.deviceId);t>=0&&(this.devices[t]=js.convertToGenericDevice(e),this.trigger("deviceschange",gt.void))}handleDevicePaired(e){e.type!=="vivi"&&(this.devices.push(js.convertToGenericDevice(e)),this.trigger("deviceschange",gt.void))}handleDeviceUnpaired(e){this.devices=this.devices.filter(t=>t.id!==e),this.trigger("deviceschange",gt.void)}handlePlayStatusChange(e,t){this.trigger("message",{event:Zl.PlaybackStatusChange,deviceId:e,params:{playbackStatus:t.commandType}})}handleTimeSync(e,t){this.trigger("message",{event:Zl.PositionChange,deviceId:e,params:{position:t}})}dispose(){this.hubProxy.off("DeviceList",this.handleDeviceList),this.hubProxy.off("DeviceStateChange",this.handleDeviceStateChange),this.hubProxy.off("Paired",this.handleDevicePaired),this.hubProxy.off("Unpaired",this.handleDeviceUnpaired),this.hubProxy.off("PlayStatusChange",this.handlePlayStatusChange),this.hubProxy.off("TimeSync",this.handleTimeSync),this.hubProxy.connection.stop(!1,!0),this.heartbeat.stop(),super.dispose()}canCastToDevice(e){return e===er.AppleTv}getDevices(){return this.devices}startCastSession(e){return new SH(this,e)}async lock(e){if(!await this.invoke("Lock",e,this.options.userId,this.options.username??""))throw new Error("Could not lock device")}async loadVideo(e){if(!this.options.trackingCode)throw new Error("Tracking code must be provided to cast videos");await this.invoke("Command",{DeviceId:e,CommandType:pi.Play,Data:this.options.trackingCode})}async play(e){await this.invoke("Command",{DeviceId:e,CommandType:pi.Play})}async pause(e){await this.invoke("Command",{DeviceId:e,CommandType:pi.Pause})}seek(e,t){this.invokeDebounced("Command",{DeviceId:e,CommandType:pi.Play,Params:`1,${Math.trunc(t)}`})}async stop(e){await this.invoke("Command",{DeviceId:e,CommandType:pi.Stop})}async pair(e){const t=await this.invoke("Pair",e);if(!t)throw new Error("Could not pair device");return t}async unpair(e){await this.invoke("Unpair",e)}async renameDevice({deviceId:e,deviceName:t}){if(!await this.invoke("Renamedevice",e,t))throw new Error("Could not rename device")}static convertToGenericDeviceStatus(e){switch(e){case kl.Online:return ea.Available;case kl.Locked:return ea.Busy;case kl.Suspended:case kl.Offline:return ea.Offline}}static convertToGenericDevice(e){return{id:e.deviceId,name:e.name,type:er.AppleTv,status:js.convertToGenericDeviceStatus(e.status)}}}const Xb={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:""};class xH{constructor(e,t=Xb){this.bindFunctions(),this.url=e,this.options={...Xb,...t},this.webSocket=this.connect(),this.heartbeat=new Sv().schedule(()=>this.send(this.options.heartbeatMessage)).every(this.options.heartbeatIntervalInMillseconds)}bindFunctions(){this.cleanup=this.cleanup.bind(this),this.handleOpen=this.handleOpen.bind(this),this.handleMessage=this.handleMessage.bind(this),this.handleClose=this.handleClose.bind(this),this.handleError=this.handleError.bind(this),this.connect=this.connect.bind(this),this.send=this.send.bind(this),this.dipose=this.dipose.bind(this)}cleanup(){this.heartbeat.stop(),this.webSocket.removeEventListener("error",this.handleError),this.webSocket.removeEventListener("message",this.handleMessage),this.webSocket.removeEventListener("open",this.handleOpen),this.webSocket.removeEventListener("close",this.handleClose)}handleOpen(e){var t;(t=this.onOpen)==null||t.call(this,e),this.options.heartbeatEnabled&&this.heartbeat.start()}handleMessage(e){var t;(t=this.onMessage)==null||t.call(this,e)}handleClose(e){var t;(t=this.onClose)==null||t.call(this,e),this.cleanup(),setTimeout(()=>{this.webSocket=this.connect()},this.options.reconnectIntervalInMilliseconds)}handleError(e){var t;(t=this.onError)==null||t.call(this,e),this.handleClose()}connect(){const e=new WebSocket(this.url);return e.addEventListener("open",this.handleOpen),e.addEventListener("message",this.handleMessage),e.addEventListener("close",this.handleClose),e.addEventListener("error",this.handleError),e}send(e){this.webSocket.send(e)}dipose(){this.cleanup(),this.webSocket.close()}}const AH=2e3;class IH{constructor(e,t){return this._timerStartedAt=0,this.position=0,this.duration=void 0,this.playing=!1,this.mute=!1,this.videoSource="",this.subtitleSource="",this.subtitles=!1,this.volume=0,this.title=e,this.device=t,this.ready=!1,this.playbackFinished=!1,this.debounced=Eh.withDebouncedSetters(this,AH),Eh.withTimestampedSetters(this)}get position(){return this._position+this.getTimerDurationInSeconds()}set position(e){this._position=e,this.restartTimer()}get playing(){return this._playing}set playing(e){this._playing=e,e?this.restartTimer():(this._position+=this.getTimerDurationInSeconds(),this.stopTimer())}restartTimer(){this._timerStartedAt=Date.now()}stopTimer(){this._timerStartedAt=0}getTimerDurationInSeconds(){return this._timerStartedAt?(Date.now()-this._timerStartedAt)/1e3:0}}var es=(s=>(s.Update="update",s.Volume="volume",s.Playing="playing",s.Paused="paused",s.NewChapter="new_chapter",s.Stopped="stopped",s.Ready="ready",s.Mute="mute",s.Finished="finished",s.Subtitles="subtitles",s))(es||{});class PH extends pu{constructor(e,t){super(),this.client=e,this.localState=new IH(t.title,t.device),this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleClientConnected=this.handleClientConnected.bind(this),this.handleDisconnectMessage=this.handleDisconnectMessage.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handleUpdateMessage=this.handleUpdateMessage.bind(this),this.handleVolumeMessage=this.handleVolumeMessage.bind(this),this.handlePlayingMessage=this.handlePlayingMessage.bind(this),this.handlePausedMessage=this.handlePausedMessage.bind(this),this.handleFinishedMessage=this.handleFinishedMessage.bind(this),this.handleNewChapterMessage=this.handleNewChapterMessage.bind(this),this.handleStoppedMessage=this.handleStoppedMessage.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}initialize(){this.client.on("dispose",this.dispose),this.client.on("connected",this.handleClientConnected),this.client.on("message",this.handleDisconnectMessage).filter(e=>e.source===this.getDevice().id&&e.message.type==="disconnect"),this.client.on("message",this.handleAllVideoMessages).filter(e=>e.source===this.getDevice().id&&e.message.type==="video_event")}dispose(){this.client.off("dispose",this.dispose),this.client.off("connected",this.handleClientConnected),this.client.off("message",this.handleDisconnectMessage),this.client.off("message",this.handleAllVideoMessages),this.client.stop(this.getDevice().id).catch(e=>console.error(e)),super.dispose()}async handleClientConnected(){try{await this.client.joinRoom(this.getDevice().id)}catch(e){this.trigger("error",e)}}handleDisconnectMessage(){this.dispose()}handleAllVideoMessages(e){const t=this.localState.debounced,r=e.message.payload.params||{};switch(e.message.payload.event){case es.Update:this.handleUpdateMessage(t,r);break;case es.NewChapter:this.handleNewChapterMessage(t,r);break;case es.Volume:this.handleVolumeMessage(t,r);break;case es.Playing:this.handlePlayingMessage(t);break;case es.Paused:this.handlePausedMessage(t);break;case es.Finished:this.handleFinishedMessage(t);break;case es.Stopped:this.handleStoppedMessage();break}}handleUpdateMessage(e,t){e.duration!==t.duration&&(e.duration=t.duration,this.trigger("durationchange",gt.void)),e.position!==t.position&&(e.position=t.position,this.trigger("positionchange",gt.void)),e.subtitles!==t.subtitles&&(e.subtitles=t.subtitles,this.trigger("subtitleschange",gt.void))}handleVolumeMessage(e,t){e.volume!==t.level&&(e.volume=t.level,e.mute=t.level===0,this.trigger("volumechange",gt.void))}handlePlayingMessage(e){e.playing!==!0&&(e.playing=!0,e.playbackFinished=!1,this.trigger("playingchange",gt.void))}handlePausedMessage(e){e.playing!==!1&&(e.playing=!1,this.trigger("playingchange",gt.void))}handleFinishedMessage(e){e.playbackFinished!==!0&&(e.playing=!1,e.playbackFinished=!0,this.trigger("playingchange",gt.void))}handleNewChapterMessage(e,t){const i=(t.queue??[]).find(n=>n.url===e.videoSource);if(!i){console.info("The device is no longer playing the source we loaded - disposing the session"),this.dispose();return}e.subtitleSource!==i.suburl&&(e.subtitleSource=i.suburl,this.trigger("subtitleschange",gt.void))}handleStoppedMessage(){this.dispose()}async loadSource(e,t){if(!(this.localState.videoSource===e&&this.localState.subtitleSource===t))try{const r=this.getDevice().id,i=this.getPosition();this.localState.videoSource=e,this.localState.subtitleSource=t,this.localState.ready=!1,await this.client.joinRoom(r),await this.client.loadQueue({title:this.getTitle(),roomId:r,videoSource:e,subtitleSource:t}),this.localState.ready=!0,this.trigger("sourceloaded",gt.void),i>0&&this.seek(i),t&&this.setSubtitles(t)}catch(r){console.error(r),this.trigger("error",new Error("Could not load video on Vivi device"))}}play(){this.localState.ready&&this.localState.playing!==!0&&(this.localState.playing=!0,this.client.play(this.getDevice().id),this.trigger("playingchange",gt.void))}pause(){this.localState.ready&&this.localState.playing!==!1&&(this.localState.playing=!1,this.client.pause(this.getDevice().id),this.trigger("playingchange",gt.void))}seek(e){this.localState.ready&&this.localState.position!==e&&(this.localState.position=e,this.client.seek(this.getDevice().id,e),this.trigger("positionchange",gt.void))}setVolume(e){this.localState.ready&&this.localState.volume!==e&&(this.localState.volume=e,this.client.setVolume(this.getDevice().id,e),this.trigger("volumechange",gt.void))}setMuted(e){this.localState.ready&&this.localState.mute!==e&&(this.localState.mute=e,this.client.setMuted(this.getDevice().id,e),this.trigger("volumechange",gt.void))}async setSubtitles(e){if(!this.localState.ready)return;e&&await this.loadSource(this.localState.videoSource,e);const t=!!e;this.localState.subtitles!==t&&(this.localState.subtitles=t,this.client.setSubtitles(this.getDevice().id,t),this.trigger("subtitleschange",gt.void))}isPlaying(){return this.localState.playing}isPlaybackFinished(){return this.localState.playbackFinished}getPosition(){return this.localState.position}getDuration(){return this.localState.duration}getVolume(){return this.localState.volume}getMuted(){return this.localState.mute}getSubtitles(){if(this.localState.subtitles)return this.localState.subtitleSource}getDevice(){return this.localState.device}getTitle(){return this.localState.title}}const dr=1e4,DH=500,NH=1e4;class Vs extends pu{constructor(e){super(),this.options=e,this.accessToken="",this.devices=[],this.devicesFingerprint="",this.deviceDiscovery=new Sv,this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendMessageDebounced=au(this.sendMessage,DH,!0),this.beginDeviceDiscovery=this.beginDeviceDiscovery.bind(this),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.bind(this),this.authenticateWithVivi=this.authenticateWithVivi.bind(this),this.getRoomList=this.getRoomList.bind(this),this.joinRoom=this.joinRoom.bind(this),this.query=this.query.bind(this),this.loadQueue=this.loadQueue.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.stop=this.stop.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.setMuted=this.setMuted.bind(this),this.setSubtitles=this.setSubtitles.bind(this)}initialize(){this.webSocket=new xH(this.options.url),this.webSocket.onMessage=e=>this.trigger("message",JSON.parse(e.data)),this.webSocket.onOpen=async()=>{try{this.accessToken=await this.options.fetchAccessToken(),await this.authenticateWithVivi(),this.beginDeviceDiscovery(),this.trigger("connected",gt.void)}catch(e){console.error(e),this.trigger("error",new Error("Could not connect to Vivi"))}}}sendMessage(e){var t;(t=this.webSocket)==null||t.send(JSON.stringify(e))}beginDeviceDiscovery(){this.deviceDiscovery.every(NH).schedule(async()=>{try{const e=await this.getRoomList(),t=Vs.calculateFingerprint(e);if(t===this.devicesFingerprint)return;const r=new Set(e.map(n=>n.organisation??"")).size,i=new Set(e.map(n=>n.location??"")).size;this.devices=e.map(n=>({id:n.id,name:n.name,schoolName:r>1?n.organisation:"",description:i>1?n.location:"",type:er.Vivi,status:ea.Available})),this.devicesFingerprint=t,this.trigger("deviceschange",gt.void)}catch(e){console.warn(e)}}).trigger().start()}dispose(){var e;this.deviceDiscovery.stop(),(e=this.webSocket)==null||e.dipose(),super.dispose()}canCastToDevice(e){return e===er.Vivi}getDevices(){return this.devices}startCastSession(e){return new PH(this,e)}async authenticateWithVivi(){this.sendMessage({destination:"relay",message:{token:this.accessToken,type:"identify_video_api"}}),await this.one("message",e=>e.message.type==="video_api_identified").timeout(dr).catch(()=>{throw new Error("Failed to authenticate with Vivi")})}async getRoomList(){return this.sendMessage({destination:"relay",message:{type:"video_api_rooms"}}),(await this.one("message",t=>t.message.type==="video_api_rooms").timeout(dr).catch(()=>{throw new Error("Failed to fetch rooms")})).message.rooms||[]}async joinRoom(e){this.sendMessage({destination:"relay",message:{destination_type:"box",new_destination:e,token:this.accessToken,type:"connect"}}),await this.one("message",t=>{if(t.source===e&&t.message.type==="connect"||t.message.type==="error"&&t.message.error_type==="already_connected")return!0}).timeout(dr).catch(()=>{throw new Error("Failed to join room")})}async query(e){const t=Vs.createAckId();return this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:t,name:"query"}}),await this.one("message",r=>r.message.ack_id===t).timeout(dr).catch(()=>{throw new Error("Failed to fetch query")})}async loadQueue({roomId:e,title:t,videoSource:r,subtitleSource:i}){this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:Vs.createAckId(),name:"queue_load",payload:{urls:[{title:t,url:r,suburl:i}]}}}),await this.one("message",n=>{var a;return n.source===e&&((a=n.message.payload)==null?void 0:a.event)==="ready"}).timeout(dr).catch(()=>{throw new Error("Failed to load media")})}async play(e){this.sendMessage({destination:e,message:{type:"message",name:"video_play",payload:{}}}),await this.one("message",t=>{var r;return t.source===e&&((r=t.message.payload)==null?void 0:r.event)==="playing"}).timeout(dr).catch(()=>{throw new Error("Failed to play video")})}async pause(e){this.sendMessage({destination:e,message:{type:"message",name:"video_pause"}}),await this.one("message",t=>{var r;return t.source===e&&((r=t.message.payload)==null?void 0:r.event)==="paused"}).timeout(dr).catch(()=>{throw new Error("Failed to pause video")})}async stop(e){this.sendMessage({destination:e,message:{type:"message",name:"video_stop"}}),await this.one("message",t=>{var r;return t.source===e&&((r=t.message.payload)==null?void 0:r.event)==="stopped"}).timeout(dr).catch(()=>{throw new Error("Failed to stop video")})}async seek(e,t){this.sendMessageDebounced({destination:e,message:{type:"message",name:"video_seek",payload:{position:t}}})&&await this.one("message",i=>{var n;return i.source===e&&((n=i.message.payload)==null?void 0:n.event)==="playing"}).timeout(dr).catch(()=>{throw new Error("Failed to seek video")})}async setVolume(e,t){this.sendMessageDebounced({destination:e,message:{type:"message",name:"set_volume",payload:{volume:t}}})&&await this.one("message",i=>{var n;return i.source===e&&((n=i.message.payload)==null?void 0:n.event)==="volume"}).timeout(dr).catch(()=>{throw new Error("Failed to set volume")})}async setMuted(e,t){this.sendMessage({destination:e,message:{type:"message",name:"set_mute",payload:{mute:t}}}),await this.one("message",r=>{var i;return r.source===e&&((i=r.message.payload)==null?void 0:i.event)==="mute"}).timeout(dr).catch(()=>{throw new Error("Failed to set mute")})}async setSubtitles(e,t){const r=Vs.createAckId();this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:r,name:"set_subtitles",payload:{subtitles:t}}}),await this.one("message",i=>{var n;return i.source===e&&((n=i.message.payload)==null?void 0:n.event)==="subtitles"}).timeout(dr).catch(()=>{throw new Error("Failed to set subtitles")})}static createAckId(){return dw.generateRandomId()}static calculateFingerprint(e){return e.map(t=>t.id).sort().join(",")}}const kh=class kh extends pu{constructor(e){super(),this.instanceId=e,this.clients=[],this.bindFunctions()}bindFunctions(){this.addClient=this.addClient.bind(this),this.hasInstanceOfClient=this.hasInstanceOfClient.bind(this),this.startCastSession=this.startCastSession.bind(this),this.gatherAndPublishDevices=this.gatherAndPublishDevices.bind(this),this.dispose=this.dispose.bind(this)}addClient(e){e.on("deviceschange",this.gatherAndPublishDevices),e.on("error",t=>this.trigger("error",t)),this.clients.push(e)}hasInstanceOfClient(e){return this.clients.some(t=>t instanceof e)}startCastSession(e){if(this.castSession)if(this.castSession.getDevice().id!==e.device.id)this.castSession.dispose();else{console.info(`A session with device ${e.device.id} already exists - this is a no-op`);return}const t=this.clients.find(r=>r.canCastToDevice(e.device.type));t&&(this.castSession=t.startCastSession(e),this.castSession.on("error",r=>{this.castSession.dispose(),this.trigger("error",r)}),this.castSession.on("dispose",()=>{this.castSession=void 0,this.trigger("castsessionchange",void 0)}),this.trigger("castsessionchange",this.castSession))}getCastSession(){return this.castSession}gatherAndPublishDevices(){const t=this.clients.map(r=>r.getDevices()).reduce((r,i)=>[...r,...i],[]);this.trigger("deviceschange",t)}dispose(){var e;(e=this.castSession)==null||e.dispose(),this.clients.forEach(t=>t.dispose()),this.castSession=void 0,this.clients=[],super.dispose()}static getOrCreateInstance(e){if(!e)throw new Error("instanceId is required");return this.instances[e]||(this.instances[e]=new kh(e)),this.instances[e]}static disposeAndRemoveInstance(e){e.dispose(),delete this.instances[e.instanceId]}static isActive(){return Object.keys(this.instances).length>0}};kh.instances={};let ta=kh;const LH=B.getComponent("MenuItem");class Yb extends LH{constructor(e,t){super(e,t),this.isVisible=this.isVisible.bind(this)}createEl(){const e={vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"},t=super.createEl("li",{className:"vjs-menu-item cv-device-menu-item"}),r=B.dom.createEl("div",{className:"cv-device-menu-item-body",innerHTML:`
|
|
341
|
-
<span class="cv-device-icon ${e[this.options_.type]}"></span>
|
|
342
|
-
<div>
|
|
343
|
-
<span class="vjs-menu-item-text">${this.options_.label}</span>
|
|
344
|
-
<span class="vjs-menu-item-text cv-device-truncated-text">${this.options_.schoolName??""}</span>
|
|
345
|
-
<span class="vjs-menu-item-text cv-device-truncated-text cv-device-description">${this.options_.description??""}</span>
|
|
346
|
-
</div>
|
|
347
|
-
`});return t.replaceChildren(r),t}handleClick(){this.options_.onClick()}show(){super.show()}hide(){super.hide()}isVisible(){return!super.hasClass("vjs-hidden")}}const OH=B.getComponent("Menu");class fw extends OH{createEl(){const e=G2.apply(this),t=this.contentEl_;return this.contentWrapper=B.dom.createEl("div",{className:"vjs-menu-content"}),e.className="vjs-menu cv-devices-menu",t.className="cv-devices-menu-item-list",e.removeChild(t),e.appendChild(this.contentWrapper),this.contentWrapper.appendChild(t),this.simpleBar=new zt(t,{autoHide:!1}),e}addCta(e){if(this.ctaElement){console.warn("CTA has already been added to the menu - this is a no-op");return}this.ctaElement=e.el(),this.contentWrapper.prepend(this.ctaElement),this.el().classList.add("has-cta")}removeCta(){this.ctaElement&&(this.contentWrapper.removeChild(this.ctaElement),this.el().classList.remove("has-cta"))}}B.registerComponent("DevicesMenu",fw);function MH({inactiveIntegrations:s,canUserManageIntegrations:e,player:t,onDismiss:r,onInstall:i,onLearnMore:n,onContactSupport:a}){if(s.length===0)return te.jsx(te.Fragment,{});const o=c=>t.localize(c),l=c=>s.indexOf(c)!==-1;let u;return l(er.AppleTv)&&l(er.Vivi)?u="vivi_and_apple_tv":l(er.Vivi)?u="vivi":u="apple_tv",te.jsxs("div",{className:"cv-devices-cta",tabIndex:-1,children:[te.jsx(RH,{context:u,localize:o,onDismiss:()=>r(u)}),te.jsx(BH,{context:u}),te.jsx(FH,{context:u,canUserManageIntegrations:e,localize:o,onContactSupport:()=>a(u),onInstall:()=>i(u),onLearnMore:()=>n(u)})]})}function RH({context:s,localize:e,onDismiss:t}){return te.jsxs("div",{className:"cv-devices-cta-header",children:[te.jsx("span",{className:"cv-devices-badge",children:e("New")}),te.jsxs("span",{className:"cv-devices-title",children:[s==="vivi_and_apple_tv"&&e("Cast to Vivi and Apple TV"),s==="vivi"&&e("Cast to Vivi"),s==="apple_tv"&&e("Cast to Apple TV")]}),te.jsx("span",{className:"cv-devices-close",onClick:t,children:te.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:te.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"white",d:"M11.9588 10.6413L16.3612 6.34478C16.7361 5.97191 17.3439 5.97191 17.7188 6.34478C18.0937 6.71764 18.0937 7.32218 17.7188 7.69505L13.3165 11.9916L17.7188 16.3701C18.0937 16.7429 18.0937 17.3475 17.7188 17.7203C17.3439 18.0932 16.7361 18.0932 16.3612 17.7203L11.9588 13.3419L7.63882 17.7203C7.26392 18.0932 6.65608 18.0932 6.28118 17.7203C5.90627 17.3475 5.90627 16.7429 6.28118 16.3701L10.6012 11.9916L6.28118 7.62993C5.90627 7.25706 5.90627 6.65252 6.28118 6.27965C6.65608 5.90678 7.26392 5.90678 7.63882 6.27965L11.9588 10.6413Z"})})})]})}function BH({context:s}){const e=s==="vivi_and_apple_tv"?"bg-vivi-and-apple":s==="vivi"?"bg-vivi":"bg-apple";return te.jsxs("div",{className:`cv-devices-cta-body ${e}`,children:[(s==="vivi_and_apple_tv"||s==="apple_tv")&&te.jsx("div",{className:"cv-devices-icon-container",children:te.jsx("span",{className:"cv-devices-icon apple"})}),(s==="vivi_and_apple_tv"||s==="vivi")&&te.jsx("div",{className:"cv-devices-icon-container",children:te.jsx("span",{className:"cv-devices-icon vivi"})})]})}function FH({context:s,canUserManageIntegrations:e,localize:t,onInstall:r,onLearnMore:i,onContactSupport:n}){return e?te.jsxs("div",{className:"cv-devices-cta-footer",children:[te.jsxs("span",{children:[s==="vivi_and_apple_tv"&&t("Discover our new device integrations to make presenting in the classroom easy!"),s==="vivi"&&t("Discover our new Vivi integration."),s==="apple_tv"&&t("Discover our new Apple TV integration.")]}),te.jsx("br",{}),te.jsx("span",{className:"cv-devices-link",onClick:r,children:t("Click here to install")})]}):te.jsxs("div",{className:"cv-devices-cta-footer",children:[te.jsxs("span",{children:[s==="vivi_and_apple_tv"&&t("Cast to Vivi and Apple TV is now available! Please contact "),s==="vivi"&&t("Cast to Vivi is now available! Please contact "),s==="apple_tv"&&t("Cast to Apple TV is now available! Please contact ")]}),te.jsx("span",{className:"cv-devices-link",onClick:n,children:"ClickView Support"}),te.jsxs("span",{children:[s==="vivi_and_apple_tv"&&t(" or your administrator to set up Apple TV and Vivi."),s==="vivi"&&t(" or your administrator to set up Vivi."),s==="apple_tv"&&t(" or your administrator to set up Apple TV.")]}),te.jsx("br",{}),te.jsx("span",{className:"cv-devices-link",onClick:i,children:"Learn more"})]})}B.registerComponent("DevicesCta",ud((s,e)=>te.jsx(MH,{player:s,...e}),{properties:{className:"cv-devices-cta-wrapper"}}));const UH=20,$H=B.getComponent("DevicesCta"),Qb=B.getComponent("MenuButton");class pw extends Qb{constructor(e,t){super(e,t),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-devices-menu-button",this.searchText="",this.devices=[],this.castSession=void 0,this.bindFunctions(),this.bindEventListeners()}bindFunctions(){this.bindEventListeners=this.bindEventListeners.bind(this),this.setDevices=this.setDevices.bind(this),this.setCastSession=this.setCastSession.bind(this),this.setSearchText=this.setSearchText.bind(this),this.getDeviceMenuItems=this.getDeviceMenuItems.bind(this),this.showNotificationBadge=this.showNotificationBadge.bind(this),this.hideNotificationBadge=this.hideNotificationBadge.bind(this),this.render=this.render.bind(this),this.removeMenuItems=this.removeMenuItems.bind(this),this.addMenuItemsForDevices=this.addMenuItemsForDevices.bind(this),this.shouldShowSearchInput=this.shouldShowSearchInput.bind(this),this.toggleSearchInput=this.toggleSearchInput.bind(this),this.toggleDeviceMenuItems=this.toggleDeviceMenuItems.bind(this),this.toggleEmptyStatePlaceholder=this.toggleEmptyStatePlaceholder.bind(this)}bindEventListeners(){const e=this.$("button"),t=r=>{this.menu.handleBlur(r)};e.addEventListener("blur",t),this.one("dispose",()=>{var r;e.removeEventListener("blur",t),(r=this.cta)==null||r.dispose()})}createEl(...e){return Qb.prototype.createEl.apply(this,...e)}buildWrapperCSSClass(){return`cv-menu-small cv-devices-button ${super.buildWrapperCSSClass()}`}createMenu(){const e=new fw(this.player_,{menuButton:this});if(!this.options_.ctaOptions.hasBeenDismissed&&this.options_.ctaOptions.inactiveIntegrations.length>0){const{onDismiss:r,...i}=this.options_.ctaOptions;this.cta=new $H(this.player(),{...i,onDismiss:n=>{this.hideNotificationBadge(),e.removeCta(),r(n)}}),this.showNotificationBadge(),e.addCta(this.cta)}return this.createItems().forEach(r=>e.addItem(r)),e}createItems(){const e=[];return this.headingItem=new aa(this.player_,{label:this.localize("Select a device"),selectable:!1}),this.searchInputItem=new wg(this.player_,{menuButton:this,search:t=>this.setSearchText(t),className:"cv-devices-search-input"}),this.emptyPlaceholder=new kg(this.player_,{label:"No devices found",selected:!1,selectable:!1,multiSelectable:!1}),this.headingItem.show(),this.searchInputItem.hide(),this.emptyPlaceholder.show(),e.push(this.headingItem,this.searchInputItem,this.emptyPlaceholder),e}pressButton(){var e;super.pressButton(),this.shouldShowSearchInput()&&((e=this.searchInputItem)==null||e.focus())}setDevices(e){this.devices=e,this.render()}setCastSession(e){this.castSession=e,this.render()}setSearchText(e){this.searchText=e,this.render()}getDeviceMenuItems(){return this.menu.children_.filter(e=>e instanceof Yb)}showNotificationBadge(){this.addClass("notification-badge")}hideNotificationBadge(){this.removeClass("notification-badge")}render(){this.removeMenuItems(this.getDeviceMenuItems()),this.addMenuItemsForDevices(this.devices),this.toggleSearchInput(),this.toggleDeviceMenuItems(),this.toggleEmptyStatePlaceholder()}removeMenuItems(e){e.forEach(t=>{this.menu.removeChild(t),t.dispose()})}addMenuItemsForDevices(e){e.sort((r,i)=>{const n=`${r.type}${r.schoolName??""}${r.description??""}${r.name}`,a=`${i.type}${i.schoolName??""}${i.description??""}${i.name}`;return n.localeCompare(a)}).forEach(r=>{const i=new Yb(this.player(),{id:r.id,label:r.name,schoolName:r.schoolName,description:r.description,selected:!1,multiSelectable:!1,selectable:!0,available:r.status===ea.Available,type:r.type,onClick:()=>{this.options_.onDeviceMenuItemClick(i,r)}});this.menu.addItem(i)})}shouldShowSearchInput(){return this.getDeviceMenuItems().length>=UH}toggleSearchInput(){this.shouldShowSearchInput()?(this.searchInputItem.show(),this.menu.addClass("vertical-fill")):(this.searchInputItem.hide(),this.menu.removeClass("vertical-fill"))}toggleDeviceMenuItems(){const e=this.getDeviceMenuItems(),t=this.shouldShowSearchInput(),r=this.searchText.toLowerCase();e.forEach(i=>{var u;const n=this.devices.find(c=>c.id===i.options_.id);if(!n)return;const a=n.status===ea.Available,o=n.id===((u=this.castSession)==null?void 0:u.getDevice().id),l=t?`${n.name} ${n.schoolName??""} ${n.description??""}`.trim().toLowerCase().indexOf(r)!==-1:!0;a?i.enable():i.disable(),l?i.show():i.hide(),o?i.selected(!0):i.selected(!1)})}toggleEmptyStatePlaceholder(){const e=this.getDeviceMenuItems();e.filter(r=>r.isVisible()).length?this.emptyPlaceholder.hide():this.emptyPlaceholder.show(),e.length?this.emptyPlaceholder.setLabel(this.localize("No matching results")):this.emptyPlaceholder.setLabel(this.localize("No devices found"))}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){var e;return((e=this.castSession)==null?void 0:e.getDevice().name)??" "}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){this.handleClick()}handleClick(){super.handleClick(null),this.options_.onClick()}}pw.prototype.controlText_="Devices";B.registerComponent("DevicesButton",pw);const jH=B.getComponent("Component");class VH extends jH{constructor(e){super(null,e)}createEl(){return super.createEl("div",{className:"cv-devices-tech"})}setPoster(e){this.poster=e,this.update()}setDevice(e){this.device=e,this.update()}update(){var i,n;const e={vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"};this.el_.innerHTML=`
|
|
348
|
-
<div class="cv-devices-content">
|
|
349
|
-
<p>${this.localize("Currently playing on")}</p>
|
|
350
|
-
<h2><span class="cv-device-icon ${e[((i=this.device)==null?void 0:i.type)??er.Vivi]}"></span>${((n=this.device)==null?void 0:n.name)??""}</h2>
|
|
351
|
-
</div>
|
|
352
|
-
<div class="cv-devices-background" style="background-image: url(${this.poster})"></div>
|
|
353
|
-
`;const t=document.createElement("button"),r=a=>{a.stopPropagation(),this.options_.onStopCasting()};t.onclick=r,t.ontouchstart=r,t.className="stop-casting-button",t.innerHTML=this.localize("Stop casting"),this.el_.querySelector(".cv-devices-content").appendChild(t)}play(){}}const HH=B.getComponent("Tech");class qH extends HH{constructor(e,t){super(e,t),this.featuresVolumeControl=!0,this.featuresPlaybackRate=!1,this.movingMediaElementInDOM=!1,this.featuresFullscreenResize=!0,this.featuresTimeupdateEvents=!0,this.featuresProgressEvents=!1,this.featuresNativeTextTracks=!1,this.featuresNativeAudioTracks=!1,this.featuresNativeVideoTracks=!1,this.featuresMuteControl=!0,this.featuresSourceset=!1,this.videojsPlayer=B(this.options_.playerId),this.bindFunctions(),this.bindEventListeners(),this.ready(()=>{this.setSource(this.options_.source)}),this.triggerReady()}bindFunctions(){this.bindEventListeners=this.bindEventListeners.bind(this),this.onTextTrackChanged=this.onTextTrackChanged.bind(this),this.getSelectedTextTrack=this.getSelectedTextTrack.bind(this),this.setSelectedTextTrack=this.setSelectedTextTrack.bind(this),this.showUI=this.showUI.bind(this),this.hideUI=this.hideUI.bind(this),this.dispose=this.dispose.bind(this),this.setSource=this.setSource.bind(this),this.getCastSession=this.getCastSession.bind(this)}bindEventListeners(){const e=this.getCastSession();e&&(this.textTracks().on("change",this.onTextTrackChanged),this.videojsPlayer.one("ended",()=>{e.dispose()}),e.on("durationchange",()=>{this.trigger("durationchange")}),e.on("dispose",()=>{this.trigger("ended"),this.hideUI()}),e.on("playingchange",()=>{e.isPlaying()?(this.trigger("play"),this.trigger("playing")):this.trigger("pause")}),e.on("volumechange",()=>{this.trigger("volumechange")}),e.on("sourceloaded",()=>{this.trigger("loadeddata")}),e.on("subtitleschange",()=>{this.setSelectedTextTrack(e.getSubtitles())}))}onTextTrackChanged(){var t;const e=this.getSelectedTextTrack();(t=this.getCastSession())==null||t.setSubtitles(e==null?void 0:e.src)}getSelectedTextTrack(){return Zt.findTrackByPredicate(this.videojsPlayer.player_,e=>e.mode==="showing"&&!!e.src)}setSelectedTextTrack(e){Zt.forEachTrack(this.videojsPlayer.player_,t=>{t.kind==="subtitles"&&(t.src===e?t.mode="showing":t.mode="disabled")})}showUI(e){this.ui&&(this.ui.setPoster(this.options_.poster),this.ui.setDevice(e),this.ui.show())}hideUI(){var e;(e=this.ui)==null||e.hide()}dispose(){this.textTracks().off("change",this.onTextTrackChanged);const e=this.getCastSession();e&&e.dispose(),super.cleanupAutoTextTracks(),super.dispose()}createEl(){return this.ui=this.ui||new VH({onStopCasting:()=>{var e;(e=this.getCastSession())==null||e.dispose()}}),this.ui.el()}setSource(e){const t=this.getCastSession();if(!t)return;this.showUI(t.getDevice()),this.trigger("loadstart");const r=this.getSelectedTextTrack();t.loadSource(e.src,r==null?void 0:r.src)}addRemoteTextTrack(e){return super.addRemoteTextTrack(e,!0)}getCastSession(){return ta.getOrCreateInstance(this.options_.instanceId??"").getCastSession()}play(){var e;(e=this.getCastSession())==null||e.play()}pause(){var e;(e=this.getCastSession())==null||e.pause()}paused(){var e;return((e=this.getCastSession())==null?void 0:e.isPlaying())===!1}ended(){var e;return((e=this.getCastSession())==null?void 0:e.isPlaybackFinished())??!1}setCurrentTime(e){var t;(t=this.getCastSession())==null||t.seek(e??0)}currentTime(){var e;return((e=this.getCastSession())==null?void 0:e.getPosition())??0}duration(){var e;return((e=this.getCastSession())==null?void 0:e.getDuration())??this.videojsPlayer.duration()}volume(){var e;return((e=this.getCastSession())==null?void 0:e.getVolume())??1}setVolume(e){var t;(t=this.getCastSession())==null||t.setVolume(e)}muted(){var e;return((e=this.getCastSession())==null?void 0:e.getMuted())??!1}setMuted(e){var t;(t=this.getCastSession())==null||t.setMuted(e)}buffered(){}seekable(){return B.createTimeRanges(0,this.duration())}playbackRate(){return 1}readyState(){return 4}controls(){return!1}playsinline(){return!0}supportsFullScreen(){return!0}setAutoplay(){}preload(){}load(){}setPlaybackRate(){}static canPlayType(){return""}static canPlaySource(e,t){return!!ta.getOrCreateInstance((t==null?void 0:t.instanceId)??"").getCastSession()}static isSupported(){return ta.isActive()}}B.registerTech("devices",qH);const zH=B.getPlugin("plugin");class WH extends zH{constructor(e,t){var r;super(e,t),this.options=t,this.instanceId=((r=this.player.options_.devices)==null?void 0:r.instanceId)??"",this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.onReady=this.onReady.bind(this),this.onDevicesChanged=this.onDevicesChanged.bind(this),this.onCastSessionChanged=this.onCastSessionChanged.bind(this),this.onDevicesError=this.onDevicesError.bind(this),this.addViviClient=this.addViviClient.bind(this),this.addAppleTvClient=this.addAppleTvClient.bind(this),this.reloadTech=this.reloadTech.bind(this),this.getSessionManager=this.getSessionManager.bind(this),this.dispose=this.dispose.bind(this)}initialize(){this.player.ready(this.onReady)}onReady(){const e=this.player.getChild("collapserator"),t=e==null?void 0:e.children().findIndex(g=>g.name()==="CustomControlSpacer"),r=e==null?void 0:e.children().findIndex(g=>g.name()==="OpenExternallyButton"),i=Math.max(t,r)+1,n=this.getSessionManager();if(!e||!t||t===-1||!n)return;n.on("deviceschange",this.onDevicesChanged),n.on("castsessionchange",this.onCastSessionChanged),n.on("error",this.onDevicesError);const a=()=>{this.addViviClient(n),this.addAppleTvClient(n)},o=(g,C)=>{var p;n.startCastSession({device:C,title:this.options.title}),(p=this.options.analyticsService)==null||p.logUserAction(C,{actionType:Jt.Select,workflowPhase:ia.Complete,descriptor:ra.ChangeDevice,entity:xi.Device,eventVersion:qs.V3})},l=this.options.ctaOptions,u=this.options.vivi,c=this.options.appleTv,h=[];c.enabled||h.push(er.AppleTv),(!u.enabled||!u.accountConnected)&&h.push(er.Vivi);const f={onClick:a,onDeviceMenuItemClick:o,ctaOptions:{...l,inactiveIntegrations:h}};this.devicesButton=e.addChild("DevicesButton",f,i)}onDevicesChanged(e){var t;(t=this.devicesButton)==null||t.setDevices(e)}onCastSessionChanged(e){var t;(t=this.devicesButton)==null||t.setCastSession(e),this.reloadTech(),e?(this.player.addClass("cv-device-casting"),this.player.addClass(`cv-device-${e.getDevice().type}`),this.player.isFullscreen()&&this.player.exitFullscreen()):(this.player.removeClass("cv-device-casting"),this.player.removeClass(`cv-device-${er.AppleTv}`),this.player.removeClass(`cv-device-${er.Vivi}`))}onDevicesError(e){this.player.error(e.message),this.player.pause()}addViviClient(e){if(!this.options.vivi.enabled||!this.options.vivi.accountConnected||!this.options.vivi.apiUrl||e.hasInstanceOfClient(Vs))return;const t=new Vs({url:this.options.vivi.apiUrl,fetchAccessToken:this.options.vivi.fetchAccessToken});e.addClient(t)}addAppleTvClient(e){if(!this.options.appleTv.enabled||!this.options.trackingCode||!this.options.userId||e.hasInstanceOfClient(js))return;const t=new js({fetchAccessToken:this.options.appleTv.fetchAccessToken,trackingCode:this.options.trackingCode,userId:this.options.userId});e.addClient(t)}reloadTech(){const e=this.player,t=e.currentSources(),r=e.volume(),i=e.muted(),n=e.currentTime(),a=e.paused();e.src(t),e.one("playing",()=>{e.volume(r),e.muted(i),e.currentTime(n),a?e.pause():e.play()})}getSessionManager(){if(this.instanceId)return ta.getOrCreateInstance(this.instanceId)}dispose(){const e=this.getSessionManager();e&&(e.off("deviceschange",this.onDevicesChanged),e.off("castsessionchange",this.onCastSessionChanged),e.off("error",this.onDevicesError),ta.disposeAndRemoveInstance(e),super.dispose())}}B.registerPlugin("devicesPlugin",WH);function GH(s){var n;const[e,t]=gi.useState(5);if(gi.useEffect(()=>{const a=setInterval(()=>{t(o=>o-1)},1e3);return()=>{clearInterval(a)}},[]),gi.useEffect(()=>{e===0&&s.onPlayNext()},[e]),!s.nextVideo||!s.onPlayNext)return te.jsx(te.Fragment,{});const r=Math.ceil(e),i=r===1?"second":"seconds";return te.jsx(te.Fragment,{children:te.jsxs("div",{className:"cv-up-next-container",children:[te.jsx("div",{className:"cv-cancel-up-next cursor-pointer",role:"button",onClick:s.onCancel,children:"×"}),te.jsxs("div",{className:"cv-up-next-heading",children:["Up next in ",r," ",i,":"]}),te.jsx("div",{className:"cv-up-next-image cursor-pointer",onClick:s.onPlayNext,style:{backgroundImage:`url(${(n=s.nextVideo)==null?void 0:n.thumbnailUrl})`}}),te.jsx("div",{className:"cv-up-next-title",children:s.nextVideo.name})]})})}B.registerComponent("UpNext",ud((s,e)=>te.jsx(GH,{player:s,...e})));const KH=B.getComponent("MenuItem");let XH=class extends KH{constructor(e,t){super(e,t),this.bindListeners(),this.player_.nextVideoPlugin().getShouldPlayNext()&&this.toggleOn()}bindListeners(){this.onPlayNextChange=this.onPlayNextChange.bind(this),this.player_.on("cv:playnext",this.onPlayNextChange)}handleToggle(){const e=this.player_.nextVideoPlugin().getShouldPlayNext();this.player_.nextVideoPlugin().setShouldPlayNext(!e,!0)}onPlayNextChange(e,t){t?this.toggleOn():this.toggleOff()}toggleOn(){B.dom.addClass(this.toggleEl,"on")}toggleOff(){B.dom.removeClass(this.toggleEl,"on")}handleClick(e){e.stopImmediatePropagation()}createEl(e,t,r){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=B.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);const n=super.createEl(e,{className:"vjs-menu-item cv-cog-menu-item cv-play-next-toggle",innerHTML:`
|
|
354
|
-
<span class="vjs-menu-item-text">Play next video</span>
|
|
355
|
-
<span class="cv-toggle-container"></span>`},r);return n.children[1].appendChild(this.toggleEl),n}dispose(){this.player_.off("cv:playnext",this.onPlayNextChange),super.dispose()}};B.registerComponent("NextVideoMenuItem",XH);const Jb="cv-persisttest",Zb="cv-play-next-video",YH=B.getPlugin("plugin");B.getComponent("MenuItem");const QH=B.getComponent("NextVideoMenuItem");class JH extends YH{constructor(e){if(super(e),this.setShouldPlayNext=this.setShouldPlayNext.bind(this),this.getShouldPlayNext=this.getShouldPlayNext.bind(this),this.getChapterTrack=this.getChapterTrack.bind(this),this.onTimeUpdate=this.onTimeUpdate.bind(this),this.hasLocalStorage=this.testHasLocalStorage(),this.shouldPlayNextVideo=!1,this.hasLocalStorage){const t=window.localStorage.getItem(Zb);this.shouldPlayNextVideo=t==="true"}e.ready(()=>{this.initialize()})}initialize(){this.player.isDisposed()||this.bindListeners()}getChapterTrack(){return Zt.getTrack(this.player,"chapters",null)}setNextVideo(e,t,r){var n;this.nextVideo=e,this.callback=r,t&&this.setShouldPlayNext(!0),((n=this.player.getChild("collapserator"))==null?void 0:n.getChild("cogButton")).addItem({ctor:QH,name:"NextVideoMenuItem"})}getShouldPlayNext(){return this.shouldPlayNextVideo}setShouldPlayNext(e,t){this.shouldPlayNextVideo=e,this.player.trigger("cv:playnext",e),this.hasLocalStorage&&t&&window.localStorage.setItem(Zb,e.toString()),e&&this.player.loopVideoPlugin().loop(!1)}bindListeners(){this.player.on("timeupdate",this.onTimeUpdate)}dispose(){this.player.off("timeupdate",this.onTimeUpdate),this.hideUpNext(),super.dispose()}onTimeUpdate(){if(!(this.player.pictureInPicture&&this.player.isInPictureInPicture())){if(!this.getShouldPlayNext()){this.hideUpNext();return}if(this.upNextRendered&&this.player.currentTime()<this.player.duration()){this.hideUpNext();return}this.player.ended()&&this.showUpNext()}}showUpNext(){this.upNextRendered||(this.upNextRendered=!0,this.player.addChild("UpNext",{nextVideo:this.nextVideo,onPlayNext:this.callback,onCancel:()=>{this.hideUpNext(),this.setShouldPlayNext(!1)}}))}hideUpNext(){if(!this.upNextRendered)return;this.upNextRendered=!1;const e=this.player.getChild("UpNext");e&&(this.player.removeChild(e),e.dispose())}testHasLocalStorage(){try{return window.localStorage.setItem(Jb,"persistPlayNext"),window.localStorage.removeItem(Jb),!0}catch{return!1}}}B.registerPlugin("nextVideoPlugin",JH);function ZH(s){return te.jsx("div",{className:"cv-resource-item",children:te.jsx(Qk,{data:s.resource,imageCdnUrl:s.imageCdnUrl,titlePosition:"above",hideTypeBadge:!0})})}const eq=ud((s,e)=>te.jsx(ZH,{...e})),tq=B.getComponent("MenuItem");class iq extends tq{constructor(e,t){super(e,t);const r=new eq(e,{resource:t.resource,imageCdnUrl:t.imageCdnUrl});this.addChild(r)}createEl(e,t={},r){return super.createEl(e,{...t,className:`${t.className} cv-resource-menu-item`},r)}handleClick(e){e.stopImmediatePropagation(),this.options_.downloadResource(this.options_.resource)}}const rq=B.getComponent("MenuButton");class mw extends rq{constructor(){super(...arguments),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0}buildWrapperCSSClass(){return`cv-menu-small cv-resources-button-wrapper ${super.buildWrapperCSSClass()}`}buildCSSClass(){return`cv-resources-button ${super.buildCSSClass()}`}update(){super.update()}createItems(){const e=[];return e.push(new aa(this.player_,{label:"Resources"})),this.options_.resources.forEach(t=>{const r=new iq(this.player(),{resource:t,imageCdnUrl:this.options_.imageCdnUrl,downloadResource:i=>this.downloadResource(i),label:t.name});e.push(r)}),e}downloadResource(e){if(e.type==="link"){xk.PageLoad(e.url,!0);return}this.getDownloadIframe().src=e.url}getDownloadIframe(){return this.downloadIframe?this.downloadIframe:(this.downloadIframe=B.dom.createEl("iframe"),this.downloadIframe.style.display="none",B.dom.appendContent(B.dom.$("body"),this.downloadIframe),this.downloadIframe)}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){super.handleClick(null)}}mw.prototype.controlText_="Resources";B.registerComponent("ResourcesButton",mw);const nq=B.getPlugin("plugin");class sq extends nq{constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){if(!this.options.resources.length)return;const e=this.player.getChild("collapserator");e.addChild("ResourcesButton",{resources:this.options.resources,imageCdnUrl:this.options.imageCdnUrl},e.children_.length-4)}}B.registerPlugin("resourcesPlugin",sq);function aq(s){const{className:e="",playerApi:t,onReady:r,onDispose:i,...n}=s,a=at.useRef(null);return at.useEffect(()=>{if(!a)return;const o=new aH(a.current,{...n,playerApi:t});return r&&o.ready(()=>{r(oH(o))}),i&&o.one("dispose",i),()=>{o==null||o.dispose()}},[s.viewKey]),te.jsx("div",{ref:a,className:e})}function oq(s){var r,i;const e=((r=s.resources)==null?void 0:r.data)??[],t=((i=s.links)==null?void 0:i.data)??[];return[...e,...t]}function lq(s,e){if(Number.isInteger(+s))return+s;const t=it.getVideoProgress(e);return!t||t>=e.duration/1e3-Um.VIDEO_START_TIME_CUTOFF?0:t}const uq=38,cq=40,hq=()=>{function s(e){if(e.keyCode===uq||e.keyCode===cq)return e.preventDefault(),!1}at.useEffect(()=>(window.addEventListener("keydown",s,!1),()=>{window.removeEventListener("keydown",s,!1)}),[])},dq="_embeddedPlayer_q5kte_1",fq={embeddedPlayer:dq};function pq(s){const e=at.useRef(null),t=at.useRef(null);hq();const r=CA();function i(a){e.current=a,r(),s.onReady&&s.onReady(a),n(a)}function n(a){t.current=new kA({player:a,video:s.video,analyticsLocation:s.embed?Ir.EmbeddedPlayer:Ir.PlayPage})}return te.jsx(aq,{className:s.embed?fq.embeddedPlayer:"",pointsOfInterest:s.pointsOfInterest,onReady:i,viewKey:s.viewKey.viewKey,playerApi:new URL(s.config.playerApiUrl),imageCdnUrl:s.config.imageCdnUrl,autoplay:s.autoplay,startTime:lq(s.params.t,s.video),hotkeyElQuerySelector:"body"})}const mq="_closeButton_17q31_1",gq="_dropdown_17q31_6",e0={closeButton:mq,dropdown:gq},vq="shared.curriculumLinks";function yq(s){const{preferredCurriculum:e,availableCurriculums:t,curriculumLinks:r,updateCurriculum:i}=s.curriculums;function n(a){i(a,{shouldLog:!0,locationContext:Ir.PlayPage,video:s.video})}return!(r!=null&&r.length)&&!s.curriculums.mappedCurriculums.length?te.jsx(te.Fragment,{}):te.jsx("div",{className:"rounded border position-relative",children:te.jsx(n0.Scrollbars,{autoHeight:!0,autoHeightMax:s.height,children:te.jsxs("div",{className:"p-3",children:[te.jsx("h2",{className:"h6 h-100",children:te.jsx(Ar,{namespace:vq,phrase:"heading"})}),te.jsx(ux,{availableCurriculums:t,onChangeCurriculum:n,selectedCurriculum:e,className:e0.dropdown}),te.jsx(cx,{curriculumLinks:s.curriculums.curriculumLinks,onChangeCurriculum:n,hasCompleted:s.curriculums.hasCompleted,mappedCurriculums:s.curriculums.mappedCurriculums,isFetching:s.curriculums.isFetching,locationContext:Ir.PlayPage}),!!s.onClickClose&&te.jsx("button",{type:"button",className:`btn-close ${e0.closeButton}`,"aria-label":"Close",onClick:s.onClickClose})]})})})}const gw="shared.playPage",_q=Kt.encloseNamespace(gw);function Tq(s){const[e,t]=at.useState(),{canConsume:r}=it.getCanBeConsumed(s.video),i=it.isVideoTypeArchived(s.video),n=S0(s.video,s.glanceTheme),a=at.useRef(!1),[o,l]=at.useState({view:"loading",referrer:null});at.useEffect(()=>{s.glanceLoaded&&l({view:s.glanceTheme?"v@g":"details",referrer:null})},[s.glanceLoaded,s.glanceTheme]);function u(){a.current=!(e!=null&&e.isPaused()),e==null||e.pause()}function c(){a.current&&(e==null||e.play())}function h(p){t(p)}function f(){return C?()=>({application:Ep.VIDEOS,action:Cp.Videos.SIGN_IN_POPUP}):p=>{var T;return Wd.resource(p,(T=s.video)==null?void 0:T.id)}}const g=oq(s.video),C=!s.currentUser.isAuthenticated;return te.jsxs(r0.Provider,{value:gw,children:[i&&te.jsx(mA,{}),te.jsxs("section",{className:"mb-2",children:[r&&te.jsx(pq,{video:s.video,config:s.config,pointsOfInterest:s.pointsOfInterest,viewKey:s.viewKey,onReady:h,params:s.params,autoplay:!0}),te.jsx("div",{className:C?"":"d-none",children:te.jsx(SA,{video:s.video,appLink:{application:Ep.VIDEOS,action:Cp.Videos.SIGN_IN_POPUP}})})]}),te.jsx(yA,{video:s.video,audiences:s.audiences,getSubTextAppLink:s.commonVideoProps.getSubTextAppLink}),te.jsx("section",{className:`${o.view==="v@g"?"d-block":"d-none"}`,children:te.jsx(Jx,{theme:s.glanceTheme,video:s.video,pointsOfInterest:s.pointsOfInterest,onClickShowDescription:()=>l({view:"details",referrer:"v@g"}),onClickShowCurriculumLinks:s.curriculums.mappedCurriculums.length&&(()=>l({view:"curriculumLinks",referrer:"v@g"})),setStartTime:p=>e.currentTime(p),getTagAppLink:Wd.tag,suppressInteractivity:!s.currentUser.isAuthenticated})}),te.jsx("section",{className:`${o.view==="details"?"d-block":"d-none"}`,children:te.jsx(dA,{video:s.video,onLaunchImmersiveReader:u,onExitImmersiveReader:c,onClickClose:n&&(()=>l({view:"v@g",referrer:"details"})),onClickShowCurriculumLinks:s.curriculums.mappedCurriculums.length&&(()=>l({view:"curriculumLinks",referrer:"details"})),getTagAppLink:Wd.tag,suppressInteractivity:!s.currentUser.isAuthenticated})}),te.jsx("section",{className:`${o.view==="curriculumLinks"?"d-block pb-3":"d-none"}`,children:te.jsx(yq,{height:Um.MINIMUM_GLANCE_HEIGHT,curriculums:s.curriculums,onClickClose:(()=>l({view:o.referrer,referrer:"curriculumLinks"})),video:s.video})}),te.jsx("section",{className:`${o.view==="loading"?"d-block":"d-none"}`,children:te.jsx(fA,{})}),!!(g!=null&&g.length)&&te.jsx("section",{className:"pb-3",children:te.jsx(Jk,{name:_q("resources",{count:g.length}),contents:ex.PlayPageResources,collection:g,prefetched:!0,childComponent:Zk,extraChildComponentProps:{imageCdnUrl:s.config.imageCdnUrl,imageErrorFallbackUrl:Ak.Fallbacks.RESOURCE_THUMBNAIL,actionBehaviour:s.currentUser.isAuthenticated?"normal":"public",location:"play-page",titlePosition:"above",hideTypeBadge:!0},getChildAppLink:f(),analyticsOptions:s.currentUser.isAuthenticated?{}:{workflowPhase:ia.Start,descriptor:a0.SignUp},analyticsData:{widgetId:"resources"}})})]})}function bq(s,e){const t=s,r=e,i=m0(s&&(n=>t(n).key));return gi.useEffect(()=>{i&&i.shouldInitialFetch&&e&&r()},[i==null?void 0:i.shouldInitialFetch,e]),gi.useEffect(()=>{!i||!i.nextCursor||i.isFetching||!e||r(i.nextCursor)},[i==null?void 0:i.nextCursor,i==null?void 0:i.isFetching,e]),i}function Sq(s){const e=Ik();function t(i){return wp.pointsOfInterest(s,i)}function r(i){e(t(i))}return bq(!!s&&t,!!s&&r),m0(!!s&&(i=>t(i).key))}const Cq="streamableVideos.play",Eq=Kt.encloseNamespace(Cq),wq={notFound:dx,forbidden:{privacy:v0}};function ZW(s){var p,T,A,N,F,V;const{commonVideoProps:e}=Wk(),t=Vr(wp.video(s.id)),r=Vr(i0.currentUser()),i=Vr(((p=r.data)==null?void 0:p.isAuthenticated)&&mx.createViewKey(s.id,g0.MasterObject)),n=Vr(Mk.config()),a=Vr(Rk.streamableLearning()),o=Vr(Pk.streamablePresentation()),l=Vr(o.data&&Fk.audiencesByPresentationId(o.data.id)),u=!!((A=(T=t.data)==null?void 0:T.glance)!=null&&A.theme),c=Vr(u&&gx.themeImages(t.data.glance.theme,t.data.glance.type)),h=Vr(t.statusCode===Dk.Forbidden&&wp.video(s.id,Bk.StripMetadata)),f=hx(s.id),g=Sq(s.id);Nk(Lk.getVideoMetadata({content:t.data,phraseContext:{phraseHandler:Eq,titlePhrase:"pageTitle",descriptionPhrase:"pageDescription"},canonicalLink:Gk.getCanonicalLink({customAppLink:{application:Ep.VIDEOS,action:Cp.Videos.PLAY_VIDEO,args:[(N=t.data)==null?void 0:N.id,o0.slugify((F=t.data)==null?void 0:F.name)]}}),allowIndexing:!0,product:Um.PRODUCT_NAME})),$k(t,wq,{forbidden:!0}),Nx(h);const C=t.data&&(!((V=r.data)!=null&&V.isAuthenticated)||i.data)&&r.hasCompleted&&n.hasCompleted&&g.hasCompleted;return gi.useEffect(()=>{var R;!t.data||!a.data||(R=t.data.libraries)!=null&&R.data.find(O=>O.id===a.data.objectId)||Rm.throw(new Ok)},[t.hasCompleted,a.hasCompleted]),C?te.jsx("div",{className:"px-4",children:te.jsx(Tq,{video:t.data,viewKey:i.data,config:n.data,glanceTheme:c.data,glanceLoaded:!u||c.hasCompleted,curriculums:f,currentUser:r.data,pointsOfInterest:g.items,audiences:l.data,params:s.params,commonVideoProps:e})}):te.jsx(te.Fragment,{})}export{ZW as PlayView};
|
|
356
|
-
//# sourceMappingURL=D1EE4AEz.chunk.js.map
|