From 77a931d3c11b2018374e05de3aab2e494a14a5dc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 12 Jun 2024 01:18:29 +0000 Subject: [PATCH] Release: version 0.10.1 --- Dockerfile | 2 +- Readme.md | 2 +- ...ccount-BdTOSg7M.js => Account-ccYjkIrH.js} | 2 +- .../{Base-DG5Aczxr.js => Base-D8WlXaKF.js} | 2 +- ...aption-DTN65rsJ.js => Caption-iQ0Q9kku.js} | 2 +- ...apture-DXmMH4Q0.js => Capture-CXo2T7QZ.js} | 2 +- ...I9DNZ.js => CaptureCompositor-IHku5OQc.js} | 6 +- ...-eNnhxLya.js => ChannelsStore-DchOc5Uo.js} | 2 +- ...8By.js => CommentMuteSettings-B8qrNY4M.js} | 2 +- ...44xfhw.js => DataBroadcasting-jA1j5Sob.js} | 2 +- ...eneral-BDH0Q5Sc.js => General-C-9qy5lQ.js} | 2 +- .../{Home-X3_NWbJ7.js => Home-QNi6QgIc.js} | 2 +- .../{Index-URzyaqeB.js => Index-Cgb5zSyW.js} | 2 +- client/dist/assets/Jikkyo-B_6kQb1w.js | 1 - client/dist/assets/Jikkyo-Dl7DpmHu.js | 1 + ...ikkyo.tkdegJaQ.css => Jikkyo.BXj39bNx.css} | 2 +- ...=> LivePSIArchivedDataDecoder-UNf1hsdD.js} | 6 +- .../{Login-BYLQtBry.js => Login-RVjujZFe.js} | 2 +- ...ion-CsJWaG4R.js => Navigation-DZesdvbM.js} | 2 +- ...Found-DmKC9dt8.js => NotFound-DQeyXnhV.js} | 2 +- ...t1PTIZ.js => PlayerController-CPRxjWAH.js} | 130 +++++++++--------- ...w1wc.css => PlayerController.DYQ78zJV.css} | 2 +- ...uality-DK_FYgCl.js => Quality-gVW3mlCw.js} | 2 +- ...ister-DlYiOkKw.js => Register-DasYxOlR.js} | 2 +- client/dist/assets/Server-DBO70_b0.js | 2 - client/dist/assets/Server-DT8h7w7n.js | 2 + ...witter-Q1WO_0TU.js => Twitter-C35t607p.js} | 2 +- ...witter-Bph-nOIj.js => Twitter-DX_Loh3n.js} | 2 +- ...Avatar-CTvU0rd-.js => VAvatar-BrXxzhAv.js} | 2 +- .../{VCard-C5ODUzfZ.js => VCard-BBvTbBT9.js} | 2 +- ...Dialog-BE2JXbX2.js => VDialog-B1HdJyP2.js} | 2 +- ...put-CPtGNAvQ.js => VFileInput-dOsuHg_x.js} | 2 +- .../{VForm-la6x9pr-.js => VForm-B829AxXJ.js} | 2 +- ...Select-BuCCGZYb.js => VSelect-dbg9h4rI.js} | 2 +- ...Slider-S8IhLMNG.js => VSlider-CBNN6xX6.js} | 2 +- ...Switch-BiucEdzW.js => VSwitch-Cf-jClsc.js} | 2 +- ...eld-DymZQzkG.js => VTextField-DTBkpwFs.js} | 2 +- .../{Watch-D4hYYE_4.js => Watch-By8d0RQ2.js} | 2 +- .../{Watch-Dgkro2UJ.js => Watch-_oOaHvAT.js} | 2 +- .../{index-D2zR81a8.js => index-Dbi6R656.js} | 40 +++--- ...srBoot-BvljY2yG.js => ssrBoot-sWDXISB3.js} | 2 +- ...{swiper-cQLwFU5D.js => swiper-BjXfmU5J.js} | 2 +- ...9vE-3L.js => vuedraggable.umd-Dq96441i.js} | 2 +- client/dist/index.html | 2 +- client/dist/sw.js | 2 +- client/package.json | 2 +- installer/KonomiTV-Installer.py | 2 +- installer/pyproject.toml | 2 +- server/app/constants.py | 2 +- server/pyproject.toml | 2 +- 50 files changed, 136 insertions(+), 136 deletions(-) rename client/dist/assets/{Account-BdTOSg7M.js => Account-ccYjkIrH.js} (97%) rename client/dist/assets/{Base-DG5Aczxr.js => Base-D8WlXaKF.js} (96%) rename client/dist/assets/{Caption-DTN65rsJ.js => Caption-iQ0Q9kku.js} (95%) rename client/dist/assets/{Capture-DXmMH4Q0.js => Capture-CXo2T7QZ.js} (94%) rename client/dist/assets/{CaptureCompositor-CiYI9DNZ.js => CaptureCompositor-IHku5OQc.js} (98%) rename client/dist/assets/{ChannelsStore-eNnhxLya.js => ChannelsStore-DchOc5Uo.js} (99%) rename client/dist/assets/{CommentMuteSettings-aK-5x8By.js => CommentMuteSettings-B8qrNY4M.js} (97%) rename client/dist/assets/{DataBroadcasting-2V44xfhw.js => DataBroadcasting-jA1j5Sob.js} (97%) rename client/dist/assets/{General-BDH0Q5Sc.js => General-C-9qy5lQ.js} (95%) rename client/dist/assets/{Home-X3_NWbJ7.js => Home-QNi6QgIc.js} (97%) rename client/dist/assets/{Index-URzyaqeB.js => Index-Cgb5zSyW.js} (93%) delete mode 100644 client/dist/assets/Jikkyo-B_6kQb1w.js create mode 100644 client/dist/assets/Jikkyo-Dl7DpmHu.js rename client/dist/assets/{Jikkyo.tkdegJaQ.css => Jikkyo.BXj39bNx.css} (51%) rename client/dist/assets/{LivePSIArchivedDataDecoder-BHXU14x5.js => LivePSIArchivedDataDecoder-UNf1hsdD.js} (99%) rename client/dist/assets/{Login-BYLQtBry.js => Login-RVjujZFe.js} (88%) rename client/dist/assets/{Navigation-CsJWaG4R.js => Navigation-DZesdvbM.js} (98%) rename client/dist/assets/{NotFound-DmKC9dt8.js => NotFound-DQeyXnhV.js} (76%) rename client/dist/assets/{PlayerController-BUt1PTIZ.js => PlayerController-CPRxjWAH.js} (93%) rename client/dist/assets/{PlayerController.DG7mw1wc.css => PlayerController.DYQ78zJV.css} (97%) rename client/dist/assets/{Quality-DK_FYgCl.js => Quality-gVW3mlCw.js} (98%) rename client/dist/assets/{Register-DlYiOkKw.js => Register-DasYxOlR.js} (90%) delete mode 100644 client/dist/assets/Server-DBO70_b0.js create mode 100644 client/dist/assets/Server-DT8h7w7n.js rename client/dist/assets/{Twitter-Q1WO_0TU.js => Twitter-C35t607p.js} (96%) rename client/dist/assets/{Twitter-Bph-nOIj.js => Twitter-DX_Loh3n.js} (96%) rename client/dist/assets/{VAvatar-CTvU0rd-.js => VAvatar-BrXxzhAv.js} (99%) rename client/dist/assets/{VCard-C5ODUzfZ.js => VCard-BBvTbBT9.js} (97%) rename client/dist/assets/{VDialog-BE2JXbX2.js => VDialog-B1HdJyP2.js} (90%) rename client/dist/assets/{VFileInput-CPtGNAvQ.js => VFileInput-dOsuHg_x.js} (94%) rename client/dist/assets/{VForm-la6x9pr-.js => VForm-B829AxXJ.js} (83%) rename client/dist/assets/{VSelect-BuCCGZYb.js => VSelect-dbg9h4rI.js} (99%) rename client/dist/assets/{VSlider-S8IhLMNG.js => VSlider-CBNN6xX6.js} (98%) rename client/dist/assets/{VSwitch-BiucEdzW.js => VSwitch-Cf-jClsc.js} (99%) rename client/dist/assets/{VTextField-DymZQzkG.js => VTextField-DTBkpwFs.js} (99%) rename client/dist/assets/{Watch-D4hYYE_4.js => Watch-By8d0RQ2.js} (74%) rename client/dist/assets/{Watch-Dgkro2UJ.js => Watch-_oOaHvAT.js} (60%) rename client/dist/assets/{index-D2zR81a8.js => index-Dbi6R656.js} (72%) rename client/dist/assets/{ssrBoot-BvljY2yG.js => ssrBoot-sWDXISB3.js} (91%) rename client/dist/assets/{swiper-cQLwFU5D.js => swiper-BjXfmU5J.js} (71%) rename client/dist/assets/{vuedraggable.umd-X59vE-3L.js => vuedraggable.umd-Dq96441i.js} (99%) diff --git a/Dockerfile b/Dockerfile index 27577cb9..f1d53ad5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends aria2 ca-certif ## サードパーティーライブラリは変更が少ないので、先にダウンロード処理を実行してビルドキャッシュを効かせる WORKDIR / ## リリース版用 -RUN aria2c -x10 https://github.com/tsukumijima/KonomiTV/releases/download/v0.10.0/thirdparty-linux.tar.xz +RUN aria2c -x10 https://github.com/tsukumijima/KonomiTV/releases/download/v0.10.1/thirdparty-linux.tar.xz RUN tar xvf thirdparty-linux.tar.xz ## 開発版 (0.x.x-dev) 用 # RUN aria2c -x10 https://nightly.link/tsukumijima/KonomiTV/actions/runs/9164924503/thirdparty-linux.tar.xz.zip diff --git a/Readme.md b/Readme.md index a5504677..c9d85324 100644 --- a/Readme.md +++ b/Readme.md @@ -480,7 +480,7 @@ Docker Compose は V1 と V2 の両方に対応していますが、できれば
```bash -curl -LO https://github.com/tsukumijima/KonomiTV/releases/download/v0.10.0/KonomiTV-Installer.elf +curl -LO https://github.com/tsukumijima/KonomiTV/releases/download/v0.10.1/KonomiTV-Installer.elf chmod a+x KonomiTV-Installer.elf ./KonomiTV-Installer.elf ``` diff --git a/client/dist/assets/Account-BdTOSg7M.js b/client/dist/assets/Account-ccYjkIrH.js similarity index 97% rename from client/dist/assets/Account-BdTOSg7M.js rename to client/dist/assets/Account-ccYjkIrH.js index a7ce7e1f..b03de260 100644 --- a/client/dist/assets/Account-BdTOSg7M.js +++ b/client/dist/assets/Account-ccYjkIrH.js @@ -1 +1 @@ -import{d as b,U as S,u as C,m as V,cl as k,cm as $,M as F,N as T,_ as I,r as m,o as c,j as U,h as i,e as u,w as K,c as d,b as t,k as n,V as r,i as _,t as p,l as g,n as N,R as j,p as z,q as M}from"./index-D2zR81a8.js";import{S as J}from"./Base-DG5Aczxr.js";import{V as O}from"./VSwitch-BiucEdzW.js";import{a as E,V as h,b as D,c as R}from"./VCard-C5ODUzfZ.js";import{V as v}from"./VDialog-BE2JXbX2.js";import{b as y,V as q}from"./VTextField-DymZQzkG.js";import{V as f}from"./VForm-la6x9pr-.js";import{V as H}from"./VFileInput-CPtGNAvQ.js";import{V as Z}from"./ssrBoot-BvljY2yG.js";import"./Navigation-CsJWaG4R.js";import"./VAvatar-CTvU0rd-.js";const G=b({name:"Settings-Account",components:{SettingsBase:J},data(){return{is_form_dense:S.isSmartphoneHorizontal(),is_loading:!0,settings_username:null,settings_username_validation:s=>s===""||s===null?"ユーザー名を入力してください。":/^.{2,}$/.test(s)===!1?"ユーザー名は2文字以上で入力してください。":!0,settings_password:null,settings_password_showing:!1,settings_password_validation:s=>s===""||s===null?"パスワードを入力してください。":/^[a-zA-Z0-9!-/:-@¥[-`{-~]{4,}$/.test(s)===!1?"パスワードは4文字以上の半角英数記号を入力してください。":!0,settings_icon_file:[],account_delete_confirm_dialog:!1,sync_settings:C().settings.sync_settings,sync_settings_dialog:!1}},computed:{...V(C,T)},watch:{async sync_settings(){if(this.sync_settings===!0&&this.sync_settings_dialog===!1){const s=k(this.settingsStore.settings),e=JSON.stringify(s),B=await $.fetchClientSettings();if(B===null){F.error("サーバーから設定データを取得できませんでした。");return}const A=JSON.stringify(B);e!==A?(this.sync_settings_dialog=!0,this.sync_settings=!1):this.settingsStore.settings.sync_settings=!0}else this.sync_settings===!1&&this.sync_settings_dialog===!1&&(this.settingsStore.settings.sync_settings=!1)}},async created(){await this.userStore.fetchUser(),this.is_loading=!1},methods:{async overrideServerSettingsFromClient(){await this.settingsStore.syncClientSettingsToServer(!0),this.settingsStore.settings.sync_settings=!0,this.sync_settings=!0,this.sync_settings_dialog=!1},async overrideClientSettingsFromServer(){await this.settingsStore.syncClientSettingsFromServer(!0),this.settingsStore.settings.sync_settings=!0,this.sync_settings=!0,this.sync_settings_dialog=!1},async updateAccountInfo(s){if(s==="username"){if((await this.$refs.settings_username.validate()).valid===!1)return}else if((await this.$refs.settings_password.validate()).valid===!1)return;if(s==="username"){if(this.settings_username===null)return;await this.userStore.updateUser({username:this.settings_username})}else{if(this.settings_password===null)return;await this.userStore.updateUser({password:this.settings_password})}},async updateAccountIcon(){if(this.settings_icon_file.length===0){F.error("アップロードする画像を選択してください!");return}await this.userStore.updateUserIcon(this.settings_icon_file[0])},async deleteAccount(){this.account_delete_confirm_dialog=!1,await this.userStore.deleteUser()}}}),L="/assets/images/account-icon-default.png",a=s=>(z("data-v-fc2e44f8"),s=s(),M(),s),P={class:"settings__heading"},Q=a(()=>u("span",{class:"ml-2"},"アカウント",-1)),W={key:0,class:"account"},X=a(()=>u("div",{class:"account-wrapper"},[u("img",{class:"account__icon",src:L}),u("div",{class:"account__info"},[u("div",{class:"account__info-name"},[u("span",{class:"account__info-name-text"},"ログインしていません")]),u("span",{class:"account__info-id"},"Not logged in")])],-1)),Y={key:1,class:"account"},x={class:"account-wrapper"},uu=["src"],su={class:"account__info"},tu={class:"account__info-name"},eu={class:"account__info-name-text"},nu={key:0,class:"account__info-admin"},iu={class:"account__info-id"},ou={key:2,class:"account-register"},au=a(()=>u("div",{class:"account-register__heading"},[n(" KonomiTV アカウントにログインすると、"),u("br"),n("より便利な機能が使えます! ")],-1)),lu={class:"account-register__feature"},ru={class:"account-feature"},cu=a(()=>u("div",{class:"account-feature__info"},[u("span",{class:"account-feature__info-heading"},"ニコニコ実況にコメントする"),u("span",{class:"account-feature__info-text"},"テレビを見ながらニコニコ実況にコメントできます。別途、ニコニコアカウントとの連携が必要です。")],-1)),du={class:"account-feature"},_u=a(()=>u("div",{class:"account-feature__info"},[u("span",{class:"account-feature__info-heading"},"Twitter 連携機能"),u("span",{class:"account-feature__info-text"},"テレビを見ながら Twitter にツイートしたり、検索したツイートをリアルタイムで表示できます。別途、Twitter アカウントとの連携が必要です。")],-1)),Bu={class:"account-feature"},gu=a(()=>u("div",{class:"account-feature__info"},[u("span",{class:"account-feature__info-heading"},"設定をデバイス間で同期"),u("span",{class:"account-feature__info-text"},"ピン留めしたチャンネルなど、ブラウザに保存されている各種設定をブラウザやデバイスをまたいで同期できます。")],-1)),fu={class:"account-feature"},Au=a(()=>u("div",{class:"account-feature__info"},[u("span",{class:"account-feature__info-heading"},"サーバー設定をブラウザから変更"),u("span",{class:"account-feature__info-text"},"管理者権限があれば、サーバー設定をブラウザから変更できます。一番最初に作成されたアカウントには、自動で管理者権限が付与されます。")],-1)),Cu=a(()=>u("div",{class:"account-register__description"},[n(" KonomiTV アカウントの作成に必要なものは"),u("br",{class:"smartphone-vertical-only"}),n("ユーザー名とパスワードだけです。"),u("br"),n(" アカウントはローカルに導入した"),u("br",{class:"smartphone-vertical-only"}),n(" KonomiTV サーバーにのみ保存されます。"),u("br"),n(" 外部のサービスには保存されませんので、ご安心ください。"),u("br")],-1)),Fu={key:3},mu={class:"settings__item settings__item--switch"},pu=a(()=>u("label",{class:"settings__item-heading",for:"sync_settings"},"設定をデバイス間で同期する",-1)),Eu=a(()=>u("label",{class:"settings__item-label",for:"sync_settings"},[n(" KonomiTV では、設定を同じアカウントでログインしているデバイス間で同期できます!"),u("br"),n(" 同期をオンにすると、同期をオンにしているすべてのデバイスで共通の設定が使えます。ピン留めチャンネルやハッシュタグリストなども同期されます。"),u("br"),n(" なお、デバイス固有の設定(画質設定など)は、同期後も各デバイスで個別に反映されます。"),u("br")],-1)),hu=a(()=>u("br",null,null,-1)),Du=a(()=>u("br",null,null,-1)),vu={class:"d-flex flex-column px-4 pb-6 settings__conflict-dialog"},yu=a(()=>u("br",{class:"smartphone-vertical-only"},null,-1)),wu=a(()=>u("br",{class:"smartphone-vertical-only"},null,-1)),bu=a(()=>u("div",{class:"settings__item-heading"},"ユーザー名",-1)),Su=a(()=>u("div",{class:"settings__item-label"},[n(" KonomiTV アカウントのユーザー名を設定します。アルファベットだけでなく日本語や記号も使えます。"),u("br"),n(" 同じ KonomiTV サーバー上の他のアカウントと同じユーザー名には変更できません。"),u("br")],-1)),Vu=a(()=>u("div",{class:"settings__item-heading"},"アイコン画像",-1)),ku=a(()=>u("div",{class:"settings__item-label"},[n(" KonomiTV アカウントのアイコン画像を設定します。"),u("br"),n(" アップロードされた画像は自動で 400×400 の正方形にリサイズされます。"),u("br")],-1)),$u=a(()=>u("div",{class:"settings__item-heading"},"新しいパスワード",-1)),Tu=a(()=>u("div",{class:"settings__item-label"},[n(" KonomiTV アカウントの新しいパスワードを設定します。"),u("br")],-1)),Iu=a(()=>u("div",{class:"settings__item mt-6"},[u("div",{class:"settings__item-heading text-error-lighten-1"},"アカウントを削除"),u("div",{class:"settings__item-label"},[n(" 現在ログインしている KonomiTV アカウントを削除します。"),u("br"),u("strong",{class:"text-error-lighten-1"},"アカウントに紐づくすべてのデータが削除されます。元に戻すことはできません。"),u("br")])],-1)),Uu=a(()=>u("br",null,null,-1));function Ku(s,e,B,A,Nu,ju){const l=m("Icon"),w=m("SettingsBase");return c(),U(w,null,{default:i(()=>[u("h2",P,[K((c(),d("a",{class:"settings__back-button",onClick:e[0]||(e[0]=o=>s.$router.back())},[t(l,{icon:"fluent:arrow-left-12-filled",width:"25px"})])),[[j]]),t(l,{icon:"fluent:person-20-filled",width:"25px"}),Q]),u("div",{class:N(["settings__content",{"settings__content--loading":s.is_loading}])},[s.userStore.user===null?(c(),d("div",W,[X,t(r,{class:"account__login ml-auto",color:"secondary",width:"140",height:"56",variant:"flat",to:"/login/"},{default:i(()=>[t(l,{icon:"fa:sign-in",class:"mr-2"}),n("ログイン ")]),_:1})])):_("",!0),s.userStore.user!==null?(c(),d("div",Y,[u("div",x,[u("img",{class:"account__icon",src:s.userStore.user_icon_url??""},null,8,uu),u("div",su,[u("div",tu,[u("span",eu,p(s.userStore.user.name),1),s.userStore.user.is_admin?(c(),d("span",nu,"管理者")):_("",!0)]),u("span",iu,"User ID: "+p(s.userStore.user.id),1)])]),t(r,{class:"account__login ml-auto",color:"secondary",width:"140",height:"56",variant:"flat",onClick:e[1]||(e[1]=o=>s.userStore.logout())},{default:i(()=>[t(l,{icon:"fa:sign-out",class:"mr-2"}),n("ログアウト ")]),_:1})])):_("",!0),s.userStore.is_logged_in===!1?(c(),d("div",ou,[au,u("div",lu,[u("div",ru,[t(l,{class:"account-feature__icon",icon:"bi:chat-left-text-fill"}),cu]),u("div",du,[t(l,{class:"account-feature__icon",icon:"fa-brands:twitter"}),_u]),u("div",Bu,[t(l,{class:"account-feature__icon",icon:"fluent:arrow-sync-20-filled"}),gu]),u("div",fu,[t(l,{class:"account-feature__icon",icon:"fa-solid:sliders-h"}),Au])]),Cu,t(r,{class:"account-register__button",color:"secondary",width:"100%","max-width":"250",height:"50",variant:"flat",to:"/register/"},{default:i(()=>[t(l,{icon:"fluent:person-add-20-filled",class:"mr-2",height:"24"}),n("アカウントを作成 ")]),_:1})])):_("",!0),s.userStore.is_logged_in===!0?(c(),d("div",Fu,[u("div",mu,[pu,Eu,t(O,{class:"settings__item-switch",color:"primary",id:"sync_settings","hide-details":"",modelValue:s.sync_settings,"onUpdate:modelValue":e[2]||(e[2]=o=>s.sync_settings=o)},null,8,["modelValue"])]),t(v,{"max-width":"530",modelValue:s.sync_settings_dialog,"onUpdate:modelValue":e[6]||(e[6]=o=>s.sync_settings_dialog=o)},{default:i(()=>[t(E,null,{default:i(()=>[t(h,{class:"d-flex justify-center font-weight-bold pt-6"},{default:i(()=>[n("設定データの競合")]),_:1}),t(D,{class:"pt-2 pb-5"},{default:i(()=>[n(" このデバイスの設定と、サーバーに保存されている設定が競合しています。"),hu,n(" 一度上書きすると、元に戻すことはできません。慎重に選択してください。"),Du]),_:1}),u("div",vu,[t(r,{class:"settings__save-button text-error-lighten-1",color:"background-lighten-1",variant:"flat",onClick:e[3]||(e[3]=o=>s.overrideServerSettingsFromClient())},{default:i(()=>[t(l,{icon:"fluent:document-arrow-up-16-filled",class:"mr-2",height:"22px"}),n(" サーバーに保存されている設定を、"),yu,n("このデバイスの設定で上書きする ")]),_:1}),t(r,{class:"settings__save-button text-error-lighten-1 mt-3",color:"background-lighten-1",variant:"flat",onClick:e[4]||(e[4]=o=>s.overrideClientSettingsFromServer())},{default:i(()=>[t(l,{icon:"fluent:document-arrow-down-16-filled",class:"mr-2",height:"22px"}),n(" このデバイスの設定を、"),wu,n("サーバーに保存されている設定で上書きする ")]),_:1}),t(r,{class:"settings__save-button mt-3",variant:"flat",color:"background-lighten-1",onClick:e[5]||(e[5]=o=>s.sync_settings_dialog=!1)},{default:i(()=>[t(l,{icon:"fluent:dismiss-16-filled",class:"mr-2",height:"22px"}),n(" キャンセル ")]),_:1})])]),_:1})]),_:1},8,["modelValue"]),t(f,{class:"settings__item",ref:"settings_username",onSubmit:e[8]||(e[8]=g(()=>{},["prevent"]))},{default:i(()=>[bu,Su,t(y,{class:"settings__item-form",color:"primary",variant:"outlined",placeholder:"ユーザー名",density:s.is_form_dense?"compact":"default",modelValue:s.settings_username,"onUpdate:modelValue":e[7]||(e[7]=o=>s.settings_username=o),rules:[s.settings_username_validation]},null,8,["density","modelValue","rules"])]),_:1},512),t(r,{class:"settings__save-button mt-2",variant:"flat",onClick:e[9]||(e[9]=o=>s.updateAccountInfo("username"))},{default:i(()=>[t(l,{icon:"fluent:save-16-filled",class:"mr-2",height:"24px"}),n("ユーザー名を更新 ")]),_:1}),t(f,{class:"settings__item",onSubmit:e[11]||(e[11]=g(()=>{},["prevent"]))},{default:i(()=>[Vu,ku,t(H,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",label:"アイコン画像を選択",density:s.is_form_dense?"compact":"default",accept:"image/jpeg, image/png","prepend-icon":"","prepend-inner-icon":"mdi-paperclip",modelValue:s.settings_icon_file,"onUpdate:modelValue":e[10]||(e[10]=o=>s.settings_icon_file=o)},null,8,["density","modelValue"])]),_:1}),t(r,{class:"settings__save-button mt-5",variant:"flat",onClick:e[12]||(e[12]=o=>s.updateAccountIcon())},{default:i(()=>[t(l,{icon:"fluent:save-16-filled",class:"mr-2",height:"24px"}),n("アイコン画像を更新 ")]),_:1}),t(f,{class:"settings__item",ref:"settings_password",onSubmit:e[15]||(e[15]=g(()=>{},["prevent"]))},{default:i(()=>[$u,Tu,t(y,{class:"settings__item-form",color:"primary",variant:"outlined",placeholder:"新しいパスワード",density:s.is_form_dense?"compact":"default",modelValue:s.settings_password,"onUpdate:modelValue":e[13]||(e[13]=o=>s.settings_password=o),type:s.settings_password_showing?"text":"password",rules:[s.settings_password_validation],"append-inner-icon":s.settings_password_showing?"mdi-eye":"mdi-eye-off","onClick:appendInner":e[14]||(e[14]=o=>s.settings_password_showing=!s.settings_password_showing)},null,8,["density","modelValue","type","rules","append-inner-icon"])]),_:1},512),t(r,{class:"settings__save-button mt-2",variant:"flat",onClick:e[16]||(e[16]=o=>s.updateAccountInfo("password"))},{default:i(()=>[t(l,{icon:"fluent:save-16-filled",class:"mr-2",height:"24px"}),n("パスワードを更新 ")]),_:1}),t(q,{class:"mt-6"}),Iu,t(r,{class:"settings__save-button bg-error mt-5",variant:"flat",onClick:e[17]||(e[17]=o=>s.account_delete_confirm_dialog=!0)},{default:i(()=>[t(l,{icon:"fluent:delete-16-filled",class:"mr-2",height:"24px"}),n("アカウントを削除 ")]),_:1}),t(v,{"max-width":"385",modelValue:s.account_delete_confirm_dialog,"onUpdate:modelValue":e[20]||(e[20]=o=>s.account_delete_confirm_dialog=o)},{default:i(()=>[t(E,null,{default:i(()=>[t(h,{class:"d-flex justify-center pt-6 font-weight-bold"},{default:i(()=>[n("本当にアカウントを削除しますか?")]),_:1}),t(D,{class:"pt-2 pb-0"},{default:i(()=>[n(" アカウントに紐づくすべてのユーザーデータが削除されます。元に戻すことはできません。"),Uu,n(" 本当にアカウントを削除しますか? ")]),_:1}),t(R,{class:"pt-4 px-6 pb-6"},{default:i(()=>[t(Z),t(r,{color:"text",variant:"text",onClick:e[18]||(e[18]=o=>s.account_delete_confirm_dialog=!1)},{default:i(()=>[n("キャンセル")]),_:1}),t(r,{color:"error",variant:"flat",onClick:e[19]||(e[19]=o=>s.deleteAccount())},{default:i(()=>[n("削除")]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])])):_("",!0)],2)]),_:1})}const Qu=I(G,[["render",Ku],["__scopeId","data-v-fc2e44f8"]]);export{Qu as default}; +import{d as b,U as S,u as C,m as V,cl as k,cm as $,M as F,N as T,_ as I,r as m,o as c,j as U,h as i,e as u,w as K,c as d,b as t,k as n,V as r,i as _,t as p,l as g,n as N,R as j,p as z,q as M}from"./index-Dbi6R656.js";import{S as J}from"./Base-D8WlXaKF.js";import{V as O}from"./VSwitch-Cf-jClsc.js";import{a as E,V as h,b as D,c as R}from"./VCard-BBvTbBT9.js";import{V as v}from"./VDialog-B1HdJyP2.js";import{b as y,V as q}from"./VTextField-DTBkpwFs.js";import{V as f}from"./VForm-B829AxXJ.js";import{V as H}from"./VFileInput-dOsuHg_x.js";import{V as Z}from"./ssrBoot-sWDXISB3.js";import"./Navigation-DZesdvbM.js";import"./VAvatar-BrXxzhAv.js";const G=b({name:"Settings-Account",components:{SettingsBase:J},data(){return{is_form_dense:S.isSmartphoneHorizontal(),is_loading:!0,settings_username:null,settings_username_validation:s=>s===""||s===null?"ユーザー名を入力してください。":/^.{2,}$/.test(s)===!1?"ユーザー名は2文字以上で入力してください。":!0,settings_password:null,settings_password_showing:!1,settings_password_validation:s=>s===""||s===null?"パスワードを入力してください。":/^[a-zA-Z0-9!-/:-@¥[-`{-~]{4,}$/.test(s)===!1?"パスワードは4文字以上の半角英数記号を入力してください。":!0,settings_icon_file:[],account_delete_confirm_dialog:!1,sync_settings:C().settings.sync_settings,sync_settings_dialog:!1}},computed:{...V(C,T)},watch:{async sync_settings(){if(this.sync_settings===!0&&this.sync_settings_dialog===!1){const s=k(this.settingsStore.settings),e=JSON.stringify(s),B=await $.fetchClientSettings();if(B===null){F.error("サーバーから設定データを取得できませんでした。");return}const A=JSON.stringify(B);e!==A?(this.sync_settings_dialog=!0,this.sync_settings=!1):this.settingsStore.settings.sync_settings=!0}else this.sync_settings===!1&&this.sync_settings_dialog===!1&&(this.settingsStore.settings.sync_settings=!1)}},async created(){await this.userStore.fetchUser(),this.is_loading=!1},methods:{async overrideServerSettingsFromClient(){await this.settingsStore.syncClientSettingsToServer(!0),this.settingsStore.settings.sync_settings=!0,this.sync_settings=!0,this.sync_settings_dialog=!1},async overrideClientSettingsFromServer(){await this.settingsStore.syncClientSettingsFromServer(!0),this.settingsStore.settings.sync_settings=!0,this.sync_settings=!0,this.sync_settings_dialog=!1},async updateAccountInfo(s){if(s==="username"){if((await this.$refs.settings_username.validate()).valid===!1)return}else if((await this.$refs.settings_password.validate()).valid===!1)return;if(s==="username"){if(this.settings_username===null)return;await this.userStore.updateUser({username:this.settings_username})}else{if(this.settings_password===null)return;await this.userStore.updateUser({password:this.settings_password})}},async updateAccountIcon(){if(this.settings_icon_file.length===0){F.error("アップロードする画像を選択してください!");return}await this.userStore.updateUserIcon(this.settings_icon_file[0])},async deleteAccount(){this.account_delete_confirm_dialog=!1,await this.userStore.deleteUser()}}}),L="/assets/images/account-icon-default.png",a=s=>(z("data-v-fc2e44f8"),s=s(),M(),s),P={class:"settings__heading"},Q=a(()=>u("span",{class:"ml-2"},"アカウント",-1)),W={key:0,class:"account"},X=a(()=>u("div",{class:"account-wrapper"},[u("img",{class:"account__icon",src:L}),u("div",{class:"account__info"},[u("div",{class:"account__info-name"},[u("span",{class:"account__info-name-text"},"ログインしていません")]),u("span",{class:"account__info-id"},"Not logged in")])],-1)),Y={key:1,class:"account"},x={class:"account-wrapper"},uu=["src"],su={class:"account__info"},tu={class:"account__info-name"},eu={class:"account__info-name-text"},nu={key:0,class:"account__info-admin"},iu={class:"account__info-id"},ou={key:2,class:"account-register"},au=a(()=>u("div",{class:"account-register__heading"},[n(" KonomiTV アカウントにログインすると、"),u("br"),n("より便利な機能が使えます! ")],-1)),lu={class:"account-register__feature"},ru={class:"account-feature"},cu=a(()=>u("div",{class:"account-feature__info"},[u("span",{class:"account-feature__info-heading"},"ニコニコ実況にコメントする"),u("span",{class:"account-feature__info-text"},"テレビを見ながらニコニコ実況にコメントできます。別途、ニコニコアカウントとの連携が必要です。")],-1)),du={class:"account-feature"},_u=a(()=>u("div",{class:"account-feature__info"},[u("span",{class:"account-feature__info-heading"},"Twitter 連携機能"),u("span",{class:"account-feature__info-text"},"テレビを見ながら Twitter にツイートしたり、検索したツイートをリアルタイムで表示できます。別途、Twitter アカウントとの連携が必要です。")],-1)),Bu={class:"account-feature"},gu=a(()=>u("div",{class:"account-feature__info"},[u("span",{class:"account-feature__info-heading"},"設定をデバイス間で同期"),u("span",{class:"account-feature__info-text"},"ピン留めしたチャンネルなど、ブラウザに保存されている各種設定をブラウザやデバイスをまたいで同期できます。")],-1)),fu={class:"account-feature"},Au=a(()=>u("div",{class:"account-feature__info"},[u("span",{class:"account-feature__info-heading"},"サーバー設定をブラウザから変更"),u("span",{class:"account-feature__info-text"},"管理者権限があれば、サーバー設定をブラウザから変更できます。一番最初に作成されたアカウントには、自動で管理者権限が付与されます。")],-1)),Cu=a(()=>u("div",{class:"account-register__description"},[n(" KonomiTV アカウントの作成に必要なものは"),u("br",{class:"smartphone-vertical-only"}),n("ユーザー名とパスワードだけです。"),u("br"),n(" アカウントはローカルに導入した"),u("br",{class:"smartphone-vertical-only"}),n(" KonomiTV サーバーにのみ保存されます。"),u("br"),n(" 外部のサービスには保存されませんので、ご安心ください。"),u("br")],-1)),Fu={key:3},mu={class:"settings__item settings__item--switch"},pu=a(()=>u("label",{class:"settings__item-heading",for:"sync_settings"},"設定をデバイス間で同期する",-1)),Eu=a(()=>u("label",{class:"settings__item-label",for:"sync_settings"},[n(" KonomiTV では、設定を同じアカウントでログインしているデバイス間で同期できます!"),u("br"),n(" 同期をオンにすると、同期をオンにしているすべてのデバイスで共通の設定が使えます。ピン留めチャンネルやハッシュタグリストなども同期されます。"),u("br"),n(" なお、デバイス固有の設定(画質設定など)は、同期後も各デバイスで個別に反映されます。"),u("br")],-1)),hu=a(()=>u("br",null,null,-1)),Du=a(()=>u("br",null,null,-1)),vu={class:"d-flex flex-column px-4 pb-6 settings__conflict-dialog"},yu=a(()=>u("br",{class:"smartphone-vertical-only"},null,-1)),wu=a(()=>u("br",{class:"smartphone-vertical-only"},null,-1)),bu=a(()=>u("div",{class:"settings__item-heading"},"ユーザー名",-1)),Su=a(()=>u("div",{class:"settings__item-label"},[n(" KonomiTV アカウントのユーザー名を設定します。アルファベットだけでなく日本語や記号も使えます。"),u("br"),n(" 同じ KonomiTV サーバー上の他のアカウントと同じユーザー名には変更できません。"),u("br")],-1)),Vu=a(()=>u("div",{class:"settings__item-heading"},"アイコン画像",-1)),ku=a(()=>u("div",{class:"settings__item-label"},[n(" KonomiTV アカウントのアイコン画像を設定します。"),u("br"),n(" アップロードされた画像は自動で 400×400 の正方形にリサイズされます。"),u("br")],-1)),$u=a(()=>u("div",{class:"settings__item-heading"},"新しいパスワード",-1)),Tu=a(()=>u("div",{class:"settings__item-label"},[n(" KonomiTV アカウントの新しいパスワードを設定します。"),u("br")],-1)),Iu=a(()=>u("div",{class:"settings__item mt-6"},[u("div",{class:"settings__item-heading text-error-lighten-1"},"アカウントを削除"),u("div",{class:"settings__item-label"},[n(" 現在ログインしている KonomiTV アカウントを削除します。"),u("br"),u("strong",{class:"text-error-lighten-1"},"アカウントに紐づくすべてのデータが削除されます。元に戻すことはできません。"),u("br")])],-1)),Uu=a(()=>u("br",null,null,-1));function Ku(s,e,B,A,Nu,ju){const l=m("Icon"),w=m("SettingsBase");return c(),U(w,null,{default:i(()=>[u("h2",P,[K((c(),d("a",{class:"settings__back-button",onClick:e[0]||(e[0]=o=>s.$router.back())},[t(l,{icon:"fluent:arrow-left-12-filled",width:"25px"})])),[[j]]),t(l,{icon:"fluent:person-20-filled",width:"25px"}),Q]),u("div",{class:N(["settings__content",{"settings__content--loading":s.is_loading}])},[s.userStore.user===null?(c(),d("div",W,[X,t(r,{class:"account__login ml-auto",color:"secondary",width:"140",height:"56",variant:"flat",to:"/login/"},{default:i(()=>[t(l,{icon:"fa:sign-in",class:"mr-2"}),n("ログイン ")]),_:1})])):_("",!0),s.userStore.user!==null?(c(),d("div",Y,[u("div",x,[u("img",{class:"account__icon",src:s.userStore.user_icon_url??""},null,8,uu),u("div",su,[u("div",tu,[u("span",eu,p(s.userStore.user.name),1),s.userStore.user.is_admin?(c(),d("span",nu,"管理者")):_("",!0)]),u("span",iu,"User ID: "+p(s.userStore.user.id),1)])]),t(r,{class:"account__login ml-auto",color:"secondary",width:"140",height:"56",variant:"flat",onClick:e[1]||(e[1]=o=>s.userStore.logout())},{default:i(()=>[t(l,{icon:"fa:sign-out",class:"mr-2"}),n("ログアウト ")]),_:1})])):_("",!0),s.userStore.is_logged_in===!1?(c(),d("div",ou,[au,u("div",lu,[u("div",ru,[t(l,{class:"account-feature__icon",icon:"bi:chat-left-text-fill"}),cu]),u("div",du,[t(l,{class:"account-feature__icon",icon:"fa-brands:twitter"}),_u]),u("div",Bu,[t(l,{class:"account-feature__icon",icon:"fluent:arrow-sync-20-filled"}),gu]),u("div",fu,[t(l,{class:"account-feature__icon",icon:"fa-solid:sliders-h"}),Au])]),Cu,t(r,{class:"account-register__button",color:"secondary",width:"100%","max-width":"250",height:"50",variant:"flat",to:"/register/"},{default:i(()=>[t(l,{icon:"fluent:person-add-20-filled",class:"mr-2",height:"24"}),n("アカウントを作成 ")]),_:1})])):_("",!0),s.userStore.is_logged_in===!0?(c(),d("div",Fu,[u("div",mu,[pu,Eu,t(O,{class:"settings__item-switch",color:"primary",id:"sync_settings","hide-details":"",modelValue:s.sync_settings,"onUpdate:modelValue":e[2]||(e[2]=o=>s.sync_settings=o)},null,8,["modelValue"])]),t(v,{"max-width":"530",modelValue:s.sync_settings_dialog,"onUpdate:modelValue":e[6]||(e[6]=o=>s.sync_settings_dialog=o)},{default:i(()=>[t(E,null,{default:i(()=>[t(h,{class:"d-flex justify-center font-weight-bold pt-6"},{default:i(()=>[n("設定データの競合")]),_:1}),t(D,{class:"pt-2 pb-5"},{default:i(()=>[n(" このデバイスの設定と、サーバーに保存されている設定が競合しています。"),hu,n(" 一度上書きすると、元に戻すことはできません。慎重に選択してください。"),Du]),_:1}),u("div",vu,[t(r,{class:"settings__save-button text-error-lighten-1",color:"background-lighten-1",variant:"flat",onClick:e[3]||(e[3]=o=>s.overrideServerSettingsFromClient())},{default:i(()=>[t(l,{icon:"fluent:document-arrow-up-16-filled",class:"mr-2",height:"22px"}),n(" サーバーに保存されている設定を、"),yu,n("このデバイスの設定で上書きする ")]),_:1}),t(r,{class:"settings__save-button text-error-lighten-1 mt-3",color:"background-lighten-1",variant:"flat",onClick:e[4]||(e[4]=o=>s.overrideClientSettingsFromServer())},{default:i(()=>[t(l,{icon:"fluent:document-arrow-down-16-filled",class:"mr-2",height:"22px"}),n(" このデバイスの設定を、"),wu,n("サーバーに保存されている設定で上書きする ")]),_:1}),t(r,{class:"settings__save-button mt-3",variant:"flat",color:"background-lighten-1",onClick:e[5]||(e[5]=o=>s.sync_settings_dialog=!1)},{default:i(()=>[t(l,{icon:"fluent:dismiss-16-filled",class:"mr-2",height:"22px"}),n(" キャンセル ")]),_:1})])]),_:1})]),_:1},8,["modelValue"]),t(f,{class:"settings__item",ref:"settings_username",onSubmit:e[8]||(e[8]=g(()=>{},["prevent"]))},{default:i(()=>[bu,Su,t(y,{class:"settings__item-form",color:"primary",variant:"outlined",placeholder:"ユーザー名",density:s.is_form_dense?"compact":"default",modelValue:s.settings_username,"onUpdate:modelValue":e[7]||(e[7]=o=>s.settings_username=o),rules:[s.settings_username_validation]},null,8,["density","modelValue","rules"])]),_:1},512),t(r,{class:"settings__save-button mt-2",variant:"flat",onClick:e[9]||(e[9]=o=>s.updateAccountInfo("username"))},{default:i(()=>[t(l,{icon:"fluent:save-16-filled",class:"mr-2",height:"24px"}),n("ユーザー名を更新 ")]),_:1}),t(f,{class:"settings__item",onSubmit:e[11]||(e[11]=g(()=>{},["prevent"]))},{default:i(()=>[Vu,ku,t(H,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",label:"アイコン画像を選択",density:s.is_form_dense?"compact":"default",accept:"image/jpeg, image/png","prepend-icon":"","prepend-inner-icon":"mdi-paperclip",modelValue:s.settings_icon_file,"onUpdate:modelValue":e[10]||(e[10]=o=>s.settings_icon_file=o)},null,8,["density","modelValue"])]),_:1}),t(r,{class:"settings__save-button mt-5",variant:"flat",onClick:e[12]||(e[12]=o=>s.updateAccountIcon())},{default:i(()=>[t(l,{icon:"fluent:save-16-filled",class:"mr-2",height:"24px"}),n("アイコン画像を更新 ")]),_:1}),t(f,{class:"settings__item",ref:"settings_password",onSubmit:e[15]||(e[15]=g(()=>{},["prevent"]))},{default:i(()=>[$u,Tu,t(y,{class:"settings__item-form",color:"primary",variant:"outlined",placeholder:"新しいパスワード",density:s.is_form_dense?"compact":"default",modelValue:s.settings_password,"onUpdate:modelValue":e[13]||(e[13]=o=>s.settings_password=o),type:s.settings_password_showing?"text":"password",rules:[s.settings_password_validation],"append-inner-icon":s.settings_password_showing?"mdi-eye":"mdi-eye-off","onClick:appendInner":e[14]||(e[14]=o=>s.settings_password_showing=!s.settings_password_showing)},null,8,["density","modelValue","type","rules","append-inner-icon"])]),_:1},512),t(r,{class:"settings__save-button mt-2",variant:"flat",onClick:e[16]||(e[16]=o=>s.updateAccountInfo("password"))},{default:i(()=>[t(l,{icon:"fluent:save-16-filled",class:"mr-2",height:"24px"}),n("パスワードを更新 ")]),_:1}),t(q,{class:"mt-6"}),Iu,t(r,{class:"settings__save-button bg-error mt-5",variant:"flat",onClick:e[17]||(e[17]=o=>s.account_delete_confirm_dialog=!0)},{default:i(()=>[t(l,{icon:"fluent:delete-16-filled",class:"mr-2",height:"24px"}),n("アカウントを削除 ")]),_:1}),t(v,{"max-width":"385",modelValue:s.account_delete_confirm_dialog,"onUpdate:modelValue":e[20]||(e[20]=o=>s.account_delete_confirm_dialog=o)},{default:i(()=>[t(E,null,{default:i(()=>[t(h,{class:"d-flex justify-center pt-6 font-weight-bold"},{default:i(()=>[n("本当にアカウントを削除しますか?")]),_:1}),t(D,{class:"pt-2 pb-0"},{default:i(()=>[n(" アカウントに紐づくすべてのユーザーデータが削除されます。元に戻すことはできません。"),Uu,n(" 本当にアカウントを削除しますか? ")]),_:1}),t(R,{class:"pt-4 px-6 pb-6"},{default:i(()=>[t(Z),t(r,{color:"text",variant:"text",onClick:e[18]||(e[18]=o=>s.account_delete_confirm_dialog=!1)},{default:i(()=>[n("キャンセル")]),_:1}),t(r,{color:"error",variant:"flat",onClick:e[19]||(e[19]=o=>s.deleteAccount())},{default:i(()=>[n("削除")]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])])):_("",!0)],2)]),_:1})}const Qu=I(G,[["render",Ku],["__scopeId","data-v-fc2e44f8"]]);export{Qu as default}; diff --git a/client/dist/assets/Base-DG5Aczxr.js b/client/dist/assets/Base-D8WlXaKF.js similarity index 96% rename from client/dist/assets/Base-DG5Aczxr.js rename to client/dist/assets/Base-D8WlXaKF.js index 4358d672..da543602 100644 --- a/client/dist/assets/Base-DG5Aczxr.js +++ b/client/dist/assets/Base-D8WlXaKF.js @@ -1 +1 @@ -import{H as u,N as _}from"./Navigation-CsJWaG4R.js";import{d as p,_ as r,r as l,o as f,c as g,b as t,e as s,h as n,V as e,bn as h,p as v,q as m}from"./index-D2zR81a8.js";const C=p({name:"Settings-Base",components:{HeaderBar:u,Navigation:_}}),a=o=>(v("data-v-4bf1804e"),o=o(),m(),o),x={class:"route-container"},B={class:"settings-container d-flex px-5 py-5 mx-auto",width:"100%","max-width":"1000"},w={class:"settings-navigation"},b=a(()=>s("h1",{class:"mt-2 ml-4",style:{"font-size":"24px"}},"設定",-1)),A=a(()=>s("span",{class:"ml-4"},"全般",-1)),y=a(()=>s("span",{class:"ml-4"},"画質",-1)),H=a(()=>s("span",{class:"ml-4"},"字幕",-1)),S=a(()=>s("svg",{width:"26px",height:"26px",viewBox:"0 0 512 512"},[s("path",{fill:"currentColor",d:"M248.039 381.326L355.039 67.8258C367.539 28.3257 395.039 34.3258 406.539 34.3258C431.039 34.3258 453.376 61.3258 441.039 96.8258C362.639 322.426 343.539 375.326 340.539 384.826C338.486 391.326 342.039 391.326 345.539 391.326C377.039 391.326 386.539 418.326 386.539 435.326C386.539 458.826 371.539 477.326 350.039 477.326H214.539C179.039 477.326 85.8269 431.3 88.0387 335.826C91.0387 206.326 192.039 183.326 243.539 183.326H296.539L265.539 272.326H243.539C185.539 272.326 174.113 314.826 176.039 334.326C180.039 374.826 215.039 389.814 237.039 390.326C244.539 390.5 246.039 386.826 248.039 381.326Z"})],-1)),E=a(()=>s("span",{class:"ml-4"},"データ放送",-1)),F=a(()=>s("span",{class:"ml-4"},"キャプチャ",-1)),I=a(()=>s("span",{class:"ml-4"},"アカウント",-1)),N=a(()=>s("span",{class:"ml-4"},"ニコニコ実況",-1)),D=a(()=>s("span",{class:"ml-4"},"Twitter",-1)),$=a(()=>s("span",{class:"ml-4"},"サーバー設定",-1)),k={class:"settings ml-5 px-7 py-7",width:"100%"};function V(o,q,L,j,z,M){const c=l("HeaderBar"),d=l("Navigation"),i=l("Icon");return f(),g("div",x,[t(c),s("main",null,[t(d),s("div",B,[s("nav",w,[b,t(e,{variant:"flat",class:"settings-navigation__button mt-6",to:"/settings/general"},{default:n(()=>[t(i,{icon:"fa-solid:sliders-h",width:"26px",style:{padding:"0 3px"}}),A]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/quality"},{default:n(()=>[t(i,{icon:"fluent:video-clip-multiple-16-filled",width:"26px"}),y]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/caption"},{default:n(()=>[t(i,{icon:"fluent:subtitles-16-filled",width:"26px"}),H]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/data-broadcasting"},{default:n(()=>[S,E]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/capture"},{default:n(()=>[t(i,{icon:"fluent:image-multiple-16-filled",width:"26px"}),F]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/account"},{default:n(()=>[t(i,{icon:"fluent:person-20-filled",width:"26px"}),I]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/jikkyo"},{default:n(()=>[t(i,{icon:"bi:chat-left-text-fill",width:"26px",style:{padding:"0 2px"}}),N]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/twitter"},{default:n(()=>[t(i,{icon:"fa-brands:twitter",width:"26px",style:{padding:"0 1px"}}),D]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/server"},{default:n(()=>[t(i,{icon:"fluent:server-surface-16-filled",width:"26px"}),$]),_:1})]),s("div",k,[h(o.$slots,"default",{},void 0,!0)])])])])}const G=r(C,[["render",V],["__scopeId","data-v-4bf1804e"]]);export{G as S}; +import{H as u,N as _}from"./Navigation-DZesdvbM.js";import{d as p,_ as r,r as l,o as f,c as g,b as t,e as s,h as n,V as e,bn as h,p as v,q as m}from"./index-Dbi6R656.js";const C=p({name:"Settings-Base",components:{HeaderBar:u,Navigation:_}}),a=o=>(v("data-v-4bf1804e"),o=o(),m(),o),x={class:"route-container"},B={class:"settings-container d-flex px-5 py-5 mx-auto",width:"100%","max-width":"1000"},w={class:"settings-navigation"},b=a(()=>s("h1",{class:"mt-2 ml-4",style:{"font-size":"24px"}},"設定",-1)),A=a(()=>s("span",{class:"ml-4"},"全般",-1)),y=a(()=>s("span",{class:"ml-4"},"画質",-1)),H=a(()=>s("span",{class:"ml-4"},"字幕",-1)),S=a(()=>s("svg",{width:"26px",height:"26px",viewBox:"0 0 512 512"},[s("path",{fill:"currentColor",d:"M248.039 381.326L355.039 67.8258C367.539 28.3257 395.039 34.3258 406.539 34.3258C431.039 34.3258 453.376 61.3258 441.039 96.8258C362.639 322.426 343.539 375.326 340.539 384.826C338.486 391.326 342.039 391.326 345.539 391.326C377.039 391.326 386.539 418.326 386.539 435.326C386.539 458.826 371.539 477.326 350.039 477.326H214.539C179.039 477.326 85.8269 431.3 88.0387 335.826C91.0387 206.326 192.039 183.326 243.539 183.326H296.539L265.539 272.326H243.539C185.539 272.326 174.113 314.826 176.039 334.326C180.039 374.826 215.039 389.814 237.039 390.326C244.539 390.5 246.039 386.826 248.039 381.326Z"})],-1)),E=a(()=>s("span",{class:"ml-4"},"データ放送",-1)),F=a(()=>s("span",{class:"ml-4"},"キャプチャ",-1)),I=a(()=>s("span",{class:"ml-4"},"アカウント",-1)),N=a(()=>s("span",{class:"ml-4"},"ニコニコ実況",-1)),D=a(()=>s("span",{class:"ml-4"},"Twitter",-1)),$=a(()=>s("span",{class:"ml-4"},"サーバー設定",-1)),k={class:"settings ml-5 px-7 py-7",width:"100%"};function V(o,q,L,j,z,M){const c=l("HeaderBar"),d=l("Navigation"),i=l("Icon");return f(),g("div",x,[t(c),s("main",null,[t(d),s("div",B,[s("nav",w,[b,t(e,{variant:"flat",class:"settings-navigation__button mt-6",to:"/settings/general"},{default:n(()=>[t(i,{icon:"fa-solid:sliders-h",width:"26px",style:{padding:"0 3px"}}),A]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/quality"},{default:n(()=>[t(i,{icon:"fluent:video-clip-multiple-16-filled",width:"26px"}),y]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/caption"},{default:n(()=>[t(i,{icon:"fluent:subtitles-16-filled",width:"26px"}),H]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/data-broadcasting"},{default:n(()=>[S,E]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/capture"},{default:n(()=>[t(i,{icon:"fluent:image-multiple-16-filled",width:"26px"}),F]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/account"},{default:n(()=>[t(i,{icon:"fluent:person-20-filled",width:"26px"}),I]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/jikkyo"},{default:n(()=>[t(i,{icon:"bi:chat-left-text-fill",width:"26px",style:{padding:"0 2px"}}),N]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/twitter"},{default:n(()=>[t(i,{icon:"fa-brands:twitter",width:"26px",style:{padding:"0 1px"}}),D]),_:1}),t(e,{variant:"flat",class:"settings-navigation__button",to:"/settings/server"},{default:n(()=>[t(i,{icon:"fluent:server-surface-16-filled",width:"26px"}),$]),_:1})]),s("div",k,[h(o.$slots,"default",{},void 0,!0)])])])])}const G=r(C,[["render",V],["__scopeId","data-v-4bf1804e"]]);export{G as S}; diff --git a/client/dist/assets/Caption-DTN65rsJ.js b/client/dist/assets/Caption-iQ0Q9kku.js similarity index 95% rename from client/dist/assets/Caption-DTN65rsJ.js rename to client/dist/assets/Caption-iQ0Q9kku.js index 7ce96ff4..470bf2cc 100644 --- a/client/dist/assets/Caption-DTN65rsJ.js +++ b/client/dist/assets/Caption-iQ0Q9kku.js @@ -1 +1 @@ -import{d as r,U as m,m as p,u as c,_ as B,r as l,o as _,j as E,h as A,e as u,w as g,c as C,b as i,n as F,k as o,R as h}from"./index-D2zR81a8.js";import{S as D}from"./Base-DG5Aczxr.js";import{c as f}from"./VSelect-BuCCGZYb.js";import{V as a}from"./VSwitch-BiucEdzW.js";import{V as b}from"./VSlider-S8IhLMNG.js";import{V as w}from"./VTextField-DymZQzkG.js";import"./Navigation-CsJWaG4R.js";import"./ssrBoot-BvljY2yG.js";import"./VAvatar-CTvU0rd-.js";const V=r({name:"Settings-Caption",components:{SettingsBase:D},data(){return{is_form_dense:m.isSmartphoneHorizontal(),caption_font:[{title:"Windows TV ゴシック",value:"Windows TV Gothic"},{title:"Windows TV 丸ゴシック",value:"Windows TV MaruGothic"},{title:"Windows TV 太丸ゴシック",value:"Windows TV FutoMaruGothic"},{title:"ヒラギノTV丸ゴ",value:"Hiragino TV Sans Rd S"},{title:"新丸ゴ ARIB",value:"TT-ShinMGo-regular"},{title:"Rounded M+ 1m for ARIB",value:"Rounded M+ 1m for ARIB"},{title:"Noto Sans JP",value:"Noto Sans JP"},{title:"デフォルトのフォント",value:"sans-serif"}]}},computed:{...p(c)}}),S={class:"settings__heading"},v=u("span",{class:"ml-3"},"字幕",-1),y={class:"settings__content"},T={class:"settings__item"},k=u("label",{class:"settings__item-heading"},"字幕のフォント",-1),R=u("label",{class:"settings__item-label"},[o(" プレイヤーで字幕表示をオンにしているときの、字幕のフォントを設定します。"),u("br")],-1),U={class:"settings__item settings__item--switch"},N=u("label",{class:"settings__item-heading",for:"always_border_caption_text"},"字幕の文字を常に縁取りする",-1),W=u("label",{class:"settings__item-label",for:"always_border_caption_text"},[o(" この設定をオンにすると、字幕の文字が縁取りされてより見やすくなります。とくに理由がなければ、オンにしておくのがおすすめです。"),u("br"),o(" この設定がオフのときも、字幕データから明示的に縁取りが指定されている場合は、オンのときと同様に字幕の文字が縁取りされます。"),u("br")],-1),$={class:"settings__item settings__item--switch"},I=u("label",{class:"settings__item-heading",for:"specify_caption_opacity"},"字幕の不透明度を指定する",-1),M=u("label",{class:"settings__item-label",for:"specify_caption_opacity"},[o(" この設定がオフのときは、字幕データから指定されている不透明度で描画します。とくに理由がなければ、オフにしておくのがおすすめです。"),u("br")],-1),G=u("label",{class:"settings__item-heading"},"字幕の不透明度",-1),H=u("label",{class:"settings__item-label"},[o(" 上の [字幕の不透明度を指定する] をオンに設定したときのみ有効です。不透明度を 0 に設定すれば、字幕の背景を非表示にできます。"),u("br")],-1),z={class:"settings__item-label",ref:"caption_opacity"},J={class:"settings__item settings__item--switch"},K=u("label",{class:"settings__item-heading",for:"tv_show_superimpose"},"テレビをみるときに文字スーパーを表示する",-1),P=u("label",{class:"settings__item-label",for:"tv_show_superimpose"},[o(" 文字スーパーは、緊急地震速報の赤テロップや、NHK BS のニュース速報のテロップなどで利用されています。とくに理由がなければ、オンにしておくのがおすすめです。"),u("br")],-1),j={class:"settings__item settings__item--switch"},q=u("label",{class:"settings__item-heading",for:"video_show_superimpose"},"ビデオをみるときに文字スーパーを表示する",-1),L=u("label",{class:"settings__item-label",for:"video_show_superimpose"},[o(" 文字スーパーは、緊急地震速報の赤テロップや、NHK BS のニュース速報のテロップなどで利用されています。録画当時の文字スーパーによるニュース速報を確認したい方以外は、オフにしておくのがおすすめです。"),u("br")],-1);function O(t,s,Q,X,Y,Z){const n=l("Icon"),d=l("SettingsBase");return _(),E(d,null,{default:A(()=>[u("h2",S,[g((_(),C("a",{class:"settings__back-button",onClick:s[0]||(s[0]=e=>t.$router.back())},[i(n,{icon:"fluent:arrow-left-12-filled",width:"25px"})])),[[h]]),i(n,{icon:"fluent:subtitles-16-filled",width:"25px"}),v]),u("div",y,[u("div",T,[k,R,i(f,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",density:t.is_form_dense?"compact":"default",items:t.caption_font,modelValue:t.settingsStore.settings.caption_font,"onUpdate:modelValue":s[1]||(s[1]=e=>t.settingsStore.settings.caption_font=e)},null,8,["density","items","modelValue"])]),u("div",U,[N,W,i(a,{class:"settings__item-switch",color:"primary",id:"always_border_caption_text","hide-details":"",modelValue:t.settingsStore.settings.always_border_caption_text,"onUpdate:modelValue":s[2]||(s[2]=e=>t.settingsStore.settings.always_border_caption_text=e)},null,8,["modelValue"])]),u("div",$,[I,M,i(a,{class:"settings__item-switch",color:"primary",id:"specify_caption_opacity","hide-details":"",modelValue:t.settingsStore.settings.specify_caption_opacity,"onUpdate:modelValue":s[3]||(s[3]=e=>t.settingsStore.settings.specify_caption_opacity=e)},null,8,["modelValue"])]),u("div",{class:F(["settings__item",{"settings__item--disabled":t.settingsStore.settings.specify_caption_opacity===!1}])},[G,H,u("div",z,[i(b,{class:"settings__item-form",color:"primary","show-ticks":"always","thumb-label":"","hide-details":"",min:0,max:1,step:.05,modelValue:t.settingsStore.settings.caption_opacity,"onUpdate:modelValue":s[4]||(s[4]=e=>t.settingsStore.settings.caption_opacity=e),disabled:t.settingsStore.settings.specify_caption_opacity===!1},null,8,["modelValue","disabled"])],512)],2),i(w,{class:"mt-6"}),u("div",J,[K,P,i(a,{class:"settings__item-switch",color:"primary",id:"tv_show_superimpose","hide-details":"",modelValue:t.settingsStore.settings.tv_show_superimpose,"onUpdate:modelValue":s[5]||(s[5]=e=>t.settingsStore.settings.tv_show_superimpose=e)},null,8,["modelValue"])]),u("div",j,[q,L,i(a,{class:"settings__item-switch",color:"primary",id:"video_show_superimpose","hide-details":"",modelValue:t.settingsStore.settings.video_show_superimpose,"onUpdate:modelValue":s[6]||(s[6]=e=>t.settingsStore.settings.video_show_superimpose=e)},null,8,["modelValue"])])])]),_:1})}const lu=B(V,[["render",O]]);export{lu as default}; +import{d as r,U as m,m as p,u as c,_ as B,r as l,o as _,j as E,h as A,e as u,w as g,c as C,b as i,n as F,k as o,R as h}from"./index-Dbi6R656.js";import{S as D}from"./Base-D8WlXaKF.js";import{c as f}from"./VSelect-dbg9h4rI.js";import{V as a}from"./VSwitch-Cf-jClsc.js";import{V as b}from"./VSlider-CBNN6xX6.js";import{V as w}from"./VTextField-DTBkpwFs.js";import"./Navigation-DZesdvbM.js";import"./ssrBoot-sWDXISB3.js";import"./VAvatar-BrXxzhAv.js";const V=r({name:"Settings-Caption",components:{SettingsBase:D},data(){return{is_form_dense:m.isSmartphoneHorizontal(),caption_font:[{title:"Windows TV ゴシック",value:"Windows TV Gothic"},{title:"Windows TV 丸ゴシック",value:"Windows TV MaruGothic"},{title:"Windows TV 太丸ゴシック",value:"Windows TV FutoMaruGothic"},{title:"ヒラギノTV丸ゴ",value:"Hiragino TV Sans Rd S"},{title:"新丸ゴ ARIB",value:"TT-ShinMGo-regular"},{title:"Rounded M+ 1m for ARIB",value:"Rounded M+ 1m for ARIB"},{title:"Noto Sans JP",value:"Noto Sans JP"},{title:"デフォルトのフォント",value:"sans-serif"}]}},computed:{...p(c)}}),S={class:"settings__heading"},v=u("span",{class:"ml-3"},"字幕",-1),y={class:"settings__content"},T={class:"settings__item"},k=u("label",{class:"settings__item-heading"},"字幕のフォント",-1),R=u("label",{class:"settings__item-label"},[o(" プレイヤーで字幕表示をオンにしているときの、字幕のフォントを設定します。"),u("br")],-1),U={class:"settings__item settings__item--switch"},N=u("label",{class:"settings__item-heading",for:"always_border_caption_text"},"字幕の文字を常に縁取りする",-1),W=u("label",{class:"settings__item-label",for:"always_border_caption_text"},[o(" この設定をオンにすると、字幕の文字が縁取りされてより見やすくなります。とくに理由がなければ、オンにしておくのがおすすめです。"),u("br"),o(" この設定がオフのときも、字幕データから明示的に縁取りが指定されている場合は、オンのときと同様に字幕の文字が縁取りされます。"),u("br")],-1),$={class:"settings__item settings__item--switch"},I=u("label",{class:"settings__item-heading",for:"specify_caption_opacity"},"字幕の不透明度を指定する",-1),M=u("label",{class:"settings__item-label",for:"specify_caption_opacity"},[o(" この設定がオフのときは、字幕データから指定されている不透明度で描画します。とくに理由がなければ、オフにしておくのがおすすめです。"),u("br")],-1),G=u("label",{class:"settings__item-heading"},"字幕の不透明度",-1),H=u("label",{class:"settings__item-label"},[o(" 上の [字幕の不透明度を指定する] をオンに設定したときのみ有効です。不透明度を 0 に設定すれば、字幕の背景を非表示にできます。"),u("br")],-1),z={class:"settings__item-label",ref:"caption_opacity"},J={class:"settings__item settings__item--switch"},K=u("label",{class:"settings__item-heading",for:"tv_show_superimpose"},"テレビをみるときに文字スーパーを表示する",-1),P=u("label",{class:"settings__item-label",for:"tv_show_superimpose"},[o(" 文字スーパーは、緊急地震速報の赤テロップや、NHK BS のニュース速報のテロップなどで利用されています。とくに理由がなければ、オンにしておくのがおすすめです。"),u("br")],-1),j={class:"settings__item settings__item--switch"},q=u("label",{class:"settings__item-heading",for:"video_show_superimpose"},"ビデオをみるときに文字スーパーを表示する",-1),L=u("label",{class:"settings__item-label",for:"video_show_superimpose"},[o(" 文字スーパーは、緊急地震速報の赤テロップや、NHK BS のニュース速報のテロップなどで利用されています。録画当時の文字スーパーによるニュース速報を確認したい方以外は、オフにしておくのがおすすめです。"),u("br")],-1);function O(t,s,Q,X,Y,Z){const n=l("Icon"),d=l("SettingsBase");return _(),E(d,null,{default:A(()=>[u("h2",S,[g((_(),C("a",{class:"settings__back-button",onClick:s[0]||(s[0]=e=>t.$router.back())},[i(n,{icon:"fluent:arrow-left-12-filled",width:"25px"})])),[[h]]),i(n,{icon:"fluent:subtitles-16-filled",width:"25px"}),v]),u("div",y,[u("div",T,[k,R,i(f,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",density:t.is_form_dense?"compact":"default",items:t.caption_font,modelValue:t.settingsStore.settings.caption_font,"onUpdate:modelValue":s[1]||(s[1]=e=>t.settingsStore.settings.caption_font=e)},null,8,["density","items","modelValue"])]),u("div",U,[N,W,i(a,{class:"settings__item-switch",color:"primary",id:"always_border_caption_text","hide-details":"",modelValue:t.settingsStore.settings.always_border_caption_text,"onUpdate:modelValue":s[2]||(s[2]=e=>t.settingsStore.settings.always_border_caption_text=e)},null,8,["modelValue"])]),u("div",$,[I,M,i(a,{class:"settings__item-switch",color:"primary",id:"specify_caption_opacity","hide-details":"",modelValue:t.settingsStore.settings.specify_caption_opacity,"onUpdate:modelValue":s[3]||(s[3]=e=>t.settingsStore.settings.specify_caption_opacity=e)},null,8,["modelValue"])]),u("div",{class:F(["settings__item",{"settings__item--disabled":t.settingsStore.settings.specify_caption_opacity===!1}])},[G,H,u("div",z,[i(b,{class:"settings__item-form",color:"primary","show-ticks":"always","thumb-label":"","hide-details":"",min:0,max:1,step:.05,modelValue:t.settingsStore.settings.caption_opacity,"onUpdate:modelValue":s[4]||(s[4]=e=>t.settingsStore.settings.caption_opacity=e),disabled:t.settingsStore.settings.specify_caption_opacity===!1},null,8,["modelValue","disabled"])],512)],2),i(w,{class:"mt-6"}),u("div",J,[K,P,i(a,{class:"settings__item-switch",color:"primary",id:"tv_show_superimpose","hide-details":"",modelValue:t.settingsStore.settings.tv_show_superimpose,"onUpdate:modelValue":s[5]||(s[5]=e=>t.settingsStore.settings.tv_show_superimpose=e)},null,8,["modelValue"])]),u("div",j,[q,L,i(a,{class:"settings__item-switch",color:"primary",id:"video_show_superimpose","hide-details":"",modelValue:t.settingsStore.settings.video_show_superimpose,"onUpdate:modelValue":s[6]||(s[6]=e=>t.settingsStore.settings.video_show_superimpose=e)},null,8,["modelValue"])])])]),_:1})}const lu=B(V,[["render",O]]);export{lu as default}; diff --git a/client/dist/assets/Capture-DXmMH4Q0.js b/client/dist/assets/Capture-CXo2T7QZ.js similarity index 94% rename from client/dist/assets/Capture-DXmMH4Q0.js rename to client/dist/assets/Capture-CXo2T7QZ.js index c729f1d2..bbbfac98 100644 --- a/client/dist/assets/Capture-DXmMH4Q0.js +++ b/client/dist/assets/Capture-CXo2T7QZ.js @@ -1 +1 @@ -import{d as B,U as l,m as r,u as A,_ as F,r as E,o as a,j as _,h as d,e as u,w as m,c,b as i,k as e,R as p}from"./index-D2zR81a8.js";import{S as g}from"./Base-DG5Aczxr.js";import{c as D}from"./VSelect-BuCCGZYb.js";import{V as b}from"./VSwitch-BiucEdzW.js";import"./Navigation-CsJWaG4R.js";import"./ssrBoot-BvljY2yG.js";import"./VTextField-DymZQzkG.js";import"./VAvatar-CTvU0rd-.js";const f=B({name:"Settings-Capture",components:{SettingsBase:g},data(){return{is_form_dense:l.isSmartphoneHorizontal(),capture_save_mode:[{title:"ブラウザでダウンロード",value:"Browser"},{title:"KonomiTV サーバーにアップロード",value:"UploadServer"},{title:"ブラウザでのダウンロードと、KonomiTV サーバーへのアップロードを両方行う",value:"Both"}],capture_caption_mode:[{title:"映像のみのキャプチャを保存する",value:"VideoOnly"},{title:"字幕を合成したキャプチャを保存する",value:"CompositingCaption"},{title:"映像のみのキャプチャと、字幕を合成したキャプチャを両方保存する",value:"Both"}]}},computed:{...r(A)}}),h={class:"settings__heading"},v=u("span",{class:"ml-2"},"キャプチャ",-1),S={class:"settings__content"},V={class:"settings__item"},y=u("div",{class:"settings__item-heading"},"キャプチャの保存先",-1),w=u("div",{class:"settings__item-label"},[u("p",null,[e(" キャプチャした画像をブラウザでダウンロードするか、KonomiTV サーバーにアップロードするかを設定します。"),u("br"),e(" ブラウザでのダウンロードと、KonomiTV サーバーへのアップロードを両方同時に行うこともできます。"),u("br")]),u("p",null,[e(" ブラウザでダウンロードすると、視聴中のデバイスのダウンロードフォルダに保存されます。"),u("br"),e(" 視聴中のデバイスにそのまま保存されるためシンプルですが、保存先のフォルダを変更できないこと、iOS Safari (PWA モード) ではダウンロードするとファイル概要画面が表示されて視聴に支障することがデメリットです (将来的には、iOS / Android アプリ版や拡張機能などで解消される予定) 。"),u("br")]),u("p",null,[e(" KonomiTV サーバーにアップロードすると、サーバー設定で指定されたキャプチャ保存フォルダに保存されます。視聴したデバイスにかかわらず、今までに撮ったキャプチャをひとつのフォルダにまとめて保存できます。"),u("br"),e(" 他のデバイスでキャプチャを見るにはキャプチャ保存フォルダをネットワークに共有する必要があること、スマホ・タブレットではネットワーク上のフォルダへのアクセスがやや面倒なことがデメリットです。(将来的には、保存フォルダ内のキャプチャを Google フォトのように表示する機能を追加予定)"),u("br")])],-1),k={class:"settings__item"},T=u("div",{class:"settings__item-heading"},"字幕表示時のキャプチャの保存モード",-1),U=u("div",{class:"settings__item-label"},[e(" 字幕表示時、キャプチャした画像に字幕を合成するかを設定します。"),u("br"),e(" 映像のみのキャプチャと、字幕を合成したキャプチャを両方同時に保存することもできます。"),u("br"),e(" なお、字幕非表示時は、常に映像のみ (+コメント付きキャプチャではコメントを合成して) 保存されます。"),u("br")],-1),$={class:"settings__item settings__item--switch settings__item--sync-disabled"},K=u("label",{class:"settings__item-heading",for:"capture_copy_to_clipboard"},"キャプチャをクリップボードにコピーする",-1),N=u("label",{class:"settings__item-label",for:"capture_copy_to_clipboard"},[e(" この設定をオンにすると、撮ったキャプチャ画像がクリップボードにもコピーされます。"),u("br"),e(" クリップボードの履歴をサポートしていない環境では、この設定をオンにしてキャプチャを撮ると、以前のクリップボードが上書きされます。注意してください。"),u("br")],-1);function O(t,s,I,R,j,z){const C=E("Icon"),n=E("SettingsBase");return a(),_(n,null,{default:d(()=>[u("h2",h,[m((a(),c("a",{class:"settings__back-button",onClick:s[0]||(s[0]=o=>t.$router.back())},[i(C,{icon:"fluent:arrow-left-12-filled",width:"25px"})])),[[p]]),i(C,{icon:"fluent:image-multiple-16-filled",width:"26px"}),v]),u("div",S,[u("div",V,[y,w,i(D,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",density:t.is_form_dense?"compact":"default",items:t.capture_save_mode,modelValue:t.settingsStore.settings.capture_save_mode,"onUpdate:modelValue":s[1]||(s[1]=o=>t.settingsStore.settings.capture_save_mode=o)},null,8,["density","items","modelValue"])]),u("div",k,[T,U,i(D,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",density:t.is_form_dense?"compact":"default",items:t.capture_caption_mode,modelValue:t.settingsStore.settings.capture_caption_mode,"onUpdate:modelValue":s[2]||(s[2]=o=>t.settingsStore.settings.capture_caption_mode=o)},null,8,["density","items","modelValue"])]),u("div",$,[K,N,i(b,{class:"settings__item-switch",color:"primary",id:"capture_copy_to_clipboard","hide-details":"",modelValue:t.settingsStore.settings.capture_copy_to_clipboard,"onUpdate:modelValue":s[3]||(s[3]=o=>t.settingsStore.settings.capture_copy_to_clipboard=o)},null,8,["modelValue"])])])]),_:1})}const Q=F(f,[["render",O]]);export{Q as default}; +import{d as B,U as l,m as r,u as A,_ as F,r as E,o as a,j as _,h as d,e as u,w as m,c,b as i,k as e,R as p}from"./index-Dbi6R656.js";import{S as g}from"./Base-D8WlXaKF.js";import{c as D}from"./VSelect-dbg9h4rI.js";import{V as b}from"./VSwitch-Cf-jClsc.js";import"./Navigation-DZesdvbM.js";import"./ssrBoot-sWDXISB3.js";import"./VTextField-DTBkpwFs.js";import"./VAvatar-BrXxzhAv.js";const f=B({name:"Settings-Capture",components:{SettingsBase:g},data(){return{is_form_dense:l.isSmartphoneHorizontal(),capture_save_mode:[{title:"ブラウザでダウンロード",value:"Browser"},{title:"KonomiTV サーバーにアップロード",value:"UploadServer"},{title:"ブラウザでのダウンロードと、KonomiTV サーバーへのアップロードを両方行う",value:"Both"}],capture_caption_mode:[{title:"映像のみのキャプチャを保存する",value:"VideoOnly"},{title:"字幕を合成したキャプチャを保存する",value:"CompositingCaption"},{title:"映像のみのキャプチャと、字幕を合成したキャプチャを両方保存する",value:"Both"}]}},computed:{...r(A)}}),h={class:"settings__heading"},v=u("span",{class:"ml-2"},"キャプチャ",-1),S={class:"settings__content"},V={class:"settings__item"},y=u("div",{class:"settings__item-heading"},"キャプチャの保存先",-1),w=u("div",{class:"settings__item-label"},[u("p",null,[e(" キャプチャした画像をブラウザでダウンロードするか、KonomiTV サーバーにアップロードするかを設定します。"),u("br"),e(" ブラウザでのダウンロードと、KonomiTV サーバーへのアップロードを両方同時に行うこともできます。"),u("br")]),u("p",null,[e(" ブラウザでダウンロードすると、視聴中のデバイスのダウンロードフォルダに保存されます。"),u("br"),e(" 視聴中のデバイスにそのまま保存されるためシンプルですが、保存先のフォルダを変更できないこと、iOS Safari (PWA モード) ではダウンロードするとファイル概要画面が表示されて視聴に支障することがデメリットです (将来的には、iOS / Android アプリ版や拡張機能などで解消される予定) 。"),u("br")]),u("p",null,[e(" KonomiTV サーバーにアップロードすると、サーバー設定で指定されたキャプチャ保存フォルダに保存されます。視聴したデバイスにかかわらず、今までに撮ったキャプチャをひとつのフォルダにまとめて保存できます。"),u("br"),e(" 他のデバイスでキャプチャを見るにはキャプチャ保存フォルダをネットワークに共有する必要があること、スマホ・タブレットではネットワーク上のフォルダへのアクセスがやや面倒なことがデメリットです。(将来的には、保存フォルダ内のキャプチャを Google フォトのように表示する機能を追加予定)"),u("br")])],-1),k={class:"settings__item"},T=u("div",{class:"settings__item-heading"},"字幕表示時のキャプチャの保存モード",-1),U=u("div",{class:"settings__item-label"},[e(" 字幕表示時、キャプチャした画像に字幕を合成するかを設定します。"),u("br"),e(" 映像のみのキャプチャと、字幕を合成したキャプチャを両方同時に保存することもできます。"),u("br"),e(" なお、字幕非表示時は、常に映像のみ (+コメント付きキャプチャではコメントを合成して) 保存されます。"),u("br")],-1),$={class:"settings__item settings__item--switch settings__item--sync-disabled"},K=u("label",{class:"settings__item-heading",for:"capture_copy_to_clipboard"},"キャプチャをクリップボードにコピーする",-1),N=u("label",{class:"settings__item-label",for:"capture_copy_to_clipboard"},[e(" この設定をオンにすると、撮ったキャプチャ画像がクリップボードにもコピーされます。"),u("br"),e(" クリップボードの履歴をサポートしていない環境では、この設定をオンにしてキャプチャを撮ると、以前のクリップボードが上書きされます。注意してください。"),u("br")],-1);function O(t,s,I,R,j,z){const C=E("Icon"),n=E("SettingsBase");return a(),_(n,null,{default:d(()=>[u("h2",h,[m((a(),c("a",{class:"settings__back-button",onClick:s[0]||(s[0]=o=>t.$router.back())},[i(C,{icon:"fluent:arrow-left-12-filled",width:"25px"})])),[[p]]),i(C,{icon:"fluent:image-multiple-16-filled",width:"26px"}),v]),u("div",S,[u("div",V,[y,w,i(D,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",density:t.is_form_dense?"compact":"default",items:t.capture_save_mode,modelValue:t.settingsStore.settings.capture_save_mode,"onUpdate:modelValue":s[1]||(s[1]=o=>t.settingsStore.settings.capture_save_mode=o)},null,8,["density","items","modelValue"])]),u("div",k,[T,U,i(D,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",density:t.is_form_dense?"compact":"default",items:t.capture_caption_mode,modelValue:t.settingsStore.settings.capture_caption_mode,"onUpdate:modelValue":s[2]||(s[2]=o=>t.settingsStore.settings.capture_caption_mode=o)},null,8,["density","items","modelValue"])]),u("div",$,[K,N,i(b,{class:"settings__item-switch",color:"primary",id:"capture_copy_to_clipboard","hide-details":"",modelValue:t.settingsStore.settings.capture_copy_to_clipboard,"onUpdate:modelValue":s[3]||(s[3]=o=>t.settingsStore.settings.capture_copy_to_clipboard=o)},null,8,["modelValue"])])])]),_:1})}const Q=F(f,[["render",O]]);export{Q as default}; diff --git a/client/dist/assets/CaptureCompositor-CiYI9DNZ.js b/client/dist/assets/CaptureCompositor-IHku5OQc.js similarity index 98% rename from client/dist/assets/CaptureCompositor-CiYI9DNZ.js rename to client/dist/assets/CaptureCompositor-IHku5OQc.js index 467b1464..0c7b8488 100644 --- a/client/dist/assets/CaptureCompositor-CiYI9DNZ.js +++ b/client/dist/assets/CaptureCompositor-IHku5OQc.js @@ -87,7 +87,7 @@ Type: ${g}`)}const f=y.length,p={value:"",lengthBinary:"",fourBytesOver:""};retu self.addEventListener('message', msg => { setInterval(() => self.postMessage(null), msg.data); }); - `,a=new Worker(`data:text/javascript;base64,${btoa(o)}`);return a.onmessage=()=>e(...r),a.postMessage(n),()=>a.terminate()}catch{const a=setInterval(e,n,...r);return()=>clearInterval(a)}}static async sleep(e){return await new Promise(n=>setTimeout(n,e*1e3))}static time(){return Date.now()/1e3}static typeof(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}static URLtoLink(e){e=at.escapeHTML(e);const n=/(https?:\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/ig;return e.replace(n,'$1')}static async waitUntilOnline(){return await new Promise(e=>{window.addEventListener("online",()=>e())})}};xe(at,"version","0.10.0"),xe(at,"api_base_url",`${self.location.protocol}//${self.location.host}/api`);let ge=at;/** + `,a=new Worker(`data:text/javascript;base64,${btoa(o)}`);return a.onmessage=()=>e(...r),a.postMessage(n),()=>a.terminate()}catch{const a=setInterval(e,n,...r);return()=>clearInterval(a)}}static async sleep(e){return await new Promise(n=>setTimeout(n,e*1e3))}static time(){return Date.now()/1e3}static typeof(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}static URLtoLink(e){e=at.escapeHTML(e);const n=/(https?:\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/ig;return e.replace(n,'$1')}static async waitUntilOnline(){return await new Promise(e=>{window.addEventListener("online",()=>e())})}};xe(at,"version","0.10.1"),xe(at,"api_base_url",`${self.location.protocol}//${self.location.host}/api`);let ge=at;/** * @vue/shared v3.4.12 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT @@ -105,9 +105,9 @@ Type: ${g}`)}const f=y.length,p={value:"",lengthBinary:"",fourBytesOver:""};retu * @license MIT */let us;const Xn=t=>us=t,Bl=Symbol();function Jn(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var Ht;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(Ht||(Ht={}));const ls=()=>{};function fs(t,e,n,r=ls){t.push(e);const o=()=>{const a=t.indexOf(e);a>-1&&(t.splice(a,1),r())};return!n&&Io()&&zu(o),o}function Bt(t,...e){t.slice().forEach(n=>{n(...e)})}const Tl=t=>t();function Zn(t,e){t instanceof Map&&e instanceof Map&&e.forEach((n,r)=>t.set(r,n)),t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n],o=t[n];Jn(o)&&Jn(r)&&t.hasOwnProperty(n)&&!Ne(r)&&!xt(r)?t[n]=Zn(o,r):t[n]=r}return t}const Dl=Symbol();function Fl(t){return!Jn(t)||!t.hasOwnProperty(Dl)}const{assign:ot}=Object;function Ml(t){return!!(Ne(t)&&t.effect)}function Ll(t,e,n,r){const{state:o,actions:a,getters:u}=e,c=n.state.value[t];let b;function O(){c||(n.state.value[t]=o?o():{});const m=yl(n.state.value[t]);return ot(m,a,Object.keys(u||{}).reduce((P,j)=>(P[j]=ll(Il(()=>{Xn(n);const I=n._s.get(t);return u[j].call(I,I)})),P),{}))}return b=ps(t,O,e,n,r,!0),b}function ps(t,e,n={},r,o,a){let u;const c=ot({actions:{}},n),b={deep:!0};let O,m,P=[],j=[],I;const k=r.state.value[t];!a&&!k&&(r.state.value[t]={}),pl({});let T;function Q(ee){let X;O=m=!1,typeof ee=="function"?(ee(r.state.value[t]),X={type:Ht.patchFunction,storeId:t,events:I}):(Zn(r.state.value[t],ee),X={type:Ht.patchObject,payload:ee,storeId:t,events:I});const oe=T=Symbol();Ol().then(()=>{T===oe&&(O=!0)}),m=!0,Bt(P,X,r.state.value[t])}const J=a?function(){const{state:X}=n,oe=X?X():{};this.$patch(te=>{ot(te,oe)})}:ls;function F(){u.stop(),P=[],j=[],r._s.delete(t)}function R(ee,X){return function(){Xn(r);const oe=Array.from(arguments),te=[],ae=[];function pe(U){te.push(U)}function ie(U){ae.push(U)}Bt(j,{args:oe,name:ee,store:z,after:pe,onError:ie});let V;try{V=X.apply(this&&this.$id===t?this:z,oe)}catch(U){throw Bt(ae,U),U}return V instanceof Promise?V.then(U=>(Bt(te,U),U)).catch(U=>(Bt(ae,U),Promise.reject(U))):(Bt(te,V),V)}}const Y={_p:r,$id:t,$onAction:fs.bind(null,j),$patch:Q,$reset:J,$subscribe(ee,X={}){const oe=fs(P,ee,X.detached,()=>te()),te=u.run(()=>xl(()=>r.state.value[t],ae=>{(X.flush==="sync"?m:O)&&ee({storeId:t,type:Ht.direct,events:I},ae)},ot({},b,X)));return oe},$dispose:F},z=zn(Y);r._s.set(t,z);const W=(r._a&&r._a.runWithContext||Tl)(()=>r._e.run(()=>(u=Gu()).run(e)));for(const ee in W){const X=W[ee];if(Ne(X)&&!Ml(X)||xt(X))a||(k&&Fl(X)&&(Ne(X)?X.value=k[ee]:Zn(X,k[ee])),r.state.value[t][ee]=X);else if(typeof X=="function"){const oe=R(ee,X);W[ee]=oe,c.actions[ee]=X}}return ot(z,W),ot(me(z),W),Object.defineProperty(z,"$state",{get:()=>r.state.value[t],set:ee=>{Q(X=>{ot(X,ee)})}}),r._p.forEach(ee=>{ot(z,u.run(()=>ee({store:z,app:r._a,pinia:r,options:c})))}),k&&a&&n.hydrate&&n.hydrate(z.$state,k),O=!0,m=!0,z}function Qn(t,e,n){let r,o;const a=typeof e=="function";typeof t=="string"?(r=t,o=a?n:e):(o=t,r=t.id);function u(c,b){const O=Cl();return c=c||(O?as(Bl,null):null),c&&Xn(c),c=us,c._s.has(r)||(a?ps(r,e,o,c):Ll(r,o,c)),c._s.get(r)}return u.$id=r,u}function hs(t,e){return function(){return t.apply(e,arguments)}}const{toString:Nl}=Object.prototype,{getPrototypeOf:ei}=Object,Dr=(t=>e=>{const n=Nl.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ze=t=>(t=t.toLowerCase(),e=>Dr(e)===t),Fr=t=>e=>typeof e===t,{isArray:Tt}=Array,qt=Fr("undefined");function kl(t){return t!==null&&!qt(t)&&t.constructor!==null&&!qt(t.constructor)&&ke(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const ds=ze("ArrayBuffer");function $l(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&ds(t.buffer),e}const Gl=Fr("string"),ke=Fr("function"),ys=Fr("number"),Mr=t=>t!==null&&typeof t=="object",Ul=t=>t===!0||t===!1,Lr=t=>{if(Dr(t)!=="object")return!1;const e=ei(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},zl=ze("Date"),Hl=ze("File"),ql=ze("Blob"),Yl=ze("FileList"),Vl=t=>Mr(t)&&ke(t.pipe),Wl=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||ke(t.append)&&((e=Dr(t))==="formdata"||e==="object"&&ke(t.toString)&&t.toString()==="[object FormData]"))},Kl=ze("URLSearchParams"),[Xl,Jl,Zl,Ql]=["ReadableStream","Request","Response","Headers"].map(ze),ef=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Yt(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),Tt(t))for(r=0,o=t.length;r0;)if(o=n[r],e===o.toLowerCase())return o;return null}const ms=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,bs=t=>!qt(t)&&t!==ms;function ti(){const{caseless:t}=bs(this)&&this||{},e={},n=(r,o)=>{const a=t&&gs(e,o)||o;Lr(e[a])&&Lr(r)?e[a]=ti(e[a],r):Lr(r)?e[a]=ti({},r):Tt(r)?e[a]=r.slice():e[a]=r};for(let r=0,o=arguments.length;r(Yt(e,(o,a)=>{n&&ke(o)?t[a]=hs(o,n):t[a]=o},{allOwnKeys:r}),t),rf=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),nf=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},of=(t,e,n,r)=>{let o,a,u;const c={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),a=o.length;a-- >0;)u=o[a],(!r||r(u,t,e))&&!c[u]&&(e[u]=t[u],c[u]=!0);t=n!==!1&&ei(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},sf=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},af=t=>{if(!t)return null;if(Tt(t))return t;let e=t.length;if(!ys(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},cf=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ei(Uint8Array)),uf=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=r.next())&&!o.done;){const a=o.value;e.call(t,a[0],a[1])}},lf=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},ff=ze("HTMLFormElement"),pf=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Os=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),hf=ze("RegExp"),ws=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Yt(n,(o,a)=>{let u;(u=e(o,a,t))!==!1&&(r[a]=u||o)}),Object.defineProperties(t,r)},df=t=>{ws(t,(e,n)=>{if(ke(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(ke(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},yf=(t,e)=>{const n={},r=o=>{o.forEach(a=>{n[a]=!0})};return Tt(t)?r(t):r(String(t).split(e)),n},gf=()=>{},mf=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,ri="abcdefghijklmnopqrstuvwxyz",Ss="0123456789",Es={DIGIT:Ss,ALPHA:ri,ALPHA_DIGIT:ri+ri.toUpperCase()+Ss},bf=(t=16,e=Es.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function Of(t){return!!(t&&ke(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const wf=t=>{const e=new Array(10),n=(r,o)=>{if(Mr(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[o]=r;const a=Tt(r)?[]:{};return Yt(r,(u,c)=>{const b=n(u,o+1);!qt(b)&&(a[c]=b)}),e[o]=void 0,a}}return r};return n(t,0)},Sf=ze("AsyncFunction");var N={isArray:Tt,isArrayBuffer:ds,isBuffer:kl,isFormData:Wl,isArrayBufferView:$l,isString:Gl,isNumber:ys,isBoolean:Ul,isObject:Mr,isPlainObject:Lr,isReadableStream:Xl,isRequest:Jl,isResponse:Zl,isHeaders:Ql,isUndefined:qt,isDate:zl,isFile:Hl,isBlob:ql,isRegExp:hf,isFunction:ke,isStream:Vl,isURLSearchParams:Kl,isTypedArray:cf,isFileList:Yl,forEach:Yt,merge:ti,extend:tf,trim:ef,stripBOM:rf,inherits:nf,toFlatObject:of,kindOf:Dr,kindOfTest:ze,endsWith:sf,toArray:af,forEachEntry:uf,matchAll:lf,isHTMLForm:ff,hasOwnProperty:Os,hasOwnProp:Os,reduceDescriptors:ws,freezeMethods:df,toObjectSet:yf,toCamelCase:pf,noop:gf,toFiniteNumber:mf,findKey:gs,global:ms,isContextDefined:bs,ALPHABET:Es,generateString:bf,isSpecCompliantForm:Of,toJSONObject:wf,isAsyncFn:Sf,isThenable:t=>t&&(Mr(t)||ke(t))&&ke(t.then)&&ke(t.catch)};function ue(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}N.inherits(ue,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:N.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const vs=ue.prototype,_s={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{_s[t]={value:t}}),Object.defineProperties(ue,_s),Object.defineProperty(vs,"isAxiosError",{value:!0}),ue.from=(t,e,n,r,o,a)=>{const u=Object.create(vs);return N.toFlatObject(t,u,function(b){return b!==Error.prototype},c=>c!=="isAxiosError"),ue.call(u,t.message,e,n,r,o),u.cause=t,u.name=t.name,a&&Object.assign(u,a),u};var Ef=null;function ni(t){return N.isPlainObject(t)||N.isArray(t)}function As(t){return N.endsWith(t,"[]")?t.slice(0,-2):t}function Ps(t,e,n){return t?t.concat(e).map(function(o,a){return o=As(o),!n&&a?"["+o+"]":o}).join(n?".":""):e}function vf(t){return N.isArray(t)&&!t.some(ni)}const _f=N.toFlatObject(N,{},null,function(e){return/^is[A-Z]/.test(e)});function Nr(t,e,n){if(!N.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=N.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,Q){return!N.isUndefined(Q[T])});const r=n.metaTokens,o=n.visitor||m,a=n.dots,u=n.indexes,b=(n.Blob||typeof Blob<"u"&&Blob)&&N.isSpecCompliantForm(e);if(!N.isFunction(o))throw new TypeError("visitor must be a function");function O(k){if(k===null)return"";if(N.isDate(k))return k.toISOString();if(!b&&N.isBlob(k))throw new ue("Blob is not supported. Use a Buffer instead.");return N.isArrayBuffer(k)||N.isTypedArray(k)?b&&typeof Blob=="function"?new Blob([k]):Buffer.from(k):k}function m(k,T,Q){let J=k;if(k&&!Q&&typeof k=="object"){if(N.endsWith(T,"{}"))T=r?T:T.slice(0,-2),k=JSON.stringify(k);else if(N.isArray(k)&&vf(k)||(N.isFileList(k)||N.endsWith(T,"[]"))&&(J=N.toArray(k)))return T=As(T),J.forEach(function(R,Y){!(N.isUndefined(R)||R===null)&&e.append(u===!0?Ps([T],Y,a):u===null?T:T+"[]",O(R))}),!1}return ni(k)?!0:(e.append(Ps(Q,T,a),O(k)),!1)}const P=[],j=Object.assign(_f,{defaultVisitor:m,convertValue:O,isVisitable:ni});function I(k,T){if(!N.isUndefined(k)){if(P.indexOf(k)!==-1)throw Error("Circular reference detected in "+T.join("."));P.push(k),N.forEach(k,function(J,F){(!(N.isUndefined(J)||J===null)&&o.call(e,J,N.isString(F)?F.trim():F,T,j))===!0&&I(J,T?T.concat(F):[F])}),P.pop()}}if(!N.isObject(t))throw new TypeError("data must be an object");return I(t),e}function js(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function ii(t,e){this._pairs=[],t&&Nr(t,this,e)}const xs=ii.prototype;xs.append=function(e,n){this._pairs.push([e,n])},xs.toString=function(e){const n=e?function(r){return e.call(this,r,js)}:js;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Af(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Rs(t,e,n){if(!e)return t;const r=n&&n.encode||Af,o=n&&n.serialize;let a;if(o?a=o(e,n):a=N.isURLSearchParams(e)?e.toString():new ii(e,n).toString(r),a){const u=t.indexOf("#");u!==-1&&(t=t.slice(0,u)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}class Cs{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){N.forEach(this.handlers,function(r){r!==null&&e(r)})}}var Is={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Pf=typeof URLSearchParams<"u"?URLSearchParams:ii,jf=typeof FormData<"u"?FormData:null,xf=typeof Blob<"u"?Blob:null,Rf={isBrowser:!0,classes:{URLSearchParams:Pf,FormData:jf,Blob:xf},protocols:["http","https","file","blob","url","data"]};const oi=typeof window<"u"&&typeof document<"u",Cf=(t=>oi&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),If=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Bf=oi&&window.location.href||"http://localhost";var Tf=Object.freeze({__proto__:null,hasBrowserEnv:oi,hasStandardBrowserEnv:Cf,hasStandardBrowserWebWorkerEnv:If,origin:Bf}),He={...Tf,...Rf};function Df(t,e){return Nr(t,new He.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,a){return He.isNode&&N.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function Ff(t){return N.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Mf(t){const e={},n=Object.keys(t);let r;const o=n.length;let a;for(r=0;r=n.length;return u=!u&&N.isArray(o)?o.length:u,b?(N.hasOwnProp(o,u)?o[u]=[o[u],r]:o[u]=r,!c):((!o[u]||!N.isObject(o[u]))&&(o[u]=[]),e(n,r,o[u],a)&&N.isArray(o[u])&&(o[u]=Mf(o[u])),!c)}if(N.isFormData(t)&&N.isFunction(t.entries)){const n={};return N.forEachEntry(t,(r,o)=>{e(Ff(r),o,n,0)}),n}return null}function Lf(t,e,n){if(N.isString(t))try{return(e||JSON.parse)(t),N.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Vt={transitional:Is,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,a=N.isObject(e);if(a&&N.isHTMLForm(e)&&(e=new FormData(e)),N.isFormData(e))return o?JSON.stringify(Bs(e)):e;if(N.isArrayBuffer(e)||N.isBuffer(e)||N.isStream(e)||N.isFile(e)||N.isBlob(e)||N.isReadableStream(e))return e;if(N.isArrayBufferView(e))return e.buffer;if(N.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Df(e,this.formSerializer).toString();if((c=N.isFileList(e))||r.indexOf("multipart/form-data")>-1){const b=this.env&&this.env.FormData;return Nr(c?{"files[]":e}:e,b&&new b,this.formSerializer)}}return a||o?(n.setContentType("application/json",!1),Lf(e)):e}],transformResponse:[function(e){const n=this.transitional||Vt.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(N.isResponse(e)||N.isReadableStream(e))return e;if(e&&N.isString(e)&&(r&&!this.responseType||o)){const u=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(c){if(u)throw c.name==="SyntaxError"?ue.from(c,ue.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:He.classes.FormData,Blob:He.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};N.forEach(["delete","get","head","post","put","patch"],t=>{Vt.headers[t]={}});const Nf=N.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var kf=t=>{const e={};let n,r,o;return t&&t.split(` `).forEach(function(u){o=u.indexOf(":"),n=u.substring(0,o).trim().toLowerCase(),r=u.substring(o+1).trim(),!(!n||e[n]&&Nf[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e};const Ts=Symbol("internals");function Wt(t){return t&&String(t).trim().toLowerCase()}function kr(t){return t===!1||t==null?t:N.isArray(t)?t.map(kr):String(t)}function $f(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const Gf=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function si(t,e,n,r,o){if(N.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!N.isString(e)){if(N.isString(r))return e.indexOf(r)!==-1;if(N.isRegExp(r))return r.test(e)}}function Uf(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function zf(t,e){const n=N.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,a,u){return this[r].call(this,e,o,a,u)},configurable:!0})})}let Be=class{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function a(c,b,O){const m=Wt(b);if(!m)throw new Error("header name must be a non-empty string");const P=N.findKey(o,m);(!P||o[P]===void 0||O===!0||O===void 0&&o[P]!==!1)&&(o[P||b]=kr(c))}const u=(c,b)=>N.forEach(c,(O,m)=>a(O,m,b));if(N.isPlainObject(e)||e instanceof this.constructor)u(e,n);else if(N.isString(e)&&(e=e.trim())&&!Gf(e))u(kf(e),n);else if(N.isHeaders(e))for(const[c,b]of e.entries())a(b,c,r);else e!=null&&a(n,e,r);return this}get(e,n){if(e=Wt(e),e){const r=N.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return $f(o);if(N.isFunction(n))return n.call(this,o,r);if(N.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Wt(e),e){const r=N.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||si(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function a(u){if(u=Wt(u),u){const c=N.findKey(r,u);c&&(!n||si(r,r[c],c,n))&&(delete r[c],o=!0)}}return N.isArray(e)?e.forEach(a):a(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const a=n[r];(!e||si(this,this[a],a,e,!0))&&(delete this[a],o=!0)}return o}normalize(e){const n=this,r={};return N.forEach(this,(o,a)=>{const u=N.findKey(r,a);if(u){n[u]=kr(o),delete n[a];return}const c=e?Uf(a):String(a).trim();c!==a&&delete n[a],n[c]=kr(o),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return N.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&N.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[Ts]=this[Ts]={accessors:{}}).accessors,o=this.prototype;function a(u){const c=Wt(u);r[c]||(zf(o,u),r[c]=!0)}return N.isArray(e)?e.forEach(a):a(e),this}};Be.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),N.reduceDescriptors(Be.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),N.freezeMethods(Be);function ai(t,e){const n=this||Vt,r=e||n,o=Be.from(r.headers);let a=r.data;return N.forEach(t,function(c){a=c.call(n,a,o.normalize(),e?e.status:void 0)}),o.normalize(),a}function Ds(t){return!!(t&&t.__CANCEL__)}function Dt(t,e,n){ue.call(this,t??"canceled",ue.ERR_CANCELED,e,n),this.name="CanceledError"}N.inherits(Dt,ue,{__CANCEL__:!0});function Fs(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new ue("Request failed with status code "+n.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Hf(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function qf(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,a=0,u;return e=e!==void 0?e:1e3,function(b){const O=Date.now(),m=r[a];u||(u=O),n[o]=b,r[o]=O;let P=a,j=0;for(;P!==o;)j+=n[P++],P=P%t;if(o=(o+1)%t,o===a&&(a=(a+1)%t),O-ur)return o&&(clearTimeout(o),o=null),n=c,t.apply(null,arguments);o||(o=setTimeout(()=>(o=null,n=Date.now(),t.apply(null,arguments)),r-(c-n)))}}var $r=(t,e,n=3)=>{let r=0;const o=qf(50,250);return Yf(a=>{const u=a.loaded,c=a.lengthComputable?a.total:void 0,b=u-r,O=o(b),m=u<=c;r=u;const P={loaded:u,total:c,progress:c?u/c:void 0,bytes:b,rate:O||void 0,estimated:O&&c&&m?(c-u)/O:void 0,event:a,lengthComputable:c!=null};P[e?"download":"upload"]=!0,t(P)},n)},Vf=He.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(a){let u=a;return e&&(n.setAttribute("href",u),u=n.href),n.setAttribute("href",u),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(u){const c=N.isString(u)?o(u):u;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),Wf=He.hasStandardBrowserEnv?{write(t,e,n,r,o,a){const u=[t+"="+encodeURIComponent(e)];N.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),N.isString(r)&&u.push("path="+r),N.isString(o)&&u.push("domain="+o),a===!0&&u.push("secure"),document.cookie=u.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Kf(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Xf(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Ms(t,e){return t&&!Kf(e)?Xf(t,e):e}const Ls=t=>t instanceof Be?{...t}:t;function yt(t,e){e=e||{};const n={};function r(O,m,P){return N.isPlainObject(O)&&N.isPlainObject(m)?N.merge.call({caseless:P},O,m):N.isPlainObject(m)?N.merge({},m):N.isArray(m)?m.slice():m}function o(O,m,P){if(N.isUndefined(m)){if(!N.isUndefined(O))return r(void 0,O,P)}else return r(O,m,P)}function a(O,m){if(!N.isUndefined(m))return r(void 0,m)}function u(O,m){if(N.isUndefined(m)){if(!N.isUndefined(O))return r(void 0,O)}else return r(void 0,m)}function c(O,m,P){if(P in e)return r(O,m);if(P in t)return r(void 0,O)}const b={url:a,method:a,data:a,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:c,headers:(O,m)=>o(Ls(O),Ls(m),!0)};return N.forEach(Object.keys(Object.assign({},t,e)),function(m){const P=b[m]||o,j=P(t[m],e[m],m);N.isUndefined(j)&&P!==c||(n[m]=j)}),n}var Ns=t=>{const e=yt({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:a,headers:u,auth:c}=e;e.headers=u=Be.from(u),e.url=Rs(Ms(e.baseURL,e.url),t.params,t.paramsSerializer),c&&u.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let b;if(N.isFormData(n)){if(He.hasStandardBrowserEnv||He.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if((b=u.getContentType())!==!1){const[O,...m]=b?b.split(";").map(P=>P.trim()).filter(Boolean):[];u.setContentType([O||"multipart/form-data",...m].join("; "))}}if(He.hasStandardBrowserEnv&&(r&&N.isFunction(r)&&(r=r(e)),r||r!==!1&&Vf(e.url))){const O=o&&a&&Wf.read(a);O&&u.set(o,O)}return e},Jf=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=Ns(t);let a=o.data;const u=Be.from(o.headers).normalize();let{responseType:c}=o,b;function O(){o.cancelToken&&o.cancelToken.unsubscribe(b),o.signal&&o.signal.removeEventListener("abort",b)}let m=new XMLHttpRequest;m.open(o.method.toUpperCase(),o.url,!0),m.timeout=o.timeout;function P(){if(!m)return;const I=Be.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),T={data:!c||c==="text"||c==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:I,config:t,request:m};Fs(function(J){n(J),O()},function(J){r(J),O()},T),m=null}"onloadend"in m?m.onloadend=P:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(P)},m.onabort=function(){m&&(r(new ue("Request aborted",ue.ECONNABORTED,o,m)),m=null)},m.onerror=function(){r(new ue("Network Error",ue.ERR_NETWORK,o,m)),m=null},m.ontimeout=function(){let k=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const T=o.transitional||Is;o.timeoutErrorMessage&&(k=o.timeoutErrorMessage),r(new ue(k,T.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,o,m)),m=null},a===void 0&&u.setContentType(null),"setRequestHeader"in m&&N.forEach(u.toJSON(),function(k,T){m.setRequestHeader(T,k)}),N.isUndefined(o.withCredentials)||(m.withCredentials=!!o.withCredentials),c&&c!=="json"&&(m.responseType=o.responseType),typeof o.onDownloadProgress=="function"&&m.addEventListener("progress",$r(o.onDownloadProgress,!0)),typeof o.onUploadProgress=="function"&&m.upload&&m.upload.addEventListener("progress",$r(o.onUploadProgress)),(o.cancelToken||o.signal)&&(b=I=>{m&&(r(!I||I.type?new Dt(null,t,m):I),m.abort(),m=null)},o.cancelToken&&o.cancelToken.subscribe(b),o.signal&&(o.signal.aborted?b():o.signal.addEventListener("abort",b)));const j=Hf(o.url);if(j&&He.protocols.indexOf(j)===-1){r(new ue("Unsupported protocol "+j+":",ue.ERR_BAD_REQUEST,t));return}m.send(a||null)})};const Zf=(t,e)=>{let n=new AbortController,r;const o=function(b){if(!r){r=!0,u();const O=b instanceof Error?b:this.reason;n.abort(O instanceof ue?O:new Dt(O instanceof Error?O.message:O))}};let a=e&&setTimeout(()=>{o(new ue(`timeout ${e} of ms exceeded`,ue.ETIMEDOUT))},e);const u=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(b=>{b&&(b.removeEventListener?b.removeEventListener("abort",o):b.unsubscribe(o))}),t=null)};t.forEach(b=>b&&b.addEventListener&&b.addEventListener("abort",o));const{signal:c}=n;return c.unsubscribe=u,[c,()=>{a&&clearTimeout(a),a=null}]},Qf=function*(t,e){let n=t.byteLength;if(!e||n{const a=ep(t,e,o);let u=0;return new ReadableStream({type:"bytes",async pull(c){const{done:b,value:O}=await a.next();if(b){c.close(),r();return}let m=O.byteLength;n&&n(u+=m),c.enqueue(new Uint8Array(O))},cancel(c){return r(c),a.return()}},{highWaterMark:2})},$s=(t,e)=>{const n=t!=null;return r=>setTimeout(()=>e({lengthComputable:n,total:t,loaded:r}))},Gr=typeof fetch<"u",Gs=Gr&&typeof ReadableStream<"u",ci=Gr&&(typeof TextEncoder<"u"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),tp=Gs&&(()=>{let t=!1;const e=new Request(He.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})(),Us=64*1024,ui=Gs&&!!(()=>{try{return N.isReadableStream(new Response("").body)}catch{}})(),Ur={stream:ui&&(t=>t.body)};Gr&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Ur[e]&&(Ur[e]=N.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new ue(`Response type '${e}' is not supported`,ue.ERR_NOT_SUPPORT,r)})})})(new Response);const rp=async t=>{if(t==null)return 0;if(N.isBlob(t))return t.size;if(N.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(N.isArrayBufferView(t))return t.byteLength;if(N.isURLSearchParams(t)&&(t=t+""),N.isString(t))return(await ci(t)).byteLength},np=async(t,e)=>{const n=N.toFiniteNumber(t.getContentLength());return n??rp(e)};var ip=Gr&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:a,timeout:u,onDownloadProgress:c,onUploadProgress:b,responseType:O,headers:m,withCredentials:P="same-origin",fetchOptions:j}=Ns(t);O=O?(O+"").toLowerCase():"text";let[I,k]=o||a||u?Zf([o,a],u):[],T,Q;const J=()=>{!T&&setTimeout(()=>{I&&I.unsubscribe()}),T=!0};let F;try{if(b&&tp&&n!=="get"&&n!=="head"&&(F=await np(m,r))!==0){let H=new Request(e,{method:"POST",body:r,duplex:"half"}),W;N.isFormData(r)&&(W=H.headers.get("content-type"))&&m.setContentType(W),H.body&&(r=ks(H.body,Us,$s(F,$r(b)),null,ci))}N.isString(P)||(P=P?"cors":"omit"),Q=new Request(e,{...j,signal:I,method:n.toUpperCase(),headers:m.normalize().toJSON(),body:r,duplex:"half",withCredentials:P});let R=await fetch(Q);const Y=ui&&(O==="stream"||O==="response");if(ui&&(c||Y)){const H={};["status","statusText","headers"].forEach(ee=>{H[ee]=R[ee]});const W=N.toFiniteNumber(R.headers.get("content-length"));R=new Response(ks(R.body,Us,c&&$s(W,$r(c,!0)),Y&&J,ci),H)}O=O||"text";let z=await Ur[N.findKey(Ur,O)||"text"](R,t);return!Y&&J(),k&&k(),await new Promise((H,W)=>{Fs(H,W,{data:z,headers:Be.from(R.headers),status:R.status,statusText:R.statusText,config:t,request:Q})})}catch(R){throw J(),R&&R.name==="TypeError"&&/fetch/i.test(R.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,t,Q),{cause:R.cause||R}):ue.from(R,R&&R.code,t,Q)}});const li={http:Ef,xhr:Jf,fetch:ip};N.forEach(li,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const zs=t=>`- ${t}`,op=t=>N.isFunction(t)||t===null||t===!1;var Hs={getAdapter:t=>{t=N.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let a=0;a`adapter ${c} `+(b===!1?"is not supported by the environment":"is not available in the build"));let u=e?a.length>1?`since : +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[Ts]=this[Ts]={accessors:{}}).accessors,o=this.prototype;function a(u){const c=Wt(u);r[c]||(zf(o,u),r[c]=!0)}return N.isArray(e)?e.forEach(a):a(e),this}};Be.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),N.reduceDescriptors(Be.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),N.freezeMethods(Be);function ai(t,e){const n=this||Vt,r=e||n,o=Be.from(r.headers);let a=r.data;return N.forEach(t,function(c){a=c.call(n,a,o.normalize(),e?e.status:void 0)}),o.normalize(),a}function Ds(t){return!!(t&&t.__CANCEL__)}function Dt(t,e,n){ue.call(this,t??"canceled",ue.ERR_CANCELED,e,n),this.name="CanceledError"}N.inherits(Dt,ue,{__CANCEL__:!0});function Fs(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new ue("Request failed with status code "+n.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Hf(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function qf(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,a=0,u;return e=e!==void 0?e:1e3,function(b){const O=Date.now(),m=r[a];u||(u=O),n[o]=b,r[o]=O;let P=a,j=0;for(;P!==o;)j+=n[P++],P=P%t;if(o=(o+1)%t,o===a&&(a=(a+1)%t),O-ur)return o&&(clearTimeout(o),o=null),n=c,t.apply(null,arguments);o||(o=setTimeout(()=>(o=null,n=Date.now(),t.apply(null,arguments)),r-(c-n)))}}var $r=(t,e,n=3)=>{let r=0;const o=qf(50,250);return Yf(a=>{const u=a.loaded,c=a.lengthComputable?a.total:void 0,b=u-r,O=o(b),m=u<=c;r=u;const P={loaded:u,total:c,progress:c?u/c:void 0,bytes:b,rate:O||void 0,estimated:O&&c&&m?(c-u)/O:void 0,event:a,lengthComputable:c!=null};P[e?"download":"upload"]=!0,t(P)},n)},Vf=He.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(a){let u=a;return e&&(n.setAttribute("href",u),u=n.href),n.setAttribute("href",u),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(u){const c=N.isString(u)?o(u):u;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),Wf=He.hasStandardBrowserEnv?{write(t,e,n,r,o,a){const u=[t+"="+encodeURIComponent(e)];N.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),N.isString(r)&&u.push("path="+r),N.isString(o)&&u.push("domain="+o),a===!0&&u.push("secure"),document.cookie=u.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Kf(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Xf(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Ms(t,e){return t&&!Kf(e)?Xf(t,e):e}const Ls=t=>t instanceof Be?{...t}:t;function yt(t,e){e=e||{};const n={};function r(O,m,P){return N.isPlainObject(O)&&N.isPlainObject(m)?N.merge.call({caseless:P},O,m):N.isPlainObject(m)?N.merge({},m):N.isArray(m)?m.slice():m}function o(O,m,P){if(N.isUndefined(m)){if(!N.isUndefined(O))return r(void 0,O,P)}else return r(O,m,P)}function a(O,m){if(!N.isUndefined(m))return r(void 0,m)}function u(O,m){if(N.isUndefined(m)){if(!N.isUndefined(O))return r(void 0,O)}else return r(void 0,m)}function c(O,m,P){if(P in e)return r(O,m);if(P in t)return r(void 0,O)}const b={url:a,method:a,data:a,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:c,headers:(O,m)=>o(Ls(O),Ls(m),!0)};return N.forEach(Object.keys(Object.assign({},t,e)),function(m){const P=b[m]||o,j=P(t[m],e[m],m);N.isUndefined(j)&&P!==c||(n[m]=j)}),n}var Ns=t=>{const e=yt({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:a,headers:u,auth:c}=e;e.headers=u=Be.from(u),e.url=Rs(Ms(e.baseURL,e.url),t.params,t.paramsSerializer),c&&u.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let b;if(N.isFormData(n)){if(He.hasStandardBrowserEnv||He.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if((b=u.getContentType())!==!1){const[O,...m]=b?b.split(";").map(P=>P.trim()).filter(Boolean):[];u.setContentType([O||"multipart/form-data",...m].join("; "))}}if(He.hasStandardBrowserEnv&&(r&&N.isFunction(r)&&(r=r(e)),r||r!==!1&&Vf(e.url))){const O=o&&a&&Wf.read(a);O&&u.set(o,O)}return e},Jf=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=Ns(t);let a=o.data;const u=Be.from(o.headers).normalize();let{responseType:c}=o,b;function O(){o.cancelToken&&o.cancelToken.unsubscribe(b),o.signal&&o.signal.removeEventListener("abort",b)}let m=new XMLHttpRequest;m.open(o.method.toUpperCase(),o.url,!0),m.timeout=o.timeout;function P(){if(!m)return;const I=Be.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),T={data:!c||c==="text"||c==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:I,config:t,request:m};Fs(function(J){n(J),O()},function(J){r(J),O()},T),m=null}"onloadend"in m?m.onloadend=P:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(P)},m.onabort=function(){m&&(r(new ue("Request aborted",ue.ECONNABORTED,o,m)),m=null)},m.onerror=function(){r(new ue("Network Error",ue.ERR_NETWORK,o,m)),m=null},m.ontimeout=function(){let k=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const T=o.transitional||Is;o.timeoutErrorMessage&&(k=o.timeoutErrorMessage),r(new ue(k,T.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,o,m)),m=null},a===void 0&&u.setContentType(null),"setRequestHeader"in m&&N.forEach(u.toJSON(),function(k,T){m.setRequestHeader(T,k)}),N.isUndefined(o.withCredentials)||(m.withCredentials=!!o.withCredentials),c&&c!=="json"&&(m.responseType=o.responseType),typeof o.onDownloadProgress=="function"&&m.addEventListener("progress",$r(o.onDownloadProgress,!0)),typeof o.onUploadProgress=="function"&&m.upload&&m.upload.addEventListener("progress",$r(o.onUploadProgress)),(o.cancelToken||o.signal)&&(b=I=>{m&&(r(!I||I.type?new Dt(null,t,m):I),m.abort(),m=null)},o.cancelToken&&o.cancelToken.subscribe(b),o.signal&&(o.signal.aborted?b():o.signal.addEventListener("abort",b)));const j=Hf(o.url);if(j&&He.protocols.indexOf(j)===-1){r(new ue("Unsupported protocol "+j+":",ue.ERR_BAD_REQUEST,t));return}m.send(a||null)})};const Zf=(t,e)=>{let n=new AbortController,r;const o=function(b){if(!r){r=!0,u();const O=b instanceof Error?b:this.reason;n.abort(O instanceof ue?O:new Dt(O instanceof Error?O.message:O))}};let a=e&&setTimeout(()=>{o(new ue(`timeout ${e} of ms exceeded`,ue.ETIMEDOUT))},e);const u=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(b=>{b&&(b.removeEventListener?b.removeEventListener("abort",o):b.unsubscribe(o))}),t=null)};t.forEach(b=>b&&b.addEventListener&&b.addEventListener("abort",o));const{signal:c}=n;return c.unsubscribe=u,[c,()=>{a&&clearTimeout(a),a=null}]},Qf=function*(t,e){let n=t.byteLength;if(!e||n{const a=ep(t,e,o);let u=0;return new ReadableStream({type:"bytes",async pull(c){const{done:b,value:O}=await a.next();if(b){c.close(),r();return}let m=O.byteLength;n&&n(u+=m),c.enqueue(new Uint8Array(O))},cancel(c){return r(c),a.return()}},{highWaterMark:2})},$s=(t,e)=>{const n=t!=null;return r=>setTimeout(()=>e({lengthComputable:n,total:t,loaded:r}))},Gr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Gs=Gr&&typeof ReadableStream=="function",ci=Gr&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),tp=Gs&&(()=>{let t=!1;const e=new Request(He.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})(),Us=64*1024,ui=Gs&&!!(()=>{try{return N.isReadableStream(new Response("").body)}catch{}})(),Ur={stream:ui&&(t=>t.body)};Gr&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Ur[e]&&(Ur[e]=N.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new ue(`Response type '${e}' is not supported`,ue.ERR_NOT_SUPPORT,r)})})})(new Response);const rp=async t=>{if(t==null)return 0;if(N.isBlob(t))return t.size;if(N.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(N.isArrayBufferView(t))return t.byteLength;if(N.isURLSearchParams(t)&&(t=t+""),N.isString(t))return(await ci(t)).byteLength},np=async(t,e)=>{const n=N.toFiniteNumber(t.getContentLength());return n??rp(e)};var ip=Gr&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:a,timeout:u,onDownloadProgress:c,onUploadProgress:b,responseType:O,headers:m,withCredentials:P="same-origin",fetchOptions:j}=Ns(t);O=O?(O+"").toLowerCase():"text";let[I,k]=o||a||u?Zf([o,a],u):[],T,Q;const J=()=>{!T&&setTimeout(()=>{I&&I.unsubscribe()}),T=!0};let F;try{if(b&&tp&&n!=="get"&&n!=="head"&&(F=await np(m,r))!==0){let H=new Request(e,{method:"POST",body:r,duplex:"half"}),W;N.isFormData(r)&&(W=H.headers.get("content-type"))&&m.setContentType(W),H.body&&(r=ks(H.body,Us,$s(F,$r(b)),null,ci))}N.isString(P)||(P=P?"cors":"omit"),Q=new Request(e,{...j,signal:I,method:n.toUpperCase(),headers:m.normalize().toJSON(),body:r,duplex:"half",withCredentials:P});let R=await fetch(Q);const Y=ui&&(O==="stream"||O==="response");if(ui&&(c||Y)){const H={};["status","statusText","headers"].forEach(ee=>{H[ee]=R[ee]});const W=N.toFiniteNumber(R.headers.get("content-length"));R=new Response(ks(R.body,Us,c&&$s(W,$r(c,!0)),Y&&J,ci),H)}O=O||"text";let z=await Ur[N.findKey(Ur,O)||"text"](R,t);return!Y&&J(),k&&k(),await new Promise((H,W)=>{Fs(H,W,{data:z,headers:Be.from(R.headers),status:R.status,statusText:R.statusText,config:t,request:Q})})}catch(R){throw J(),R&&R.name==="TypeError"&&/fetch/i.test(R.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,t,Q),{cause:R.cause||R}):ue.from(R,R&&R.code,t,Q)}});const li={http:Ef,xhr:Jf,fetch:ip};N.forEach(li,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const zs=t=>`- ${t}`,op=t=>N.isFunction(t)||t===null||t===!1;var Hs={getAdapter:t=>{t=N.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let a=0;a`adapter ${c} `+(b===!1?"is not supported by the environment":"is not available in the build"));let u=e?a.length>1?`since : `+a.map(zs).join(` -`):" "+zs(a[0]):"as no adapter specified";throw new ue("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return r},adapters:li};function fi(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Dt(null,t)}function qs(t){return fi(t),t.headers=Be.from(t.headers),t.data=ai.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Hs.getAdapter(t.adapter||Vt.adapter)(t).then(function(r){return fi(t),r.data=ai.call(t,t.transformResponse,r),r.headers=Be.from(r.headers),r},function(r){return Ds(r)||(fi(t),r&&r.response&&(r.response.data=ai.call(t,t.transformResponse,r.response),r.response.headers=Be.from(r.response.headers))),Promise.reject(r)})}const Ys="1.7.1",pi={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{pi[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Vs={};pi.transitional=function(e,n,r){function o(a,u){return"[Axios v"+Ys+"] Transitional option '"+a+"'"+u+(r?". "+r:"")}return(a,u,c)=>{if(e===!1)throw new ue(o(u," has been removed"+(n?" in "+n:"")),ue.ERR_DEPRECATED);return n&&!Vs[u]&&(Vs[u]=!0,console.warn(o(u," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(a,u,c):!0}};function sp(t,e,n){if(typeof t!="object")throw new ue("options must be an object",ue.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const a=r[o],u=e[a];if(u){const c=t[a],b=c===void 0||u(c,a,t);if(b!==!0)throw new ue("option "+a+" must be "+b,ue.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ue("Unknown option "+a,ue.ERR_BAD_OPTION)}}var hi={assertOptions:sp,validators:pi};const st=hi.validators;let gt=class{constructor(e){this.defaults=e,this.interceptors={request:new Cs,response:new Cs}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const a=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`):" "+zs(a[0]):"as no adapter specified";throw new ue("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return r},adapters:li};function fi(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Dt(null,t)}function qs(t){return fi(t),t.headers=Be.from(t.headers),t.data=ai.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Hs.getAdapter(t.adapter||Vt.adapter)(t).then(function(r){return fi(t),r.data=ai.call(t,t.transformResponse,r),r.headers=Be.from(r.headers),r},function(r){return Ds(r)||(fi(t),r&&r.response&&(r.response.data=ai.call(t,t.transformResponse,r.response),r.response.headers=Be.from(r.response.headers))),Promise.reject(r)})}const Ys="1.7.2",pi={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{pi[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Vs={};pi.transitional=function(e,n,r){function o(a,u){return"[Axios v"+Ys+"] Transitional option '"+a+"'"+u+(r?". "+r:"")}return(a,u,c)=>{if(e===!1)throw new ue(o(u," has been removed"+(n?" in "+n:"")),ue.ERR_DEPRECATED);return n&&!Vs[u]&&(Vs[u]=!0,console.warn(o(u," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(a,u,c):!0}};function sp(t,e,n){if(typeof t!="object")throw new ue("options must be an object",ue.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const a=r[o],u=e[a];if(u){const c=t[a],b=c===void 0||u(c,a,t);if(b!==!0)throw new ue("option "+a+" must be "+b,ue.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ue("Unknown option "+a,ue.ERR_BAD_OPTION)}}var hi={assertOptions:sp,validators:pi};const st=hi.validators;let gt=class{constructor(e){this.defaults=e,this.interceptors={request:new Cs,response:new Cs}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const a=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+a):r.stack=a}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=yt(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:a}=n;r!==void 0&&hi.assertOptions(r,{silentJSONParsing:st.transitional(st.boolean),forcedJSONParsing:st.transitional(st.boolean),clarifyTimeoutError:st.transitional(st.boolean)},!1),o!=null&&(N.isFunction(o)?n.paramsSerializer={serialize:o}:hi.assertOptions(o,{encode:st.function,serialize:st.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=a&&N.merge(a.common,a[n.method]);a&&N.forEach(["delete","get","head","post","put","patch","common"],k=>{delete a[k]}),n.headers=Be.concat(u,a);const c=[];let b=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(n)===!1||(b=b&&T.synchronous,c.unshift(T.fulfilled,T.rejected))});const O=[];this.interceptors.response.forEach(function(T){O.push(T.fulfilled,T.rejected)});let m,P=0,j;if(!b){const k=[qs.bind(this),void 0];for(k.unshift.apply(k,c),k.push.apply(k,O),j=k.length,m=Promise.resolve(n);P{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const u=new Promise(c=>{r.subscribe(c),a=c}).then(o);return u.cancel=function(){r.unsubscribe(a)},u},e(function(a,u,c){r.reason||(r.reason=new Dt(a,u,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new ta(function(o){e=o}),cancel:e}}};function cp(t){return function(n){return t.apply(null,n)}}function up(t){return N.isObject(t)&&t.isAxiosError===!0}const di={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(di).forEach(([t,e])=>{di[e]=t});function Ws(t){const e=new gt(t),n=hs(gt.prototype.request,e);return N.extend(n,gt.prototype,e,{allOwnKeys:!0}),N.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return Ws(yt(t,o))},n}const Pe=Ws(Vt);Pe.Axios=gt,Pe.CanceledError=Dt,Pe.CancelToken=ap,Pe.isCancel=Ds,Pe.VERSION=Ys,Pe.toFormData=Nr,Pe.AxiosError=ue,Pe.Cancel=Pe.CanceledError,Pe.all=function(e){return Promise.all(e)},Pe.spread=cp,Pe.isAxiosError=up,Pe.mergeConfig=yt,Pe.AxiosHeaders=Be,Pe.formToJSON=t=>Bs(N.isHTMLForm(t)?new FormData(t):t),Pe.getAdapter=Hs.getAdapter,Pe.HttpStatusCode=di,Pe.default=Pe;const{Axios:wp,AxiosError:zr,CanceledError:Sp,isCancel:Ep,CancelToken:vp,VERSION:_p,all:Ap,Cancel:Pp,isAxiosError:jp,spread:xp,toFormData:Rp,AxiosHeaders:Cp,HttpStatusCode:Ip,formToJSON:Bp,getAdapter:Tp,mergeConfig:Dp}=Pe,lp="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let fp=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)e+=lp[n[t]&63];return e};const Kt=Qn("snackbars",{state:()=>({snackbars:[]}),actions:{async show(t,e,n=5){const r=this;this.snackbars.push({id:fp(),level:t,text:e,showing:!1,destroying:!1,show(){this.showing=!0},async hide(){this.showing&&(this.showing=!1,await ge.sleep(.2),this.destroying=!0,await ge.sleep(.3),await ge.sleep(.1),r.snackbars.splice(r.snackbars.indexOf(this),1))}});const o=this.snackbars[this.snackbars.length-1];await ge.sleep(.05),o.show(),await ge.sleep(n),await o.hide()}}});var we={success(t,e){Kt().show("success",t,e)},info(t,e){Kt().show("info",t,e)},warning(t,e){Kt().show("warning",t,e)},error(t,e){Kt().show("error",t,e)},show(t,e){Kt().show("default",t,e)}};class mt{static async createUser(e){const n=await be.post("/users",e);if(n.type==="error"){switch(n.data.detail){case"Specified username is duplicated":{we.error("ユーザー名が重複しています。");break}case"Specified username is not accepted due to system limitations":{we.error("ユーザー名に token と me は使えません。");break}default:{be.showGenericError(n,"アカウントを作成できませんでした。");break}}return null}return n.data}static async createUserAccessToken(e,n){const r=await be.post("/users/token",new URLSearchParams({username:e,password:n}));if(r.type==="error"){switch(r.data.detail){case"Incorrect username":{we.error("ログインできませんでした。そのユーザー名のアカウントは存在しません。");break}case"Incorrect password":{we.error("ログインできませんでした。パスワードを間違えていませんか?");break}default:{be.showGenericError(r,"ログインできませんでした。");break}}return null}return r.data}static async fetchUser(){const e=await be.get("/users/me");return e.type==="error"?(be.showGenericError(e,"アカウント情報を取得できませんでした。"),null):e.data}static async fetchUserIcon(){const e=await be.get("/users/me/icon",{responseType:"blob"});return e.type==="error"?(be.showGenericError(e,"アイコン画像を取得できませんでした。"),null):URL.createObjectURL(e.data)}static async updateUser(e){const n=await be.put("/users/me",e);if(n.type==="error"){switch(n.data.detail){case"Specified username is duplicated":{we.error("ユーザー名が重複しています。");break}case"Specified username is not accepted due to system limitations":{we.error("ユーザー名に token と me は使えません。");break}default:{be.showGenericError(n,"アカウント情報を更新できませんでした。");break}}return!1}return!0}static async updateUserIcon(e){const n=new FormData;n.append("image",e);const r=await be.put("/users/me/icon",n,{headers:{"Content-Type":"multipart/form-data"}});if(r.type==="error"){switch(r.data.detail){case"Please upload JPEG or PNG image":{we.error("JPEG または PNG 画像をアップロードしてください。");break}default:{be.showGenericError(r,"アイコン画像を更新できませんでした。");break}}return}}static async deleteUser(){const e=await be.delete("/users/me");if(e.type==="error"){be.showGenericError(e,"アカウントを削除できませんでした。");return}}static async fetchAllUsers(){const e=await be.get("/users");return e.type==="error"?(be.showGenericError(e,"ユーザー情報リストを取得できませんでした。"),null):e.data}static async fetchSpecifiedUser(e){const n=await be.get(`/users/${e}`);if(n.type==="error"){switch(n.data.detail){case"Specified user was not found":{we.error(`${e} のユーザーが見つかりませんでした。`);break}default:{be.showGenericError(n,`${e} のユーザー情報を取得できませんでした。`);break}}return null}return n.data}static async updateSpecifiedUser(e,n){const r=await be.put(`/users/${e}`,{is_admin:n});return r.type==="error"?(be.showGenericError(r,`${e} のユーザー情報を更新できませんでした。`),!1):!0}static async fetchSpecifiedUserIcon(e){const n=await be.get(`/users/${e}/icon`,{responseType:"blob"});if(n.type==="error")throw be.showGenericError(n,`${e} のユーザーアイコン画像を取得できませんでした。`),new Error("Failed to get specified user icon");return URL.createObjectURL(n.data)}static async deleteSpecifiedUser(e){const n=await be.delete(`/users/${e}`);return n.type==="error"?(be.showGenericError(n,`${e} のユーザーアカウントを削除できませんでした。`),!1):!0}}const pp=Qn("user",{state:()=>({is_logged_in:!1,user:null,user_icon_url:null}),getters:{user_niconico_icon_url(){return this.user===null||this.user.niconico_user_id===null?null:`https://secure-dcdn.cdn.nimg.jp/nicoaccount/usericon/${this.user.niconico_user_id.toString().slice(0,4)}/${this.user.niconico_user_id}.jpg`}},actions:{async register(t,e){return await mt.createUser({username:t,password:e})===null?(console.log("Register failed."),!1):(await this.login(t,e,!0),console.log("Register successful."),we.success("アカウントを作成しました。"),!0)},async login(t,e,n=!1){const r=await mt.createUserAccessToken(t,e);return r===null?(console.log("Login failed."),this.logout(!0),!1):(console.log("Login successful."),ge.saveAccessToken(r.access_token),this.is_logged_in=!0,await this.fetchUser(!0),n===!1&&we.success("ログインしました。"),!0)},logout(t=!1){const e=qr();e.settings.sync_settings=!1,ge.deleteAccessToken(),this.is_logged_in=!1,this.user=null,this.user_icon_url="",t===!1&&we.success("ログアウトしました。")},async fetchUser(t=!1){if(ge.getAccessToken()===null)return null;if(this.user!==null&&t===!1)return this.user;const e=await mt.fetchUser();if(e===null)return ge.getAccessToken()===null&&this.logout(!0),null;this.is_logged_in=!0,this.user=e;const n=await mt.fetchUserIcon();return n===null?null:(this.user_icon_url=n,this.user)},async updateUser(t){if(await mt.updateUser(t)===!1){console.log("Update user failed.");return}await this.fetchUser(!0),t.username!==void 0?we.show("ユーザー名を更新しました。"):t.password!==void 0&&we.show("パスワードを更新しました。")},async updateUserIcon(t){await mt.updateUserIcon(t),await this.fetchUser(!0),we.show("アイコン画像を更新しました。")},async deleteUser(){await mt.deleteUser(),this.logout(!0),we.show("アカウントを削除しました。")}}});class Ft{static async request(e){var r;if(e.baseURL===void 0&&(e.baseURL=ge.api_base_url),e.headers===void 0&&(e.headers={}),((r=e.url)==null?void 0:r.startsWith("http"))===!1){const o=ge.getAccessToken();o!==null&&(e.headers.Authorization=`Bearer ${o}`),e.headers["X-KonomiTV-Version"]=ge.version}e.timeout===void 0&&(e.timeout=30*1e3),e.transitional={clarifyTimeoutError:!0};const n=await Pe.request(e).catch(o=>o);return n instanceof zr?(console.error(n),n.response?{type:"error",status:n.response.status,headers:n.response.headers,data:n.response.data,error:n}:{type:"error",status:NaN,headers:{},data:{detail:n.message},error:n}):{type:"success",headers:n.headers,status:n.status,data:n.data}}static async get(e,n){const r={url:e,method:"GET",...n};return await Ft.request(r)}static async post(e,n,r){const o={url:e,method:"POST",data:n,...r};return await Ft.request(o)}static async put(e,n,r){const o={url:e,method:"PUT",data:n,...r};return await Ft.request(o)}static async delete(e,n){const r={url:e,method:"DELETE",...n};return await Ft.request(r)}static showGenericError(e,n){const r=pp();switch(e.data.detail){case"Not authenticated":{r.logout(!0),we.error(`${n} ログインし直してください。`);return}case"Access token data is invalid":{r.logout(!0),we.error(`${n} ログインセッションが不正です。もう一度ログインし直してください。`);return}case"Access token is invalid":{r.logout(!0),we.error(`${n} diff --git a/client/dist/assets/ChannelsStore-eNnhxLya.js b/client/dist/assets/ChannelsStore-DchOc5Uo.js similarity index 99% rename from client/dist/assets/ChannelsStore-eNnhxLya.js rename to client/dist/assets/ChannelsStore-DchOc5Uo.js index 683135e2..41b5cd92 100644 --- a/client/dist/assets/ChannelsStore-eNnhxLya.js +++ b/client/dist/assets/ChannelsStore-DchOc5Uo.js @@ -1 +1 @@ -import{G as u,I as v,u as k,U as f}from"./index-D2zR81a8.js";class S{static getChannelType(t){try{switch(t.match("(?[a-z]+)[0-9]+").groups.channel_type.toUpperCase()){case"GR":return"GR";case"BS":return"BS";case"CS":return"CS";case"CATV":return"CATV";case"SKY":return"SKY";case"STARDIGIO":return"STARDIGIO";default:return null}}catch{return null}}static getChannelForceType(t){return t===null?"normal":t>=500?"festival":t>=200?"so-many":t>=100?"many":"normal"}static getChannelHashtag(t){const e={NHK総合:"#nhk",NHKEテレ:"#etv",HBC:"#hbc",札幌テレビ:"#stv",HTB:"#htv",TVh:"#tvh",北海道文化放送:"#uhb",RAB青森放送:"#rab",青森朝日放送:"#aba",ATV青森テレビ:"#atv",テレビ岩手:"#tvi",岩手朝日テレビ:"#iat",IBCテレビ:"#ibc",めんこいテレビ:"#mit",TBCテレビ:"#tbc",ミヤギテレビ:"#mmt",東日本放送:"#khb",仙台放送:"#oxtv",ABS秋田放送:"#abs",秋田朝日放送:"#aab",AKT秋田テレビ:"#akt",山形放送:"#ybc",山形テレビ:"#yts",TUY:"#tuy",さくらんぼテレビ:"#say",福島中央テレビ:"#fct",KFB福島放送:"#kfb",テレビユー福島:"#tuf",FTV福島テレビ:"#ftv",TeNY:"#TeNY",新潟テレビ21:"#uxtv",BSN:"#bsn",NST:"#nst",KNBテレビ:"#knb",チューリップテレビ:"#tut",富山テレビ放送:"#toyamatv",テレビ金沢:"#tv_kanazawa",HAB:"#hab",MRO:"#mro",石川テレビ:"#ishikawatv",福井放送:"#fbc",福井テレビ:"#fukuitv",山梨放送:"#ybs",UTYテレビ山梨:"#uty",テレビ信州:"#tsb",長野朝日放送:"#abn",SBC信越放送:"#sbc",長野放送:"#nbs","Daiichi-TV":"#sdt",静岡朝日テレビ:"#satv",SBS:"#sbs",テレビ静岡:"#sut",三重テレビ:"#mietv",ぎふチャン:"#gifuchan",BBCびわ湖放送:"#BBC_biwako",奈良テレビ:"#tvn",WTV:"#telewaka",RNC西日本テレビ:"#rnc",瀬戸内海放送:"#ksb",RSKテレビ:"#rsk",TSCテレビせとうち:"#tvsetouchi",OHK:"#ohk",RCCテレビ:"#rcc",広島テレビ:"#htv",広島ホームテレビ:"#hometv",テレビ新広島:"#tss",日本海テレビ:"#nkt",BSSテレビ:"#bss",さんいん中央テレビ:"#tsk",tysテレビ山口:"#tys",山口放送:"#kry",yab山口朝日:"#yab",四国放送:"#jrt",高知放送:"#rkc",テレビ高知:"#kutv",高知さんさんテレビ:"#kss",南海放送:"#rnb",愛媛朝日テレビ:"#eat",あいテレビ:"#itv",テレビ愛媛:"#ebc",KBCテレビ:"#kbc",RKB毎日放送:"#rkb",FBS福岡放送:"#fbs",TVQ九州放送:"#tvq",テレビ西日本:"#tnc",STSサガテレビ:"#sagatv",NBC長崎放送:"#nbc",長崎国際テレビ:"#nib",NCC長崎文化放送:"#ncc",テレビ長崎:"#ktn",RKK熊本放送:"#rkk",くまもと県民:"#kkt",KAB熊本朝日放送:"#kab",テレビ熊本:"#tku",OBS大分放送:"#obs",TOSテレビ大分:"#tos",OAB大分朝日放送:"#oab",MRT宮崎放送:"#mrt",テレビ宮崎:"#umk",MBC南日本放送:"#mbc",鹿児島讀賣テレビ:"#kyt",KKB鹿児島放送:"#kkb",鹿児島テレビ放送:"#kts",RBCテレビ:"#rbc",琉球朝日放送:"#qab",沖縄テレビ:"#otv",日テレ:"#ntv",読売テレビ:"#ytv",中京テレビ:"#chukyotv",テレビ朝日:"#tvasahi",ABCテレビ:"#abc","メ~テレ":"#nagoyatv","メ〜テレ":"#nagoyatv",TBSチャンネル:null,TBS:"#tbs",MBS:"#mbs",CBC:"#cbc",テレビ東京:"#tvtokyo",テレ東:"#tvtokyo",テレビ大阪:"#tvo",テレビ愛知:"#tva",フジテレビ:"#fujitv",関西テレビ:"#kantele",東海テレビ:"#tokaitv","TOKYO MX":"#tokyomx",tvk:"#tvk",チバテレ:"#chibatv",テレ玉:"#teletama",群馬テレビ:"#gtv",とちぎテレビ:"#tochitere",とちテレ:"#tochitere",サンテレビ:"#suntv",KBS京都:"#kbs",NHKBS1:"#nhkbs1",NHKBSプレミアム:"#nhkbsp",NHKBS:"#nhkbs",BS日テレ:"#bsntv",BS朝日:"#bsasahi","BS-TBS":"#bstbs",BSテレ東:"#bstvtokyo",BSフジ:"#bsfuji",BS11:"#bs11",BS12:"#bs12",BS松竹東急:"#bs260ch",BSJapanext:"#bsjapanext",BSよしもと:"#bsyoshimoto","AT-X":"#at_x"},s=Object.keys(e).find(l=>t.startsWith(l));return s?e[s]:null}}const b={id:"NID0-SID0-EID0",channel_id:"NID0-SID0",network_id:0,service_id:0,event_id:0,title:"取得中…",description:"取得中…",detail:{},start_time:"2000-01-01T00:00:00+09:00",end_time:"2000-01-01T00:00:00+09:00",duration:0,is_free:!0,genres:[],video_type:"映像1080i(1125i)、アスペクト比16:9 パンベクトルなし",video_codec:"MPEG-2",video_resolution:"1080i",primary_audio_type:"2/0モード(ステレオ)",primary_audio_language:"日本語",primary_audio_sampling_rate:"48kHz",secondary_audio_type:null,secondary_audio_language:null,secondary_audio_sampling_rate:null},p={id:"NID0-SID0",display_channel_id:"gr000",network_id:0,service_id:0,transport_stream_id:null,remocon_id:0,channel_number:"---",type:"GR",name:"取得中…",jikkyo_force:null,is_subchannel:!1,is_radiochannel:!1,is_watchable:!0,is_display:!0,viewer_count:0,program_present:b,program_following:b};class B{static async fetchAll(){const t=await u.get("/channels");return t.type==="error"?(u.showGenericError(t,"チャンネル情報を取得できませんでした。"),null):t.data}static async fetch(t){const e=await u.get(`/channels/${t}`);return e.type==="error"?(u.showGenericError(e,"チャンネル情報を取得できませんでした。"),null):e.data}static async fetchJikkyoSession(t){const e=await u.get(`/channels/${t}/jikkyo`);return e.type==="error"?(u.showGenericError(e,"ニコニコ実況のセッション情報を取得できませんでした。"),null):e.data}}const m=v("channels",{state:()=>({channels_list:{GR:[],BS:[],CS:[],CATV:[],SKY:[],STARDIGIO:[]},is_channels_list_initial_updated:!1,last_updated_at:0,display_channel_id:"gr000",viewer_count:null,current_program_present:null,current_program_following:null}),getters:{channel(){if(this.is_channels_list_initial_updated===!1)return{previous:p,current:p,next:p};const n={...b,title:"チャンネル情報取得エラー",description:"このチャンネル ID のチャンネル情報は存在しません。"},t={...p,name:"チャンネル情報取得エラー",program_present:n,program_following:n},e=S.getChannelType(this.display_channel_id);if(e===null)return{previous:t,current:t,next:t};const s=this.channels_list[e],l=s.findIndex(i=>i.display_channel_id===this.display_channel_id);if(l===-1)return{previous:t,current:t,next:t};const _=(()=>{let i=l-1;for(;s.length;){if(i<=-1&&(i=s.length-1),s[i].is_display)return i;i--}return 0})(),h=(()=>{let i=l+1;for(;s.length;){if(i>=s.length&&(i=0),s[i].is_display)return i;i++}return 0})(),o=structuredClone(s[l]);return this.current_program_present!==null&&(o.program_present=this.current_program_present),this.current_program_following!==null&&(o.program_following=this.current_program_following),this.viewer_count!==null&&(o.viewer_count=this.viewer_count),{previous:s[_],current:o,next:s[h]}},channels_list_with_pinned(){var s,l,_,h,o,i,g;const n=k(),t=new Map;if(t.set("ピン留め",[]),t.set("地デジ",[]),this.is_channels_list_initial_updated===!1)return t;t.set("BS",[]),t.set("CS",[]),t.set("CATV",[]),t.set("SKY",[]),t.set("StarDigio",[]),n.settings.pinned_channel_ids=n.settings.pinned_channel_ids.map(a=>{if(a.includes("NID")&&a.includes("SID"))return a;{const c=S.getChannelType(a);if(c===null)return"NID0-SID0";const d=this.channels_list[c].find(y=>y.display_channel_id===a)??null;return d===null?"NID0-SID0":d.id}}).filter(a=>a!=="NID0-SID0");const e=[];for(const[a,c]of Object.entries(this.channels_list))for(const r of c)if(n.settings.pinned_channel_ids.includes(r.id)&&e.push(r),r.is_display!==!1)switch(r.type){case"GR":{(s=t.get("地デジ"))==null||s.push(r);break}case"BS":{(l=t.get("BS"))==null||l.push(r);break}case"CS":{(_=t.get("CS"))==null||_.push(r);break}case"CATV":{(h=t.get("CATV"))==null||h.push(r);break}case"SKY":{(o=t.get("SKY"))==null||o.push(r);break}case"STARDIGIO":{(i=t.get("StarDigio"))==null||i.push(r);break}}n.settings.pinned_channel_ids=n.settings.pinned_channel_ids.filter(a=>e.some(c=>c.id===a)),(g=t.get("ピン留め"))==null||g.push(...e.sort((a,c)=>{const r=n.settings.pinned_channel_ids.indexOf(a.id),d=n.settings.pinned_channel_ids.indexOf(c.id);return r-d}));for(const[a,c]of t)a!=="ピン留め"&&c.length===0&&t.delete(a);return t.size===1&&t.has("ピン留め")&&t.delete("ピン留め"),t},channels_list_with_pinned_for_watch(){var t;const n=new Map([...this.channels_list_with_pinned]);return this.is_channels_list_initial_updated===!1||((t=n.get("ピン留め"))==null?void 0:t.length)===0&&n.delete("ピン留め"),n}},actions:{getChannelByRemoconID(n,t){return this.channels_list[n].find(l=>l.remocon_id===t)??null},async update(n=!1){const t=async()=>{const e=await B.fetchAll();e!==null&&(this.channels_list=f.deepObjectFreeze(e),this.is_channels_list_initial_updated===!1&&(this.is_channels_list_initial_updated=!0),this.last_updated_at=f.time())};if(this.is_channels_list_initial_updated===!0&&n===!1){f.time()-this.last_updated_at>60&&t();return}await t()}}}),T=m;export{S as C,B as a,T as u}; +import{G as u,I as v,u as k,U as f}from"./index-Dbi6R656.js";class S{static getChannelType(t){try{switch(t.match("(?[a-z]+)[0-9]+").groups.channel_type.toUpperCase()){case"GR":return"GR";case"BS":return"BS";case"CS":return"CS";case"CATV":return"CATV";case"SKY":return"SKY";case"STARDIGIO":return"STARDIGIO";default:return null}}catch{return null}}static getChannelForceType(t){return t===null?"normal":t>=500?"festival":t>=200?"so-many":t>=100?"many":"normal"}static getChannelHashtag(t){const e={NHK総合:"#nhk",NHKEテレ:"#etv",HBC:"#hbc",札幌テレビ:"#stv",HTB:"#htv",TVh:"#tvh",北海道文化放送:"#uhb",RAB青森放送:"#rab",青森朝日放送:"#aba",ATV青森テレビ:"#atv",テレビ岩手:"#tvi",岩手朝日テレビ:"#iat",IBCテレビ:"#ibc",めんこいテレビ:"#mit",TBCテレビ:"#tbc",ミヤギテレビ:"#mmt",東日本放送:"#khb",仙台放送:"#oxtv",ABS秋田放送:"#abs",秋田朝日放送:"#aab",AKT秋田テレビ:"#akt",山形放送:"#ybc",山形テレビ:"#yts",TUY:"#tuy",さくらんぼテレビ:"#say",福島中央テレビ:"#fct",KFB福島放送:"#kfb",テレビユー福島:"#tuf",FTV福島テレビ:"#ftv",TeNY:"#TeNY",新潟テレビ21:"#uxtv",BSN:"#bsn",NST:"#nst",KNBテレビ:"#knb",チューリップテレビ:"#tut",富山テレビ放送:"#toyamatv",テレビ金沢:"#tv_kanazawa",HAB:"#hab",MRO:"#mro",石川テレビ:"#ishikawatv",福井放送:"#fbc",福井テレビ:"#fukuitv",山梨放送:"#ybs",UTYテレビ山梨:"#uty",テレビ信州:"#tsb",長野朝日放送:"#abn",SBC信越放送:"#sbc",長野放送:"#nbs","Daiichi-TV":"#sdt",静岡朝日テレビ:"#satv",SBS:"#sbs",テレビ静岡:"#sut",三重テレビ:"#mietv",ぎふチャン:"#gifuchan",BBCびわ湖放送:"#BBC_biwako",奈良テレビ:"#tvn",WTV:"#telewaka",RNC西日本テレビ:"#rnc",瀬戸内海放送:"#ksb",RSKテレビ:"#rsk",TSCテレビせとうち:"#tvsetouchi",OHK:"#ohk",RCCテレビ:"#rcc",広島テレビ:"#htv",広島ホームテレビ:"#hometv",テレビ新広島:"#tss",日本海テレビ:"#nkt",BSSテレビ:"#bss",さんいん中央テレビ:"#tsk",tysテレビ山口:"#tys",山口放送:"#kry",yab山口朝日:"#yab",四国放送:"#jrt",高知放送:"#rkc",テレビ高知:"#kutv",高知さんさんテレビ:"#kss",南海放送:"#rnb",愛媛朝日テレビ:"#eat",あいテレビ:"#itv",テレビ愛媛:"#ebc",KBCテレビ:"#kbc",RKB毎日放送:"#rkb",FBS福岡放送:"#fbs",TVQ九州放送:"#tvq",テレビ西日本:"#tnc",STSサガテレビ:"#sagatv",NBC長崎放送:"#nbc",長崎国際テレビ:"#nib",NCC長崎文化放送:"#ncc",テレビ長崎:"#ktn",RKK熊本放送:"#rkk",くまもと県民:"#kkt",KAB熊本朝日放送:"#kab",テレビ熊本:"#tku",OBS大分放送:"#obs",TOSテレビ大分:"#tos",OAB大分朝日放送:"#oab",MRT宮崎放送:"#mrt",テレビ宮崎:"#umk",MBC南日本放送:"#mbc",鹿児島讀賣テレビ:"#kyt",KKB鹿児島放送:"#kkb",鹿児島テレビ放送:"#kts",RBCテレビ:"#rbc",琉球朝日放送:"#qab",沖縄テレビ:"#otv",日テレ:"#ntv",読売テレビ:"#ytv",中京テレビ:"#chukyotv",テレビ朝日:"#tvasahi",ABCテレビ:"#abc","メ~テレ":"#nagoyatv","メ〜テレ":"#nagoyatv",TBSチャンネル:null,TBS:"#tbs",MBS:"#mbs",CBC:"#cbc",テレビ東京:"#tvtokyo",テレ東:"#tvtokyo",テレビ大阪:"#tvo",テレビ愛知:"#tva",フジテレビ:"#fujitv",関西テレビ:"#kantele",東海テレビ:"#tokaitv","TOKYO MX":"#tokyomx",tvk:"#tvk",チバテレ:"#chibatv",テレ玉:"#teletama",群馬テレビ:"#gtv",とちぎテレビ:"#tochitere",とちテレ:"#tochitere",サンテレビ:"#suntv",KBS京都:"#kbs",NHKBS1:"#nhkbs1",NHKBSプレミアム:"#nhkbsp",NHKBS:"#nhkbs",BS日テレ:"#bsntv",BS朝日:"#bsasahi","BS-TBS":"#bstbs",BSテレ東:"#bstvtokyo",BSフジ:"#bsfuji",BS11:"#bs11",BS12:"#bs12",BS松竹東急:"#bs260ch",BSJapanext:"#bsjapanext",BSよしもと:"#bsyoshimoto","AT-X":"#at_x"},s=Object.keys(e).find(l=>t.startsWith(l));return s?e[s]:null}}const b={id:"NID0-SID0-EID0",channel_id:"NID0-SID0",network_id:0,service_id:0,event_id:0,title:"取得中…",description:"取得中…",detail:{},start_time:"2000-01-01T00:00:00+09:00",end_time:"2000-01-01T00:00:00+09:00",duration:0,is_free:!0,genres:[],video_type:"映像1080i(1125i)、アスペクト比16:9 パンベクトルなし",video_codec:"MPEG-2",video_resolution:"1080i",primary_audio_type:"2/0モード(ステレオ)",primary_audio_language:"日本語",primary_audio_sampling_rate:"48kHz",secondary_audio_type:null,secondary_audio_language:null,secondary_audio_sampling_rate:null},p={id:"NID0-SID0",display_channel_id:"gr000",network_id:0,service_id:0,transport_stream_id:null,remocon_id:0,channel_number:"---",type:"GR",name:"取得中…",jikkyo_force:null,is_subchannel:!1,is_radiochannel:!1,is_watchable:!0,is_display:!0,viewer_count:0,program_present:b,program_following:b};class B{static async fetchAll(){const t=await u.get("/channels");return t.type==="error"?(u.showGenericError(t,"チャンネル情報を取得できませんでした。"),null):t.data}static async fetch(t){const e=await u.get(`/channels/${t}`);return e.type==="error"?(u.showGenericError(e,"チャンネル情報を取得できませんでした。"),null):e.data}static async fetchJikkyoSession(t){const e=await u.get(`/channels/${t}/jikkyo`);return e.type==="error"?(u.showGenericError(e,"ニコニコ実況のセッション情報を取得できませんでした。"),null):e.data}}const m=v("channels",{state:()=>({channels_list:{GR:[],BS:[],CS:[],CATV:[],SKY:[],STARDIGIO:[]},is_channels_list_initial_updated:!1,last_updated_at:0,display_channel_id:"gr000",viewer_count:null,current_program_present:null,current_program_following:null}),getters:{channel(){if(this.is_channels_list_initial_updated===!1)return{previous:p,current:p,next:p};const n={...b,title:"チャンネル情報取得エラー",description:"このチャンネル ID のチャンネル情報は存在しません。"},t={...p,name:"チャンネル情報取得エラー",program_present:n,program_following:n},e=S.getChannelType(this.display_channel_id);if(e===null)return{previous:t,current:t,next:t};const s=this.channels_list[e],l=s.findIndex(i=>i.display_channel_id===this.display_channel_id);if(l===-1)return{previous:t,current:t,next:t};const _=(()=>{let i=l-1;for(;s.length;){if(i<=-1&&(i=s.length-1),s[i].is_display)return i;i--}return 0})(),h=(()=>{let i=l+1;for(;s.length;){if(i>=s.length&&(i=0),s[i].is_display)return i;i++}return 0})(),o=structuredClone(s[l]);return this.current_program_present!==null&&(o.program_present=this.current_program_present),this.current_program_following!==null&&(o.program_following=this.current_program_following),this.viewer_count!==null&&(o.viewer_count=this.viewer_count),{previous:s[_],current:o,next:s[h]}},channels_list_with_pinned(){var s,l,_,h,o,i,g;const n=k(),t=new Map;if(t.set("ピン留め",[]),t.set("地デジ",[]),this.is_channels_list_initial_updated===!1)return t;t.set("BS",[]),t.set("CS",[]),t.set("CATV",[]),t.set("SKY",[]),t.set("StarDigio",[]),n.settings.pinned_channel_ids=n.settings.pinned_channel_ids.map(a=>{if(a.includes("NID")&&a.includes("SID"))return a;{const c=S.getChannelType(a);if(c===null)return"NID0-SID0";const d=this.channels_list[c].find(y=>y.display_channel_id===a)??null;return d===null?"NID0-SID0":d.id}}).filter(a=>a!=="NID0-SID0");const e=[];for(const[a,c]of Object.entries(this.channels_list))for(const r of c)if(n.settings.pinned_channel_ids.includes(r.id)&&e.push(r),r.is_display!==!1)switch(r.type){case"GR":{(s=t.get("地デジ"))==null||s.push(r);break}case"BS":{(l=t.get("BS"))==null||l.push(r);break}case"CS":{(_=t.get("CS"))==null||_.push(r);break}case"CATV":{(h=t.get("CATV"))==null||h.push(r);break}case"SKY":{(o=t.get("SKY"))==null||o.push(r);break}case"STARDIGIO":{(i=t.get("StarDigio"))==null||i.push(r);break}}n.settings.pinned_channel_ids=n.settings.pinned_channel_ids.filter(a=>e.some(c=>c.id===a)),(g=t.get("ピン留め"))==null||g.push(...e.sort((a,c)=>{const r=n.settings.pinned_channel_ids.indexOf(a.id),d=n.settings.pinned_channel_ids.indexOf(c.id);return r-d}));for(const[a,c]of t)a!=="ピン留め"&&c.length===0&&t.delete(a);return t.size===1&&t.has("ピン留め")&&t.delete("ピン留め"),t},channels_list_with_pinned_for_watch(){var t;const n=new Map([...this.channels_list_with_pinned]);return this.is_channels_list_initial_updated===!1||((t=n.get("ピン留め"))==null?void 0:t.length)===0&&n.delete("ピン留め"),n}},actions:{getChannelByRemoconID(n,t){return this.channels_list[n].find(l=>l.remocon_id===t)??null},async update(n=!1){const t=async()=>{const e=await B.fetchAll();e!==null&&(this.channels_list=f.deepObjectFreeze(e),this.is_channels_list_initial_updated===!1&&(this.is_channels_list_initial_updated=!0),this.last_updated_at=f.time())};if(this.is_channels_list_initial_updated===!0&&n===!1){f.time()-this.last_updated_at>60&&t();return}await t()}}}),T=m;export{S as C,B as a,T as u}; diff --git a/client/dist/assets/CommentMuteSettings-aK-5x8By.js b/client/dist/assets/CommentMuteSettings-B8qrNY4M.js similarity index 97% rename from client/dist/assets/CommentMuteSettings-aK-5x8By.js rename to client/dist/assets/CommentMuteSettings-B8qrNY4M.js index 1200d31f..3fafd232 100644 --- a/client/dist/assets/CommentMuteSettings-aK-5x8By.js +++ b/client/dist/assets/CommentMuteSettings-B8qrNY4M.js @@ -1 +1 @@ -import{d as F,m as A,u as f,_ as v,r as b,o as l,j as D,h as r,b as t,w as g,c as _,e as u,V as C,g as h,F as E,R as B,p as w,q as V,k as n}from"./index-D2zR81a8.js";import{V as y}from"./VDialog-BE2JXbX2.js";import{V as S,a as k}from"./VCard-C5ODUzfZ.js";import{V as U}from"./ssrBoot-BvljY2yG.js";import{V as c}from"./VSwitch-BiucEdzW.js";import{b as p}from"./VTextField-DymZQzkG.js";import{c as $}from"./VSelect-BuCCGZYb.js";const I=F({name:"CommentMuteSettings",props:{modelValue:{type:Boolean,required:!0}},emits:{"update:modelValue":e=>!0},data(){return{comment_mute_settings_modal:!1,muted_comment_keyword_match_type:[{title:"部分一致",value:"partial"},{title:"前方一致",value:"forward"},{title:"後方一致",value:"backward"},{title:"完全一致",value:"exact"},{title:"正規表現",value:"regex"}]}},computed:{...A(f)},watch:{modelValue(){this.comment_mute_settings_modal=this.modelValue},comment_mute_settings_modal(){this.$emit("update:modelValue",this.comment_mute_settings_modal)}}}),o=e=>(w("data-v-0638398d"),e=e(),V(),e),M=o(()=>u("span",{class:"ml-3"},"コメントのミュート設定",-1)),Z={class:"px-5 pb-6"},x={class:"text-subtitle-1 d-flex align-center font-weight-bold mt-4"},j=o(()=>u("span",{class:"ml-2"},"クイック設定",-1)),z={class:"settings__item settings__item--switch"},H=o(()=>u("label",{class:"settings__item-heading",for:"mute_vulgar_comments"}," 露骨な表現を含むコメントをミュートする ",-1)),L=o(()=>u("label",{class:"settings__item-label",for:"mute_vulgar_comments"},[n(" 性的な単語などの露骨・下品な表現を含むコメントを、一括でミュートするかを設定します。"),u("br")],-1)),N={class:"settings__item settings__item--switch"},T=o(()=>u("label",{class:"settings__item-heading",for:"mute_abusive_discriminatory_prejudiced_comments"}," ネガティブな表現、差別的な表現、政治的に偏った表現を含むコメントをミュートする ",-1)),q=o(()=>u("label",{class:"settings__item-label",for:"mute_abusive_discriminatory_prejudiced_comments"},[n(" 『死ね』『殺す』などのネガティブな表現、特定の国や人々への差別的な表現、政治的に偏った表現を含むコメントを、一括でミュートするかを設定します。"),u("br")],-1)),O={class:"settings__item settings__item--switch"},R=o(()=>u("label",{class:"settings__item-heading",for:"mute_big_size_comments"}," 文字サイズが大きいコメントをミュートする ",-1)),G=o(()=>u("label",{class:"settings__item-label",for:"mute_big_size_comments"},[n(" 通常より大きい文字サイズで表示されるコメントを、一括でミュートするかを設定します。"),u("br"),n(" 文字サイズが大きいコメントには迷惑なコメントが多いです。基本的にはオンにしておくのがおすすめです。"),u("br")],-1)),J={class:"settings__item settings__item--switch"},K=o(()=>u("label",{class:"settings__item-heading",for:"mute_fixed_comments"}," 映像の上下に固定表示されるコメントをミュートする ",-1)),P=o(()=>u("label",{class:"settings__item-label",for:"mute_fixed_comments"},[n(" 映像の上下に固定された状態で表示されるコメントを、一括でミュートするかを設定します。"),u("br"),n(" 固定表示されるコメントが煩わしい方におすすめです。"),u("br")],-1)),Q={class:"settings__item settings__item--switch"},W=o(()=>u("label",{class:"settings__item-heading",for:"mute_colored_comments"}," 色付きのコメントをミュートする ",-1)),X=o(()=>u("label",{class:"settings__item-label",for:"mute_colored_comments"},[n(" 白以外の色で表示される色付きのコメントを、一括でミュートするかを設定します。"),u("br"),n(" この設定をオンにしておくと、目立つ色のコメントを一掃できます。"),u("br")],-1)),Y={class:"settings__item settings__item--switch"},uu=o(()=>u("label",{class:"settings__item-heading",for:"mute_consecutive_same_characters_comments"}," 8文字以上同じ文字が連続しているコメントをミュートする ",-1)),eu=o(()=>u("label",{class:"settings__item-label",for:"mute_consecutive_same_characters_comments"},[n(" 『wwwwwwwwwww』『あばばばばばばばばば』など、8文字以上同じ文字が連続しているコメントを、一括でミュートするかを設定します。"),u("br"),n(" しばしばあるテンプレコメントが煩わしい方におすすめです。"),u("br")],-1)),tu={class:"text-subtitle-1 d-flex align-center font-weight-bold mt-4"},su=o(()=>u("span",{class:"ml-2 mr-2"},"ミュート済みのキーワード",-1)),iu=o(()=>u("span",{class:"ml-1"},"追加",-1)),ou={class:"muted-comment-items"},nu=["onClick"],mu=o(()=>u("svg",{class:"iconify iconify--fluent",width:"20px",height:"20px",viewBox:"0 0 16 16"},[u("path",{fill:"currentColor",d:"M7 3h2a1 1 0 0 0-2 0ZM6 3a2 2 0 1 1 4 0h4a.5.5 0 0 1 0 1h-.564l-1.205 8.838A2.5 2.5 0 0 1 9.754 15H6.246a2.5 2.5 0 0 1-2.477-2.162L2.564 4H2a.5.5 0 0 1 0-1h4Zm1 3.5a.5.5 0 0 0-1 0v5a.5.5 0 0 0 1 0v-5ZM9.5 6a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 1 0v-5a.5.5 0 0 0-.5-.5Z"})],-1)),lu=[mu],au={class:"text-subtitle-1 d-flex align-center font-weight-bold mt-4"},du=o(()=>u("span",{class:"ml-2 mr-2"},"ミュート済みのニコニコユーザー ID",-1)),_u=o(()=>u("span",{class:"ml-1"},"追加",-1)),cu={class:"muted-comment-items"},ru=["onClick"],gu=o(()=>u("svg",{class:"iconify iconify--fluent",width:"20px",height:"20px",viewBox:"0 0 16 16"},[u("path",{fill:"currentColor",d:"M7 3h2a1 1 0 0 0-2 0ZM6 3a2 2 0 1 1 4 0h4a.5.5 0 0 1 0 1h-.564l-1.205 8.838A2.5 2.5 0 0 1 9.754 15H6.246a2.5 2.5 0 0 1-2.477-2.162L2.564 4H2a.5.5 0 0 1 0-1h4Zm1 3.5a.5.5 0 0 0-1 0v5a.5.5 0 0 0 1 0v-5ZM9.5 6a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 1 0v-5a.5.5 0 0 0-.5-.5Z"})],-1)),Bu=[gu];function Cu(e,s,hu,Eu,pu,Fu){const a=b("Icon");return l(),D(y,{"max-width":"770",transition:"slide-y-transition",modelValue:e.comment_mute_settings_modal,"onUpdate:modelValue":s[9]||(s[9]=i=>e.comment_mute_settings_modal=i)},{default:r(()=>[t(k,{class:"comment-mute-settings"},{default:r(()=>[t(S,{class:"px-5 pt-6 pb-3 d-flex align-center font-weight-bold",style:{height:"60px"}},{default:r(()=>[t(a,{icon:"heroicons-solid:filter",height:"26px"}),M,t(U),g((l(),_("div",{class:"d-flex align-center rounded-circle cursor-pointer px-2 py-2",onClick:s[0]||(s[0]=i=>e.comment_mute_settings_modal=!1)},[t(a,{icon:"fluent:dismiss-12-filled",width:"23px",height:"23px"})])),[[B]])]),_:1}),u("div",Z,[u("div",x,[t(a,{icon:"fa-solid:sliders-h",width:"24px",height:"20px"}),j]),u("div",z,[H,L,t(c,{class:"settings__item-switch",color:"primary",id:"mute_vulgar_comments","hide-details":"",modelValue:e.settingsStore.settings.mute_vulgar_comments,"onUpdate:modelValue":s[1]||(s[1]=i=>e.settingsStore.settings.mute_vulgar_comments=i)},null,8,["modelValue"])]),u("div",N,[T,q,t(c,{class:"settings__item-switch",color:"primary",id:"mute_abusive_discriminatory_prejudiced_comments","hide-details":"",modelValue:e.settingsStore.settings.mute_abusive_discriminatory_prejudiced_comments,"onUpdate:modelValue":s[2]||(s[2]=i=>e.settingsStore.settings.mute_abusive_discriminatory_prejudiced_comments=i)},null,8,["modelValue"])]),u("div",O,[R,G,t(c,{class:"settings__item-switch",color:"primary",id:"mute_big_size_comments","hide-details":"",modelValue:e.settingsStore.settings.mute_big_size_comments,"onUpdate:modelValue":s[3]||(s[3]=i=>e.settingsStore.settings.mute_big_size_comments=i)},null,8,["modelValue"])]),u("div",J,[K,P,t(c,{class:"settings__item-switch",color:"primary",id:"mute_fixed_comments","hide-details":"",modelValue:e.settingsStore.settings.mute_fixed_comments,"onUpdate:modelValue":s[4]||(s[4]=i=>e.settingsStore.settings.mute_fixed_comments=i)},null,8,["modelValue"])]),u("div",Q,[W,X,t(c,{class:"settings__item-switch",color:"primary",id:"mute_colored_comments","hide-details":"",modelValue:e.settingsStore.settings.mute_colored_comments,"onUpdate:modelValue":s[5]||(s[5]=i=>e.settingsStore.settings.mute_colored_comments=i)},null,8,["modelValue"])]),u("div",Y,[uu,eu,t(c,{class:"settings__item-switch",color:"primary",id:"mute_consecutive_same_characters_comments","hide-details":"",modelValue:e.settingsStore.settings.mute_consecutive_same_characters_comments,"onUpdate:modelValue":s[6]||(s[6]=i=>e.settingsStore.settings.mute_consecutive_same_characters_comments=i)},null,8,["modelValue"])]),u("div",tu,[t(a,{icon:"fluent:comment-dismiss-20-filled",width:"24px"}),su,t(C,{class:"ml-auto",color:"background-lighten-1",variant:"flat",onClick:s[7]||(s[7]=i=>e.settingsStore.settings.muted_comment_keywords.unshift({match:"partial",pattern:""}))},{default:r(()=>[t(a,{icon:"fluent:add-12-filled",height:"17px"}),iu]),_:1})]),u("div",ou,[(l(!0),_(E,null,h(e.settingsStore.settings.muted_comment_keywords,(i,m)=>(l(),_("div",{class:"muted-comment-item",key:m},[t(p,{type:"search",class:"muted-comment-item__input",color:"primary",density:"compact",variant:"outlined","hide-details":"",placeholder:"ミュートするキーワードを入力",modelValue:e.settingsStore.settings.muted_comment_keywords[m].pattern,"onUpdate:modelValue":d=>e.settingsStore.settings.muted_comment_keywords[m].pattern=d},null,8,["modelValue","onUpdate:modelValue"]),t($,{class:"muted-comment-item__match-type",color:"primary",density:"compact",variant:"outlined","hide-details":"",items:e.muted_comment_keyword_match_type,modelValue:e.settingsStore.settings.muted_comment_keywords[m].match,"onUpdate:modelValue":d=>e.settingsStore.settings.muted_comment_keywords[m].match=d},null,8,["items","modelValue","onUpdate:modelValue"]),g((l(),_("button",{class:"muted-comment-item__delete-button",onClick:d=>e.settingsStore.settings.muted_comment_keywords.splice(e.settingsStore.settings.muted_comment_keywords.indexOf(i),1)},lu,8,nu)),[[B]])]))),128))]),u("div",au,[t(a,{icon:"fluent:person-prohibited-20-filled",width:"24px"}),du,t(C,{class:"ml-auto",color:"background-lighten-1",variant:"flat",onClick:s[8]||(s[8]=i=>e.settingsStore.settings.muted_niconico_user_ids.unshift(""))},{default:r(()=>[t(a,{icon:"fluent:add-12-filled",height:"17px"}),_u]),_:1})]),u("div",cu,[(l(!0),_(E,null,h(e.settingsStore.settings.muted_niconico_user_ids,(i,m)=>(l(),_("div",{class:"muted-comment-item",key:m},[t(p,{type:"search",class:"muted-comment-item__input",color:"primary",density:"compact",variant:"outlined","hide-details":"",placeholder:"ミュートするニコニコユーザー ID を入力",modelValue:e.settingsStore.settings.muted_niconico_user_ids[m],"onUpdate:modelValue":d=>e.settingsStore.settings.muted_niconico_user_ids[m]=d},null,8,["modelValue","onUpdate:modelValue"]),g((l(),_("button",{class:"muted-comment-item__delete-button",onClick:d=>e.settingsStore.settings.muted_niconico_user_ids.splice(e.settingsStore.settings.muted_niconico_user_ids.indexOf(i),1)},Bu,8,ru)),[[B]])]))),128))])])]),_:1})]),_:1},8,["modelValue"])}const yu=v(I,[["render",Cu],["__scopeId","data-v-0638398d"]]);export{yu as C}; +import{d as F,m as A,u as f,_ as v,r as b,o as l,j as D,h as r,b as t,w as g,c as _,e as u,V as C,g as h,F as E,R as B,p as w,q as V,k as n}from"./index-Dbi6R656.js";import{V as y}from"./VDialog-B1HdJyP2.js";import{V as S,a as k}from"./VCard-BBvTbBT9.js";import{V as U}from"./ssrBoot-sWDXISB3.js";import{V as c}from"./VSwitch-Cf-jClsc.js";import{b as p}from"./VTextField-DTBkpwFs.js";import{c as $}from"./VSelect-dbg9h4rI.js";const I=F({name:"CommentMuteSettings",props:{modelValue:{type:Boolean,required:!0}},emits:{"update:modelValue":e=>!0},data(){return{comment_mute_settings_modal:!1,muted_comment_keyword_match_type:[{title:"部分一致",value:"partial"},{title:"前方一致",value:"forward"},{title:"後方一致",value:"backward"},{title:"完全一致",value:"exact"},{title:"正規表現",value:"regex"}]}},computed:{...A(f)},watch:{modelValue(){this.comment_mute_settings_modal=this.modelValue},comment_mute_settings_modal(){this.$emit("update:modelValue",this.comment_mute_settings_modal)}}}),o=e=>(w("data-v-0638398d"),e=e(),V(),e),M=o(()=>u("span",{class:"ml-3"},"コメントのミュート設定",-1)),Z={class:"px-5 pb-6"},x={class:"text-subtitle-1 d-flex align-center font-weight-bold mt-4"},j=o(()=>u("span",{class:"ml-2"},"クイック設定",-1)),z={class:"settings__item settings__item--switch"},H=o(()=>u("label",{class:"settings__item-heading",for:"mute_vulgar_comments"}," 露骨な表現を含むコメントをミュートする ",-1)),L=o(()=>u("label",{class:"settings__item-label",for:"mute_vulgar_comments"},[n(" 性的な単語などの露骨・下品な表現を含むコメントを、一括でミュートするかを設定します。"),u("br")],-1)),N={class:"settings__item settings__item--switch"},T=o(()=>u("label",{class:"settings__item-heading",for:"mute_abusive_discriminatory_prejudiced_comments"}," ネガティブな表現、差別的な表現、政治的に偏った表現を含むコメントをミュートする ",-1)),q=o(()=>u("label",{class:"settings__item-label",for:"mute_abusive_discriminatory_prejudiced_comments"},[n(" 『死ね』『殺す』などのネガティブな表現、特定の国や人々への差別的な表現、政治的に偏った表現を含むコメントを、一括でミュートするかを設定します。"),u("br")],-1)),O={class:"settings__item settings__item--switch"},R=o(()=>u("label",{class:"settings__item-heading",for:"mute_big_size_comments"}," 文字サイズが大きいコメントをミュートする ",-1)),G=o(()=>u("label",{class:"settings__item-label",for:"mute_big_size_comments"},[n(" 通常より大きい文字サイズで表示されるコメントを、一括でミュートするかを設定します。"),u("br"),n(" 文字サイズが大きいコメントには迷惑なコメントが多いです。基本的にはオンにしておくのがおすすめです。"),u("br")],-1)),J={class:"settings__item settings__item--switch"},K=o(()=>u("label",{class:"settings__item-heading",for:"mute_fixed_comments"}," 映像の上下に固定表示されるコメントをミュートする ",-1)),P=o(()=>u("label",{class:"settings__item-label",for:"mute_fixed_comments"},[n(" 映像の上下に固定された状態で表示されるコメントを、一括でミュートするかを設定します。"),u("br"),n(" 固定表示されるコメントが煩わしい方におすすめです。"),u("br")],-1)),Q={class:"settings__item settings__item--switch"},W=o(()=>u("label",{class:"settings__item-heading",for:"mute_colored_comments"}," 色付きのコメントをミュートする ",-1)),X=o(()=>u("label",{class:"settings__item-label",for:"mute_colored_comments"},[n(" 白以外の色で表示される色付きのコメントを、一括でミュートするかを設定します。"),u("br"),n(" この設定をオンにしておくと、目立つ色のコメントを一掃できます。"),u("br")],-1)),Y={class:"settings__item settings__item--switch"},uu=o(()=>u("label",{class:"settings__item-heading",for:"mute_consecutive_same_characters_comments"}," 8文字以上同じ文字が連続しているコメントをミュートする ",-1)),eu=o(()=>u("label",{class:"settings__item-label",for:"mute_consecutive_same_characters_comments"},[n(" 『wwwwwwwwwww』『あばばばばばばばばば』など、8文字以上同じ文字が連続しているコメントを、一括でミュートするかを設定します。"),u("br"),n(" しばしばあるテンプレコメントが煩わしい方におすすめです。"),u("br")],-1)),tu={class:"text-subtitle-1 d-flex align-center font-weight-bold mt-4"},su=o(()=>u("span",{class:"ml-2 mr-2"},"ミュート済みのキーワード",-1)),iu=o(()=>u("span",{class:"ml-1"},"追加",-1)),ou={class:"muted-comment-items"},nu=["onClick"],mu=o(()=>u("svg",{class:"iconify iconify--fluent",width:"20px",height:"20px",viewBox:"0 0 16 16"},[u("path",{fill:"currentColor",d:"M7 3h2a1 1 0 0 0-2 0ZM6 3a2 2 0 1 1 4 0h4a.5.5 0 0 1 0 1h-.564l-1.205 8.838A2.5 2.5 0 0 1 9.754 15H6.246a2.5 2.5 0 0 1-2.477-2.162L2.564 4H2a.5.5 0 0 1 0-1h4Zm1 3.5a.5.5 0 0 0-1 0v5a.5.5 0 0 0 1 0v-5ZM9.5 6a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 1 0v-5a.5.5 0 0 0-.5-.5Z"})],-1)),lu=[mu],au={class:"text-subtitle-1 d-flex align-center font-weight-bold mt-4"},du=o(()=>u("span",{class:"ml-2 mr-2"},"ミュート済みのニコニコユーザー ID",-1)),_u=o(()=>u("span",{class:"ml-1"},"追加",-1)),cu={class:"muted-comment-items"},ru=["onClick"],gu=o(()=>u("svg",{class:"iconify iconify--fluent",width:"20px",height:"20px",viewBox:"0 0 16 16"},[u("path",{fill:"currentColor",d:"M7 3h2a1 1 0 0 0-2 0ZM6 3a2 2 0 1 1 4 0h4a.5.5 0 0 1 0 1h-.564l-1.205 8.838A2.5 2.5 0 0 1 9.754 15H6.246a2.5 2.5 0 0 1-2.477-2.162L2.564 4H2a.5.5 0 0 1 0-1h4Zm1 3.5a.5.5 0 0 0-1 0v5a.5.5 0 0 0 1 0v-5ZM9.5 6a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 1 0v-5a.5.5 0 0 0-.5-.5Z"})],-1)),Bu=[gu];function Cu(e,s,hu,Eu,pu,Fu){const a=b("Icon");return l(),D(y,{"max-width":"770",transition:"slide-y-transition",modelValue:e.comment_mute_settings_modal,"onUpdate:modelValue":s[9]||(s[9]=i=>e.comment_mute_settings_modal=i)},{default:r(()=>[t(k,{class:"comment-mute-settings"},{default:r(()=>[t(S,{class:"px-5 pt-6 pb-3 d-flex align-center font-weight-bold",style:{height:"60px"}},{default:r(()=>[t(a,{icon:"heroicons-solid:filter",height:"26px"}),M,t(U),g((l(),_("div",{class:"d-flex align-center rounded-circle cursor-pointer px-2 py-2",onClick:s[0]||(s[0]=i=>e.comment_mute_settings_modal=!1)},[t(a,{icon:"fluent:dismiss-12-filled",width:"23px",height:"23px"})])),[[B]])]),_:1}),u("div",Z,[u("div",x,[t(a,{icon:"fa-solid:sliders-h",width:"24px",height:"20px"}),j]),u("div",z,[H,L,t(c,{class:"settings__item-switch",color:"primary",id:"mute_vulgar_comments","hide-details":"",modelValue:e.settingsStore.settings.mute_vulgar_comments,"onUpdate:modelValue":s[1]||(s[1]=i=>e.settingsStore.settings.mute_vulgar_comments=i)},null,8,["modelValue"])]),u("div",N,[T,q,t(c,{class:"settings__item-switch",color:"primary",id:"mute_abusive_discriminatory_prejudiced_comments","hide-details":"",modelValue:e.settingsStore.settings.mute_abusive_discriminatory_prejudiced_comments,"onUpdate:modelValue":s[2]||(s[2]=i=>e.settingsStore.settings.mute_abusive_discriminatory_prejudiced_comments=i)},null,8,["modelValue"])]),u("div",O,[R,G,t(c,{class:"settings__item-switch",color:"primary",id:"mute_big_size_comments","hide-details":"",modelValue:e.settingsStore.settings.mute_big_size_comments,"onUpdate:modelValue":s[3]||(s[3]=i=>e.settingsStore.settings.mute_big_size_comments=i)},null,8,["modelValue"])]),u("div",J,[K,P,t(c,{class:"settings__item-switch",color:"primary",id:"mute_fixed_comments","hide-details":"",modelValue:e.settingsStore.settings.mute_fixed_comments,"onUpdate:modelValue":s[4]||(s[4]=i=>e.settingsStore.settings.mute_fixed_comments=i)},null,8,["modelValue"])]),u("div",Q,[W,X,t(c,{class:"settings__item-switch",color:"primary",id:"mute_colored_comments","hide-details":"",modelValue:e.settingsStore.settings.mute_colored_comments,"onUpdate:modelValue":s[5]||(s[5]=i=>e.settingsStore.settings.mute_colored_comments=i)},null,8,["modelValue"])]),u("div",Y,[uu,eu,t(c,{class:"settings__item-switch",color:"primary",id:"mute_consecutive_same_characters_comments","hide-details":"",modelValue:e.settingsStore.settings.mute_consecutive_same_characters_comments,"onUpdate:modelValue":s[6]||(s[6]=i=>e.settingsStore.settings.mute_consecutive_same_characters_comments=i)},null,8,["modelValue"])]),u("div",tu,[t(a,{icon:"fluent:comment-dismiss-20-filled",width:"24px"}),su,t(C,{class:"ml-auto",color:"background-lighten-1",variant:"flat",onClick:s[7]||(s[7]=i=>e.settingsStore.settings.muted_comment_keywords.unshift({match:"partial",pattern:""}))},{default:r(()=>[t(a,{icon:"fluent:add-12-filled",height:"17px"}),iu]),_:1})]),u("div",ou,[(l(!0),_(E,null,h(e.settingsStore.settings.muted_comment_keywords,(i,m)=>(l(),_("div",{class:"muted-comment-item",key:m},[t(p,{type:"search",class:"muted-comment-item__input",color:"primary",density:"compact",variant:"outlined","hide-details":"",placeholder:"ミュートするキーワードを入力",modelValue:e.settingsStore.settings.muted_comment_keywords[m].pattern,"onUpdate:modelValue":d=>e.settingsStore.settings.muted_comment_keywords[m].pattern=d},null,8,["modelValue","onUpdate:modelValue"]),t($,{class:"muted-comment-item__match-type",color:"primary",density:"compact",variant:"outlined","hide-details":"",items:e.muted_comment_keyword_match_type,modelValue:e.settingsStore.settings.muted_comment_keywords[m].match,"onUpdate:modelValue":d=>e.settingsStore.settings.muted_comment_keywords[m].match=d},null,8,["items","modelValue","onUpdate:modelValue"]),g((l(),_("button",{class:"muted-comment-item__delete-button",onClick:d=>e.settingsStore.settings.muted_comment_keywords.splice(e.settingsStore.settings.muted_comment_keywords.indexOf(i),1)},lu,8,nu)),[[B]])]))),128))]),u("div",au,[t(a,{icon:"fluent:person-prohibited-20-filled",width:"24px"}),du,t(C,{class:"ml-auto",color:"background-lighten-1",variant:"flat",onClick:s[8]||(s[8]=i=>e.settingsStore.settings.muted_niconico_user_ids.unshift(""))},{default:r(()=>[t(a,{icon:"fluent:add-12-filled",height:"17px"}),_u]),_:1})]),u("div",cu,[(l(!0),_(E,null,h(e.settingsStore.settings.muted_niconico_user_ids,(i,m)=>(l(),_("div",{class:"muted-comment-item",key:m},[t(p,{type:"search",class:"muted-comment-item__input",color:"primary",density:"compact",variant:"outlined","hide-details":"",placeholder:"ミュートするニコニコユーザー ID を入力",modelValue:e.settingsStore.settings.muted_niconico_user_ids[m],"onUpdate:modelValue":d=>e.settingsStore.settings.muted_niconico_user_ids[m]=d},null,8,["modelValue","onUpdate:modelValue"]),g((l(),_("button",{class:"muted-comment-item__delete-button",onClick:d=>e.settingsStore.settings.muted_niconico_user_ids.splice(e.settingsStore.settings.muted_niconico_user_ids.indexOf(i),1)},Bu,8,ru)),[[B]])]))),128))])])]),_:1})]),_:1},8,["modelValue"])}const yu=v(I,[["render",Cu],["__scopeId","data-v-0638398d"]]);export{yu as C}; diff --git a/client/dist/assets/DataBroadcasting-2V44xfhw.js b/client/dist/assets/DataBroadcasting-jA1j5Sob.js similarity index 97% rename from client/dist/assets/DataBroadcasting-2V44xfhw.js rename to client/dist/assets/DataBroadcasting-jA1j5Sob.js index 80dc007b..23a151c0 100644 --- a/client/dist/assets/DataBroadcasting-2V44xfhw.js +++ b/client/dist/assets/DataBroadcasting-jA1j5Sob.js @@ -1 +1 @@ -import{d as m,U as g,m as E,M as A,u as v,_ as p,r as c,o as F,j as D,h as C,e as u,w as f,c as h,b as i,l as w,k as a,V as S,R as V}from"./index-D2zR81a8.js";import{S as z}from"./Base-DG5Aczxr.js";import{V as B}from"./VSwitch-BiucEdzW.js";import{V as y,b as $}from"./VTextField-DymZQzkG.js";import{c as I}from"./VSelect-BuCCGZYb.js";import"./Navigation-CsJWaG4R.js";import"./ssrBoot-BvljY2yG.js";import"./VAvatar-CTvU0rd-.js";const o="KonomiTV-BMLBrowser_nvram_prefix=receiverinfo%2F",k=m({name:"Settings-DataBroadcasting",components:{SettingsBase:z},data(){return{is_form_dense:g.isSmartphoneHorizontal(),data_broadcasting_zip_code:"",data_broadcasting_zip_code_validation:t=>t===""?!0:t.match(/^[0-9]{3}-[0-9]{4}$/)===null?"郵便番号は「000-0000」の形式で入力してください。":!0,data_broadcasting_prefecture:"255-0b0",data_broadcasting_prefectures:[{title:"未設定",value:"255-0b0"},{title:"西北海道",value:"2-0b000101101011"},{title:"東北海道",value:"1-0b000101101011"},{title:"青森県",value:"3-0b010001100111"},{title:"岩手県",value:"4-0b010111010100"},{title:"宮城県",value:"5-0b011101011000"},{title:"秋田県",value:"6-0b101011000110"},{title:"山形県",value:"7-0b111001001100"},{title:"福島県",value:"8-0b000110101110"},{title:"茨城県",value:"9-0b110001101001"},{title:"栃木県",value:"10-0b111000111000"},{title:"群馬県",value:"11-0b100110001011"},{title:"埼玉県",value:"12-0b011001001011"},{title:"千葉県",value:"13-0b000111000111"},{title:"東京都 (島部を除く)",value:"14-0b101010101100"},{title:"東京都島部 (伊豆・小笠原諸島)",value:"49-0b101010101100"},{title:"神奈川県",value:"15-0b010101101100"},{title:"新潟県",value:"16-0b010011001110"},{title:"富山県",value:"17-0b010100111001"},{title:"石川県",value:"18-0b011010100110"},{title:"福井県",value:"19-0b100100101101"},{title:"山梨県",value:"20-0b110101001010"},{title:"長野県",value:"21-0b100111010010"},{title:"岐阜県",value:"22-0b101001100101"},{title:"静岡県",value:"23-0b101001011010"},{title:"愛知県",value:"24-0b100101100110"},{title:"三重県",value:"25-0b001011011100"},{title:"滋賀県",value:"26-0b110011100100"},{title:"京都府",value:"27-0b010110011010"},{title:"大阪府",value:"28-0b110010110010"},{title:"兵庫県",value:"29-0b011001110100"},{title:"奈良県",value:"30-0b101010010011"},{title:"和歌山県",value:"31-0b001110010110"},{title:"鳥取県",value:"32-0b110100100011"},{title:"島根県",value:"33-0b001100011011"},{title:"岡山県",value:"34-0b001010110101"},{title:"広島県",value:"35-0b101100110001"},{title:"山口県",value:"36-0b101110011000"},{title:"徳島県",value:"37-0b111001100010"},{title:"香川県",value:"38-0b100110110100"},{title:"愛媛県",value:"39-0b000110011101"},{title:"高知県",value:"40-0b001011100011"},{title:"福岡県",value:"41-0b011000101101"},{title:"佐賀県",value:"42-0b100101011001"},{title:"長崎県",value:"43-0b101000101011"},{title:"熊本県",value:"44-0b100010100111"},{title:"大分県",value:"45-0b110010001101"},{title:"宮崎県",value:"46-0b110100011100"},{title:"鹿児島県 (南西諸島を除く)",value:"47-0b110101000101"},{title:"鹿児島県島部 (南西諸島の鹿児島県域)",value:"50-0b110101000101"},{title:"沖縄県",value:"48-0b001101110010"}]}},computed:{...E(v)},watch:{async data_broadcasting_zip_code(t){if(this.data_broadcasting_zip_code_validation(t)===!0)if(t!==""){const e=window.btoa(t.replace("-",""));localStorage.setItem(`${o}zipcode`,e)}else localStorage.removeItem(`${o}zipcode`)},data_broadcasting_prefecture(t){if(t!=="255-0b0"){const e=t.split("-0b"),l=parseInt(e[0]),r=window.btoa(String.fromCharCode(l));localStorage.setItem(`${o}prefecture`,r);const n=parseInt(e[1],2),_=window.btoa(String.fromCharCode(n>>8,n&255));localStorage.setItem(`${o}regioncode`,_)}else localStorage.removeItem(`${o}prefecture`),localStorage.removeItem(`${o}regioncode`)}},created(){const t=localStorage.getItem(`${o}zipcode`);if(t)try{this.data_broadcasting_zip_code=window.atob(t),this.data_broadcasting_zip_code=this.data_broadcasting_zip_code.slice(0,3)+"-"+this.data_broadcasting_zip_code.slice(3)}catch{}const e=localStorage.getItem(`${o}prefecture`);if(e)try{const l=window.atob(e).charCodeAt(0);for(const r of this.data_broadcasting_prefectures)if(r.value.startsWith(`${l}-`)){this.data_broadcasting_prefecture=r.value;break}}catch{}},methods:{resetNVRAMSettings(){for(const t in localStorage)t.startsWith("KonomiTV-BMLBrowser_nvram_")&&localStorage.removeItem(t);this.data_broadcasting_zip_code="",this.data_broadcasting_prefecture="255-0b0",A.success("データ放送の保存データをリセットしました。")}}}),M={class:"settings__heading"},R=u("svg",{width:"27px",height:"27px",viewBox:"0 0 512 512"},[u("path",{fill:"currentColor",d:"M248.039 381.326L355.039 67.8258C367.539 28.3257 395.039 34.3258 406.539 34.3258C431.039 34.3258 453.376 61.3258 441.039 96.8258C362.639 322.426 343.539 375.326 340.539 384.826C338.486 391.326 342.039 391.326 345.539 391.326C377.039 391.326 386.539 418.326 386.539 435.326C386.539 458.826 371.539 477.326 350.039 477.326H214.539C179.039 477.326 85.8269 431.3 88.0387 335.826C91.0387 206.326 192.039 183.326 243.539 183.326H296.539L265.539 272.326H243.539C185.539 272.326 174.113 314.826 176.039 334.326C180.039 374.826 215.039 389.814 237.039 390.326C244.539 390.5 246.039 386.826 248.039 381.326Z"})],-1),L=u("span",{class:"ml-2"},"データ放送",-1),N={class:"settings__content"},U={class:"settings__item settings__item--switch settings__item--sync-disabled"},T=u("label",{class:"settings__item-heading",for:"tv_show_data_broadcasting"},"テレビをみるときにデータ放送機能を利用する",-1),H=u("label",{class:"settings__item-label",for:"tv_show_data_broadcasting"},[a(" データ放送画面自体のオン/オフは、視聴画面右側のパネルからリモコンを表示した上で、リモコンの d ボタンから切り替えられます。"),u("br")],-1),K=u("label",{class:"settings__item-label",for:"tv_show_data_broadcasting"},[a(" データ放送機能をオンにすると、視聴時の負荷が若干高くなります。データ放送を利用しない場合や、スペックの低い Android デバイスで動作が重い場合は、オフに設定してみてください。"),u("br")],-1),O={class:"settings__item settings__item--switch settings__item--sync-disabled"},W=u("label",{class:"settings__item-heading",for:"enable_internet_access_from_data_broadcasting"},"データ放送からのインターネットアクセスを有効にする",-1),j=u("label",{class:"settings__item-label",for:"enable_internet_access_from_data_broadcasting"},[a(" この設定をオンにすると、データ放送機能を利用する際に、データ放送からインターネットにアクセスできるようになります。"),u("br"),a(" たとえば紅白歌合戦の視聴者投票をはじめとした双方向番組に参加したり、ネット接続時限定のミニゲームが遊べるようになります。"),u("br")],-1),G=u("label",{class:"settings__item-label",for:"enable_internet_access_from_data_broadcasting"},[a(" その一方で、"),u("b",null,"データ放送からのインターネットアクセスが有効な場合、あなたの視聴データがテレビ局に送信されることがあります。"),u("br"),a(" 大半のチャンネルでは個別に視聴データの送信を無効化できますが、依然プライバシー上の問題が残ります。 通常はオフにしておき、双方向コンテンツを使うときだけオンにすることをおすすめします。"),u("br")],-1),P=u("label",{class:"settings__item-heading"},"お住まいの郵便番号",-1),X=u("label",{class:"settings__item-label"},[a(" ここで設定した郵便番号をもとに、データ放送の地域情報(ニュース・天気予報など)が表示されます。"),u("br"),a(" 設定しない場合、データ放送の一部のコンテンツが利用できないことがあります。"),u("br")],-1),Z={class:"settings__item settings__item--sync-disabled mt-2"},q=u("label",{class:"settings__item-heading"},"お住まいの都道府県",-1),x=u("label",{class:"settings__item-label"},[a(" ここで設定した都道府県をもとに、データ放送の地域情報(ニュース・天気予報など)が表示されます。"),u("br"),a(" 設定しない場合、データ放送の一部のコンテンツが利用できないことがあります。"),u("br")],-1),J=u("div",{class:"settings__item"},[u("div",{class:"settings__item-heading text-error-lighten-1"},"データ放送の保存データをリセット"),u("div",{class:"settings__item-label"},[a(" このデバイス(ブラウザ)に保存されているデータ放送の保存データを、初期状態にリセット (消去) できます。"),u("br"),a(" 保存データには、データ放送内のミニゲームの得点、プレゼント企画のスタンプ個数、設定などが含まれます。"),u("br"),u("strong",{class:"text-error-lighten-1"},"保存データをリセットすると、元に戻すことはできません。十分ご注意ください。"),u("br")])],-1);function Q(t,e,l,r,n,_){const d=c("Icon"),b=c("SettingsBase");return F(),D(b,null,{default:C(()=>[u("h2",M,[f((F(),h("a",{class:"settings__back-button",onClick:e[0]||(e[0]=s=>t.$router.back())},[i(d,{icon:"fluent:arrow-left-12-filled",width:"25px"})])),[[V]]),R,L]),u("div",N,[u("div",U,[T,H,K,i(B,{class:"settings__item-switch",color:"primary",id:"tv_show_data_broadcasting","hide-details":"",modelValue:t.settingsStore.settings.tv_show_data_broadcasting,"onUpdate:modelValue":e[1]||(e[1]=s=>t.settingsStore.settings.tv_show_data_broadcasting=s)},null,8,["modelValue"])]),u("div",O,[W,j,G,i(B,{class:"settings__item-switch",color:"primary",id:"enable_internet_access_from_data_broadcasting","hide-details":"",modelValue:t.settingsStore.settings.enable_internet_access_from_data_broadcasting,"onUpdate:modelValue":e[2]||(e[2]=s=>t.settingsStore.settings.enable_internet_access_from_data_broadcasting=s)},null,8,["modelValue"])]),i(y,{class:"mt-6"}),u("div",{class:"settings__item settings__item--sync-disabled",onSubmit:e[4]||(e[4]=w(()=>{},["prevent"]))},[P,X,i($,{class:"settings__item-form",color:"primary",variant:"outlined",placeholder:"郵便番号",density:t.is_form_dense?"compact":"default",rules:[t.data_broadcasting_zip_code_validation],modelValue:t.data_broadcasting_zip_code,"onUpdate:modelValue":e[3]||(e[3]=s=>t.data_broadcasting_zip_code=s)},null,8,["density","rules","modelValue"])],32),u("div",Z,[q,x,i(I,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",density:t.is_form_dense?"compact":"default",items:t.data_broadcasting_prefectures,modelValue:t.data_broadcasting_prefecture,"onUpdate:modelValue":e[5]||(e[5]=s=>t.data_broadcasting_prefecture=s)},null,8,["density","items","modelValue"])]),J,i(S,{class:"settings__save-button bg-error mt-5",variant:"flat",onClick:e[6]||(e[6]=s=>t.resetNVRAMSettings())},{default:C(()=>[i(d,{icon:"material-symbols:device-reset-rounded",class:"mr-2",height:"23px"}),a("保存データをリセット ")]),_:1})])]),_:1})}const l0=p(k,[["render",Q]]);export{l0 as default}; +import{d as m,U as g,m as E,M as A,u as v,_ as p,r as c,o as F,j as D,h as C,e as u,w as f,c as h,b as i,l as w,k as a,V as S,R as V}from"./index-Dbi6R656.js";import{S as z}from"./Base-D8WlXaKF.js";import{V as B}from"./VSwitch-Cf-jClsc.js";import{V as y,b as $}from"./VTextField-DTBkpwFs.js";import{c as I}from"./VSelect-dbg9h4rI.js";import"./Navigation-DZesdvbM.js";import"./ssrBoot-sWDXISB3.js";import"./VAvatar-BrXxzhAv.js";const o="KonomiTV-BMLBrowser_nvram_prefix=receiverinfo%2F",k=m({name:"Settings-DataBroadcasting",components:{SettingsBase:z},data(){return{is_form_dense:g.isSmartphoneHorizontal(),data_broadcasting_zip_code:"",data_broadcasting_zip_code_validation:t=>t===""?!0:t.match(/^[0-9]{3}-[0-9]{4}$/)===null?"郵便番号は「000-0000」の形式で入力してください。":!0,data_broadcasting_prefecture:"255-0b0",data_broadcasting_prefectures:[{title:"未設定",value:"255-0b0"},{title:"西北海道",value:"2-0b000101101011"},{title:"東北海道",value:"1-0b000101101011"},{title:"青森県",value:"3-0b010001100111"},{title:"岩手県",value:"4-0b010111010100"},{title:"宮城県",value:"5-0b011101011000"},{title:"秋田県",value:"6-0b101011000110"},{title:"山形県",value:"7-0b111001001100"},{title:"福島県",value:"8-0b000110101110"},{title:"茨城県",value:"9-0b110001101001"},{title:"栃木県",value:"10-0b111000111000"},{title:"群馬県",value:"11-0b100110001011"},{title:"埼玉県",value:"12-0b011001001011"},{title:"千葉県",value:"13-0b000111000111"},{title:"東京都 (島部を除く)",value:"14-0b101010101100"},{title:"東京都島部 (伊豆・小笠原諸島)",value:"49-0b101010101100"},{title:"神奈川県",value:"15-0b010101101100"},{title:"新潟県",value:"16-0b010011001110"},{title:"富山県",value:"17-0b010100111001"},{title:"石川県",value:"18-0b011010100110"},{title:"福井県",value:"19-0b100100101101"},{title:"山梨県",value:"20-0b110101001010"},{title:"長野県",value:"21-0b100111010010"},{title:"岐阜県",value:"22-0b101001100101"},{title:"静岡県",value:"23-0b101001011010"},{title:"愛知県",value:"24-0b100101100110"},{title:"三重県",value:"25-0b001011011100"},{title:"滋賀県",value:"26-0b110011100100"},{title:"京都府",value:"27-0b010110011010"},{title:"大阪府",value:"28-0b110010110010"},{title:"兵庫県",value:"29-0b011001110100"},{title:"奈良県",value:"30-0b101010010011"},{title:"和歌山県",value:"31-0b001110010110"},{title:"鳥取県",value:"32-0b110100100011"},{title:"島根県",value:"33-0b001100011011"},{title:"岡山県",value:"34-0b001010110101"},{title:"広島県",value:"35-0b101100110001"},{title:"山口県",value:"36-0b101110011000"},{title:"徳島県",value:"37-0b111001100010"},{title:"香川県",value:"38-0b100110110100"},{title:"愛媛県",value:"39-0b000110011101"},{title:"高知県",value:"40-0b001011100011"},{title:"福岡県",value:"41-0b011000101101"},{title:"佐賀県",value:"42-0b100101011001"},{title:"長崎県",value:"43-0b101000101011"},{title:"熊本県",value:"44-0b100010100111"},{title:"大分県",value:"45-0b110010001101"},{title:"宮崎県",value:"46-0b110100011100"},{title:"鹿児島県 (南西諸島を除く)",value:"47-0b110101000101"},{title:"鹿児島県島部 (南西諸島の鹿児島県域)",value:"50-0b110101000101"},{title:"沖縄県",value:"48-0b001101110010"}]}},computed:{...E(v)},watch:{async data_broadcasting_zip_code(t){if(this.data_broadcasting_zip_code_validation(t)===!0)if(t!==""){const e=window.btoa(t.replace("-",""));localStorage.setItem(`${o}zipcode`,e)}else localStorage.removeItem(`${o}zipcode`)},data_broadcasting_prefecture(t){if(t!=="255-0b0"){const e=t.split("-0b"),l=parseInt(e[0]),r=window.btoa(String.fromCharCode(l));localStorage.setItem(`${o}prefecture`,r);const n=parseInt(e[1],2),_=window.btoa(String.fromCharCode(n>>8,n&255));localStorage.setItem(`${o}regioncode`,_)}else localStorage.removeItem(`${o}prefecture`),localStorage.removeItem(`${o}regioncode`)}},created(){const t=localStorage.getItem(`${o}zipcode`);if(t)try{this.data_broadcasting_zip_code=window.atob(t),this.data_broadcasting_zip_code=this.data_broadcasting_zip_code.slice(0,3)+"-"+this.data_broadcasting_zip_code.slice(3)}catch{}const e=localStorage.getItem(`${o}prefecture`);if(e)try{const l=window.atob(e).charCodeAt(0);for(const r of this.data_broadcasting_prefectures)if(r.value.startsWith(`${l}-`)){this.data_broadcasting_prefecture=r.value;break}}catch{}},methods:{resetNVRAMSettings(){for(const t in localStorage)t.startsWith("KonomiTV-BMLBrowser_nvram_")&&localStorage.removeItem(t);this.data_broadcasting_zip_code="",this.data_broadcasting_prefecture="255-0b0",A.success("データ放送の保存データをリセットしました。")}}}),M={class:"settings__heading"},R=u("svg",{width:"27px",height:"27px",viewBox:"0 0 512 512"},[u("path",{fill:"currentColor",d:"M248.039 381.326L355.039 67.8258C367.539 28.3257 395.039 34.3258 406.539 34.3258C431.039 34.3258 453.376 61.3258 441.039 96.8258C362.639 322.426 343.539 375.326 340.539 384.826C338.486 391.326 342.039 391.326 345.539 391.326C377.039 391.326 386.539 418.326 386.539 435.326C386.539 458.826 371.539 477.326 350.039 477.326H214.539C179.039 477.326 85.8269 431.3 88.0387 335.826C91.0387 206.326 192.039 183.326 243.539 183.326H296.539L265.539 272.326H243.539C185.539 272.326 174.113 314.826 176.039 334.326C180.039 374.826 215.039 389.814 237.039 390.326C244.539 390.5 246.039 386.826 248.039 381.326Z"})],-1),L=u("span",{class:"ml-2"},"データ放送",-1),N={class:"settings__content"},U={class:"settings__item settings__item--switch settings__item--sync-disabled"},T=u("label",{class:"settings__item-heading",for:"tv_show_data_broadcasting"},"テレビをみるときにデータ放送機能を利用する",-1),H=u("label",{class:"settings__item-label",for:"tv_show_data_broadcasting"},[a(" データ放送画面自体のオン/オフは、視聴画面右側のパネルからリモコンを表示した上で、リモコンの d ボタンから切り替えられます。"),u("br")],-1),K=u("label",{class:"settings__item-label",for:"tv_show_data_broadcasting"},[a(" データ放送機能をオンにすると、視聴時の負荷が若干高くなります。データ放送を利用しない場合や、スペックの低い Android デバイスで動作が重い場合は、オフに設定してみてください。"),u("br")],-1),O={class:"settings__item settings__item--switch settings__item--sync-disabled"},W=u("label",{class:"settings__item-heading",for:"enable_internet_access_from_data_broadcasting"},"データ放送からのインターネットアクセスを有効にする",-1),j=u("label",{class:"settings__item-label",for:"enable_internet_access_from_data_broadcasting"},[a(" この設定をオンにすると、データ放送機能を利用する際に、データ放送からインターネットにアクセスできるようになります。"),u("br"),a(" たとえば紅白歌合戦の視聴者投票をはじめとした双方向番組に参加したり、ネット接続時限定のミニゲームが遊べるようになります。"),u("br")],-1),G=u("label",{class:"settings__item-label",for:"enable_internet_access_from_data_broadcasting"},[a(" その一方で、"),u("b",null,"データ放送からのインターネットアクセスが有効な場合、あなたの視聴データがテレビ局に送信されることがあります。"),u("br"),a(" 大半のチャンネルでは個別に視聴データの送信を無効化できますが、依然プライバシー上の問題が残ります。 通常はオフにしておき、双方向コンテンツを使うときだけオンにすることをおすすめします。"),u("br")],-1),P=u("label",{class:"settings__item-heading"},"お住まいの郵便番号",-1),X=u("label",{class:"settings__item-label"},[a(" ここで設定した郵便番号をもとに、データ放送の地域情報(ニュース・天気予報など)が表示されます。"),u("br"),a(" 設定しない場合、データ放送の一部のコンテンツが利用できないことがあります。"),u("br")],-1),Z={class:"settings__item settings__item--sync-disabled mt-2"},q=u("label",{class:"settings__item-heading"},"お住まいの都道府県",-1),x=u("label",{class:"settings__item-label"},[a(" ここで設定した都道府県をもとに、データ放送の地域情報(ニュース・天気予報など)が表示されます。"),u("br"),a(" 設定しない場合、データ放送の一部のコンテンツが利用できないことがあります。"),u("br")],-1),J=u("div",{class:"settings__item"},[u("div",{class:"settings__item-heading text-error-lighten-1"},"データ放送の保存データをリセット"),u("div",{class:"settings__item-label"},[a(" このデバイス(ブラウザ)に保存されているデータ放送の保存データを、初期状態にリセット (消去) できます。"),u("br"),a(" 保存データには、データ放送内のミニゲームの得点、プレゼント企画のスタンプ個数、設定などが含まれます。"),u("br"),u("strong",{class:"text-error-lighten-1"},"保存データをリセットすると、元に戻すことはできません。十分ご注意ください。"),u("br")])],-1);function Q(t,e,l,r,n,_){const d=c("Icon"),b=c("SettingsBase");return F(),D(b,null,{default:C(()=>[u("h2",M,[f((F(),h("a",{class:"settings__back-button",onClick:e[0]||(e[0]=s=>t.$router.back())},[i(d,{icon:"fluent:arrow-left-12-filled",width:"25px"})])),[[V]]),R,L]),u("div",N,[u("div",U,[T,H,K,i(B,{class:"settings__item-switch",color:"primary",id:"tv_show_data_broadcasting","hide-details":"",modelValue:t.settingsStore.settings.tv_show_data_broadcasting,"onUpdate:modelValue":e[1]||(e[1]=s=>t.settingsStore.settings.tv_show_data_broadcasting=s)},null,8,["modelValue"])]),u("div",O,[W,j,G,i(B,{class:"settings__item-switch",color:"primary",id:"enable_internet_access_from_data_broadcasting","hide-details":"",modelValue:t.settingsStore.settings.enable_internet_access_from_data_broadcasting,"onUpdate:modelValue":e[2]||(e[2]=s=>t.settingsStore.settings.enable_internet_access_from_data_broadcasting=s)},null,8,["modelValue"])]),i(y,{class:"mt-6"}),u("div",{class:"settings__item settings__item--sync-disabled",onSubmit:e[4]||(e[4]=w(()=>{},["prevent"]))},[P,X,i($,{class:"settings__item-form",color:"primary",variant:"outlined",placeholder:"郵便番号",density:t.is_form_dense?"compact":"default",rules:[t.data_broadcasting_zip_code_validation],modelValue:t.data_broadcasting_zip_code,"onUpdate:modelValue":e[3]||(e[3]=s=>t.data_broadcasting_zip_code=s)},null,8,["density","rules","modelValue"])],32),u("div",Z,[q,x,i(I,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",density:t.is_form_dense?"compact":"default",items:t.data_broadcasting_prefectures,modelValue:t.data_broadcasting_prefecture,"onUpdate:modelValue":e[5]||(e[5]=s=>t.data_broadcasting_prefecture=s)},null,8,["density","items","modelValue"])]),J,i(S,{class:"settings__save-button bg-error mt-5",variant:"flat",onClick:e[6]||(e[6]=s=>t.resetNVRAMSettings())},{default:C(()=>[i(d,{icon:"material-symbols:device-reset-rounded",class:"mr-2",height:"23px"}),a("保存データをリセット ")]),_:1})])]),_:1})}const l0=p(k,[["render",Q]]);export{l0 as default}; diff --git a/client/dist/assets/General-BDH0Q5Sc.js b/client/dist/assets/General-C-9qy5lQ.js similarity index 95% rename from client/dist/assets/General-BDH0Q5Sc.js rename to client/dist/assets/General-C-9qy5lQ.js index 14651405..19a59d4b 100644 --- a/client/dist/assets/General-BDH0Q5Sc.js +++ b/client/dist/assets/General-C-9qy5lQ.js @@ -1 +1 @@ -import{d as f,U as B,m as b,u as V,_ as S,r as c,o as d,j as h,h as o,b as s,w as E,c as r,e as u,i as g,k as n,t as p,R as A,p as q,q as U,M as _,V as C}from"./index-D2zR81a8.js";import{d as j}from"./vuedraggable.umd-X59vE-3L.js";import{u as I}from"./ChannelsStore-eNnhxLya.js";import{V as O}from"./VDialog-BE2JXbX2.js";import{V as P,a as M}from"./VCard-C5ODUzfZ.js";import{V as Z}from"./ssrBoot-BvljY2yG.js";import{S as H}from"./Base-DG5Aczxr.js";import{V as N}from"./VSwitch-BiucEdzW.js";import{V as v}from"./VTextField-DymZQzkG.js";import{c as D}from"./VSelect-BuCCGZYb.js";import{V as K}from"./VFileInput-CPtGNAvQ.js";import"./VAvatar-CTvU0rd-.js";import"./Navigation-CsJWaG4R.js";const R=f({name:"PinnedChannelSettings",components:{draggable:j},props:{modelValue:{type:Boolean,required:!0}},emits:{"update:modelValue":e=>!0},data(){return{Utils:Object.freeze(B),pinned_channel_settings_modal:!1,pinned_channels:[]}},computed:{...b(I,V)},watch:{modelValue(){this.pinned_channel_settings_modal=this.modelValue},pinned_channel_settings_modal(){this.$emit("update:modelValue",this.pinned_channel_settings_modal)},pinned_channels(){this.settingsStore.settings.pinned_channel_ids=this.pinned_channels.map(e=>e.id)}},async created(){await this.channelsStore.update(),this.pinned_channels=this.channelsStore.channels_list_with_pinned.get("ピン留め")??[]}}),m=e=>(q("data-v-81b72fa2"),e=e(),U(),e),z=m(()=>u("span",{class:"ml-3"},"ピン留め中チャンネルの並び替え",-1)),G={class:"px-5 pb-6"},x={key:0,class:"pinned-channels-settings__label"},J=m(()=>u("div",null,"各チャンネルのつまみをドラッグして並べ替えできます。",-1)),L=[J],Q={key:1,class:"pinned-channels-settings__label"},W=m(()=>u("div",null,[u("b",null,"ピン留めされているチャンネルがありません。")],-1)),X={class:"mt-1"},Y={class:"pinned-channel"},uu=["src"],eu={class:"pinned-channel__name"},tu=m(()=>u("button",{class:"pinned-channel__sort-handle"},[u("svg",{class:"iconify iconify--material-symbols",width:"20px",height:"20px",viewBox:"0 0 24 24"},[u("path",{fill:"currentColor",d:"M5 15q-.425 0-.713-.288T4 14q0-.425.288-.713T5 13h14q.425 0 .713.288T20 14q0 .425-.288.713T19 15H5Zm0-4q-.425 0-.713-.288T4 10q0-.425.288-.713T5 9h14q.425 0 .713.288T20 10q0 .425-.288.713T19 11H5Z"})])],-1)),su=["onClick"],nu=m(()=>u("svg",{class:"iconify iconify--fluent",width:"20px",height:"20px",viewBox:"0 0 16 16"},[u("path",{fill:"currentColor",d:"M7 3h2a1 1 0 0 0-2 0ZM6 3a2 2 0 1 1 4 0h4a.5.5 0 0 1 0 1h-.564l-1.205 8.838A2.5 2.5 0 0 1 9.754 15H6.246a2.5 2.5 0 0 1-2.477-2.162L2.564 4H2a.5.5 0 0 1 0-1h4Zm1 3.5a.5.5 0 0 0-1 0v5a.5.5 0 0 0 1 0v-5ZM9.5 6a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 1 0v-5a.5.5 0 0 0-.5-.5Z"})],-1)),iu=[nu];function lu(e,t,y,w,$,k){const a=c("Icon"),F=c("draggable");return d(),h(O,{"max-width":"550",transition:"slide-y-transition",modelValue:e.pinned_channel_settings_modal,"onUpdate:modelValue":t[2]||(t[2]=l=>e.pinned_channel_settings_modal=l)},{default:o(()=>[s(M,{class:"pinned-channels-settings"},{default:o(()=>[s(P,{class:"px-5 pt-6 pb-3 d-flex align-center font-weight-bold",style:{height:"60px"}},{default:o(()=>[s(a,{icon:"iconamoon:sorting-left-bold",height:"26px"}),z,s(Z),E((d(),r("div",{class:"d-flex align-center rounded-circle cursor-pointer px-2 py-2",onClick:t[0]||(t[0]=l=>e.pinned_channel_settings_modal=!1)},[s(a,{icon:"fluent:dismiss-12-filled",width:"23px",height:"23px"})])),[[A]])]),_:1}),u("div",G,[(e.channelsStore.channels_list_with_pinned.get("ピン留め")??[]).length>0?(d(),r("div",x,L)):g("",!0),(e.channelsStore.channels_list_with_pinned.get("ピン留め")??[]).length===0?(d(),r("div",Q,[W,u("div",X,[n("TV ホーム画面のチャンネルリストの "),s(a,{style:{position:"relative",bottom:"-5px"},icon:"fluent:pin-20-filled",width:"18.5px"}),n(" アイコンから、よくみるチャンネルをピン留めできます。")])])):g("",!0),e.pinned_channels.length>0?(d(),h(F,{key:2,class:"pinned-channels",handle:".pinned-channel__sort-handle","item-key":"id",modelValue:e.pinned_channels,"onUpdate:modelValue":t[1]||(t[1]=l=>e.pinned_channels=l)},{item:o(({element:l})=>[u("div",Y,[u("img",{class:"pinned-channel__icon",src:`${e.Utils.api_base_url}/channels/${l.id}/logo`},null,8,uu),u("span",eu,"Ch: "+p(l.channel_number)+" "+p(l.name),1),tu,E((d(),r("button",{class:"pinned-channel__delete-button",onClick:i=>e.pinned_channels=e.pinned_channels.filter(T=>T.id!==l.id)},iu,8,su)),[[A]])])]),_:1},8,["modelValue"])):g("",!0)])]),_:1})]),_:1},8,["modelValue"])}const au=S(R,[["render",lu],["__scopeId","data-v-81b72fa2"]]),ou=f({name:"Settings-General",components:{PinnedChannelSettings:au,SettingsBase:H},data(){return{Utils:Object.freeze(B),is_form_dense:B.isSmartphoneHorizontal(),pinned_channel_settings_modal:!1,panel_display_state:[{title:"前回の状態を復元する",value:"RestorePreviousState"},{title:"常に表示する",value:"AlwaysDisplay"},{title:"常に折りたたむ",value:"AlwaysFold"}],tv_panel_active_tab:[{title:"番組情報タブ",value:"Program"},{title:"チャンネルタブ",value:"Channel"},{title:"コメントタブ",value:"Comment"},{title:"Twitter タブ",value:"Twitter"}],video_panel_active_tab:[{title:"番組情報タブ",value:"RecordedProgram"},{title:"シリーズタブ",value:"Series"},{title:"コメントタブ",value:"Comment"},{title:"Twitter タブ",value:"Twitter"}],import_settings_file:[]}},computed:{...b(V)},methods:{exportSettings(){const e=JSON.stringify(this.settingsStore.settings,null,4),t=new Blob([e],{type:"application/json"});B.downloadBlobData(t,"KonomiTV-Settings.json"),_.success("設定をエクスポートしました。")},async importSettings(){if(this.import_settings_file.length===0){_.error("インポートする設定データを選択してください!");return}await this.settingsStore.importClientSettings(this.import_settings_file[0])===!0?(_.success("設定をインポートしました。"),window.setTimeout(()=>this.$router.go(0),300)):_.error("設定データが不正なため、インポートできませんでした。")},async resetSettings(){await this.settingsStore.resetClientSettings(),_.success("設定をリセットしました。"),window.setTimeout(()=>this.$router.go(0),300)}}}),du={class:"settings__heading"},_u=u("span",{class:"ml-3"},"全般",-1),ru={class:"settings__content"},cu=u("div",{class:"settings__item"},[u("div",{class:"settings__item-heading"},"ピン留め中チャンネルの並び替え"),u("div",{class:"settings__item-label"},[n(" ピン留め中のチャンネルの表示順序を変更できます。よくみるチャンネルは先頭に配置しておくと便利です。"),u("br"),n(" ピン留め中のチャンネルの追加・削除は、別途 TV ホーム画面のチャンネルリストから行えます。"),u("br")])],-1),mu=u("span",{class:"ml-1"},"ピン留め中チャンネルの並び替え設定を開く",-1),Cu={class:"settings__item settings__item--switch"},Bu={class:"settings__item-heading",for:"tv_channel_selection_requires_alt_key"},pu={class:"settings__item-label",for:"tv_channel_selection_requires_alt_key"},Fu=u("br",null,null,-1),gu=u("br",null,null,-1),Du={class:"settings__item"},hu=u("div",{class:"settings__item-heading"},"デフォルトのパネルの表示状態",-1),Eu=u("div",{class:"settings__item-label"},[n(" 視聴画面を開いたときに、右側のパネルをどう表示するかを設定します。"),u("br")],-1),Au={class:"settings__item"},vu=u("div",{class:"settings__item-heading"},"テレビをみるときにデフォルトで表示されるパネルのタブ",-1),fu=u("div",{class:"settings__item-label"},[n(" テレビの視聴画面を開いたときに、右側のパネルで最初に表示されるタブを設定します。"),u("br")],-1),bu={class:"settings__item"},Vu=u("div",{class:"settings__item-heading"},"ビデオをみるときにデフォルトで表示されるパネルのタブ",-1),Su=u("div",{class:"settings__item-label"},[n(" ビデオの視聴画面を開いたときに、右側のパネルで最初に表示されるタブを設定します。"),u("br")],-1),yu=u("div",{class:"settings__item"},[u("div",{class:"settings__item-heading"},"設定をエクスポート"),u("div",{class:"settings__item-label"},[n(" このデバイス (ブラウザ) に保存されている設定データを、エクスポート (ダウンロード) できます。"),u("br"),n(" ダウンロードした設定データ (KonomiTV-Settings.json) は、[設定をインポート] からインポートできます。異なるサーバーの KonomiTV を同じ設定で使いたいときなどに使ってください。"),u("br")])],-1),wu={class:"settings__item"},$u=u("div",{class:"settings__item-heading text-error-lighten-1"},"設定をインポート",-1),ku=u("div",{class:"settings__item-label"},[n(" [設定をエクスポート] でダウンロードした設定データを、このデバイス (ブラウザ) にインポートできます。"),u("br"),u("strong",{class:"text-error-lighten-1"},"設定をインポートすると、現在のデバイス設定はすべて上書きされます。元に戻すことはできません。"),u("br"),u("strong",{class:"text-error-lighten-1"},"設定のデバイス間同期がオンのときは、同期が有効なすべてのデバイスに反映されます。"),n("十分ご注意ください。"),u("br")],-1),Tu=u("div",{class:"settings__item"},[u("div",{class:"settings__item-heading text-error-lighten-1"},"設定を初期状態にリセット"),u("div",{class:"settings__item-label"},[n(" このデバイス (ブラウザ) に保存されている設定データを、初期状態のデフォルト値にリセットできます。"),u("br"),u("strong",{class:"text-error-lighten-1"},"設定をリセットすると、元に戻すことはできません。"),u("br"),u("strong",{class:"text-error-lighten-1"},"設定のデバイス間同期がオンのときは、同期が有効なすべてのデバイスに反映されます。"),n("十分ご注意ください。"),u("br")])],-1);function qu(e,t,y,w,$,k){const a=c("Icon"),F=c("PinnedChannelSettings"),l=c("SettingsBase");return d(),h(l,null,{default:o(()=>[u("h2",du,[E((d(),r("a",{class:"settings__back-button",onClick:t[0]||(t[0]=i=>e.$router.back())},[s(a,{icon:"fluent:arrow-left-12-filled",width:"25px"})])),[[A]]),s(a,{icon:"fa-solid:sliders-h",width:"19px",style:{margin:"0 4px"}}),_u]),u("div",ru,[cu,s(C,{class:"settings__save-button mt-4",variant:"flat",onClick:t[1]||(t[1]=i=>e.pinned_channel_settings_modal=!e.pinned_channel_settings_modal)},{default:o(()=>[s(a,{icon:"iconamoon:sorting-left-bold",height:"19px"}),mu]),_:1}),u("div",Cu,[u("label",Bu,"チャンネル選局のキーボードショートカットを "+p(e.Utils.AltOrOption())+" + 数字キー/テンキーに変更する",1),u("label",pu,[n(" この設定をオンにすると、数字キーまたはテンキーに対応するリモコン番号(1~12)のチャンネルに切り替えるとき、"+p(e.Utils.AltOrOption())+" キーを同時に押す必要があります。",1),Fu,n(" コメントやツイートを入力しようとして誤って数字キーを押してしまい、チャンネルが変わってしまう事態を避けたい方におすすめです。"),gu]),s(N,{class:"settings__item-switch",color:"primary",id:"tv_channel_selection_requires_alt_key","hide-details":"",modelValue:e.settingsStore.settings.tv_channel_selection_requires_alt_key,"onUpdate:modelValue":t[2]||(t[2]=i=>e.settingsStore.settings.tv_channel_selection_requires_alt_key=i)},null,8,["modelValue"])]),s(v,{class:"mt-6"}),u("div",Du,[hu,Eu,s(D,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",density:e.is_form_dense?"compact":"default",items:e.panel_display_state,modelValue:e.settingsStore.settings.panel_display_state,"onUpdate:modelValue":t[3]||(t[3]=i=>e.settingsStore.settings.panel_display_state=i)},null,8,["density","items","modelValue"])]),u("div",Au,[vu,fu,s(D,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",density:e.is_form_dense?"compact":"default",items:e.tv_panel_active_tab,modelValue:e.settingsStore.settings.tv_panel_active_tab,"onUpdate:modelValue":t[4]||(t[4]=i=>e.settingsStore.settings.tv_panel_active_tab=i)},null,8,["density","items","modelValue"])]),u("div",bu,[Vu,Su,s(D,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",density:e.is_form_dense?"compact":"default",items:e.video_panel_active_tab,modelValue:e.settingsStore.settings.video_panel_active_tab,"onUpdate:modelValue":t[5]||(t[5]=i=>e.settingsStore.settings.video_panel_active_tab=i)},null,8,["density","items","modelValue"])]),s(v,{class:"mt-6"}),yu,s(C,{class:"settings__save-button mt-4",variant:"flat",onClick:t[6]||(t[6]=i=>e.exportSettings())},{default:o(()=>[s(a,{icon:"fa6-solid:download",class:"mr-3",height:"19px"}),n("設定をエクスポート ")]),_:1}),u("div",wu,[$u,ku,s(K,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",label:"設定データ (KonomiTV-Settings.json) を選択",density:e.is_form_dense?"compact":"default",accept:"application/json","prepend-icon":"","prepend-inner-icon":"mdi-paperclip",modelValue:e.import_settings_file,"onUpdate:modelValue":t[7]||(t[7]=i=>e.import_settings_file=i)},null,8,["density","modelValue"])]),s(C,{class:"settings__save-button bg-error mt-5",variant:"flat",onClick:t[8]||(t[8]=i=>e.importSettings())},{default:o(()=>[s(a,{icon:"fa6-solid:upload",class:"mr-3",height:"19px"}),n("設定をインポート ")]),_:1}),Tu,s(C,{class:"settings__save-button bg-error mt-5",variant:"flat",onClick:t[9]||(t[9]=i=>e.resetSettings())},{default:o(()=>[s(a,{icon:"material-symbols:device-reset-rounded",class:"mr-2",height:"23px"}),n("設定をリセット ")]),_:1})]),s(F,{modelValue:e.pinned_channel_settings_modal,"onUpdate:modelValue":t[10]||(t[10]=i=>e.pinned_channel_settings_modal=i)},null,8,["modelValue"])]),_:1})}const xu=S(ou,[["render",qu]]);export{xu as default}; +import{d as f,U as B,m as b,u as V,_ as S,r as c,o as d,j as h,h as o,b as s,w as E,c as r,e as u,i as g,k as n,t as p,R as A,p as q,q as U,M as _,V as C}from"./index-Dbi6R656.js";import{d as j}from"./vuedraggable.umd-Dq96441i.js";import{u as I}from"./ChannelsStore-DchOc5Uo.js";import{V as O}from"./VDialog-B1HdJyP2.js";import{V as P,a as M}from"./VCard-BBvTbBT9.js";import{V as Z}from"./ssrBoot-sWDXISB3.js";import{S as H}from"./Base-D8WlXaKF.js";import{V as N}from"./VSwitch-Cf-jClsc.js";import{V as v}from"./VTextField-DTBkpwFs.js";import{c as D}from"./VSelect-dbg9h4rI.js";import{V as K}from"./VFileInput-dOsuHg_x.js";import"./VAvatar-BrXxzhAv.js";import"./Navigation-DZesdvbM.js";const R=f({name:"PinnedChannelSettings",components:{draggable:j},props:{modelValue:{type:Boolean,required:!0}},emits:{"update:modelValue":e=>!0},data(){return{Utils:Object.freeze(B),pinned_channel_settings_modal:!1,pinned_channels:[]}},computed:{...b(I,V)},watch:{modelValue(){this.pinned_channel_settings_modal=this.modelValue},pinned_channel_settings_modal(){this.$emit("update:modelValue",this.pinned_channel_settings_modal)},pinned_channels(){this.settingsStore.settings.pinned_channel_ids=this.pinned_channels.map(e=>e.id)}},async created(){await this.channelsStore.update(),this.pinned_channels=this.channelsStore.channels_list_with_pinned.get("ピン留め")??[]}}),m=e=>(q("data-v-81b72fa2"),e=e(),U(),e),z=m(()=>u("span",{class:"ml-3"},"ピン留め中チャンネルの並び替え",-1)),G={class:"px-5 pb-6"},x={key:0,class:"pinned-channels-settings__label"},J=m(()=>u("div",null,"各チャンネルのつまみをドラッグして並べ替えできます。",-1)),L=[J],Q={key:1,class:"pinned-channels-settings__label"},W=m(()=>u("div",null,[u("b",null,"ピン留めされているチャンネルがありません。")],-1)),X={class:"mt-1"},Y={class:"pinned-channel"},uu=["src"],eu={class:"pinned-channel__name"},tu=m(()=>u("button",{class:"pinned-channel__sort-handle"},[u("svg",{class:"iconify iconify--material-symbols",width:"20px",height:"20px",viewBox:"0 0 24 24"},[u("path",{fill:"currentColor",d:"M5 15q-.425 0-.713-.288T4 14q0-.425.288-.713T5 13h14q.425 0 .713.288T20 14q0 .425-.288.713T19 15H5Zm0-4q-.425 0-.713-.288T4 10q0-.425.288-.713T5 9h14q.425 0 .713.288T20 10q0 .425-.288.713T19 11H5Z"})])],-1)),su=["onClick"],nu=m(()=>u("svg",{class:"iconify iconify--fluent",width:"20px",height:"20px",viewBox:"0 0 16 16"},[u("path",{fill:"currentColor",d:"M7 3h2a1 1 0 0 0-2 0ZM6 3a2 2 0 1 1 4 0h4a.5.5 0 0 1 0 1h-.564l-1.205 8.838A2.5 2.5 0 0 1 9.754 15H6.246a2.5 2.5 0 0 1-2.477-2.162L2.564 4H2a.5.5 0 0 1 0-1h4Zm1 3.5a.5.5 0 0 0-1 0v5a.5.5 0 0 0 1 0v-5ZM9.5 6a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 1 0v-5a.5.5 0 0 0-.5-.5Z"})],-1)),iu=[nu];function lu(e,t,y,w,$,k){const a=c("Icon"),F=c("draggable");return d(),h(O,{"max-width":"550",transition:"slide-y-transition",modelValue:e.pinned_channel_settings_modal,"onUpdate:modelValue":t[2]||(t[2]=l=>e.pinned_channel_settings_modal=l)},{default:o(()=>[s(M,{class:"pinned-channels-settings"},{default:o(()=>[s(P,{class:"px-5 pt-6 pb-3 d-flex align-center font-weight-bold",style:{height:"60px"}},{default:o(()=>[s(a,{icon:"iconamoon:sorting-left-bold",height:"26px"}),z,s(Z),E((d(),r("div",{class:"d-flex align-center rounded-circle cursor-pointer px-2 py-2",onClick:t[0]||(t[0]=l=>e.pinned_channel_settings_modal=!1)},[s(a,{icon:"fluent:dismiss-12-filled",width:"23px",height:"23px"})])),[[A]])]),_:1}),u("div",G,[(e.channelsStore.channels_list_with_pinned.get("ピン留め")??[]).length>0?(d(),r("div",x,L)):g("",!0),(e.channelsStore.channels_list_with_pinned.get("ピン留め")??[]).length===0?(d(),r("div",Q,[W,u("div",X,[n("TV ホーム画面のチャンネルリストの "),s(a,{style:{position:"relative",bottom:"-5px"},icon:"fluent:pin-20-filled",width:"18.5px"}),n(" アイコンから、よくみるチャンネルをピン留めできます。")])])):g("",!0),e.pinned_channels.length>0?(d(),h(F,{key:2,class:"pinned-channels",handle:".pinned-channel__sort-handle","item-key":"id",modelValue:e.pinned_channels,"onUpdate:modelValue":t[1]||(t[1]=l=>e.pinned_channels=l)},{item:o(({element:l})=>[u("div",Y,[u("img",{class:"pinned-channel__icon",src:`${e.Utils.api_base_url}/channels/${l.id}/logo`},null,8,uu),u("span",eu,"Ch: "+p(l.channel_number)+" "+p(l.name),1),tu,E((d(),r("button",{class:"pinned-channel__delete-button",onClick:i=>e.pinned_channels=e.pinned_channels.filter(T=>T.id!==l.id)},iu,8,su)),[[A]])])]),_:1},8,["modelValue"])):g("",!0)])]),_:1})]),_:1},8,["modelValue"])}const au=S(R,[["render",lu],["__scopeId","data-v-81b72fa2"]]),ou=f({name:"Settings-General",components:{PinnedChannelSettings:au,SettingsBase:H},data(){return{Utils:Object.freeze(B),is_form_dense:B.isSmartphoneHorizontal(),pinned_channel_settings_modal:!1,panel_display_state:[{title:"前回の状態を復元する",value:"RestorePreviousState"},{title:"常に表示する",value:"AlwaysDisplay"},{title:"常に折りたたむ",value:"AlwaysFold"}],tv_panel_active_tab:[{title:"番組情報タブ",value:"Program"},{title:"チャンネルタブ",value:"Channel"},{title:"コメントタブ",value:"Comment"},{title:"Twitter タブ",value:"Twitter"}],video_panel_active_tab:[{title:"番組情報タブ",value:"RecordedProgram"},{title:"シリーズタブ",value:"Series"},{title:"コメントタブ",value:"Comment"},{title:"Twitter タブ",value:"Twitter"}],import_settings_file:[]}},computed:{...b(V)},methods:{exportSettings(){const e=JSON.stringify(this.settingsStore.settings,null,4),t=new Blob([e],{type:"application/json"});B.downloadBlobData(t,"KonomiTV-Settings.json"),_.success("設定をエクスポートしました。")},async importSettings(){if(this.import_settings_file.length===0){_.error("インポートする設定データを選択してください!");return}await this.settingsStore.importClientSettings(this.import_settings_file[0])===!0?(_.success("設定をインポートしました。"),window.setTimeout(()=>this.$router.go(0),300)):_.error("設定データが不正なため、インポートできませんでした。")},async resetSettings(){await this.settingsStore.resetClientSettings(),_.success("設定をリセットしました。"),window.setTimeout(()=>this.$router.go(0),300)}}}),du={class:"settings__heading"},_u=u("span",{class:"ml-3"},"全般",-1),ru={class:"settings__content"},cu=u("div",{class:"settings__item"},[u("div",{class:"settings__item-heading"},"ピン留め中チャンネルの並び替え"),u("div",{class:"settings__item-label"},[n(" ピン留め中のチャンネルの表示順序を変更できます。よくみるチャンネルは先頭に配置しておくと便利です。"),u("br"),n(" ピン留め中のチャンネルの追加・削除は、別途 TV ホーム画面のチャンネルリストから行えます。"),u("br")])],-1),mu=u("span",{class:"ml-1"},"ピン留め中チャンネルの並び替え設定を開く",-1),Cu={class:"settings__item settings__item--switch"},Bu={class:"settings__item-heading",for:"tv_channel_selection_requires_alt_key"},pu={class:"settings__item-label",for:"tv_channel_selection_requires_alt_key"},Fu=u("br",null,null,-1),gu=u("br",null,null,-1),Du={class:"settings__item"},hu=u("div",{class:"settings__item-heading"},"デフォルトのパネルの表示状態",-1),Eu=u("div",{class:"settings__item-label"},[n(" 視聴画面を開いたときに、右側のパネルをどう表示するかを設定します。"),u("br")],-1),Au={class:"settings__item"},vu=u("div",{class:"settings__item-heading"},"テレビをみるときにデフォルトで表示されるパネルのタブ",-1),fu=u("div",{class:"settings__item-label"},[n(" テレビの視聴画面を開いたときに、右側のパネルで最初に表示されるタブを設定します。"),u("br")],-1),bu={class:"settings__item"},Vu=u("div",{class:"settings__item-heading"},"ビデオをみるときにデフォルトで表示されるパネルのタブ",-1),Su=u("div",{class:"settings__item-label"},[n(" ビデオの視聴画面を開いたときに、右側のパネルで最初に表示されるタブを設定します。"),u("br")],-1),yu=u("div",{class:"settings__item"},[u("div",{class:"settings__item-heading"},"設定をエクスポート"),u("div",{class:"settings__item-label"},[n(" このデバイス (ブラウザ) に保存されている設定データを、エクスポート (ダウンロード) できます。"),u("br"),n(" ダウンロードした設定データ (KonomiTV-Settings.json) は、[設定をインポート] からインポートできます。異なるサーバーの KonomiTV を同じ設定で使いたいときなどに使ってください。"),u("br")])],-1),wu={class:"settings__item"},$u=u("div",{class:"settings__item-heading text-error-lighten-1"},"設定をインポート",-1),ku=u("div",{class:"settings__item-label"},[n(" [設定をエクスポート] でダウンロードした設定データを、このデバイス (ブラウザ) にインポートできます。"),u("br"),u("strong",{class:"text-error-lighten-1"},"設定をインポートすると、現在のデバイス設定はすべて上書きされます。元に戻すことはできません。"),u("br"),u("strong",{class:"text-error-lighten-1"},"設定のデバイス間同期がオンのときは、同期が有効なすべてのデバイスに反映されます。"),n("十分ご注意ください。"),u("br")],-1),Tu=u("div",{class:"settings__item"},[u("div",{class:"settings__item-heading text-error-lighten-1"},"設定を初期状態にリセット"),u("div",{class:"settings__item-label"},[n(" このデバイス (ブラウザ) に保存されている設定データを、初期状態のデフォルト値にリセットできます。"),u("br"),u("strong",{class:"text-error-lighten-1"},"設定をリセットすると、元に戻すことはできません。"),u("br"),u("strong",{class:"text-error-lighten-1"},"設定のデバイス間同期がオンのときは、同期が有効なすべてのデバイスに反映されます。"),n("十分ご注意ください。"),u("br")])],-1);function qu(e,t,y,w,$,k){const a=c("Icon"),F=c("PinnedChannelSettings"),l=c("SettingsBase");return d(),h(l,null,{default:o(()=>[u("h2",du,[E((d(),r("a",{class:"settings__back-button",onClick:t[0]||(t[0]=i=>e.$router.back())},[s(a,{icon:"fluent:arrow-left-12-filled",width:"25px"})])),[[A]]),s(a,{icon:"fa-solid:sliders-h",width:"19px",style:{margin:"0 4px"}}),_u]),u("div",ru,[cu,s(C,{class:"settings__save-button mt-4",variant:"flat",onClick:t[1]||(t[1]=i=>e.pinned_channel_settings_modal=!e.pinned_channel_settings_modal)},{default:o(()=>[s(a,{icon:"iconamoon:sorting-left-bold",height:"19px"}),mu]),_:1}),u("div",Cu,[u("label",Bu,"チャンネル選局のキーボードショートカットを "+p(e.Utils.AltOrOption())+" + 数字キー/テンキーに変更する",1),u("label",pu,[n(" この設定をオンにすると、数字キーまたはテンキーに対応するリモコン番号(1~12)のチャンネルに切り替えるとき、"+p(e.Utils.AltOrOption())+" キーを同時に押す必要があります。",1),Fu,n(" コメントやツイートを入力しようとして誤って数字キーを押してしまい、チャンネルが変わってしまう事態を避けたい方におすすめです。"),gu]),s(N,{class:"settings__item-switch",color:"primary",id:"tv_channel_selection_requires_alt_key","hide-details":"",modelValue:e.settingsStore.settings.tv_channel_selection_requires_alt_key,"onUpdate:modelValue":t[2]||(t[2]=i=>e.settingsStore.settings.tv_channel_selection_requires_alt_key=i)},null,8,["modelValue"])]),s(v,{class:"mt-6"}),u("div",Du,[hu,Eu,s(D,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",density:e.is_form_dense?"compact":"default",items:e.panel_display_state,modelValue:e.settingsStore.settings.panel_display_state,"onUpdate:modelValue":t[3]||(t[3]=i=>e.settingsStore.settings.panel_display_state=i)},null,8,["density","items","modelValue"])]),u("div",Au,[vu,fu,s(D,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",density:e.is_form_dense?"compact":"default",items:e.tv_panel_active_tab,modelValue:e.settingsStore.settings.tv_panel_active_tab,"onUpdate:modelValue":t[4]||(t[4]=i=>e.settingsStore.settings.tv_panel_active_tab=i)},null,8,["density","items","modelValue"])]),u("div",bu,[Vu,Su,s(D,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",density:e.is_form_dense?"compact":"default",items:e.video_panel_active_tab,modelValue:e.settingsStore.settings.video_panel_active_tab,"onUpdate:modelValue":t[5]||(t[5]=i=>e.settingsStore.settings.video_panel_active_tab=i)},null,8,["density","items","modelValue"])]),s(v,{class:"mt-6"}),yu,s(C,{class:"settings__save-button mt-4",variant:"flat",onClick:t[6]||(t[6]=i=>e.exportSettings())},{default:o(()=>[s(a,{icon:"fa6-solid:download",class:"mr-3",height:"19px"}),n("設定をエクスポート ")]),_:1}),u("div",wu,[$u,ku,s(K,{class:"settings__item-form",color:"primary",variant:"outlined","hide-details":"",label:"設定データ (KonomiTV-Settings.json) を選択",density:e.is_form_dense?"compact":"default",accept:"application/json","prepend-icon":"","prepend-inner-icon":"mdi-paperclip",modelValue:e.import_settings_file,"onUpdate:modelValue":t[7]||(t[7]=i=>e.import_settings_file=i)},null,8,["density","modelValue"])]),s(C,{class:"settings__save-button bg-error mt-5",variant:"flat",onClick:t[8]||(t[8]=i=>e.importSettings())},{default:o(()=>[s(a,{icon:"fa6-solid:upload",class:"mr-3",height:"19px"}),n("設定をインポート ")]),_:1}),Tu,s(C,{class:"settings__save-button bg-error mt-5",variant:"flat",onClick:t[9]||(t[9]=i=>e.resetSettings())},{default:o(()=>[s(a,{icon:"material-symbols:device-reset-rounded",class:"mr-2",height:"23px"}),n("設定をリセット ")]),_:1})]),s(F,{modelValue:e.pinned_channel_settings_modal,"onUpdate:modelValue":t[10]||(t[10]=i=>e.pinned_channel_settings_modal=i)},null,8,["modelValue"])]),_:1})}const xu=S(ou,[["render",qu]]);export{xu as default}; diff --git a/client/dist/assets/Home-X3_NWbJ7.js b/client/dist/assets/Home-QNi6QgIc.js similarity index 97% rename from client/dist/assets/Home-X3_NWbJ7.js rename to client/dist/assets/Home-QNi6QgIc.js index 68b29546..172f084b 100644 --- a/client/dist/assets/Home-X3_NWbJ7.js +++ b/client/dist/assets/Home-QNi6QgIc.js @@ -1 +1 @@ -import{d as M,U as C,P as $,m as T,M as S,u as I,_ as L,r as c,a as V,o,c as l,b as h,e,n as p,f as B,F as v,g as f,w,v as j,h as g,i as E,j as b,k as r,t as u,V as z,l as F,R as y,p as N,q as O,s as R}from"./index-D2zR81a8.js";import{S as Z,a as q}from"./swiper-cQLwFU5D.js";import{H as X,N as G}from"./Navigation-CsJWaG4R.js";import{C as J,u as K}from"./ChannelsStore-eNnhxLya.js";import{V as Q}from"./ssrBoot-BvljY2yG.js";const W=M({name:"TV-Home",components:{HeaderBar:X,Navigation:G,Swiper:Z,SwiperSlide:q},data(){return{Utils:Object.freeze(C),ChannelUtils:Object.freeze(J),ProgramUtils:Object.freeze($),active_tab_index:0,swiper_instance:null,scroll_abort_controller:new AbortController,is_loading:!0,interval_ids:[]}},computed:{...T(K,I)},watch:{active_tab_index(){var t,n;(t=this.swiper_instance)==null||t.updateAutoHeight(),(n=this.swiper_instance)==null||n.slideTo(this.active_tab_index,this.is_loading===!0?0:void 0)}},async mounted(){var n,d;this.settingsStore.settings.pinned_channel_ids.length===0&&(this.active_tab_index=1);const t=60-new Date().getSeconds();this.interval_ids.push(window.setTimeout(()=>{this.channelsStore.update(!0),this.interval_ids.push(window.setInterval(()=>this.channelsStore.update(!0),30*1e3))},t*1e3)),await this.channelsStore.update(),((n=this.channelsStore.channels_list_with_pinned.get("ピン留め"))==null?void 0:n.length)===0&&(this.active_tab_index=1),(d=this.swiper_instance)==null||d.updateAutoHeight(),window.addEventListener("scroll",()=>{var m;(m=this.swiper_instance)==null||m.updateAutoHeight()},{passive:!0,signal:this.scroll_abort_controller.signal}),await C.sleep(.01),this.is_loading=!1},beforeUnmount(){for(const t of this.interval_ids)window.clearInterval(t);this.scroll_abort_controller.abort(),this.scroll_abort_controller=new AbortController},methods:{addPinnedChannel(t){this.settingsStore.settings.pinned_channel_ids=[...this.settingsStore.settings.pinned_channel_ids,t.id],S.show(`${t.name}をピン留めしました。`)},removePinnedChannel(t){var n;this.settingsStore.settings.pinned_channel_ids=this.settingsStore.settings.pinned_channel_ids.filter(d=>d!==t.id),((n=this.channelsStore.channels_list_with_pinned.get("ピン留め"))==null?void 0:n.length)===0&&(this.active_tab_index=1),S.show(`${t.name}のピン留めを外しました。`)},isPinnedChannel(t){return this.settingsStore.settings.pinned_channel_ids.includes(t.id)}}}),i=t=>(N("data-v-cb649240"),t=t(),O(),t),Y={class:"route-container"},ee={class:"channels-tab"},te=i(()=>e("div",{class:"channels-tab__highlight"},null,-1)),se={class:"channel__broadcaster"},ne=["src"],ie={class:"channel__broadcaster-content"},ae={class:"channel__broadcaster-name"},oe={class:"channel__broadcaster-status"},re=i(()=>e("svg",{class:"iconify iconify--fa-solid",width:"10.5px",height:"12px",viewBox:"0 0 448 512"},[e("path",{fill:"currentColor",d:"M323.56 51.2c-20.8 19.3-39.58 39.59-56.22 59.97C240.08 73.62 206.28 35.53 168 0C69.74 91.17 0 209.96 0 281.6C0 408.85 100.29 512 224 512s224-103.15 224-230.4c0-53.27-51.98-163.14-124.44-230.4zm-19.47 340.65C282.43 407.01 255.72 416 226.86 416C154.71 416 96 368.26 96 290.75c0-38.61 24.31-72.63 72.79-130.75c6.93 7.98 98.83 125.34 98.83 125.34l58.63-66.88c4.14 6.85 7.91 13.55 11.27 19.97c27.35 52.19 15.81 118.97-33.43 153.42z"})],-1)),le=i(()=>e("span",{class:"ml-1"},"勢い:",-1)),ue={class:"ml-1"},ce=i(()=>e("span",{style:{"margin-left":"3px"}}," コメ/分",-1)),de={class:"channel__broadcaster-status-viewers ml-4"},_e=i(()=>e("svg",{class:"iconify iconify--fa-solid",width:"15.75px",height:"14px",viewBox:"0 0 576 512"},[e("path",{fill:"currentColor",d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144a143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79a47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"})],-1)),he=i(()=>e("span",{class:"ml-1"},"視聴数:",-1)),pe={class:"ml-1"},ge=["onClick"],me=i(()=>e("svg",{class:"iconify iconify--fluent",width:"24px",height:"24px",viewBox:"0 0 20 20"},[e("path",{fill:"currentColor",d:"M13.325 2.617a2 2 0 0 0-3.203.52l-1.73 3.459a1.5 1.5 0 0 1-.784.721l-3.59 1.436a1 1 0 0 0-.335 1.636L6.293 13L3 16.292V17h.707L7 13.706l2.61 2.61a1 1 0 0 0 1.636-.335l1.436-3.59a1.5 1.5 0 0 1 .722-.784l3.458-1.73a2 2 0 0 0 .52-3.203l-4.057-4.057Z"})],-1)),ve=[me],fe={class:"channel__program-present"},we={class:"channel__program-present-title-wrapper"},be=["innerHTML"],Ce={class:"channel__program-present-time"},Se=["innerHTML"],Be={class:"channel__program-following"},Ee={class:"channel__program-following-title"},Fe=i(()=>e("span",{class:"channel__program-following-title-decorate"},"NEXT",-1)),ye=i(()=>e("svg",{class:"channel__program-following-title-icon iconify iconify--fluent",width:"16px",height:"16px",viewBox:"0 0 20 20"},[e("path",{fill:"currentColor",d:"M10.018 5.486a1 1 0 0 1 1.592-.806l5.88 4.311a1.25 1.25 0 0 1 0 2.017l-5.88 4.311a1 1 0 0 1-1.592-.806v-3.16L4.61 15.319a1 1 0 0 1-1.592-.806V5.486A1 1 0 0 1 4.61 4.68l5.408 3.966v-3.16Z"})],-1)),De=["innerHTML"],xe={class:"channel__program-following-time"},Pe={class:"channel__progressbar"},ke={key:0,class:"pinned-container d-flex justify-center align-center w-100"},Ae={class:"d-flex justify-center align-center flex-column"},Ue=i(()=>e("h2",null,[r("ピン留めされているチャンネルが"),e("br"),r("ありません。")],-1)),He={class:"mt-4 text-text-darken-1"},Me=i(()=>e("br",null,null,-1)),$e=i(()=>e("div",{class:"mt-2 text-text-darken-1"},[r("チャンネルをピン留めすると、"),e("br"),r("このタブが最初に表示されます。")],-1)),Te={key:0,class:"channels-list pinned-container d-flex justify-center align-center w-100",style:{"flex-grow":"1"}},Ie=R('

視聴可能なチャンネルが
ありません。

前回チャンネルスキャンしたときに
受信可能なチャンネルを見つけられませんでした。
再度チャンネルスキャンを行ってください。
',1),Le=[Ie];function Ve(t,n,d,m,je,ze){const D=c("HeaderBar"),x=c("Navigation"),P=c("router-link"),k=c("Icon"),A=c("SwiperSlide"),U=c("Swiper"),H=V("tooltip");return o(),l("div",Y,[h(D),e("main",null,[h(x),e("div",{class:p(["channels-container channels-container--home",{"channels-container--loading":t.is_loading}])},[e("div",ee,[e("div",{class:"channels-tab__buttons",style:B({"--tab-length":Array.from(t.channelsStore.channels_list_with_pinned).length,"--active-tab-index":t.active_tab_index})},[(o(!0),l(v,null,f(Array.from(t.channelsStore.channels_list_with_pinned),([a],_)=>(o(),b(z,{variant:"flat",class:"channels-tab__button",key:a,onClick:s=>t.active_tab_index=_},{default:g(()=>[r(u(a),1)]),_:2},1032,["onClick"]))),128)),te],4)]),w(h(U,{class:"channels-list","space-between":32,"auto-height":!0,"touch-start-prevent-default":!1,observer:!0,"observe-parents":!0,onSwiper:n[1]||(n[1]=a=>t.swiper_instance=a),onSlideChange:n[2]||(n[2]=a=>t.active_tab_index=a.activeIndex)},{default:g(()=>[(o(!0),l(v,null,f(Array.from(t.channelsStore.channels_list_with_pinned),([a,_])=>(o(),b(A,{key:a},{default:g(()=>[e("div",{class:p(["channels",`channels--tab-${a} channels--length-${_.length}`])},[(o(!0),l(v,null,f(_,s=>w((o(),b(P,{class:"channel",draggable:"false",key:s.id,to:`/tv/watch/${s.display_channel_id}`},{default:g(()=>[e("div",se,[e("img",{class:"channel__broadcaster-icon",src:`${t.Utils.api_base_url}/channels/${s.id}/logo`},null,8,ne),e("div",ie,[e("span",ae,"Ch: "+u(s.channel_number)+" "+u(s.name),1),e("div",oe,[e("div",{class:p(["channel__broadcaster-status-force",`channel__broadcaster-status-force--${t.ChannelUtils.getChannelForceType(s.jikkyo_force)}`])},[re,le,e("span",ue,u(s.jikkyo_force??"--"),1),ce],2),e("div",de,[_e,he,e("span",pe,u(s.viewer_count),1)])])]),w((o(),l("div",{class:p(["channel__broadcaster-pin",{"channel__broadcaster-pin--pinned":t.isPinnedChannel(s)}]),onClick:F(Ne=>t.isPinnedChannel(s)?t.removePinnedChannel(s):t.addPinnedChannel(s),["prevent","stop"]),onMousedown:n[0]||(n[0]=F(()=>{},["prevent","stop"]))},ve,42,ge)),[[y],[H,t.isPinnedChannel(s)?"ピン留めを外す":"ピン留めする"]])]),e("div",fe,[e("div",we,[e("span",{class:"channel__program-present-title",innerHTML:t.ProgramUtils.decorateProgramInfo(s.program_present,"title")},null,8,be),e("span",Ce,u(t.ProgramUtils.getProgramTime(s.program_present)),1)]),e("span",{class:"channel__program-present-description",innerHTML:t.ProgramUtils.decorateProgramInfo(s.program_present,"description")},null,8,Se)]),h(Q),e("div",Be,[e("div",Ee,[Fe,ye,e("span",{class:"channel__program-following-title-text",innerHTML:t.ProgramUtils.decorateProgramInfo(s.program_following,"title")},null,8,De)]),e("span",xe,u(t.ProgramUtils.getProgramTime(s.program_following)),1)]),e("div",Pe,[e("div",{class:"channel__progressbar-progress",style:B(`width:${t.ProgramUtils.getProgramProgress(s.program_present)}%;`)},null,4)])]),_:2},1032,["to"])),[[y]])),128)),a==="ピン留め"&&_.length===0?(o(),l("div",ke,[e("div",Ae,[Ue,e("div",He,[r("各チャンネルの "),h(k,{style:{position:"relative",bottom:"-5px"},icon:"fluent:pin-20-filled",width:"22px"}),r(" アイコンから、よくみる"),Me,r("チャンネルをこのタブにピン留めできます。")]),$e])])):E("",!0)],2)]),_:2},1024))),128))]),_:1},512),[[j,Array.from(t.channelsStore.channels_list_with_pinned).length>0]]),Array.from(t.channelsStore.channels_list_with_pinned).length===0?(o(),l("div",Te,Le)):E("",!0)],2)])])}const Ge=L(W,[["render",Ve],["__scopeId","data-v-cb649240"]]);export{Ge as default}; +import{d as M,U as C,P as $,m as T,M as S,u as I,_ as L,r as c,a as V,o,c as l,b as h,e,n as p,f as B,F as v,g as f,w,v as j,h as g,i as E,j as b,k as r,t as u,V as z,l as F,R as y,p as N,q as O,s as R}from"./index-Dbi6R656.js";import{S as Z,a as q}from"./swiper-BjXfmU5J.js";import{H as X,N as G}from"./Navigation-DZesdvbM.js";import{C as J,u as K}from"./ChannelsStore-DchOc5Uo.js";import{V as Q}from"./ssrBoot-sWDXISB3.js";const W=M({name:"TV-Home",components:{HeaderBar:X,Navigation:G,Swiper:Z,SwiperSlide:q},data(){return{Utils:Object.freeze(C),ChannelUtils:Object.freeze(J),ProgramUtils:Object.freeze($),active_tab_index:0,swiper_instance:null,scroll_abort_controller:new AbortController,is_loading:!0,interval_ids:[]}},computed:{...T(K,I)},watch:{active_tab_index(){var t,n;(t=this.swiper_instance)==null||t.updateAutoHeight(),(n=this.swiper_instance)==null||n.slideTo(this.active_tab_index,this.is_loading===!0?0:void 0)}},async mounted(){var n,d;this.settingsStore.settings.pinned_channel_ids.length===0&&(this.active_tab_index=1);const t=60-new Date().getSeconds();this.interval_ids.push(window.setTimeout(()=>{this.channelsStore.update(!0),this.interval_ids.push(window.setInterval(()=>this.channelsStore.update(!0),30*1e3))},t*1e3)),await this.channelsStore.update(),((n=this.channelsStore.channels_list_with_pinned.get("ピン留め"))==null?void 0:n.length)===0&&(this.active_tab_index=1),(d=this.swiper_instance)==null||d.updateAutoHeight(),window.addEventListener("scroll",()=>{var m;(m=this.swiper_instance)==null||m.updateAutoHeight()},{passive:!0,signal:this.scroll_abort_controller.signal}),await C.sleep(.01),this.is_loading=!1},beforeUnmount(){for(const t of this.interval_ids)window.clearInterval(t);this.scroll_abort_controller.abort(),this.scroll_abort_controller=new AbortController},methods:{addPinnedChannel(t){this.settingsStore.settings.pinned_channel_ids=[...this.settingsStore.settings.pinned_channel_ids,t.id],S.show(`${t.name}をピン留めしました。`)},removePinnedChannel(t){var n;this.settingsStore.settings.pinned_channel_ids=this.settingsStore.settings.pinned_channel_ids.filter(d=>d!==t.id),((n=this.channelsStore.channels_list_with_pinned.get("ピン留め"))==null?void 0:n.length)===0&&(this.active_tab_index=1),S.show(`${t.name}のピン留めを外しました。`)},isPinnedChannel(t){return this.settingsStore.settings.pinned_channel_ids.includes(t.id)}}}),i=t=>(N("data-v-cb649240"),t=t(),O(),t),Y={class:"route-container"},ee={class:"channels-tab"},te=i(()=>e("div",{class:"channels-tab__highlight"},null,-1)),se={class:"channel__broadcaster"},ne=["src"],ie={class:"channel__broadcaster-content"},ae={class:"channel__broadcaster-name"},oe={class:"channel__broadcaster-status"},re=i(()=>e("svg",{class:"iconify iconify--fa-solid",width:"10.5px",height:"12px",viewBox:"0 0 448 512"},[e("path",{fill:"currentColor",d:"M323.56 51.2c-20.8 19.3-39.58 39.59-56.22 59.97C240.08 73.62 206.28 35.53 168 0C69.74 91.17 0 209.96 0 281.6C0 408.85 100.29 512 224 512s224-103.15 224-230.4c0-53.27-51.98-163.14-124.44-230.4zm-19.47 340.65C282.43 407.01 255.72 416 226.86 416C154.71 416 96 368.26 96 290.75c0-38.61 24.31-72.63 72.79-130.75c6.93 7.98 98.83 125.34 98.83 125.34l58.63-66.88c4.14 6.85 7.91 13.55 11.27 19.97c27.35 52.19 15.81 118.97-33.43 153.42z"})],-1)),le=i(()=>e("span",{class:"ml-1"},"勢い:",-1)),ue={class:"ml-1"},ce=i(()=>e("span",{style:{"margin-left":"3px"}}," コメ/分",-1)),de={class:"channel__broadcaster-status-viewers ml-4"},_e=i(()=>e("svg",{class:"iconify iconify--fa-solid",width:"15.75px",height:"14px",viewBox:"0 0 576 512"},[e("path",{fill:"currentColor",d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144a143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79a47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"})],-1)),he=i(()=>e("span",{class:"ml-1"},"視聴数:",-1)),pe={class:"ml-1"},ge=["onClick"],me=i(()=>e("svg",{class:"iconify iconify--fluent",width:"24px",height:"24px",viewBox:"0 0 20 20"},[e("path",{fill:"currentColor",d:"M13.325 2.617a2 2 0 0 0-3.203.52l-1.73 3.459a1.5 1.5 0 0 1-.784.721l-3.59 1.436a1 1 0 0 0-.335 1.636L6.293 13L3 16.292V17h.707L7 13.706l2.61 2.61a1 1 0 0 0 1.636-.335l1.436-3.59a1.5 1.5 0 0 1 .722-.784l3.458-1.73a2 2 0 0 0 .52-3.203l-4.057-4.057Z"})],-1)),ve=[me],fe={class:"channel__program-present"},we={class:"channel__program-present-title-wrapper"},be=["innerHTML"],Ce={class:"channel__program-present-time"},Se=["innerHTML"],Be={class:"channel__program-following"},Ee={class:"channel__program-following-title"},Fe=i(()=>e("span",{class:"channel__program-following-title-decorate"},"NEXT",-1)),ye=i(()=>e("svg",{class:"channel__program-following-title-icon iconify iconify--fluent",width:"16px",height:"16px",viewBox:"0 0 20 20"},[e("path",{fill:"currentColor",d:"M10.018 5.486a1 1 0 0 1 1.592-.806l5.88 4.311a1.25 1.25 0 0 1 0 2.017l-5.88 4.311a1 1 0 0 1-1.592-.806v-3.16L4.61 15.319a1 1 0 0 1-1.592-.806V5.486A1 1 0 0 1 4.61 4.68l5.408 3.966v-3.16Z"})],-1)),De=["innerHTML"],xe={class:"channel__program-following-time"},Pe={class:"channel__progressbar"},ke={key:0,class:"pinned-container d-flex justify-center align-center w-100"},Ae={class:"d-flex justify-center align-center flex-column"},Ue=i(()=>e("h2",null,[r("ピン留めされているチャンネルが"),e("br"),r("ありません。")],-1)),He={class:"mt-4 text-text-darken-1"},Me=i(()=>e("br",null,null,-1)),$e=i(()=>e("div",{class:"mt-2 text-text-darken-1"},[r("チャンネルをピン留めすると、"),e("br"),r("このタブが最初に表示されます。")],-1)),Te={key:0,class:"channels-list pinned-container d-flex justify-center align-center w-100",style:{"flex-grow":"1"}},Ie=R('

視聴可能なチャンネルが
ありません。

前回チャンネルスキャンしたときに
受信可能なチャンネルを見つけられませんでした。
再度チャンネルスキャンを行ってください。
',1),Le=[Ie];function Ve(t,n,d,m,je,ze){const D=c("HeaderBar"),x=c("Navigation"),P=c("router-link"),k=c("Icon"),A=c("SwiperSlide"),U=c("Swiper"),H=V("tooltip");return o(),l("div",Y,[h(D),e("main",null,[h(x),e("div",{class:p(["channels-container channels-container--home",{"channels-container--loading":t.is_loading}])},[e("div",ee,[e("div",{class:"channels-tab__buttons",style:B({"--tab-length":Array.from(t.channelsStore.channels_list_with_pinned).length,"--active-tab-index":t.active_tab_index})},[(o(!0),l(v,null,f(Array.from(t.channelsStore.channels_list_with_pinned),([a],_)=>(o(),b(z,{variant:"flat",class:"channels-tab__button",key:a,onClick:s=>t.active_tab_index=_},{default:g(()=>[r(u(a),1)]),_:2},1032,["onClick"]))),128)),te],4)]),w(h(U,{class:"channels-list","space-between":32,"auto-height":!0,"touch-start-prevent-default":!1,observer:!0,"observe-parents":!0,onSwiper:n[1]||(n[1]=a=>t.swiper_instance=a),onSlideChange:n[2]||(n[2]=a=>t.active_tab_index=a.activeIndex)},{default:g(()=>[(o(!0),l(v,null,f(Array.from(t.channelsStore.channels_list_with_pinned),([a,_])=>(o(),b(A,{key:a},{default:g(()=>[e("div",{class:p(["channels",`channels--tab-${a} channels--length-${_.length}`])},[(o(!0),l(v,null,f(_,s=>w((o(),b(P,{class:"channel",draggable:"false",key:s.id,to:`/tv/watch/${s.display_channel_id}`},{default:g(()=>[e("div",se,[e("img",{class:"channel__broadcaster-icon",src:`${t.Utils.api_base_url}/channels/${s.id}/logo`},null,8,ne),e("div",ie,[e("span",ae,"Ch: "+u(s.channel_number)+" "+u(s.name),1),e("div",oe,[e("div",{class:p(["channel__broadcaster-status-force",`channel__broadcaster-status-force--${t.ChannelUtils.getChannelForceType(s.jikkyo_force)}`])},[re,le,e("span",ue,u(s.jikkyo_force??"--"),1),ce],2),e("div",de,[_e,he,e("span",pe,u(s.viewer_count),1)])])]),w((o(),l("div",{class:p(["channel__broadcaster-pin",{"channel__broadcaster-pin--pinned":t.isPinnedChannel(s)}]),onClick:F(Ne=>t.isPinnedChannel(s)?t.removePinnedChannel(s):t.addPinnedChannel(s),["prevent","stop"]),onMousedown:n[0]||(n[0]=F(()=>{},["prevent","stop"]))},ve,42,ge)),[[y],[H,t.isPinnedChannel(s)?"ピン留めを外す":"ピン留めする"]])]),e("div",fe,[e("div",we,[e("span",{class:"channel__program-present-title",innerHTML:t.ProgramUtils.decorateProgramInfo(s.program_present,"title")},null,8,be),e("span",Ce,u(t.ProgramUtils.getProgramTime(s.program_present)),1)]),e("span",{class:"channel__program-present-description",innerHTML:t.ProgramUtils.decorateProgramInfo(s.program_present,"description")},null,8,Se)]),h(Q),e("div",Be,[e("div",Ee,[Fe,ye,e("span",{class:"channel__program-following-title-text",innerHTML:t.ProgramUtils.decorateProgramInfo(s.program_following,"title")},null,8,De)]),e("span",xe,u(t.ProgramUtils.getProgramTime(s.program_following)),1)]),e("div",Pe,[e("div",{class:"channel__progressbar-progress",style:B(`width:${t.ProgramUtils.getProgramProgress(s.program_present)}%;`)},null,4)])]),_:2},1032,["to"])),[[y]])),128)),a==="ピン留め"&&_.length===0?(o(),l("div",ke,[e("div",Ae,[Ue,e("div",He,[r("各チャンネルの "),h(k,{style:{position:"relative",bottom:"-5px"},icon:"fluent:pin-20-filled",width:"22px"}),r(" アイコンから、よくみる"),Me,r("チャンネルをこのタブにピン留めできます。")]),$e])])):E("",!0)],2)]),_:2},1024))),128))]),_:1},512),[[j,Array.from(t.channelsStore.channels_list_with_pinned).length>0]]),Array.from(t.channelsStore.channels_list_with_pinned).length===0?(o(),l("div",Te,Le)):E("",!0)],2)])])}const Ge=L(W,[["render",Ve],["__scopeId","data-v-cb649240"]]);export{Ge as default}; diff --git a/client/dist/assets/Index-URzyaqeB.js b/client/dist/assets/Index-Cgb5zSyW.js similarity index 93% rename from client/dist/assets/Index-URzyaqeB.js rename to client/dist/assets/Index-Cgb5zSyW.js index dc65d7ab..5ca96f9d 100644 --- a/client/dist/assets/Index-URzyaqeB.js +++ b/client/dist/assets/Index-Cgb5zSyW.js @@ -1 +1 @@ -import{d as _,m as d,_ as p,r as l,o as f,c as g,b as t,e as s,h as a,V as i,n as v,t as c,p as h,q as m}from"./index-D2zR81a8.js";import{H as C,N as x,u as b}from"./Navigation-CsJWaG4R.js";import{a as B}from"./VCard-C5ODUzfZ.js";import"./ssrBoot-BvljY2yG.js";import"./VAvatar-CTvU0rd-.js";const w=_({name:"Settings-Index",components:{HeaderBar:C,Navigation:x},computed:{...d(b)},async created(){await this.versionStore.fetchServerVersion()}}),n=o=>(h("data-v-3b1f0664"),o=o(),m(),o),S={class:"route-container"},A={class:"settings-navigation"},y=n(()=>s("h1",{class:"mt-2",style:{"font-size":"24px"}},"設定",-1)),I=n(()=>s("span",{class:"ml-4"},"全般",-1)),V=n(()=>s("span",{class:"ml-4"},"画質",-1)),H=n(()=>s("span",{class:"ml-4"},"字幕",-1)),D=n(()=>s("svg",{width:"26px",height:"26px",viewBox:"0 0 512 512"},[s("path",{fill:"currentColor",d:"M248.039 381.326L355.039 67.8258C367.539 28.3257 395.039 34.3258 406.539 34.3258C431.039 34.3258 453.376 61.3258 441.039 96.8258C362.639 322.426 343.539 375.326 340.539 384.826C338.486 391.326 342.039 391.326 345.539 391.326C377.039 391.326 386.539 418.326 386.539 435.326C386.539 458.826 371.539 477.326 350.039 477.326H214.539C179.039 477.326 85.8269 431.3 88.0387 335.826C91.0387 206.326 192.039 183.326 243.539 183.326H296.539L265.539 272.326H243.539C185.539 272.326 174.113 314.826 176.039 334.326C180.039 374.826 215.039 389.814 237.039 390.326C244.539 390.5 246.039 386.826 248.039 381.326Z"})],-1)),E=n(()=>s("span",{class:"ml-4"},"データ放送",-1)),F=n(()=>s("span",{class:"ml-4"},"キャプチャ",-1)),N=n(()=>s("span",{class:"ml-4"},"アカウント",-1)),k=n(()=>s("span",{class:"ml-4"},"ニコニコ実況",-1)),$=n(()=>s("span",{class:"ml-4"},"Twitter",-1)),j=n(()=>s("span",{class:"ml-4"},"サーバー設定",-1)),q={class:"ml-4"};function z(o,L,T,K,M,U){const u=l("HeaderBar"),r=l("Navigation"),e=l("Icon");return f(),g("div",S,[t(u),s("main",null,[t(r),t(B,{class:"settings-container d-flex px-5 py-5 mx-auto",elevation:"0",width:"100%","max-width":"1000"},{default:a(()=>[s("nav",A,[y,t(i,{variant:"flat",class:"settings-navigation__button mt-6",to:"/settings/general"},{default:a(()=>[t(e,{icon:"fa-solid:sliders-h",width:"26px",style:{padding:"0 3px"}}),I]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/quality"},{default:a(()=>[t(e,{icon:"fluent:video-clip-multiple-16-filled",width:"26px"}),V]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/caption"},{default:a(()=>[t(e,{icon:"fluent:subtitles-16-filled",width:"26px"}),H]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/data-broadcasting"},{default:a(()=>[D,E]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/capture"},{default:a(()=>[t(e,{icon:"fluent:image-multiple-16-filled",width:"26px"}),F]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/account"},{default:a(()=>[t(e,{icon:"fluent:person-20-filled",width:"26px"}),N]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/jikkyo"},{default:a(()=>[t(e,{icon:"bi:chat-left-text-fill",width:"26px",style:{padding:"0 2px"}}),k]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/twitter"},{default:a(()=>[t(e,{icon:"fa-brands:twitter",width:"26px",style:{padding:"0 1px"}}),$]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/server"},{default:a(()=>[t(e,{icon:"fluent:server-surface-16-filled",width:"26px"}),j]),_:1}),t(i,{variant:"flat",class:v(["settings-navigation__button settings-navigation__button--version",{"settings-navigation__button--version-highlight":o.versionStore.is_update_available}]),href:"https://github.com/tsukumijima/KonomiTV"},{default:a(()=>[t(e,{icon:"fluent:info-16-regular",width:"26px"}),s("span",q," version "+c(o.versionStore.client_version)+c(o.versionStore.is_update_available?" (Update Available)":""),1)]),_:1},8,["class"])])]),_:1})])])}const Q=p(w,[["render",z],["__scopeId","data-v-3b1f0664"]]);export{Q as default}; +import{d as _,m as d,_ as p,r as l,o as f,c as g,b as t,e as s,h as a,V as i,n as v,t as c,p as h,q as m}from"./index-Dbi6R656.js";import{H as C,N as x,u as b}from"./Navigation-DZesdvbM.js";import{a as B}from"./VCard-BBvTbBT9.js";import"./ssrBoot-sWDXISB3.js";import"./VAvatar-BrXxzhAv.js";const w=_({name:"Settings-Index",components:{HeaderBar:C,Navigation:x},computed:{...d(b)},async created(){await this.versionStore.fetchServerVersion()}}),n=o=>(h("data-v-3b1f0664"),o=o(),m(),o),S={class:"route-container"},A={class:"settings-navigation"},y=n(()=>s("h1",{class:"mt-2",style:{"font-size":"24px"}},"設定",-1)),I=n(()=>s("span",{class:"ml-4"},"全般",-1)),V=n(()=>s("span",{class:"ml-4"},"画質",-1)),H=n(()=>s("span",{class:"ml-4"},"字幕",-1)),D=n(()=>s("svg",{width:"26px",height:"26px",viewBox:"0 0 512 512"},[s("path",{fill:"currentColor",d:"M248.039 381.326L355.039 67.8258C367.539 28.3257 395.039 34.3258 406.539 34.3258C431.039 34.3258 453.376 61.3258 441.039 96.8258C362.639 322.426 343.539 375.326 340.539 384.826C338.486 391.326 342.039 391.326 345.539 391.326C377.039 391.326 386.539 418.326 386.539 435.326C386.539 458.826 371.539 477.326 350.039 477.326H214.539C179.039 477.326 85.8269 431.3 88.0387 335.826C91.0387 206.326 192.039 183.326 243.539 183.326H296.539L265.539 272.326H243.539C185.539 272.326 174.113 314.826 176.039 334.326C180.039 374.826 215.039 389.814 237.039 390.326C244.539 390.5 246.039 386.826 248.039 381.326Z"})],-1)),E=n(()=>s("span",{class:"ml-4"},"データ放送",-1)),F=n(()=>s("span",{class:"ml-4"},"キャプチャ",-1)),N=n(()=>s("span",{class:"ml-4"},"アカウント",-1)),k=n(()=>s("span",{class:"ml-4"},"ニコニコ実況",-1)),$=n(()=>s("span",{class:"ml-4"},"Twitter",-1)),j=n(()=>s("span",{class:"ml-4"},"サーバー設定",-1)),q={class:"ml-4"};function z(o,L,T,K,M,U){const u=l("HeaderBar"),r=l("Navigation"),e=l("Icon");return f(),g("div",S,[t(u),s("main",null,[t(r),t(B,{class:"settings-container d-flex px-5 py-5 mx-auto",elevation:"0",width:"100%","max-width":"1000"},{default:a(()=>[s("nav",A,[y,t(i,{variant:"flat",class:"settings-navigation__button mt-6",to:"/settings/general"},{default:a(()=>[t(e,{icon:"fa-solid:sliders-h",width:"26px",style:{padding:"0 3px"}}),I]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/quality"},{default:a(()=>[t(e,{icon:"fluent:video-clip-multiple-16-filled",width:"26px"}),V]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/caption"},{default:a(()=>[t(e,{icon:"fluent:subtitles-16-filled",width:"26px"}),H]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/data-broadcasting"},{default:a(()=>[D,E]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/capture"},{default:a(()=>[t(e,{icon:"fluent:image-multiple-16-filled",width:"26px"}),F]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/account"},{default:a(()=>[t(e,{icon:"fluent:person-20-filled",width:"26px"}),N]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/jikkyo"},{default:a(()=>[t(e,{icon:"bi:chat-left-text-fill",width:"26px",style:{padding:"0 2px"}}),k]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/twitter"},{default:a(()=>[t(e,{icon:"fa-brands:twitter",width:"26px",style:{padding:"0 1px"}}),$]),_:1}),t(i,{variant:"flat",class:"settings-navigation__button",to:"/settings/server"},{default:a(()=>[t(e,{icon:"fluent:server-surface-16-filled",width:"26px"}),j]),_:1}),t(i,{variant:"flat",class:v(["settings-navigation__button settings-navigation__button--version",{"settings-navigation__button--version-highlight":o.versionStore.is_update_available}]),href:"https://github.com/tsukumijima/KonomiTV"},{default:a(()=>[t(e,{icon:"fluent:info-16-regular",width:"26px"}),s("span",q," version "+c(o.versionStore.client_version)+c(o.versionStore.is_update_available?" (Update Available)":""),1)]),_:1},8,["class"])])]),_:1})])])}const Q=p(w,[["render",z],["__scopeId","data-v-3b1f0664"]]);export{Q as default}; diff --git a/client/dist/assets/Jikkyo-B_6kQb1w.js b/client/dist/assets/Jikkyo-B_6kQb1w.js deleted file mode 100644 index ba8bba8a..00000000 --- a/client/dist/assets/Jikkyo-B_6kQb1w.js +++ /dev/null @@ -1 +0,0 @@ -import{G as d,d as b,m as k,M as i,U as g,N as D,u as y,_ as V,r as p,o as _,j as $,h as m,e as t,w as U,c as B,b as s,k as c,V as f,i as h,t as F,n as N,R as T,p as I,q as P}from"./index-D2zR81a8.js";import{C as R}from"./CommentMuteSettings-aK-5x8By.js";import{S as M}from"./Base-DG5Aczxr.js";import{V as E}from"./VSlider-S8IhLMNG.js";import{V as O}from"./VSwitch-BiucEdzW.js";import"./VDialog-BE2JXbX2.js";import"./VTextField-DymZQzkG.js";import"./VAvatar-CTvU0rd-.js";import"./VCard-C5ODUzfZ.js";import"./ssrBoot-BvljY2yG.js";import"./VSelect-BuCCGZYb.js";import"./Navigation-CsJWaG4R.js";class L{static async fetchAuthorizationURL(){const e=await d.get("/niconico/auth");return e.type==="error"?(d.showGenericError(e,"ニコニコアカウントとの連携用の認証 URL を取得できませんでした。"),null):e.data.authorization_url}static async logoutAccount(){const e=await d.delete("/niconico/logout");return e.type==="error"?(d.showGenericError(e,"ニコニコアカウントとの連携を解除できませんでした。"),!1):!0}}const w=L,W=b({name:"Settings-Jikkyo",components:{SettingsBase:M,CommentMuteSettings:R},data(){return{comment_mute_settings_modal:!1,is_loading:!0}},computed:{...k(y,D)},async created(){if(await this.userStore.fetchUser(),this.is_loading=!1,location.hash!==""){const u=new URLSearchParams(location.hash.replace("#",""));if(u.get("status")!==null&&u.get("detail")!==null){const e=parseInt(u.get("status")),a=u.get("detail");this.onOAuthCallbackReceived(e,a),history.replaceState(null,""," ")}}},methods:{async loginNiconicoAccount(){if(this.userStore.is_logged_in===!1){i.warning("連携をはじめるには、KonomiTV アカウントにログインしてください。");return}const u=await w.fetchAuthorizationURL();if(u===null)return;if(g.isMobileDevice()===!0){location.href=u;return}const e=window.open(u,"KonomiTV-OAuthPopup",g.getWindowFeatures());if(e===null){i.error("ポップアップウインドウを開けませんでした。");return}const a=async l=>{if(e.closed||g.typeof(l.data)!=="object"||!("KonomiTV-OAuthPopup"in l.data))return;e&&e.close(),window.removeEventListener("message",a);const C=l.data["KonomiTV-OAuthPopup"].status,A=l.data["KonomiTV-OAuthPopup"].detail;this.onOAuthCallbackReceived(C,A)};window.addEventListener("message",a)},async onOAuthCallbackReceived(u,e){if(console.log(`NiconicoAuthCallbackAPI: Status: ${u} / Detail: ${e}`),u!==200){if(e.startsWith("Authorization was denied (access_denied)"))i.error("ニコニコアカウントとの連携がキャンセルされました。");else if(e.startsWith("Failed to get access token (HTTP Error ")){const a=e.replace("Failed to get access token ","");i.error(`アクセストークンの取得に失敗しました。${a}`)}else if(e.startsWith("Failed to get access token (Connection Timeout)"))i.error("アクセストークンの取得に失敗しました。ニコニコで障害が発生している可能性があります。");else if(e.startsWith("Failed to get user information (HTTP Error ")){const a=e.replace("Failed to get user information ","");i.error(`ニコニコアカウントのユーザー情報の取得に失敗しました。${a}`)}else e.startsWith("Failed to get user information (Connection Timeout)")?i.error("ニコニコアカウントのユーザー情報の取得に失敗しました。ニコニコで障害が発生している可能性があります。"):i.error(`ニコニコアカウントとの連携に失敗しました。(${e})`);return}await this.userStore.fetchUser(!0),i.success("ニコニコアカウントと連携しました。")},async logoutNiconicoAccount(){await w.logoutAccount()!==!1&&(await this.userStore.fetchUser(!0),i.success("ニコニコアカウントとの連携を解除しました。"))}}}),n=u=>(I("data-v-a24f4904"),u=u(),P(),u),K={class:"settings__heading"},j=n(()=>t("span",{class:"ml-3"},"ニコニコ実況",-1)),z={key:0,class:"niconico-account niconico-account--anonymous"},G={class:"niconico-account-wrapper"},H=n(()=>t("div",{class:"niconico-account__info ml-4"},[t("div",{class:"niconico-account__info-name"},[t("span",{class:"niconico-account__info-name-text"},"ニコニコアカウントと連携していません")]),t("span",{class:"niconico-account__info-description"}," ニコニコアカウントと連携すると、テレビを見ながらニコニコ実況にコメントできるようになります。 ")],-1)),J={key:1,class:"niconico-account"},q={class:"niconico-account-wrapper"},Q=["src"],X={class:"niconico-account__info"},Y={class:"niconico-account__info-name"},Z={class:"niconico-account__info-name-text"},x={class:"niconico-account__info-description"},uu=n(()=>t("span",{class:"mr-2",style:{"white-space":"nowrap"}},"Niconico User ID:",-1)),eu=["href"],tu={key:0,class:"text-secondary"},su=n(()=>t("div",{class:"settings__item mt-7"},[t("div",{class:"settings__item-heading"},"コメントのミュート設定"),t("div",{class:"settings__item-label"},[c(" 表示したくないコメントを、映像上やコメントリストに表示しないようにミュートできます。"),t("br")])],-1)),ou=n(()=>t("span",{class:"ml-1"},"コメントのミュート設定を開く",-1)),nu={class:"settings__item"},iu=n(()=>t("div",{class:"settings__item-heading"},"コメントの速さ",-1)),au=n(()=>t("div",{class:"settings__item-label"},[c(" プレイヤーに流れるコメントの速さを設定します。"),t("br"),c(" たとえば 1.2 に設定すると、コメントが 1.2 倍速く流れます。"),t("br")],-1)),cu={class:"settings__item"},ru=n(()=>t("div",{class:"settings__item-heading"},"コメントの文字サイズ",-1)),lu=n(()=>t("div",{class:"settings__item-label"},[c(" プレイヤーに流れるコメントの文字サイズの基準値を設定します。"),t("br"),c(" 実際の文字サイズは画面サイズに合わせて調整されます。デフォルトの文字サイズは 34px です。"),t("br")],-1)),_u={class:"settings__item settings__item--switch"},du=n(()=>t("label",{class:"settings__item-heading",for:"close_comment_form_after_sending"},"コメント送信後にコメント入力フォームを閉じる",-1)),mu=n(()=>t("label",{class:"settings__item-label",for:"close_comment_form_after_sending"},[c(" この設定をオンにすると、コメントを送信した後に、コメント入力フォームが自動で閉じるようになります。"),t("br"),c(" コメント入力フォームが表示されたままだと、大半のショートカットキーが文字入力と競合して使えなくなります。とくに理由がなければ、オンにしておくのがおすすめです。"),t("br")],-1));function Bu(u,e,a,l,C,A){const r=p("Icon"),S=p("CommentMuteSettings"),v=p("SettingsBase");return _(),$(v,null,{default:m(()=>[t("h2",K,[U((_(),B("a",{class:"settings__back-button",onClick:e[0]||(e[0]=o=>u.$router.back())},[s(r,{icon:"fluent:arrow-left-12-filled",width:"25px"})])),[[T]]),s(r,{icon:"bi:chat-left-text-fill",width:"19px"}),j]),t("div",{class:N(["settings__content",{"settings__content--loading":u.is_loading}])},[u.userStore.user===null||u.userStore.user.niconico_user_id===null?(_(),B("div",z,[t("div",G,[s(r,{class:"flex-shrink-0",icon:"bi:chat-left-text-fill",width:"45px"}),H]),s(f,{class:"niconico-account__login ml-auto",color:"secondary",width:"130",height:"56",variant:"flat",onClick:e[1]||(e[1]=o=>u.loginNiconicoAccount())},{default:m(()=>[s(r,{icon:"fluent:plug-connected-20-filled",class:"mr-2",height:"26"}),c("連携する ")]),_:1})])):h("",!0),u.userStore.user!==null&&u.userStore.user.niconico_user_id!==null?(_(),B("div",J,[t("div",q,[t("img",{class:"niconico-account__icon",src:u.userStore.user_niconico_icon_url??""},null,8,Q),t("div",X,[t("div",Y,[t("span",Z,F(u.userStore.user.niconico_user_name)+" と連携しています",1)]),t("span",x,[uu,t("a",{class:"link mr-2",href:`https://www.nicovideo.jp/user/${u.userStore.user.niconico_user_id}`,target:"_blank"},F(u.userStore.user.niconico_user_id),9,eu),u.userStore.user.niconico_user_premium===!0?(_(),B("span",tu,"(Premium)")):h("",!0)])])]),s(f,{class:"niconico-account__login ml-auto",color:"secondary",width:"130",height:"56",variant:"flat",onClick:e[2]||(e[2]=o=>u.logoutNiconicoAccount())},{default:m(()=>[s(r,{icon:"fluent:plug-disconnected-20-filled",class:"mr-2",height:"26"}),c("連携解除 ")]),_:1})])):h("",!0),su,s(f,{class:"settings__save-button mt-4",variant:"flat",onClick:e[3]||(e[3]=o=>u.comment_mute_settings_modal=!u.comment_mute_settings_modal)},{default:m(()=>[s(r,{icon:"heroicons-solid:filter",height:"19px"}),ou]),_:1}),t("div",nu,[iu,au,s(E,{class:"settings__item-form",color:"primary","show-ticks":"always","thumb-label":"","hide-details":"",step:.1,min:.5,max:2,modelValue:u.settingsStore.settings.comment_speed_rate,"onUpdate:modelValue":e[4]||(e[4]=o=>u.settingsStore.settings.comment_speed_rate=o)},null,8,["modelValue"])]),t("div",cu,[ru,lu,s(E,{class:"settings__item-form",color:"primary","show-ticks":"always","thumb-label":"","hide-details":"",step:1,min:20,max:60,modelValue:u.settingsStore.settings.comment_font_size,"onUpdate:modelValue":e[5]||(e[5]=o=>u.settingsStore.settings.comment_font_size=o)},null,8,["modelValue"])]),t("div",_u,[du,mu,s(O,{class:"settings__item-switch",color:"primary",id:"close_comment_form_after_sending","hide-details":"",modelValue:u.settingsStore.settings.close_comment_form_after_sending,"onUpdate:modelValue":e[6]||(e[6]=o=>u.settingsStore.settings.close_comment_form_after_sending=o)},null,8,["modelValue"])])],2),s(S,{modelValue:u.comment_mute_settings_modal,"onUpdate:modelValue":e[7]||(e[7]=o=>u.comment_mute_settings_modal=o)},null,8,["modelValue"])]),_:1})}const ku=V(W,[["render",Bu],["__scopeId","data-v-a24f4904"]]);export{ku as default}; diff --git a/client/dist/assets/Jikkyo-Dl7DpmHu.js b/client/dist/assets/Jikkyo-Dl7DpmHu.js new file mode 100644 index 00000000..d7a3cd23 --- /dev/null +++ b/client/dist/assets/Jikkyo-Dl7DpmHu.js @@ -0,0 +1 @@ +import{G as m,d as b,m as S,M as a,U as A,N as y,u as V,_ as $,r as B,o as _,j as U,h as d,e as u,w as N,c as C,b as n,k as s,V as F,i as g,t as f,n as T,R as I,p as P,q as R}from"./index-Dbi6R656.js";import{C as j}from"./CommentMuteSettings-B8qrNY4M.js";import{S as M}from"./Base-D8WlXaKF.js";import{V as h}from"./VSlider-CBNN6xX6.js";import{V as O}from"./VSwitch-Cf-jClsc.js";import"./VDialog-B1HdJyP2.js";import"./VTextField-DTBkpwFs.js";import"./VAvatar-BrXxzhAv.js";import"./VCard-BBvTbBT9.js";import"./ssrBoot-sWDXISB3.js";import"./VSelect-dbg9h4rI.js";import"./Navigation-DZesdvbM.js";class L{static async fetchAuthorizationURL(){const e=await m.get("/niconico/auth");return e.type==="error"?(m.showGenericError(e,"ニコニコアカウントとの連携用の認証 URL を取得できませんでした。"),null):e.data.authorization_url}static async logoutAccount(){const e=await m.delete("/niconico/logout");return e.type==="error"?(m.showGenericError(e,"ニコニコアカウントとの連携を解除できませんでした。"),!1):!0}}const D=L,W=b({name:"Settings-Jikkyo",components:{SettingsBase:M,CommentMuteSettings:j},data(){return{comment_mute_settings_modal:!1,is_loading:!0}},computed:{...S(V,y)},async created(){if(await this.userStore.fetchUser(),this.is_loading=!1,location.hash!==""){const t=new URLSearchParams(location.hash.replace("#",""));if(t.get("status")!==null&&t.get("detail")!==null){const e=parseInt(t.get("status")),c=t.get("detail");this.onOAuthCallbackReceived(e,c),history.replaceState(null,""," ")}}},methods:{async loginNiconicoAccount(){if(this.userStore.is_logged_in===!1){a.warning("連携をはじめるには、KonomiTV アカウントにログインしてください。");return}const t=await D.fetchAuthorizationURL();if(t===null)return;if(A.isMobileDevice()===!0){location.href=t;return}const e=window.open(t,"KonomiTV-OAuthPopup",A.getWindowFeatures());if(e===null){a.error("ポップアップウインドウを開けませんでした。");return}const c=async l=>{if(e.closed||A.typeof(l.data)!=="object"||!("KonomiTV-OAuthPopup"in l.data))return;e&&e.close(),window.removeEventListener("message",c);const E=l.data["KonomiTV-OAuthPopup"].status,p=l.data["KonomiTV-OAuthPopup"].detail;this.onOAuthCallbackReceived(E,p)};window.addEventListener("message",c)},async onOAuthCallbackReceived(t,e){if(console.log(`NiconicoAuthCallbackAPI: Status: ${t} / Detail: ${e}`),t!==200){if(e.startsWith("Authorization was denied (access_denied)"))a.error("ニコニコアカウントとの連携がキャンセルされました。");else if(e.startsWith("Failed to get access token (HTTP Error ")){const c=e.replace("Failed to get access token ","");a.error(`アクセストークンの取得に失敗しました。${c}`)}else if(e.startsWith("Failed to get access token (Connection Timeout)"))a.error("アクセストークンの取得に失敗しました。ニコニコで障害が発生している可能性があります。");else if(e.startsWith("Failed to get user information (HTTP Error ")){const c=e.replace("Failed to get user information ","");a.error(`ニコニコアカウントのユーザー情報の取得に失敗しました。${c}`)}else e.startsWith("Failed to get user information (Connection Timeout)")?a.error("ニコニコアカウントのユーザー情報の取得に失敗しました。ニコニコで障害が発生している可能性があります。"):a.error(`ニコニコアカウントとの連携に失敗しました。(${e})`);return}await this.userStore.fetchUser(!0),a.success("ニコニコアカウントと連携しました。")},async logoutNiconicoAccount(){await D.logoutAccount()!==!1&&(await this.userStore.fetchUser(!0),a.success("ニコニコアカウントとの連携を解除しました。"))}}}),o=t=>(P("data-v-377ff4c9"),t=t(),R(),t),K={class:"settings__heading"},z=o(()=>u("span",{class:"ml-3"},"ニコニコ実況",-1)),G={key:0,class:"niconico-account niconico-account--anonymous"},J={class:"niconico-account-wrapper"},H=o(()=>u("div",{class:"niconico-account__info ml-4"},[u("div",{class:"niconico-account__info-name"},[u("span",{class:"niconico-account__info-name-text"},"ニコニコアカウントと連携していません")]),u("span",{class:"niconico-account__info-description"}," ニコニコアカウントと連携すると、テレビを見ながらニコニコ実況にコメントできるようになります。 ")],-1)),q={key:1,class:"niconico-account"},X={class:"niconico-account-wrapper"},Q=["src"],Y={class:"niconico-account__info"},Z={class:"niconico-account__info-name"},x={class:"niconico-account__info-name-text"},uu={class:"niconico-account__info-description"},tu=o(()=>u("span",{class:"mr-2",style:{"white-space":"nowrap"}},"Niconico User ID:",-1)),eu=["href"],su={key:0,class:"text-secondary"},ou={class:"settings__item-label mt-7",style:{"border-left":"3px solid rgb(var(--v-theme-text-darken-1))","padding-left":"12px"}},nu=o(()=>u("br",null,null,-1)),iu=o(()=>u("div",{class:"mt-1"},null,-1)),au=o(()=>u("a",{class:"link",href:"https://jk.nicovideo.jp",target:"_blank"},"ニコニコ実況",-1)),cu=o(()=>u("a",{class:"link",href:"https://nx-jikkyo.tsukumijima.net",target:"_blank"},"NX-Jikkyo",-1)),ru=o(()=>u("div",{class:"settings__item"},[u("div",{class:"settings__item-heading"},"コメントのミュート設定"),u("div",{class:"settings__item-label"},[s(" 表示したくないコメントを、映像上やコメントリストに表示しないようにミュートできます。"),u("br")]),u("div",{class:"settings__item-label mt-2"},[s(" デフォルトでは、下記のミュート設定がオンになっています。"),u("br"),s(" これらのコメントも表示したい方は、適宜オフに設定してください。"),u("br"),u("ul",{class:"ml-5 mt-2"},[u("li",null,"露骨な表現を含むコメントをミュートする"),u("li",null,"ネガティブな表現、差別的な表現、政治的に偏った表現を含むコメントをミュートする"),u("li",null,"文字サイズが大きいコメントをミュートする")])])],-1)),lu=o(()=>u("span",{class:"ml-1"},"コメントのミュート設定を開く",-1)),_u={class:"settings__item"},du=o(()=>u("div",{class:"settings__item-heading"},"コメントの速さ",-1)),mu=o(()=>u("div",{class:"settings__item-label"},[s(" プレイヤーに流れるコメントの速さを設定します。"),u("br"),s(" たとえば 1.2 に設定すると、コメントが 1.2 倍速く流れます。"),u("br")],-1)),Bu={class:"settings__item"},Cu=o(()=>u("div",{class:"settings__item-heading"},"コメントの文字サイズ",-1)),Au=o(()=>u("div",{class:"settings__item-label"},[s(" プレイヤーに流れるコメントの文字サイズの基準値を設定します。"),u("br"),s(" 実際の文字サイズは画面サイズに合わせて調整されます。デフォルトの文字サイズは 34px です。"),u("br")],-1)),Fu={class:"settings__item settings__item--switch"},gu=o(()=>u("label",{class:"settings__item-heading",for:"close_comment_form_after_sending"},"コメント送信後にコメント入力フォームを閉じる",-1)),Eu=o(()=>u("label",{class:"settings__item-label",for:"close_comment_form_after_sending"},[s(" この設定をオンにすると、コメントを送信した後に、コメント入力フォームが自動で閉じるようになります。"),u("br"),s(" コメント入力フォームが表示されたままだと、大半のショートカットキーが文字入力と競合して使えなくなります。とくに理由がなければ、オンにしておくのがおすすめです。"),u("br")],-1));function pu(t,e,c,l,E,p){const r=B("Icon"),w=B("router-link"),k=B("CommentMuteSettings"),v=B("SettingsBase");return _(),U(v,null,{default:d(()=>[u("h2",K,[N((_(),C("a",{class:"settings__back-button",onClick:e[0]||(e[0]=i=>t.$router.back())},[n(r,{icon:"fluent:arrow-left-12-filled",width:"25px"})])),[[I]]),n(r,{icon:"bi:chat-left-text-fill",width:"19px"}),z]),u("div",{class:T(["settings__content",{"settings__content--loading":t.is_loading}])},[t.userStore.user===null||t.userStore.user.niconico_user_id===null?(_(),C("div",G,[u("div",J,[n(r,{class:"flex-shrink-0",icon:"bi:chat-left-text-fill",width:"45px"}),H]),n(F,{class:"niconico-account__login ml-auto",color:"secondary",width:"130",height:"56",variant:"flat",onClick:e[1]||(e[1]=i=>t.loginNiconicoAccount())},{default:d(()=>[n(r,{icon:"fluent:plug-connected-20-filled",class:"mr-2",height:"26"}),s("連携する ")]),_:1})])):g("",!0),t.userStore.user!==null&&t.userStore.user.niconico_user_id!==null?(_(),C("div",q,[u("div",X,[u("img",{class:"niconico-account__icon",src:t.userStore.user_niconico_icon_url??""},null,8,Q),u("div",Y,[u("div",Z,[u("span",x,f(t.userStore.user.niconico_user_name)+" と連携しています",1)]),u("span",uu,[tu,u("a",{class:"link mr-2",href:`https://www.nicovideo.jp/user/${t.userStore.user.niconico_user_id}`,target:"_blank"},f(t.userStore.user.niconico_user_id),9,eu),t.userStore.user.niconico_user_premium===!0?(_(),C("span",su,"(Premium)")):g("",!0)])])]),n(F,{class:"niconico-account__login ml-auto",color:"secondary",width:"130",height:"56",variant:"flat",onClick:e[2]||(e[2]=i=>t.logoutNiconicoAccount())},{default:d(()=>[n(r,{icon:"fluent:plug-disconnected-20-filled",class:"mr-2",height:"26"}),s("連携解除 ")]),_:1})])):g("",!0),u("div",ou,[s(" コメントの透明度は、プレイヤー下にある設定アイコン ⚙️ から変更できます。"),nu,iu,au,s(" の代わりに "),cu,s(" の実況コメントをリアルタイム表示するには、"),n(w,{class:"link",to:"/settings/server"},{default:d(()=>[s("サーバー設定")]),_:1}),s(" → [テレビのライブストリーミング]に移動してください。 ")]),ru,n(F,{class:"settings__save-button mt-4",variant:"flat",onClick:e[3]||(e[3]=i=>t.comment_mute_settings_modal=!t.comment_mute_settings_modal)},{default:d(()=>[n(r,{icon:"heroicons-solid:filter",height:"19px"}),lu]),_:1}),u("div",_u,[du,mu,n(h,{class:"settings__item-form",color:"primary","show-ticks":"always","thumb-label":"","hide-details":"",step:.1,min:.5,max:2,modelValue:t.settingsStore.settings.comment_speed_rate,"onUpdate:modelValue":e[4]||(e[4]=i=>t.settingsStore.settings.comment_speed_rate=i)},null,8,["modelValue"])]),u("div",Bu,[Cu,Au,n(h,{class:"settings__item-form",color:"primary","show-ticks":"always","thumb-label":"","hide-details":"",step:1,min:20,max:60,modelValue:t.settingsStore.settings.comment_font_size,"onUpdate:modelValue":e[5]||(e[5]=i=>t.settingsStore.settings.comment_font_size=i)},null,8,["modelValue"])]),u("div",Fu,[gu,Eu,n(O,{class:"settings__item-switch",color:"primary",id:"close_comment_form_after_sending","hide-details":"",modelValue:t.settingsStore.settings.close_comment_form_after_sending,"onUpdate:modelValue":e[6]||(e[6]=i=>t.settingsStore.settings.close_comment_form_after_sending=i)},null,8,["modelValue"])])],2),n(k,{modelValue:t.comment_mute_settings_modal,"onUpdate:modelValue":e[7]||(e[7]=i=>t.comment_mute_settings_modal=i)},null,8,["modelValue"])]),_:1})}const Nu=$(W,[["render",pu],["__scopeId","data-v-377ff4c9"]]);export{Nu as default}; diff --git a/client/dist/assets/Jikkyo.tkdegJaQ.css b/client/dist/assets/Jikkyo.BXj39bNx.css similarity index 51% rename from client/dist/assets/Jikkyo.tkdegJaQ.css rename to client/dist/assets/Jikkyo.BXj39bNx.css index 7e05492d..d94ffc88 100644 --- a/client/dist/assets/Jikkyo.tkdegJaQ.css +++ b/client/dist/assets/Jikkyo.BXj39bNx.css @@ -1 +1 @@ -.settings__content[data-v-a24f4904]{opacity:1;transition:opacity .4s}.settings__content--loading[data-v-a24f4904]{opacity:0}.niconico-account[data-v-a24f4904]{display:flex;align-items:center;height:120px;padding:20px;border-radius:15px;background:rgb(var(--v-theme-background-lighten-2))}@media (min-width: 960.01px) and (max-width: 1280px) and (orientation: landscape){.niconico-account[data-v-a24f4904]{align-items:normal;flex-direction:column;height:auto;padding:16px}}@media (min-width: 600.1px) and (max-width: 1280px) and (orientation: portrait){.niconico-account[data-v-a24f4904]{align-items:normal;flex-direction:column;height:auto;padding:16px}.niconico-account .niconico-account-wrapper .niconico-account__info[data-v-a24f4904]{margin-left:16px!important;margin-right:0!important}.niconico-account .niconico-account-wrapper .niconico-account__info-name-text[data-v-a24f4904]{font-size:18.5px}.niconico-account .niconico-account-wrapper .niconico-account__info-description[data-v-a24f4904]{font-size:13.5px}}@media (max-width: 960px) and (orientation: landscape){.niconico-account[data-v-a24f4904]{align-items:normal;flex-direction:column;height:auto;padding:16px;border-radius:10px}.niconico-account .niconico-account-wrapper .niconico-account__info[data-v-a24f4904]{margin-right:0!important}}@media (max-width: 680px) and (orientation: landscape){.niconico-account .niconico-account-wrapper .niconico-account__info[data-v-a24f4904]{margin-left:16px!important}.niconico-account .niconico-account-wrapper .niconico-account__info-name-text[data-v-a24f4904]{font-size:18px}.niconico-account .niconico-account-wrapper .niconico-account__info-description[data-v-a24f4904]{font-size:13px}}@media (max-width: 600px) and (orientation: portrait){.niconico-account[data-v-a24f4904]{align-items:normal;flex-direction:column;height:auto;padding:16px 12px;border-radius:10px}.niconico-account .niconico-account-wrapper .niconico-account__info[data-v-a24f4904]{margin-left:12px!important;margin-right:0!important}.niconico-account .niconico-account-wrapper .niconico-account__info-name-text[data-v-a24f4904]{font-size:17px}.niconico-account .niconico-account-wrapper .niconico-account__info-description[data-v-a24f4904]{font-size:13px}}@media (min-width: 600.1px) and (max-width: 1280px) and (orientation: portrait){.niconico-account--anonymous .niconico-account__login[data-v-a24f4904]{margin-top:12px}}@media (max-width: 960px) and (orientation: landscape){.niconico-account--anonymous .niconico-account__login[data-v-a24f4904]{margin-top:12px}}@media (max-width: 680px) and (orientation: landscape){.niconico-account--anonymous .niconico-account-wrapper svg[data-v-a24f4904]{display:none}.niconico-account--anonymous .niconico-account-wrapper .niconico-account__info[data-v-a24f4904]{margin-left:0!important}}@media (max-width: 600px) and (orientation: portrait){.niconico-account--anonymous[data-v-a24f4904]{padding-top:20px}.niconico-account--anonymous .niconico-account__login[data-v-a24f4904]{margin-top:16px}.niconico-account--anonymous .niconico-account-wrapper svg[data-v-a24f4904]{display:none}.niconico-account--anonymous .niconico-account-wrapper .niconico-account__info[data-v-a24f4904]{margin-left:0!important;margin-right:0!important}}.niconico-account-wrapper[data-v-a24f4904]{display:flex;align-items:center;min-width:0;height:80px}@media (max-width: 600px) and (orientation: portrait){.niconico-account-wrapper[data-v-a24f4904]{height:60px}}.niconico-account__icon[data-v-a24f4904]{flex-shrink:0;min-width:80px;height:100%;border-radius:50%;object-fit:cover;background:linear-gradient(150deg,rgb(var(--v-theme-gray)),rgb(var(--v-theme-background-lighten-2)));image-rendering:-webkit-optimize-contrast}@media (max-width: 600px) and (orientation: portrait){.niconico-account__icon[data-v-a24f4904]{width:60px;min-width:60px;height:60px}}.niconico-account__info[data-v-a24f4904]{display:flex;flex-direction:column;min-width:0;margin-left:20px;margin-right:16px}.niconico-account__info-name[data-v-a24f4904]{display:inline-flex;align-items:center;height:33px}@media (max-width: 600px) and (orientation: portrait){.niconico-account__info-name[data-v-a24f4904]{height:auto}}.niconico-account__info-name-text[data-v-a24f4904]{display:inline-block;font-size:20px;color:rgb(var(--v-theme-text));font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.niconico-account__info-description[data-v-a24f4904]{display:inline-block;margin-top:4px;color:rgb(var(--v-theme-text-darken-1));font-size:14px}.niconico-account__login[data-v-a24f4904]{border-radius:7px;font-size:16px;letter-spacing:0}@media (min-width: 960.01px) and (max-width: 1280px) and (orientation: landscape){.niconico-account__login[data-v-a24f4904]{height:50px!important;margin-top:12px;margin-right:auto}}@media (min-width: 600.1px) and (max-width: 1280px) and (orientation: portrait){.niconico-account__login[data-v-a24f4904]{height:42px!important;margin-top:8px;margin-right:auto;font-size:14.5px}}@media (max-width: 960px) and (orientation: landscape){.niconico-account__login[data-v-a24f4904]{height:42px!important;margin-top:8px;margin-right:auto;font-size:14.5px}}@media (max-width: 600px) and (orientation: portrait){.niconico-account__login[data-v-a24f4904]{height:42px!important;margin-top:16px;margin-right:auto;font-size:14.5px}} +.settings__content[data-v-377ff4c9]{opacity:1;transition:opacity .4s}.settings__content--loading[data-v-377ff4c9]{opacity:0}.niconico-account[data-v-377ff4c9]{display:flex;align-items:center;height:120px;padding:20px;border-radius:15px;background:rgb(var(--v-theme-background-lighten-2))}@media (min-width: 960.01px) and (max-width: 1280px) and (orientation: landscape){.niconico-account[data-v-377ff4c9]{align-items:normal;flex-direction:column;height:auto;padding:16px}}@media (min-width: 600.1px) and (max-width: 1280px) and (orientation: portrait){.niconico-account[data-v-377ff4c9]{align-items:normal;flex-direction:column;height:auto;padding:16px}.niconico-account .niconico-account-wrapper .niconico-account__info[data-v-377ff4c9]{margin-left:16px!important;margin-right:0!important}.niconico-account .niconico-account-wrapper .niconico-account__info-name-text[data-v-377ff4c9]{font-size:18.5px}.niconico-account .niconico-account-wrapper .niconico-account__info-description[data-v-377ff4c9]{font-size:13.5px}}@media (max-width: 960px) and (orientation: landscape){.niconico-account[data-v-377ff4c9]{align-items:normal;flex-direction:column;height:auto;padding:16px;border-radius:10px}.niconico-account .niconico-account-wrapper .niconico-account__info[data-v-377ff4c9]{margin-right:0!important}}@media (max-width: 680px) and (orientation: landscape){.niconico-account .niconico-account-wrapper .niconico-account__info[data-v-377ff4c9]{margin-left:16px!important}.niconico-account .niconico-account-wrapper .niconico-account__info-name-text[data-v-377ff4c9]{font-size:18px}.niconico-account .niconico-account-wrapper .niconico-account__info-description[data-v-377ff4c9]{font-size:13px}}@media (max-width: 600px) and (orientation: portrait){.niconico-account[data-v-377ff4c9]{align-items:normal;flex-direction:column;height:auto;padding:16px 12px;border-radius:10px}.niconico-account .niconico-account-wrapper .niconico-account__info[data-v-377ff4c9]{margin-left:12px!important;margin-right:0!important}.niconico-account .niconico-account-wrapper .niconico-account__info-name-text[data-v-377ff4c9]{font-size:17px}.niconico-account .niconico-account-wrapper .niconico-account__info-description[data-v-377ff4c9]{font-size:13px}}@media (min-width: 600.1px) and (max-width: 1280px) and (orientation: portrait){.niconico-account--anonymous .niconico-account__login[data-v-377ff4c9]{margin-top:12px}}@media (max-width: 960px) and (orientation: landscape){.niconico-account--anonymous .niconico-account__login[data-v-377ff4c9]{margin-top:12px}}@media (max-width: 680px) and (orientation: landscape){.niconico-account--anonymous .niconico-account-wrapper svg[data-v-377ff4c9]{display:none}.niconico-account--anonymous .niconico-account-wrapper .niconico-account__info[data-v-377ff4c9]{margin-left:0!important}}@media (max-width: 600px) and (orientation: portrait){.niconico-account--anonymous[data-v-377ff4c9]{padding-top:20px}.niconico-account--anonymous .niconico-account__login[data-v-377ff4c9]{margin-top:16px}.niconico-account--anonymous .niconico-account-wrapper svg[data-v-377ff4c9]{display:none}.niconico-account--anonymous .niconico-account-wrapper .niconico-account__info[data-v-377ff4c9]{margin-left:0!important;margin-right:0!important}}.niconico-account-wrapper[data-v-377ff4c9]{display:flex;align-items:center;min-width:0;height:80px}@media (max-width: 600px) and (orientation: portrait){.niconico-account-wrapper[data-v-377ff4c9]{height:60px}}.niconico-account__icon[data-v-377ff4c9]{flex-shrink:0;min-width:80px;height:100%;border-radius:50%;object-fit:cover;background:linear-gradient(150deg,rgb(var(--v-theme-gray)),rgb(var(--v-theme-background-lighten-2)));image-rendering:-webkit-optimize-contrast}@media (max-width: 600px) and (orientation: portrait){.niconico-account__icon[data-v-377ff4c9]{width:60px;min-width:60px;height:60px}}.niconico-account__info[data-v-377ff4c9]{display:flex;flex-direction:column;min-width:0;margin-left:20px;margin-right:16px}.niconico-account__info-name[data-v-377ff4c9]{display:inline-flex;align-items:center;height:33px}@media (max-width: 600px) and (orientation: portrait){.niconico-account__info-name[data-v-377ff4c9]{height:auto}}.niconico-account__info-name-text[data-v-377ff4c9]{display:inline-block;font-size:20px;color:rgb(var(--v-theme-text));font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.niconico-account__info-description[data-v-377ff4c9]{display:inline-block;margin-top:4px;color:rgb(var(--v-theme-text-darken-1));font-size:14px}.niconico-account__login[data-v-377ff4c9]{border-radius:7px;font-size:16px;letter-spacing:0}@media (min-width: 960.01px) and (max-width: 1280px) and (orientation: landscape){.niconico-account__login[data-v-377ff4c9]{height:50px!important;margin-top:12px;margin-right:auto}}@media (min-width: 600.1px) and (max-width: 1280px) and (orientation: portrait){.niconico-account__login[data-v-377ff4c9]{height:42px!important;margin-top:8px;margin-right:auto;font-size:14.5px}}@media (max-width: 960px) and (orientation: landscape){.niconico-account__login[data-v-377ff4c9]{height:42px!important;margin-top:8px;margin-right:auto;font-size:14.5px}}@media (max-width: 600px) and (orientation: portrait){.niconico-account__login[data-v-377ff4c9]{height:42px!important;margin-top:16px;margin-right:auto;font-size:14.5px}} diff --git a/client/dist/assets/LivePSIArchivedDataDecoder-BHXU14x5.js b/client/dist/assets/LivePSIArchivedDataDecoder-UNf1hsdD.js similarity index 99% rename from client/dist/assets/LivePSIArchivedDataDecoder-BHXU14x5.js rename to client/dist/assets/LivePSIArchivedDataDecoder-UNf1hsdD.js index 1e082260..d9ad67fc 100644 --- a/client/dist/assets/LivePSIArchivedDataDecoder-BHXU14x5.js +++ b/client/dist/assets/LivePSIArchivedDataDecoder-UNf1hsdD.js @@ -103,7 +103,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho self.addEventListener('message', msg => { setInterval(() => self.postMessage(null), msg.data); }); - `,a=new Worker(`data:text/javascript;base64,${btoa(l)}`);return a.onmessage=()=>e(...s),a.postMessage(t),()=>a.terminate()}catch{const a=setInterval(e,t,...s);return()=>clearInterval(a)}}static async sleep(e){return await new Promise(t=>setTimeout(t,e*1e3))}static time(){return Date.now()/1e3}static typeof(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}static URLtoLink(e){e=fr.escapeHTML(e);const t=/(https?:\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/ig;return e.replace(t,'$1')}static async waitUntilOnline(){return await new Promise(e=>{window.addEventListener("online",()=>e())})}};Z(fr,"version","0.10.0"),Z(fr,"api_base_url",`${self.location.protocol}//${self.location.host}/api`);let Je=fr;/** + `,a=new Worker(`data:text/javascript;base64,${btoa(l)}`);return a.onmessage=()=>e(...s),a.postMessage(t),()=>a.terminate()}catch{const a=setInterval(e,t,...s);return()=>clearInterval(a)}}static async sleep(e){return await new Promise(t=>setTimeout(t,e*1e3))}static time(){return Date.now()/1e3}static typeof(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}static URLtoLink(e){e=fr.escapeHTML(e);const t=/(https?:\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/ig;return e.replace(t,'$1')}static async waitUntilOnline(){return await new Promise(e=>{window.addEventListener("online",()=>e())})}};Z(fr,"version","0.10.1"),Z(fr,"api_base_url",`${self.location.protocol}//${self.location.host}/api`);let Je=fr;/** * @vue/shared v3.4.12 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT @@ -121,9 +121,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * @license MIT */let U1;const Ql=r=>U1=r,C7=Symbol();function ef(r){return r&&typeof r=="object"&&Object.prototype.toString.call(r)==="[object Object]"&&typeof r.toJSON!="function"}var Hn;(function(r){r.direct="direct",r.patchObject="patch object",r.patchFunction="patch function"})(Hn||(Hn={}));const z1=()=>{};function G1(r,e,t,s=z1){r.push(e);const l=()=>{const a=r.indexOf(e);a>-1&&(r.splice(a,1),s())};return!t&&l1()&&Nw(l),l}function pn(r,...e){r.slice().forEach(t=>{t(...e)})}const B7=r=>r();function tf(r,e){r instanceof Map&&e instanceof Map&&e.forEach((t,s)=>r.set(s,t)),r instanceof Set&&e instanceof Set&&e.forEach(r.add,r);for(const t in e){if(!e.hasOwnProperty(t))continue;const s=e[t],l=r[t];ef(l)&&ef(s)&&r.hasOwnProperty(t)&&!Et(s)&&!ln(s)?r[t]=tf(l,s):r[t]=s}return r}const O7=Symbol();function k7(r){return!ef(r)||!r.hasOwnProperty(O7)}const{assign:cr}=Object;function I7(r){return!!(Et(r)&&r.effect)}function P7(r,e,t,s){const{state:l,actions:a,getters:o}=e,f=t.state.value[r];let n;function i(){f||(t.state.value[r]=l?l():{});const c=u7(t.state.value[r]);return cr(c,a,Object.keys(o||{}).reduce((d,u)=>(d[u]=o7(A7(()=>{Ql(t);const h=t._s.get(r);return o[u].call(h,h)})),d),{}))}return n=H1(r,i,e,t,s,!0),n}function H1(r,e,t={},s,l,a){let o;const f=cr({actions:{}},t),n={deep:!0};let i,c,d=[],u=[],h;const b=s.state.value[r];!a&&!b&&(s.state.value[r]={}),c7({});let x;function S(M){let O;i=c=!1,typeof M=="function"?(M(s.state.value[r]),O={type:Hn.patchFunction,storeId:r,events:h}):(tf(s.state.value[r],M),O={type:Hn.patchObject,payload:M,storeId:r,events:h});const k=x=Symbol();_7().then(()=>{x===k&&(i=!0)}),c=!0,pn(d,O,s.state.value[r])}const T=a?function(){const{state:O}=t,k=O?O():{};this.$patch(V=>{cr(V,k)})}:z1;function m(){o.stop(),d=[],u=[],s._s.delete(r)}function _(M,O){return function(){Ql(s);const k=Array.from(arguments),V=[],re=[];function Y(X){V.push(X)}function G(X){re.push(X)}pn(u,{args:k,name:M,store:v,after:Y,onError:G});let ne;try{ne=O.apply(this&&this.$id===r?this:v,k)}catch(X){throw pn(re,X),X}return ne instanceof Promise?ne.then(X=>(pn(V,X),X)).catch(X=>(pn(re,X),Promise.reject(X))):(pn(V,ne),ne)}}const g={_p:s,$id:r,$onAction:G1.bind(null,u),$patch:S,$reset:T,$subscribe(M,O={}){const k=G1(d,M,O.detached,()=>V()),V=o.run(()=>D7(()=>s.state.value[r],re=>{(O.flush==="sync"?c:i)&&M({storeId:r,type:Hn.direct,events:h},re)},cr({},n,O)));return k},$dispose:m},v=Wl(g);s._s.set(r,v);const B=(s._a&&s._a.runWithContext||B7)(()=>s._e.run(()=>(o=Fw()).run(e)));for(const M in B){const O=B[M];if(Et(O)&&!I7(O)||ln(O))a||(b&&k7(O)&&(Et(O)?O.value=b[M]:tf(O,b[M])),s.state.value[r][M]=O);else if(typeof O=="function"){const k=_(M,O);B[M]=k,f.actions[M]=O}}return cr(v,B),cr(Fe(v),B),Object.defineProperty(v,"$state",{get:()=>s.state.value[r],set:M=>{S(O=>{cr(O,M)})}}),s._p.forEach(M=>{cr(v,o.run(()=>M({store:v,app:s._a,pinia:s,options:f})))}),b&&a&&t.hydrate&&t.hydrate(v.$state,b),i=!0,c=!0,v}function rf(r,e,t){let s,l;const a=typeof e=="function";typeof r=="string"?(s=r,l=a?t:e):(l=r,s=r.id);function o(f,n){const i=T7();return f=f||(i?N1(C7,null):null),f&&Ql(f),f=U1,f._s.has(s)||(a?H1(s,e,l,f):P7(s,l,f)),f._s.get(s)}return o.$id=s,o}function q1(r,e){return function(){return r.apply(e,arguments)}}const{toString:R7}=Object.prototype,{getPrototypeOf:nf}=Object,us=(r=>e=>{const t=R7.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Ct=r=>(r=r.toLowerCase(),e=>us(e)===r),ds=r=>e=>typeof e===r,{isArray:hn}=Array,qn=ds("undefined");function j7(r){return r!==null&&!qn(r)&&r.constructor!==null&&!qn(r.constructor)&&Dt(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const W1=Ct("ArrayBuffer");function M7(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&W1(r.buffer),e}const F7=ds("string"),Dt=ds("function"),V1=ds("number"),ps=r=>r!==null&&typeof r=="object",L7=r=>r===!0||r===!1,hs=r=>{if(us(r)!=="object")return!1;const e=nf(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},N7=Ct("Date"),$7=Ct("File"),U7=Ct("Blob"),z7=Ct("FileList"),G7=r=>ps(r)&&Dt(r.pipe),H7=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||Dt(r.append)&&((e=us(r))==="formdata"||e==="object"&&Dt(r.toString)&&r.toString()==="[object FormData]"))},q7=Ct("URLSearchParams"),[W7,V7,Y7,K7]=["ReadableStream","Request","Response","Headers"].map(Ct),Z7=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Wn(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let s,l;if(typeof r!="object"&&(r=[r]),hn(r))for(s=0,l=r.length;s0;)if(l=t[s],e===l.toLowerCase())return l;return null}const K1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Z1=r=>!qn(r)&&r!==K1;function sf(){const{caseless:r}=Z1(this)&&this||{},e={},t=(s,l)=>{const a=r&&Y1(e,l)||l;hs(e[a])&&hs(s)?e[a]=sf(e[a],s):hs(s)?e[a]=sf({},s):hn(s)?e[a]=s.slice():e[a]=s};for(let s=0,l=arguments.length;s(Wn(e,(l,a)=>{t&&Dt(l)?r[a]=q1(l,t):r[a]=l},{allOwnKeys:s}),r),X7=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Q7=(r,e,t,s)=>{r.prototype=Object.create(e.prototype,s),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},e9=(r,e,t,s)=>{let l,a,o;const f={};if(e=e||{},r==null)return e;do{for(l=Object.getOwnPropertyNames(r),a=l.length;a-- >0;)o=l[a],(!s||s(o,r,e))&&!f[o]&&(e[o]=r[o],f[o]=!0);r=t!==!1&&nf(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},t9=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;const s=r.indexOf(e,t);return s!==-1&&s===t},r9=r=>{if(!r)return null;if(hn(r))return r;let e=r.length;if(!V1(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},n9=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&nf(Uint8Array)),i9=(r,e)=>{const s=(r&&r[Symbol.iterator]).call(r);let l;for(;(l=s.next())&&!l.done;){const a=l.value;e.call(r,a[0],a[1])}},s9=(r,e)=>{let t;const s=[];for(;(t=r.exec(e))!==null;)s.push(t);return s},o9=Ct("HTMLFormElement"),a9=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,l){return s.toUpperCase()+l}),J1=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),c9=Ct("RegExp"),X1=(r,e)=>{const t=Object.getOwnPropertyDescriptors(r),s={};Wn(t,(l,a)=>{let o;(o=e(l,a,r))!==!1&&(s[a]=o||l)}),Object.defineProperties(r,s)},l9=r=>{X1(r,(e,t)=>{if(Dt(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const s=r[t];if(Dt(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},f9=(r,e)=>{const t={},s=l=>{l.forEach(a=>{t[a]=!0})};return hn(r)?s(r):s(String(r).split(e)),t},u9=()=>{},d9=(r,e)=>r!=null&&Number.isFinite(r=+r)?r:e,of="abcdefghijklmnopqrstuvwxyz",Q1="0123456789",ep={DIGIT:Q1,ALPHA:of,ALPHA_DIGIT:of+of.toUpperCase()+Q1},p9=(r=16,e=ep.ALPHA_DIGIT)=>{let t="";const{length:s}=e;for(;r--;)t+=e[Math.random()*s|0];return t};function h9(r){return!!(r&&Dt(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}const _9=r=>{const e=new Array(10),t=(s,l)=>{if(ps(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[l]=s;const a=hn(s)?[]:{};return Wn(s,(o,f)=>{const n=t(o,l+1);!qn(n)&&(a[f]=n)}),e[l]=void 0,a}}return s};return t(r,0)},b9=Ct("AsyncFunction");var ve={isArray:hn,isArrayBuffer:W1,isBuffer:j7,isFormData:H7,isArrayBufferView:M7,isString:F7,isNumber:V1,isBoolean:L7,isObject:ps,isPlainObject:hs,isReadableStream:W7,isRequest:V7,isResponse:Y7,isHeaders:K7,isUndefined:qn,isDate:N7,isFile:$7,isBlob:U7,isRegExp:c9,isFunction:Dt,isStream:G7,isURLSearchParams:q7,isTypedArray:n9,isFileList:z7,forEach:Wn,merge:sf,extend:J7,trim:Z7,stripBOM:X7,inherits:Q7,toFlatObject:e9,kindOf:us,kindOfTest:Ct,endsWith:t9,toArray:r9,forEachEntry:i9,matchAll:s9,isHTMLForm:o9,hasOwnProperty:J1,hasOwnProp:J1,reduceDescriptors:X1,freezeMethods:l9,toObjectSet:f9,toCamelCase:a9,noop:u9,toFiniteNumber:d9,findKey:Y1,global:K1,isContextDefined:Z1,ALPHABET:ep,generateString:p9,isSpecCompliantForm:h9,toJSONObject:_9,isAsyncFn:b9,isThenable:r=>r&&(ps(r)||Dt(r))&&Dt(r.then)&&Dt(r.catch)};function Pe(r,e,t,s,l){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),s&&(this.request=s),l&&(this.response=l)}ve.inherits(Pe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ve.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const tp=Pe.prototype,rp={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{rp[r]={value:r}}),Object.defineProperties(Pe,rp),Object.defineProperty(tp,"isAxiosError",{value:!0}),Pe.from=(r,e,t,s,l,a)=>{const o=Object.create(tp);return ve.toFlatObject(r,o,function(n){return n!==Error.prototype},f=>f!=="isAxiosError"),Pe.call(o,r.message,e,t,s,l),o.cause=r,o.name=r.name,a&&Object.assign(o,a),o};var m9=null;function af(r){return ve.isPlainObject(r)||ve.isArray(r)}function np(r){return ve.endsWith(r,"[]")?r.slice(0,-2):r}function ip(r,e,t){return r?r.concat(e).map(function(l,a){return l=np(l),!t&&a?"["+l+"]":l}).join(t?".":""):e}function g9(r){return ve.isArray(r)&&!r.some(af)}const y9=ve.toFlatObject(ve,{},null,function(e){return/^is[A-Z]/.test(e)});function _s(r,e,t){if(!ve.isObject(r))throw new TypeError("target must be an object");e=e||new FormData,t=ve.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,S){return!ve.isUndefined(S[x])});const s=t.metaTokens,l=t.visitor||c,a=t.dots,o=t.indexes,n=(t.Blob||typeof Blob<"u"&&Blob)&&ve.isSpecCompliantForm(e);if(!ve.isFunction(l))throw new TypeError("visitor must be a function");function i(b){if(b===null)return"";if(ve.isDate(b))return b.toISOString();if(!n&&ve.isBlob(b))throw new Pe("Blob is not supported. Use a Buffer instead.");return ve.isArrayBuffer(b)||ve.isTypedArray(b)?n&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function c(b,x,S){let T=b;if(b&&!S&&typeof b=="object"){if(ve.endsWith(x,"{}"))x=s?x:x.slice(0,-2),b=JSON.stringify(b);else if(ve.isArray(b)&&g9(b)||(ve.isFileList(b)||ve.endsWith(x,"[]"))&&(T=ve.toArray(b)))return x=np(x),T.forEach(function(_,g){!(ve.isUndefined(_)||_===null)&&e.append(o===!0?ip([x],g,a):o===null?x:x+"[]",i(_))}),!1}return af(b)?!0:(e.append(ip(S,x,a),i(b)),!1)}const d=[],u=Object.assign(y9,{defaultVisitor:c,convertValue:i,isVisitable:af});function h(b,x){if(!ve.isUndefined(b)){if(d.indexOf(b)!==-1)throw Error("Circular reference detected in "+x.join("."));d.push(b),ve.forEach(b,function(T,m){(!(ve.isUndefined(T)||T===null)&&l.call(e,T,ve.isString(m)?m.trim():m,x,u))===!0&&h(T,x?x.concat(m):[m])}),d.pop()}}if(!ve.isObject(r))throw new TypeError("data must be an object");return h(r),e}function sp(r){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function cf(r,e){this._pairs=[],r&&_s(r,this,e)}const op=cf.prototype;op.append=function(e,t){this._pairs.push([e,t])},op.toString=function(e){const t=e?function(s){return e.call(this,s,sp)}:sp;return this._pairs.map(function(l){return t(l[0])+"="+t(l[1])},"").join("&")};function x9(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ap(r,e,t){if(!e)return r;const s=t&&t.encode||x9,l=t&&t.serialize;let a;if(l?a=l(e,t):a=ve.isURLSearchParams(e)?e.toString():new cf(e,t).toString(s),a){const o=r.indexOf("#");o!==-1&&(r=r.slice(0,o)),r+=(r.indexOf("?")===-1?"?":"&")+a}return r}class cp{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ve.forEach(this.handlers,function(s){s!==null&&e(s)})}}var lp={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},w9=typeof URLSearchParams<"u"?URLSearchParams:cf,v9=typeof FormData<"u"?FormData:null,E9=typeof Blob<"u"?Blob:null,D9={isBrowser:!0,classes:{URLSearchParams:w9,FormData:v9,Blob:E9},protocols:["http","https","file","blob","url","data"]};const lf=typeof window<"u"&&typeof document<"u",S9=(r=>lf&&["ReactNative","NativeScript","NS"].indexOf(r)<0)(typeof navigator<"u"&&navigator.product),T9=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",A9=lf&&window.location.href||"http://localhost";var C9=Object.freeze({__proto__:null,hasBrowserEnv:lf,hasStandardBrowserEnv:S9,hasStandardBrowserWebWorkerEnv:T9,origin:A9}),Bt={...C9,...D9};function B9(r,e){return _s(r,new Bt.classes.URLSearchParams,Object.assign({visitor:function(t,s,l,a){return Bt.isNode&&ve.isBuffer(t)?(this.append(s,t.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function O9(r){return ve.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function k9(r){const e={},t=Object.keys(r);let s;const l=t.length;let a;for(s=0;s=t.length;return o=!o&&ve.isArray(l)?l.length:o,n?(ve.hasOwnProp(l,o)?l[o]=[l[o],s]:l[o]=s,!f):((!l[o]||!ve.isObject(l[o]))&&(l[o]=[]),e(t,s,l[o],a)&&ve.isArray(l[o])&&(l[o]=k9(l[o])),!f)}if(ve.isFormData(r)&&ve.isFunction(r.entries)){const t={};return ve.forEachEntry(r,(s,l)=>{e(O9(s),l,t,0)}),t}return null}function I9(r,e,t){if(ve.isString(r))try{return(e||JSON.parse)(r),ve.trim(r)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(r)}const Vn={transitional:lp,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",l=s.indexOf("application/json")>-1,a=ve.isObject(e);if(a&&ve.isHTMLForm(e)&&(e=new FormData(e)),ve.isFormData(e))return l?JSON.stringify(fp(e)):e;if(ve.isArrayBuffer(e)||ve.isBuffer(e)||ve.isStream(e)||ve.isFile(e)||ve.isBlob(e)||ve.isReadableStream(e))return e;if(ve.isArrayBufferView(e))return e.buffer;if(ve.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let f;if(a){if(s.indexOf("application/x-www-form-urlencoded")>-1)return B9(e,this.formSerializer).toString();if((f=ve.isFileList(e))||s.indexOf("multipart/form-data")>-1){const n=this.env&&this.env.FormData;return _s(f?{"files[]":e}:e,n&&new n,this.formSerializer)}}return a||l?(t.setContentType("application/json",!1),I9(e)):e}],transformResponse:[function(e){const t=this.transitional||Vn.transitional,s=t&&t.forcedJSONParsing,l=this.responseType==="json";if(ve.isResponse(e)||ve.isReadableStream(e))return e;if(e&&ve.isString(e)&&(s&&!this.responseType||l)){const o=!(t&&t.silentJSONParsing)&&l;try{return JSON.parse(e)}catch(f){if(o)throw f.name==="SyntaxError"?Pe.from(f,Pe.ERR_BAD_RESPONSE,this,null,this.response):f}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bt.classes.FormData,Blob:Bt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ve.forEach(["delete","get","head","post","put","patch"],r=>{Vn.headers[r]={}});const P9=ve.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var R9=r=>{const e={};let t,s,l;return r&&r.split(` `).forEach(function(o){l=o.indexOf(":"),t=o.substring(0,l).trim().toLowerCase(),s=o.substring(l+1).trim(),!(!t||e[t]&&P9[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s)}),e};const up=Symbol("internals");function Yn(r){return r&&String(r).trim().toLowerCase()}function bs(r){return r===!1||r==null?r:ve.isArray(r)?r.map(bs):String(r)}function j9(r){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=t.exec(r);)e[s[1]]=s[2];return e}const M9=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function ff(r,e,t,s,l){if(ve.isFunction(s))return s.call(this,e,t);if(l&&(e=t),!!ve.isString(e)){if(ve.isString(s))return e.indexOf(s)!==-1;if(ve.isRegExp(s))return s.test(e)}}function F9(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function L9(r,e){const t=ve.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(r,s+t,{value:function(l,a,o){return this[s].call(this,e,l,a,o)},configurable:!0})})}let lt=class{constructor(e){e&&this.set(e)}set(e,t,s){const l=this;function a(f,n,i){const c=Yn(n);if(!c)throw new Error("header name must be a non-empty string");const d=ve.findKey(l,c);(!d||l[d]===void 0||i===!0||i===void 0&&l[d]!==!1)&&(l[d||n]=bs(f))}const o=(f,n)=>ve.forEach(f,(i,c)=>a(i,c,n));if(ve.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(ve.isString(e)&&(e=e.trim())&&!M9(e))o(R9(e),t);else if(ve.isHeaders(e))for(const[f,n]of e.entries())a(n,f,s);else e!=null&&a(t,e,s);return this}get(e,t){if(e=Yn(e),e){const s=ve.findKey(this,e);if(s){const l=this[s];if(!t)return l;if(t===!0)return j9(l);if(ve.isFunction(t))return t.call(this,l,s);if(ve.isRegExp(t))return t.exec(l);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Yn(e),e){const s=ve.findKey(this,e);return!!(s&&this[s]!==void 0&&(!t||ff(this,this[s],s,t)))}return!1}delete(e,t){const s=this;let l=!1;function a(o){if(o=Yn(o),o){const f=ve.findKey(s,o);f&&(!t||ff(s,s[f],f,t))&&(delete s[f],l=!0)}}return ve.isArray(e)?e.forEach(a):a(e),l}clear(e){const t=Object.keys(this);let s=t.length,l=!1;for(;s--;){const a=t[s];(!e||ff(this,this[a],a,e,!0))&&(delete this[a],l=!0)}return l}normalize(e){const t=this,s={};return ve.forEach(this,(l,a)=>{const o=ve.findKey(s,a);if(o){t[o]=bs(l),delete t[a];return}const f=e?F9(a):String(a).trim();f!==a&&delete t[a],t[f]=bs(l),s[f]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ve.forEach(this,(s,l)=>{s!=null&&s!==!1&&(t[l]=e&&ve.isArray(s)?s.join(", "):s)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach(l=>s.set(l)),s}static accessor(e){const s=(this[up]=this[up]={accessors:{}}).accessors,l=this.prototype;function a(o){const f=Yn(o);s[f]||(L9(l,o),s[f]=!0)}return ve.isArray(e)?e.forEach(a):a(e),this}};lt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ve.reduceDescriptors(lt.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(s){this[t]=s}}}),ve.freezeMethods(lt);function uf(r,e){const t=this||Vn,s=e||t,l=lt.from(s.headers);let a=s.data;return ve.forEach(r,function(f){a=f.call(t,a,l.normalize(),e?e.status:void 0)}),l.normalize(),a}function dp(r){return!!(r&&r.__CANCEL__)}function _n(r,e,t){Pe.call(this,r??"canceled",Pe.ERR_CANCELED,e,t),this.name="CanceledError"}ve.inherits(_n,Pe,{__CANCEL__:!0});function pp(r,e,t){const s=t.config.validateStatus;!t.status||!s||s(t.status)?r(t):e(new Pe("Request failed with status code "+t.status,[Pe.ERR_BAD_REQUEST,Pe.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function N9(r){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}function $9(r,e){r=r||10;const t=new Array(r),s=new Array(r);let l=0,a=0,o;return e=e!==void 0?e:1e3,function(n){const i=Date.now(),c=s[a];o||(o=i),t[l]=n,s[l]=i;let d=a,u=0;for(;d!==l;)u+=t[d++],d=d%r;if(l=(l+1)%r,l===a&&(a=(a+1)%r),i-os)return l&&(clearTimeout(l),l=null),t=f,r.apply(null,arguments);l||(l=setTimeout(()=>(l=null,t=Date.now(),r.apply(null,arguments)),s-(f-t)))}}var ms=(r,e,t=3)=>{let s=0;const l=$9(50,250);return U9(a=>{const o=a.loaded,f=a.lengthComputable?a.total:void 0,n=o-s,i=l(n),c=o<=f;s=o;const d={loaded:o,total:f,progress:f?o/f:void 0,bytes:n,rate:i||void 0,estimated:i&&f&&c?(f-o)/i:void 0,event:a,lengthComputable:f!=null};d[e?"download":"upload"]=!0,r(d)},t)},z9=Bt.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let s;function l(a){let o=a;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return s=l(window.location.href),function(o){const f=ve.isString(o)?l(o):o;return f.protocol===s.protocol&&f.host===s.host}}():function(){return function(){return!0}}(),G9=Bt.hasStandardBrowserEnv?{write(r,e,t,s,l,a){const o=[r+"="+encodeURIComponent(e)];ve.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),ve.isString(s)&&o.push("path="+s),ve.isString(l)&&o.push("domain="+l),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(r){const e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function H9(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function q9(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function hp(r,e){return r&&!H9(e)?q9(r,e):e}const _p=r=>r instanceof lt?{...r}:r;function Or(r,e){e=e||{};const t={};function s(i,c,d){return ve.isPlainObject(i)&&ve.isPlainObject(c)?ve.merge.call({caseless:d},i,c):ve.isPlainObject(c)?ve.merge({},c):ve.isArray(c)?c.slice():c}function l(i,c,d){if(ve.isUndefined(c)){if(!ve.isUndefined(i))return s(void 0,i,d)}else return s(i,c,d)}function a(i,c){if(!ve.isUndefined(c))return s(void 0,c)}function o(i,c){if(ve.isUndefined(c)){if(!ve.isUndefined(i))return s(void 0,i)}else return s(void 0,c)}function f(i,c,d){if(d in e)return s(i,c);if(d in r)return s(void 0,i)}const n={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:f,headers:(i,c)=>l(_p(i),_p(c),!0)};return ve.forEach(Object.keys(Object.assign({},r,e)),function(c){const d=n[c]||l,u=d(r[c],e[c],c);ve.isUndefined(u)&&d!==f||(t[c]=u)}),t}var bp=r=>{const e=Or({},r);let{data:t,withXSRFToken:s,xsrfHeaderName:l,xsrfCookieName:a,headers:o,auth:f}=e;e.headers=o=lt.from(o),e.url=ap(hp(e.baseURL,e.url),r.params,r.paramsSerializer),f&&o.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):"")));let n;if(ve.isFormData(t)){if(Bt.hasStandardBrowserEnv||Bt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((n=o.getContentType())!==!1){const[i,...c]=n?n.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([i||"multipart/form-data",...c].join("; "))}}if(Bt.hasStandardBrowserEnv&&(s&&ve.isFunction(s)&&(s=s(e)),s||s!==!1&&z9(e.url))){const i=l&&a&&G9.read(a);i&&o.set(l,i)}return e},W9=typeof XMLHttpRequest<"u"&&function(r){return new Promise(function(t,s){const l=bp(r);let a=l.data;const o=lt.from(l.headers).normalize();let{responseType:f}=l,n;function i(){l.cancelToken&&l.cancelToken.unsubscribe(n),l.signal&&l.signal.removeEventListener("abort",n)}let c=new XMLHttpRequest;c.open(l.method.toUpperCase(),l.url,!0),c.timeout=l.timeout;function d(){if(!c)return;const h=lt.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),x={data:!f||f==="text"||f==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:h,config:r,request:c};pp(function(T){t(T),i()},function(T){s(T),i()},x),c=null}"onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(d)},c.onabort=function(){c&&(s(new Pe("Request aborted",Pe.ECONNABORTED,l,c)),c=null)},c.onerror=function(){s(new Pe("Network Error",Pe.ERR_NETWORK,l,c)),c=null},c.ontimeout=function(){let b=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const x=l.transitional||lp;l.timeoutErrorMessage&&(b=l.timeoutErrorMessage),s(new Pe(b,x.clarifyTimeoutError?Pe.ETIMEDOUT:Pe.ECONNABORTED,l,c)),c=null},a===void 0&&o.setContentType(null),"setRequestHeader"in c&&ve.forEach(o.toJSON(),function(b,x){c.setRequestHeader(x,b)}),ve.isUndefined(l.withCredentials)||(c.withCredentials=!!l.withCredentials),f&&f!=="json"&&(c.responseType=l.responseType),typeof l.onDownloadProgress=="function"&&c.addEventListener("progress",ms(l.onDownloadProgress,!0)),typeof l.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",ms(l.onUploadProgress)),(l.cancelToken||l.signal)&&(n=h=>{c&&(s(!h||h.type?new _n(null,r,c):h),c.abort(),c=null)},l.cancelToken&&l.cancelToken.subscribe(n),l.signal&&(l.signal.aborted?n():l.signal.addEventListener("abort",n)));const u=N9(l.url);if(u&&Bt.protocols.indexOf(u)===-1){s(new Pe("Unsupported protocol "+u+":",Pe.ERR_BAD_REQUEST,r));return}c.send(a||null)})};const V9=(r,e)=>{let t=new AbortController,s;const l=function(n){if(!s){s=!0,o();const i=n instanceof Error?n:this.reason;t.abort(i instanceof Pe?i:new _n(i instanceof Error?i.message:i))}};let a=e&&setTimeout(()=>{l(new Pe(`timeout ${e} of ms exceeded`,Pe.ETIMEDOUT))},e);const o=()=>{r&&(a&&clearTimeout(a),a=null,r.forEach(n=>{n&&(n.removeEventListener?n.removeEventListener("abort",l):n.unsubscribe(l))}),r=null)};r.forEach(n=>n&&n.addEventListener&&n.addEventListener("abort",l));const{signal:f}=t;return f.unsubscribe=o,[f,()=>{a&&clearTimeout(a),a=null}]},Y9=function*(r,e){let t=r.byteLength;if(!e||t{const a=K9(r,e,l);let o=0;return new ReadableStream({type:"bytes",async pull(f){const{done:n,value:i}=await a.next();if(n){f.close(),s();return}let c=i.byteLength;t&&t(o+=c),f.enqueue(new Uint8Array(i))},cancel(f){return s(f),a.return()}},{highWaterMark:2})},gp=(r,e)=>{const t=r!=null;return s=>setTimeout(()=>e({lengthComputable:t,total:r,loaded:s}))},gs=typeof fetch<"u",yp=gs&&typeof ReadableStream<"u",df=gs&&(typeof TextEncoder<"u"?(r=>e=>r.encode(e))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),Z9=yp&&(()=>{let r=!1;const e=new Request(Bt.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!e})(),xp=64*1024,pf=yp&&!!(()=>{try{return ve.isReadableStream(new Response("").body)}catch{}})(),ys={stream:pf&&(r=>r.body)};gs&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!ys[e]&&(ys[e]=ve.isFunction(r[e])?t=>t[e]():(t,s)=>{throw new Pe(`Response type '${e}' is not supported`,Pe.ERR_NOT_SUPPORT,s)})})})(new Response);const J9=async r=>{if(r==null)return 0;if(ve.isBlob(r))return r.size;if(ve.isSpecCompliantForm(r))return(await new Request(r).arrayBuffer()).byteLength;if(ve.isArrayBufferView(r))return r.byteLength;if(ve.isURLSearchParams(r)&&(r=r+""),ve.isString(r))return(await df(r)).byteLength},X9=async(r,e)=>{const t=ve.toFiniteNumber(r.getContentLength());return t??J9(e)};var Q9=gs&&(async r=>{let{url:e,method:t,data:s,signal:l,cancelToken:a,timeout:o,onDownloadProgress:f,onUploadProgress:n,responseType:i,headers:c,withCredentials:d="same-origin",fetchOptions:u}=bp(r);i=i?(i+"").toLowerCase():"text";let[h,b]=l||a||o?V9([l,a],o):[],x,S;const T=()=>{!x&&setTimeout(()=>{h&&h.unsubscribe()}),x=!0};let m;try{if(n&&Z9&&t!=="get"&&t!=="head"&&(m=await X9(c,s))!==0){let A=new Request(e,{method:"POST",body:s,duplex:"half"}),B;ve.isFormData(s)&&(B=A.headers.get("content-type"))&&c.setContentType(B),A.body&&(s=mp(A.body,xp,gp(m,ms(n)),null,df))}ve.isString(d)||(d=d?"cors":"omit"),S=new Request(e,{...u,signal:h,method:t.toUpperCase(),headers:c.normalize().toJSON(),body:s,duplex:"half",withCredentials:d});let _=await fetch(S);const g=pf&&(i==="stream"||i==="response");if(pf&&(f||g)){const A={};["status","statusText","headers"].forEach(M=>{A[M]=_[M]});const B=ve.toFiniteNumber(_.headers.get("content-length"));_=new Response(mp(_.body,xp,f&&gp(B,ms(f,!0)),g&&T,df),A)}i=i||"text";let v=await ys[ve.findKey(ys,i)||"text"](_,r);return!g&&T(),b&&b(),await new Promise((A,B)=>{pp(A,B,{data:v,headers:lt.from(_.headers),status:_.status,statusText:_.statusText,config:r,request:S})})}catch(_){throw T(),_&&_.name==="TypeError"&&/fetch/i.test(_.message)?Object.assign(new Pe("Network Error",Pe.ERR_NETWORK,r,S),{cause:_.cause||_}):Pe.from(_,_&&_.code,r,S)}});const hf={http:m9,xhr:W9,fetch:Q9};ve.forEach(hf,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});const wp=r=>`- ${r}`,ev=r=>ve.isFunction(r)||r===null||r===!1;var vp={getAdapter:r=>{r=ve.isArray(r)?r:[r];const{length:e}=r;let t,s;const l={};for(let a=0;a`adapter ${f} `+(n===!1?"is not supported by the environment":"is not available in the build"));let o=e?a.length>1?`since : +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach(l=>s.set(l)),s}static accessor(e){const s=(this[up]=this[up]={accessors:{}}).accessors,l=this.prototype;function a(o){const f=Yn(o);s[f]||(L9(l,o),s[f]=!0)}return ve.isArray(e)?e.forEach(a):a(e),this}};lt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ve.reduceDescriptors(lt.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(s){this[t]=s}}}),ve.freezeMethods(lt);function uf(r,e){const t=this||Vn,s=e||t,l=lt.from(s.headers);let a=s.data;return ve.forEach(r,function(f){a=f.call(t,a,l.normalize(),e?e.status:void 0)}),l.normalize(),a}function dp(r){return!!(r&&r.__CANCEL__)}function _n(r,e,t){Pe.call(this,r??"canceled",Pe.ERR_CANCELED,e,t),this.name="CanceledError"}ve.inherits(_n,Pe,{__CANCEL__:!0});function pp(r,e,t){const s=t.config.validateStatus;!t.status||!s||s(t.status)?r(t):e(new Pe("Request failed with status code "+t.status,[Pe.ERR_BAD_REQUEST,Pe.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function N9(r){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}function $9(r,e){r=r||10;const t=new Array(r),s=new Array(r);let l=0,a=0,o;return e=e!==void 0?e:1e3,function(n){const i=Date.now(),c=s[a];o||(o=i),t[l]=n,s[l]=i;let d=a,u=0;for(;d!==l;)u+=t[d++],d=d%r;if(l=(l+1)%r,l===a&&(a=(a+1)%r),i-os)return l&&(clearTimeout(l),l=null),t=f,r.apply(null,arguments);l||(l=setTimeout(()=>(l=null,t=Date.now(),r.apply(null,arguments)),s-(f-t)))}}var ms=(r,e,t=3)=>{let s=0;const l=$9(50,250);return U9(a=>{const o=a.loaded,f=a.lengthComputable?a.total:void 0,n=o-s,i=l(n),c=o<=f;s=o;const d={loaded:o,total:f,progress:f?o/f:void 0,bytes:n,rate:i||void 0,estimated:i&&f&&c?(f-o)/i:void 0,event:a,lengthComputable:f!=null};d[e?"download":"upload"]=!0,r(d)},t)},z9=Bt.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let s;function l(a){let o=a;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return s=l(window.location.href),function(o){const f=ve.isString(o)?l(o):o;return f.protocol===s.protocol&&f.host===s.host}}():function(){return function(){return!0}}(),G9=Bt.hasStandardBrowserEnv?{write(r,e,t,s,l,a){const o=[r+"="+encodeURIComponent(e)];ve.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),ve.isString(s)&&o.push("path="+s),ve.isString(l)&&o.push("domain="+l),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(r){const e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function H9(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function q9(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function hp(r,e){return r&&!H9(e)?q9(r,e):e}const _p=r=>r instanceof lt?{...r}:r;function Or(r,e){e=e||{};const t={};function s(i,c,d){return ve.isPlainObject(i)&&ve.isPlainObject(c)?ve.merge.call({caseless:d},i,c):ve.isPlainObject(c)?ve.merge({},c):ve.isArray(c)?c.slice():c}function l(i,c,d){if(ve.isUndefined(c)){if(!ve.isUndefined(i))return s(void 0,i,d)}else return s(i,c,d)}function a(i,c){if(!ve.isUndefined(c))return s(void 0,c)}function o(i,c){if(ve.isUndefined(c)){if(!ve.isUndefined(i))return s(void 0,i)}else return s(void 0,c)}function f(i,c,d){if(d in e)return s(i,c);if(d in r)return s(void 0,i)}const n={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:f,headers:(i,c)=>l(_p(i),_p(c),!0)};return ve.forEach(Object.keys(Object.assign({},r,e)),function(c){const d=n[c]||l,u=d(r[c],e[c],c);ve.isUndefined(u)&&d!==f||(t[c]=u)}),t}var bp=r=>{const e=Or({},r);let{data:t,withXSRFToken:s,xsrfHeaderName:l,xsrfCookieName:a,headers:o,auth:f}=e;e.headers=o=lt.from(o),e.url=ap(hp(e.baseURL,e.url),r.params,r.paramsSerializer),f&&o.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):"")));let n;if(ve.isFormData(t)){if(Bt.hasStandardBrowserEnv||Bt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((n=o.getContentType())!==!1){const[i,...c]=n?n.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([i||"multipart/form-data",...c].join("; "))}}if(Bt.hasStandardBrowserEnv&&(s&&ve.isFunction(s)&&(s=s(e)),s||s!==!1&&z9(e.url))){const i=l&&a&&G9.read(a);i&&o.set(l,i)}return e},W9=typeof XMLHttpRequest<"u"&&function(r){return new Promise(function(t,s){const l=bp(r);let a=l.data;const o=lt.from(l.headers).normalize();let{responseType:f}=l,n;function i(){l.cancelToken&&l.cancelToken.unsubscribe(n),l.signal&&l.signal.removeEventListener("abort",n)}let c=new XMLHttpRequest;c.open(l.method.toUpperCase(),l.url,!0),c.timeout=l.timeout;function d(){if(!c)return;const h=lt.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),x={data:!f||f==="text"||f==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:h,config:r,request:c};pp(function(T){t(T),i()},function(T){s(T),i()},x),c=null}"onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(d)},c.onabort=function(){c&&(s(new Pe("Request aborted",Pe.ECONNABORTED,l,c)),c=null)},c.onerror=function(){s(new Pe("Network Error",Pe.ERR_NETWORK,l,c)),c=null},c.ontimeout=function(){let b=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const x=l.transitional||lp;l.timeoutErrorMessage&&(b=l.timeoutErrorMessage),s(new Pe(b,x.clarifyTimeoutError?Pe.ETIMEDOUT:Pe.ECONNABORTED,l,c)),c=null},a===void 0&&o.setContentType(null),"setRequestHeader"in c&&ve.forEach(o.toJSON(),function(b,x){c.setRequestHeader(x,b)}),ve.isUndefined(l.withCredentials)||(c.withCredentials=!!l.withCredentials),f&&f!=="json"&&(c.responseType=l.responseType),typeof l.onDownloadProgress=="function"&&c.addEventListener("progress",ms(l.onDownloadProgress,!0)),typeof l.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",ms(l.onUploadProgress)),(l.cancelToken||l.signal)&&(n=h=>{c&&(s(!h||h.type?new _n(null,r,c):h),c.abort(),c=null)},l.cancelToken&&l.cancelToken.subscribe(n),l.signal&&(l.signal.aborted?n():l.signal.addEventListener("abort",n)));const u=N9(l.url);if(u&&Bt.protocols.indexOf(u)===-1){s(new Pe("Unsupported protocol "+u+":",Pe.ERR_BAD_REQUEST,r));return}c.send(a||null)})};const V9=(r,e)=>{let t=new AbortController,s;const l=function(n){if(!s){s=!0,o();const i=n instanceof Error?n:this.reason;t.abort(i instanceof Pe?i:new _n(i instanceof Error?i.message:i))}};let a=e&&setTimeout(()=>{l(new Pe(`timeout ${e} of ms exceeded`,Pe.ETIMEDOUT))},e);const o=()=>{r&&(a&&clearTimeout(a),a=null,r.forEach(n=>{n&&(n.removeEventListener?n.removeEventListener("abort",l):n.unsubscribe(l))}),r=null)};r.forEach(n=>n&&n.addEventListener&&n.addEventListener("abort",l));const{signal:f}=t;return f.unsubscribe=o,[f,()=>{a&&clearTimeout(a),a=null}]},Y9=function*(r,e){let t=r.byteLength;if(!e||t{const a=K9(r,e,l);let o=0;return new ReadableStream({type:"bytes",async pull(f){const{done:n,value:i}=await a.next();if(n){f.close(),s();return}let c=i.byteLength;t&&t(o+=c),f.enqueue(new Uint8Array(i))},cancel(f){return s(f),a.return()}},{highWaterMark:2})},gp=(r,e)=>{const t=r!=null;return s=>setTimeout(()=>e({lengthComputable:t,total:r,loaded:s}))},gs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",yp=gs&&typeof ReadableStream=="function",df=gs&&(typeof TextEncoder=="function"?(r=>e=>r.encode(e))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),Z9=yp&&(()=>{let r=!1;const e=new Request(Bt.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!e})(),xp=64*1024,pf=yp&&!!(()=>{try{return ve.isReadableStream(new Response("").body)}catch{}})(),ys={stream:pf&&(r=>r.body)};gs&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!ys[e]&&(ys[e]=ve.isFunction(r[e])?t=>t[e]():(t,s)=>{throw new Pe(`Response type '${e}' is not supported`,Pe.ERR_NOT_SUPPORT,s)})})})(new Response);const J9=async r=>{if(r==null)return 0;if(ve.isBlob(r))return r.size;if(ve.isSpecCompliantForm(r))return(await new Request(r).arrayBuffer()).byteLength;if(ve.isArrayBufferView(r))return r.byteLength;if(ve.isURLSearchParams(r)&&(r=r+""),ve.isString(r))return(await df(r)).byteLength},X9=async(r,e)=>{const t=ve.toFiniteNumber(r.getContentLength());return t??J9(e)};var Q9=gs&&(async r=>{let{url:e,method:t,data:s,signal:l,cancelToken:a,timeout:o,onDownloadProgress:f,onUploadProgress:n,responseType:i,headers:c,withCredentials:d="same-origin",fetchOptions:u}=bp(r);i=i?(i+"").toLowerCase():"text";let[h,b]=l||a||o?V9([l,a],o):[],x,S;const T=()=>{!x&&setTimeout(()=>{h&&h.unsubscribe()}),x=!0};let m;try{if(n&&Z9&&t!=="get"&&t!=="head"&&(m=await X9(c,s))!==0){let A=new Request(e,{method:"POST",body:s,duplex:"half"}),B;ve.isFormData(s)&&(B=A.headers.get("content-type"))&&c.setContentType(B),A.body&&(s=mp(A.body,xp,gp(m,ms(n)),null,df))}ve.isString(d)||(d=d?"cors":"omit"),S=new Request(e,{...u,signal:h,method:t.toUpperCase(),headers:c.normalize().toJSON(),body:s,duplex:"half",withCredentials:d});let _=await fetch(S);const g=pf&&(i==="stream"||i==="response");if(pf&&(f||g)){const A={};["status","statusText","headers"].forEach(M=>{A[M]=_[M]});const B=ve.toFiniteNumber(_.headers.get("content-length"));_=new Response(mp(_.body,xp,f&&gp(B,ms(f,!0)),g&&T,df),A)}i=i||"text";let v=await ys[ve.findKey(ys,i)||"text"](_,r);return!g&&T(),b&&b(),await new Promise((A,B)=>{pp(A,B,{data:v,headers:lt.from(_.headers),status:_.status,statusText:_.statusText,config:r,request:S})})}catch(_){throw T(),_&&_.name==="TypeError"&&/fetch/i.test(_.message)?Object.assign(new Pe("Network Error",Pe.ERR_NETWORK,r,S),{cause:_.cause||_}):Pe.from(_,_&&_.code,r,S)}});const hf={http:m9,xhr:W9,fetch:Q9};ve.forEach(hf,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});const wp=r=>`- ${r}`,ev=r=>ve.isFunction(r)||r===null||r===!1;var vp={getAdapter:r=>{r=ve.isArray(r)?r:[r];const{length:e}=r;let t,s;const l={};for(let a=0;a`adapter ${f} `+(n===!1?"is not supported by the environment":"is not available in the build"));let o=e?a.length>1?`since : `+a.map(wp).join(` -`):" "+wp(a[0]):"as no adapter specified";throw new Pe("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:hf};function _f(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new _n(null,r)}function Ep(r){return _f(r),r.headers=lt.from(r.headers),r.data=uf.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),vp.getAdapter(r.adapter||Vn.adapter)(r).then(function(s){return _f(r),s.data=uf.call(r,r.transformResponse,s),s.headers=lt.from(s.headers),s},function(s){return dp(s)||(_f(r),s&&s.response&&(s.response.data=uf.call(r,r.transformResponse,s.response),s.response.headers=lt.from(s.response.headers))),Promise.reject(s)})}const Dp="1.7.1",bf={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{bf[r]=function(s){return typeof s===r||"a"+(e<1?"n ":" ")+r}});const Sp={};bf.transitional=function(e,t,s){function l(a,o){return"[Axios v"+Dp+"] Transitional option '"+a+"'"+o+(s?". "+s:"")}return(a,o,f)=>{if(e===!1)throw new Pe(l(o," has been removed"+(t?" in "+t:"")),Pe.ERR_DEPRECATED);return t&&!Sp[o]&&(Sp[o]=!0,console.warn(l(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(a,o,f):!0}};function tv(r,e,t){if(typeof r!="object")throw new Pe("options must be an object",Pe.ERR_BAD_OPTION_VALUE);const s=Object.keys(r);let l=s.length;for(;l-- >0;){const a=s[l],o=e[a];if(o){const f=r[a],n=f===void 0||o(f,a,r);if(n!==!0)throw new Pe("option "+a+" must be "+n,Pe.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Pe("Unknown option "+a,Pe.ERR_BAD_OPTION)}}var mf={assertOptions:tv,validators:bf};const lr=mf.validators;let kr=class{constructor(e){this.defaults=e,this.interceptors={request:new cp,response:new cp}}async request(e,t){try{return await this._request(e,t)}catch(s){if(s instanceof Error){let l;Error.captureStackTrace?Error.captureStackTrace(l={}):l=new Error;const a=l.stack?l.stack.replace(/^.+\n/,""):"";try{s.stack?a&&!String(s.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(s.stack+=` +`):" "+wp(a[0]):"as no adapter specified";throw new Pe("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:hf};function _f(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new _n(null,r)}function Ep(r){return _f(r),r.headers=lt.from(r.headers),r.data=uf.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),vp.getAdapter(r.adapter||Vn.adapter)(r).then(function(s){return _f(r),s.data=uf.call(r,r.transformResponse,s),s.headers=lt.from(s.headers),s},function(s){return dp(s)||(_f(r),s&&s.response&&(s.response.data=uf.call(r,r.transformResponse,s.response),s.response.headers=lt.from(s.response.headers))),Promise.reject(s)})}const Dp="1.7.2",bf={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{bf[r]=function(s){return typeof s===r||"a"+(e<1?"n ":" ")+r}});const Sp={};bf.transitional=function(e,t,s){function l(a,o){return"[Axios v"+Dp+"] Transitional option '"+a+"'"+o+(s?". "+s:"")}return(a,o,f)=>{if(e===!1)throw new Pe(l(o," has been removed"+(t?" in "+t:"")),Pe.ERR_DEPRECATED);return t&&!Sp[o]&&(Sp[o]=!0,console.warn(l(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(a,o,f):!0}};function tv(r,e,t){if(typeof r!="object")throw new Pe("options must be an object",Pe.ERR_BAD_OPTION_VALUE);const s=Object.keys(r);let l=s.length;for(;l-- >0;){const a=s[l],o=e[a];if(o){const f=r[a],n=f===void 0||o(f,a,r);if(n!==!0)throw new Pe("option "+a+" must be "+n,Pe.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Pe("Unknown option "+a,Pe.ERR_BAD_OPTION)}}var mf={assertOptions:tv,validators:bf};const lr=mf.validators;let kr=class{constructor(e){this.defaults=e,this.interceptors={request:new cp,response:new cp}}async request(e,t){try{return await this._request(e,t)}catch(s){if(s instanceof Error){let l;Error.captureStackTrace?Error.captureStackTrace(l={}):l=new Error;const a=l.stack?l.stack.replace(/^.+\n/,""):"";try{s.stack?a&&!String(s.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(s.stack+=` `+a):s.stack=a}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Or(this.defaults,t);const{transitional:s,paramsSerializer:l,headers:a}=t;s!==void 0&&mf.assertOptions(s,{silentJSONParsing:lr.transitional(lr.boolean),forcedJSONParsing:lr.transitional(lr.boolean),clarifyTimeoutError:lr.transitional(lr.boolean)},!1),l!=null&&(ve.isFunction(l)?t.paramsSerializer={serialize:l}:mf.assertOptions(l,{encode:lr.function,serialize:lr.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&ve.merge(a.common,a[t.method]);a&&ve.forEach(["delete","get","head","post","put","patch","common"],b=>{delete a[b]}),t.headers=lt.concat(o,a);const f=[];let n=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(t)===!1||(n=n&&x.synchronous,f.unshift(x.fulfilled,x.rejected))});const i=[];this.interceptors.response.forEach(function(x){i.push(x.fulfilled,x.rejected)});let c,d=0,u;if(!n){const b=[Ep.bind(this),void 0];for(b.unshift.apply(b,f),b.push.apply(b,i),u=b.length,c=Promise.resolve(t);d{if(!s._listeners)return;let a=s._listeners.length;for(;a-- >0;)s._listeners[a](l);s._listeners=null}),this.promise.then=l=>{let a;const o=new Promise(f=>{s.subscribe(f),a=f}).then(l);return o.cancel=function(){s.unsubscribe(a)},o},e(function(a,o,f){s.reason||(s.reason=new _n(a,o,f),t(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new kp(function(l){e=l}),cancel:e}}};function nv(r){return function(t){return r.apply(null,t)}}function iv(r){return ve.isObject(r)&&r.isAxiosError===!0}const gf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(gf).forEach(([r,e])=>{gf[e]=r});function Tp(r){const e=new kr(r),t=q1(kr.prototype.request,e);return ve.extend(t,kr.prototype,e,{allOwnKeys:!0}),ve.extend(t,e,null,{allOwnKeys:!0}),t.create=function(l){return Tp(Or(r,l))},t}const Ye=Tp(Vn);Ye.Axios=kr,Ye.CanceledError=_n,Ye.CancelToken=rv,Ye.isCancel=dp,Ye.VERSION=Dp,Ye.toFormData=_s,Ye.AxiosError=Pe,Ye.Cancel=Ye.CanceledError,Ye.all=function(e){return Promise.all(e)},Ye.spread=nv,Ye.isAxiosError=iv,Ye.mergeConfig=Or,Ye.AxiosHeaders=lt,Ye.formToJSON=r=>fp(ve.isHTMLForm(r)?new FormData(r):r),Ye.getAdapter=vp.getAdapter,Ye.HttpStatusCode=gf,Ye.default=Ye;const{Axios:gv,AxiosError:xs,CanceledError:yv,isCancel:xv,CancelToken:wv,VERSION:vv,all:Ev,Cancel:Dv,isAxiosError:Sv,spread:Tv,toFormData:Av,AxiosHeaders:Cv,HttpStatusCode:Bv,formToJSON:Ov,getAdapter:kv,mergeConfig:Iv}=Ye,sv="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let ov=(r=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(r));for(;r--;)e+=sv[t[r]&63];return e};const Kn=rf("snackbars",{state:()=>({snackbars:[]}),actions:{async show(r,e,t=5){const s=this;this.snackbars.push({id:ov(),level:r,text:e,showing:!1,destroying:!1,show(){this.showing=!0},async hide(){this.showing&&(this.showing=!1,await Je.sleep(.2),this.destroying=!0,await Je.sleep(.3),await Je.sleep(.1),s.snackbars.splice(s.snackbars.indexOf(this),1))}});const l=this.snackbars[this.snackbars.length-1];await Je.sleep(.05),l.show(),await Je.sleep(t),await l.hide()}}});var ze={success(r,e){Kn().show("success",r,e)},info(r,e){Kn().show("info",r,e)},warning(r,e){Kn().show("warning",r,e)},error(r,e){Kn().show("error",r,e)},show(r,e){Kn().show("default",r,e)}};class Ir{static async createUser(e){const t=await Le.post("/users",e);if(t.type==="error"){switch(t.data.detail){case"Specified username is duplicated":{ze.error("ユーザー名が重複しています。");break}case"Specified username is not accepted due to system limitations":{ze.error("ユーザー名に token と me は使えません。");break}default:{Le.showGenericError(t,"アカウントを作成できませんでした。");break}}return null}return t.data}static async createUserAccessToken(e,t){const s=await Le.post("/users/token",new URLSearchParams({username:e,password:t}));if(s.type==="error"){switch(s.data.detail){case"Incorrect username":{ze.error("ログインできませんでした。そのユーザー名のアカウントは存在しません。");break}case"Incorrect password":{ze.error("ログインできませんでした。パスワードを間違えていませんか?");break}default:{Le.showGenericError(s,"ログインできませんでした。");break}}return null}return s.data}static async fetchUser(){const e=await Le.get("/users/me");return e.type==="error"?(Le.showGenericError(e,"アカウント情報を取得できませんでした。"),null):e.data}static async fetchUserIcon(){const e=await Le.get("/users/me/icon",{responseType:"blob"});return e.type==="error"?(Le.showGenericError(e,"アイコン画像を取得できませんでした。"),null):URL.createObjectURL(e.data)}static async updateUser(e){const t=await Le.put("/users/me",e);if(t.type==="error"){switch(t.data.detail){case"Specified username is duplicated":{ze.error("ユーザー名が重複しています。");break}case"Specified username is not accepted due to system limitations":{ze.error("ユーザー名に token と me は使えません。");break}default:{Le.showGenericError(t,"アカウント情報を更新できませんでした。");break}}return!1}return!0}static async updateUserIcon(e){const t=new FormData;t.append("image",e);const s=await Le.put("/users/me/icon",t,{headers:{"Content-Type":"multipart/form-data"}});if(s.type==="error"){switch(s.data.detail){case"Please upload JPEG or PNG image":{ze.error("JPEG または PNG 画像をアップロードしてください。");break}default:{Le.showGenericError(s,"アイコン画像を更新できませんでした。");break}}return}}static async deleteUser(){const e=await Le.delete("/users/me");if(e.type==="error"){Le.showGenericError(e,"アカウントを削除できませんでした。");return}}static async fetchAllUsers(){const e=await Le.get("/users");return e.type==="error"?(Le.showGenericError(e,"ユーザー情報リストを取得できませんでした。"),null):e.data}static async fetchSpecifiedUser(e){const t=await Le.get(`/users/${e}`);if(t.type==="error"){switch(t.data.detail){case"Specified user was not found":{ze.error(`${e} のユーザーが見つかりませんでした。`);break}default:{Le.showGenericError(t,`${e} のユーザー情報を取得できませんでした。`);break}}return null}return t.data}static async updateSpecifiedUser(e,t){const s=await Le.put(`/users/${e}`,{is_admin:t});return s.type==="error"?(Le.showGenericError(s,`${e} のユーザー情報を更新できませんでした。`),!1):!0}static async fetchSpecifiedUserIcon(e){const t=await Le.get(`/users/${e}/icon`,{responseType:"blob"});if(t.type==="error")throw Le.showGenericError(t,`${e} のユーザーアイコン画像を取得できませんでした。`),new Error("Failed to get specified user icon");return URL.createObjectURL(t.data)}static async deleteSpecifiedUser(e){const t=await Le.delete(`/users/${e}`);return t.type==="error"?(Le.showGenericError(t,`${e} のユーザーアカウントを削除できませんでした。`),!1):!0}}const av=rf("user",{state:()=>({is_logged_in:!1,user:null,user_icon_url:null}),getters:{user_niconico_icon_url(){return this.user===null||this.user.niconico_user_id===null?null:`https://secure-dcdn.cdn.nimg.jp/nicoaccount/usericon/${this.user.niconico_user_id.toString().slice(0,4)}/${this.user.niconico_user_id}.jpg`}},actions:{async register(r,e){return await Ir.createUser({username:r,password:e})===null?(console.log("Register failed."),!1):(await this.login(r,e,!0),console.log("Register successful."),ze.success("アカウントを作成しました。"),!0)},async login(r,e,t=!1){const s=await Ir.createUserAccessToken(r,e);return s===null?(console.log("Login failed."),this.logout(!0),!1):(console.log("Login successful."),Je.saveAccessToken(s.access_token),this.is_logged_in=!0,await this.fetchUser(!0),t===!1&&ze.success("ログインしました。"),!0)},logout(r=!1){const e=vs();e.settings.sync_settings=!1,Je.deleteAccessToken(),this.is_logged_in=!1,this.user=null,this.user_icon_url="",r===!1&&ze.success("ログアウトしました。")},async fetchUser(r=!1){if(Je.getAccessToken()===null)return null;if(this.user!==null&&r===!1)return this.user;const e=await Ir.fetchUser();if(e===null)return Je.getAccessToken()===null&&this.logout(!0),null;this.is_logged_in=!0,this.user=e;const t=await Ir.fetchUserIcon();return t===null?null:(this.user_icon_url=t,this.user)},async updateUser(r){if(await Ir.updateUser(r)===!1){console.log("Update user failed.");return}await this.fetchUser(!0),r.username!==void 0?ze.show("ユーザー名を更新しました。"):r.password!==void 0&&ze.show("パスワードを更新しました。")},async updateUserIcon(r){await Ir.updateUserIcon(r),await this.fetchUser(!0),ze.show("アイコン画像を更新しました。")},async deleteUser(){await Ir.deleteUser(),this.logout(!0),ze.show("アカウントを削除しました。")}}});class bn{static async request(e){var s;if(e.baseURL===void 0&&(e.baseURL=Je.api_base_url),e.headers===void 0&&(e.headers={}),((s=e.url)==null?void 0:s.startsWith("http"))===!1){const l=Je.getAccessToken();l!==null&&(e.headers.Authorization=`Bearer ${l}`),e.headers["X-KonomiTV-Version"]=Je.version}e.timeout===void 0&&(e.timeout=30*1e3),e.transitional={clarifyTimeoutError:!0};const t=await Ye.request(e).catch(l=>l);return t instanceof xs?(console.error(t),t.response?{type:"error",status:t.response.status,headers:t.response.headers,data:t.response.data,error:t}:{type:"error",status:NaN,headers:{},data:{detail:t.message},error:t}):{type:"success",headers:t.headers,status:t.status,data:t.data}}static async get(e,t){const s={url:e,method:"GET",...t};return await bn.request(s)}static async post(e,t,s){const l={url:e,method:"POST",data:t,...s};return await bn.request(l)}static async put(e,t,s){const l={url:e,method:"PUT",data:t,...s};return await bn.request(l)}static async delete(e,t){const s={url:e,method:"DELETE",...t};return await bn.request(s)}static showGenericError(e,t){const s=av();switch(e.data.detail){case"Not authenticated":{s.logout(!0),ze.error(`${t} ログインし直してください。`);return}case"Access token data is invalid":{s.logout(!0),ze.error(`${t} ログインセッションが不正です。もう一度ログインし直してください。`);return}case"Access token is invalid":{s.logout(!0),ze.error(`${t} diff --git a/client/dist/assets/Login-BYLQtBry.js b/client/dist/assets/Login-RVjujZFe.js similarity index 88% rename from client/dist/assets/Login-BYLQtBry.js rename to client/dist/assets/Login-RVjujZFe.js index 76bd58b8..a0294edb 100644 --- a/client/dist/assets/Login-BYLQtBry.js +++ b/client/dist/assets/Login-RVjujZFe.js @@ -1 +1 @@ -import{d as m,U as c,m as f,M as h,N as g,_ as w,r,o as _,c as V,b as o,e as n,h as t,l as v,V as y,k as B,p as C,q as S}from"./index-D2zR81a8.js";import{H as b,N as F}from"./Navigation-CsJWaG4R.js";import{_ as N}from"./ssrBoot-BvljY2yG.js";import{a as $,V as I}from"./VCard-C5ODUzfZ.js";import{V as k,b as i}from"./VTextField-DymZQzkG.js";import{V as U}from"./VForm-la6x9pr-.js";import"./VAvatar-CTvU0rd-.js";const D=m({name:"Login",components:{HeaderBar:b,Navigation:F},data(){return{is_form_dense:c.isSmartphoneHorizontal(),username:"",password:"",password_showing:!1}},computed:{...f(g)},async created(){await this.userStore.fetchUser(),this.userStore.is_logged_in&&await this.$router.replace({path:"/settings/account"})},methods:{async login(){if(this.username===""||this.password===""){h.error("ユーザー名またはパスワードが空です。");return}await this.userStore.login(this.username,this.password)!==!1&&await this.$router.replace({path:"/settings/account"})}}}),d=e=>(C("data-v-06de593b"),e=e(),S(),e),E={class:"route-container"},H={class:"login-container-wrapper d-flex align-center w-100 mb-13"},x=d(()=>n("img",{class:"d-block",src:N,style:{"max-width":"250px"}},null,-1)),M=d(()=>n("h4",{class:"mt-10"},"ログイン",-1));function T(e,s,A,L,j,q){const l=r("HeaderBar"),p=r("Navigation"),u=r("Icon");return _(),V("div",E,[o(l),n("main",null,[o(p),n("div",H,[o($,{class:"login-container px-10 pt-8 pb-11 mx-auto",elevation:"10",width:"100%","max-width":"450"},{default:t(()=>[o(I,{class:"login__logo py-4 d-flex flex-column justify-center align-center"},{default:t(()=>[x,M]),_:1}),o(k),o(U,{ref:"login",onSubmit:s[4]||(s[4]=v(()=>{},["prevent"]))},{default:t(()=>[o(i,{class:"mt-12",color:"primary",variant:"outlined",placeholder:"ユーザー名","hide-details":"",autofocus:"",density:e.is_form_dense?"compact":"default",modelValue:e.username,"onUpdate:modelValue":s[0]||(s[0]=a=>e.username=a)},null,8,["density","modelValue"]),o(i,{class:"mt-8",color:"primary",variant:"outlined",placeholder:"パスワード","hide-details":"",density:e.is_form_dense?"compact":"default",modelValue:e.password,"onUpdate:modelValue":s[1]||(s[1]=a=>e.password=a),type:e.password_showing?"text":"password","append-inner-icon":e.password_showing?"mdi-eye":"mdi-eye-off","onClick:appendInner":s[2]||(s[2]=a=>e.password_showing=!e.password_showing)},null,8,["density","modelValue","type","append-inner-icon"]),o(y,{class:"login-button mt-5",color:"secondary",variant:"flat",width:"100%",height:"56",onClick:s[3]||(s[3]=a=>e.login())},{default:t(()=>[o(u,{icon:"fa:sign-in",class:"mr-2"}),B("ログイン ")]),_:1})]),_:1},512)]),_:1})])])])}const R=w(D,[["render",T],["__scopeId","data-v-06de593b"]]);export{R as default}; +import{d as m,U as c,m as f,M as h,N as g,_ as w,r,o as _,c as V,b as o,e as n,h as t,l as v,V as y,k as B,p as C,q as S}from"./index-Dbi6R656.js";import{H as b,N as F}from"./Navigation-DZesdvbM.js";import{_ as N}from"./ssrBoot-sWDXISB3.js";import{a as $,V as I}from"./VCard-BBvTbBT9.js";import{V as k,b as i}from"./VTextField-DTBkpwFs.js";import{V as U}from"./VForm-B829AxXJ.js";import"./VAvatar-BrXxzhAv.js";const D=m({name:"Login",components:{HeaderBar:b,Navigation:F},data(){return{is_form_dense:c.isSmartphoneHorizontal(),username:"",password:"",password_showing:!1}},computed:{...f(g)},async created(){await this.userStore.fetchUser(),this.userStore.is_logged_in&&await this.$router.replace({path:"/settings/account"})},methods:{async login(){if(this.username===""||this.password===""){h.error("ユーザー名またはパスワードが空です。");return}await this.userStore.login(this.username,this.password)!==!1&&await this.$router.replace({path:"/settings/account"})}}}),d=e=>(C("data-v-06de593b"),e=e(),S(),e),E={class:"route-container"},H={class:"login-container-wrapper d-flex align-center w-100 mb-13"},x=d(()=>n("img",{class:"d-block",src:N,style:{"max-width":"250px"}},null,-1)),M=d(()=>n("h4",{class:"mt-10"},"ログイン",-1));function T(e,s,A,L,j,q){const l=r("HeaderBar"),p=r("Navigation"),u=r("Icon");return _(),V("div",E,[o(l),n("main",null,[o(p),n("div",H,[o($,{class:"login-container px-10 pt-8 pb-11 mx-auto",elevation:"10",width:"100%","max-width":"450"},{default:t(()=>[o(I,{class:"login__logo py-4 d-flex flex-column justify-center align-center"},{default:t(()=>[x,M]),_:1}),o(k),o(U,{ref:"login",onSubmit:s[4]||(s[4]=v(()=>{},["prevent"]))},{default:t(()=>[o(i,{class:"mt-12",color:"primary",variant:"outlined",placeholder:"ユーザー名","hide-details":"",autofocus:"",density:e.is_form_dense?"compact":"default",modelValue:e.username,"onUpdate:modelValue":s[0]||(s[0]=a=>e.username=a)},null,8,["density","modelValue"]),o(i,{class:"mt-8",color:"primary",variant:"outlined",placeholder:"パスワード","hide-details":"",density:e.is_form_dense?"compact":"default",modelValue:e.password,"onUpdate:modelValue":s[1]||(s[1]=a=>e.password=a),type:e.password_showing?"text":"password","append-inner-icon":e.password_showing?"mdi-eye":"mdi-eye-off","onClick:appendInner":s[2]||(s[2]=a=>e.password_showing=!e.password_showing)},null,8,["density","modelValue","type","append-inner-icon"]),o(y,{class:"login-button mt-5",color:"secondary",variant:"flat",width:"100%",height:"56",onClick:s[3]||(s[3]=a=>e.login())},{default:t(()=>[o(u,{icon:"fa:sign-in",class:"mr-2"}),B("ログイン ")]),_:1})]),_:1},512)]),_:1})])])])}const R=w(D,[["render",T],["__scopeId","data-v-06de593b"]]);export{R as default}; diff --git a/client/dist/assets/Navigation-CsJWaG4R.js b/client/dist/assets/Navigation-DZesdvbM.js similarity index 98% rename from client/dist/assets/Navigation-CsJWaG4R.js rename to client/dist/assets/Navigation-DZesdvbM.js index 7a80c4b2..1a6fda06 100644 --- a/client/dist/assets/Navigation-CsJWaG4R.js +++ b/client/dist/assets/Navigation-DZesdvbM.js @@ -1 +1 @@ -import{V as E,_ as z,u as R}from"./ssrBoot-BvljY2yG.js";import{_ as B,r as m,o as i,c as C,w as v,j as u,h as n,b as e,R as _,p as $,q as w,e as a,z as T,cH as F,A as G,c7 as H,cu as U,ct as j,du as L,B as q,dg as K,ce as M,C as Y,dv as J,cM as O,ca as Q,bD as g,c9 as X,cy as Z,cA as tt,D as h,dw as et,ci as at,cb as st,c6 as it,dx as nt,cc as N,n as o,V as y,G as x,I as ot,U as S,d as rt,m as lt,a as ct,t as vt}from"./index-D2zR81a8.js";const _t={},ut=t=>($("data-v-d7ed015a"),t=t(),w(),t),dt={class:"header"},gt=ut(()=>a("img",{class:"konomitv-logo__image",src:z,height:"21"},null,-1));function ht(t,l){const s=m("router-link");return i(),C("header",dt,[v((i(),u(s,{class:"konomitv-logo ml-3 ml-md-6",to:"/tv/"},{default:n(()=>[gt]),_:1})),[[_]]),e(E)])}const Ut=B(_t,[["render",ht],["__scopeId","data-v-d7ed015a"]]),mt=T({bgColor:String,color:String,grow:Boolean,mode:{type:String,validator:t=>!t||["horizontal","shift"].includes(t)},height:{type:[Number,String],default:56},active:{type:Boolean,default:!0},...F(),...G(),...H(),...U(),...j(),...L({name:"bottom-navigation"}),...q({tag:"header"}),...K({modelValue:!0,selectedClass:"v-btn--selected"}),...M()},"VBottomNavigation"),ft=Y()({name:"VBottomNavigation",props:mt(),emits:{"update:modelValue":t=>!0},setup(t,l){let{slots:s}=l;const{themeClasses:I}=J(),{borderClasses:D}=O(t),{backgroundColorClasses:A,backgroundColorStyles:r}=Q(g(t,"bgColor")),{densityClasses:c}=X(t),{elevationClasses:p}=Z(t),{roundedClasses:k}=tt(t),{ssrBootStyles:P}=R(),b=h(()=>Number(t.height)-(t.density==="comfortable"?8:0)-(t.density==="compact"?16:0)),f=g(t,"active"),{layoutItemStyles:W}=et({id:t.name,order:h(()=>parseInt(t.order,10)),position:h(()=>"bottom"),layoutSize:h(()=>f.value?b.value:0),elementSize:b,active:f,absolute:g(t,"absolute")});return at(t,nt),st({VBtn:{color:g(t,"color"),density:g(t,"density"),stacked:h(()=>t.mode!=="horizontal"),variant:"text"}},{scoped:!0}),it(()=>e(t.tag,{class:["v-bottom-navigation",{"v-bottom-navigation--active":f.value,"v-bottom-navigation--grow":t.grow,"v-bottom-navigation--shift":t.mode==="shift"},I.value,A.value,D.value,c.value,p.value,k.value,t.class],style:[r.value,W.value,{height:N(b.value),transform:`translateY(${N(f.value?0:100,"%")})`},P.value,t.style]},{default:()=>[s.default&&e("div",{class:"v-bottom-navigation__content"},[s.default()])]})),{}}}),pt={},V=t=>($("data-v-ff080838"),t=t(),w(),t),kt=V(()=>a("span",{class:"mt-1"},"テレビをみる",-1)),bt=V(()=>a("span",{class:"mt-1"},"ビデオをみる",-1)),yt=V(()=>a("span",{class:"mt-1"},"設定",-1));function St(t,l){const s=m("Icon");return i(),u(ft,{class:"bottom-navigation-container elevation-12",color:"primary",grow:"",active:""},{default:n(()=>[e(y,{class:o(["bottom-navigation-button",{"v-btn--active":t.$route.path.startsWith("/tv")}]),to:"/tv/"},{default:n(()=>[e(s,{icon:"fluent:tv-20-regular",width:"30px"}),kt]),_:1},8,["class"]),e(y,{class:o(["bottom-navigation-button",{"v-btn--active":t.$route.path.startsWith("/videos")}]),to:"/videos/"},{default:n(()=>[e(s,{icon:"fluent:movies-and-tv-20-regular",width:"30px"}),bt]),_:1},8,["class"]),e(y,{class:o(["bottom-navigation-button",{"v-btn--active":t.$route.path.startsWith("/settings")}]),to:"/settings/"},{default:n(()=>[e(s,{icon:"fluent:settings-20-regular",width:"30px"}),yt]),_:1},8,["class"])]),_:1})}const Ct=B(pt,[["render",St],["__scopeId","data-v-ff080838"]]);class Bt{static async fetchServerVersion(l=!1){const s=await x.get("/version");return s.type==="error"?(l===!1&&x.showGenericError(s,"バージョン情報を取得できませんでした。"),null):s.data}}const $t=ot("version",{state:()=>({server_version_info:null,last_updated_at:0}),getters:{client_version(){return S.version},server_version(){var t;return((t=this.server_version_info)==null?void 0:t.version)??null},latest_version(){var t;return((t=this.server_version_info)==null?void 0:t.latest_version)??null},is_client_develop_version(){return this.client_version.includes("-dev")},is_server_develop_version(){var t;return((t=this.server_version)==null?void 0:t.includes("-dev"))??!1},is_update_available(){return this.server_version===null||this.latest_version===null?!1:this.is_server_develop_version===!1&&this.server_version!==this.latest_version||this.is_server_develop_version===!0&&this.server_version.replace("-dev","")===this.latest_version},is_version_mismatch(){return this.server_version===null?!1:this.client_version!==this.server_version}},actions:{async fetchServerVersion(t=!1){if(this.server_version_info!==null&&t===!1)return S.time()-this.last_updated_at>60&&this.fetchServerVersion(!0),this.server_version_info;const l=await Bt.fetchServerVersion();return l===null?null:(this.server_version_info=l,this.last_updated_at=S.time(),this.server_version_info)}}}),wt=$t,Vt=rt({name:"Navigation",components:{BottomNavigation:Ct},computed:{...lt(wt)},async created(){await this.versionStore.fetchServerVersion()}}),d=t=>($("data-v-2980c68a"),t=t(),w(),t),It={class:"navigation-container elevation-8"},Dt={class:"navigation"},At={class:"navigation-scroll"},Nt=d(()=>a("span",{class:"navigation__link-text"},"テレビをみる",-1)),xt=d(()=>a("span",{class:"navigation__link-text"},"ビデオをみる",-1)),Et=d(()=>a("span",{class:"navigation__link-text"},"番組表",-1)),Pt=d(()=>a("span",{class:"navigation__link-text"},"録画予約",-1)),Wt=d(()=>a("span",{class:"navigation__link-text"},"マイリスト",-1)),zt=d(()=>a("span",{class:"navigation__link-text"},"キャプチャ",-1)),Rt=d(()=>a("span",{class:"navigation__link-text"},"設定",-1)),Tt={class:"navigation__link-text"};function Ft(t,l,s,I,D,A){const r=m("Icon"),c=m("router-link"),p=m("BottomNavigation"),k=ct("tooltip");return i(),C("div",null,[a("div",It,[a("nav",Dt,[a("div",At,[v((i(),u(c,{class:o(["navigation__link",{"navigation__link--active":t.$route.path.startsWith("/tv")}]),"active-class":"navigation__link--active",to:"/tv/"},{default:n(()=>[e(r,{class:"navigation__link-icon",icon:"fluent:tv-20-regular",width:"26px"}),Nt]),_:1},8,["class"])),[[_]]),v((i(),u(c,{class:o(["navigation__link",{"navigation__link--active":t.$route.path.startsWith("/videos")}]),"active-class":"navigation__link--active",to:"/videos/"},{default:n(()=>[e(r,{class:"navigation__link-icon",icon:"fluent:movies-and-tv-20-regular",width:"26px"}),xt]),_:1},8,["class"])),[[_]]),v((i(),u(c,{class:o(["navigation__link",{"navigation__link--active":t.$route.path.startsWith("/timetable")}]),"active-class":"navigation__link--active",to:"/timetable/"},{default:n(()=>[e(r,{class:"navigation__link-icon",icon:"fluent:calendar-ltr-20-regular",width:"26px"}),Et]),_:1},8,["class"])),[[_]]),v((i(),u(c,{class:o(["navigation__link",{"navigation__link--active":t.$route.path.startsWith("/reserves")}]),"active-class":"navigation__link--active",to:"/reserves/"},{default:n(()=>[e(r,{class:"navigation__link-icon",icon:"fluent:timer-16-regular",width:"26px",style:{padding:"0.5px"}}),Pt]),_:1},8,["class"])),[[_]]),v((i(),u(c,{class:o(["navigation__link",{"navigation__link--active":t.$route.path.startsWith("/mylist")}]),"active-class":"navigation__link--active",to:"/mylist/"},{default:n(()=>[e(r,{class:"navigation__link-icon",icon:"ic:round-playlist-play",width:"26px"}),Wt]),_:1},8,["class"])),[[_]]),v((i(),u(c,{class:o(["navigation__link",{"navigation__link--active":t.$route.path.startsWith("/captures")}]),"active-class":"navigation__link--active",to:"/captures/"},{default:n(()=>[e(r,{class:"navigation__link-icon",icon:"fluent:image-multiple-24-regular",width:"26px"}),zt]),_:1},8,["class"])),[[_]]),e(E),v((i(),u(c,{class:o(["navigation__link",{"navigation__link--active":t.$route.path.startsWith("/settings")}]),"active-class":"navigation__link--active",to:"/settings/"},{default:n(()=>[e(r,{class:"navigation__link-icon",icon:"fluent:settings-20-regular",width:"26px"}),Rt]),_:1},8,["class"])),[[_]]),v((i(),C("a",{class:o(["navigation__link",{"navigation__link--develop-version":t.versionStore.is_client_develop_version,"navigation__link--highlight":t.versionStore.is_update_available}]),"active-class":"navigation__link--active",href:"https://github.com/tsukumijima/KonomiTV"},[e(r,{class:"navigation__link-icon",icon:"fluent:info-16-regular",width:"26px"}),a("span",Tt,"version "+vt(t.versionStore.client_version),1)],2)),[[_],[k,t.versionStore.is_update_available?`アップデートがあります (version ${t.versionStore.latest_version})`:"",void 0,{top:!0}]])])])]),e(p)])}const jt=B(Vt,[["render",Ft],["__scopeId","data-v-2980c68a"]]);export{Ut as H,jt as N,Bt as V,wt as u}; +import{V as E,_ as z,u as R}from"./ssrBoot-sWDXISB3.js";import{_ as B,r as m,o as i,c as C,w as v,j as u,h as n,b as e,R as _,p as $,q as w,e as a,z as T,cH as F,A as G,c7 as H,cu as U,ct as j,du as L,B as q,dg as K,ce as M,C as Y,dv as J,cM as O,ca as Q,bD as g,c9 as X,cy as Z,cA as tt,D as h,dw as et,ci as at,cb as st,c6 as it,dx as nt,cc as N,n as o,V as y,G as x,I as ot,U as S,d as rt,m as lt,a as ct,t as vt}from"./index-Dbi6R656.js";const _t={},ut=t=>($("data-v-d7ed015a"),t=t(),w(),t),dt={class:"header"},gt=ut(()=>a("img",{class:"konomitv-logo__image",src:z,height:"21"},null,-1));function ht(t,l){const s=m("router-link");return i(),C("header",dt,[v((i(),u(s,{class:"konomitv-logo ml-3 ml-md-6",to:"/tv/"},{default:n(()=>[gt]),_:1})),[[_]]),e(E)])}const Ut=B(_t,[["render",ht],["__scopeId","data-v-d7ed015a"]]),mt=T({bgColor:String,color:String,grow:Boolean,mode:{type:String,validator:t=>!t||["horizontal","shift"].includes(t)},height:{type:[Number,String],default:56},active:{type:Boolean,default:!0},...F(),...G(),...H(),...U(),...j(),...L({name:"bottom-navigation"}),...q({tag:"header"}),...K({modelValue:!0,selectedClass:"v-btn--selected"}),...M()},"VBottomNavigation"),ft=Y()({name:"VBottomNavigation",props:mt(),emits:{"update:modelValue":t=>!0},setup(t,l){let{slots:s}=l;const{themeClasses:I}=J(),{borderClasses:D}=O(t),{backgroundColorClasses:A,backgroundColorStyles:r}=Q(g(t,"bgColor")),{densityClasses:c}=X(t),{elevationClasses:p}=Z(t),{roundedClasses:k}=tt(t),{ssrBootStyles:P}=R(),b=h(()=>Number(t.height)-(t.density==="comfortable"?8:0)-(t.density==="compact"?16:0)),f=g(t,"active"),{layoutItemStyles:W}=et({id:t.name,order:h(()=>parseInt(t.order,10)),position:h(()=>"bottom"),layoutSize:h(()=>f.value?b.value:0),elementSize:b,active:f,absolute:g(t,"absolute")});return at(t,nt),st({VBtn:{color:g(t,"color"),density:g(t,"density"),stacked:h(()=>t.mode!=="horizontal"),variant:"text"}},{scoped:!0}),it(()=>e(t.tag,{class:["v-bottom-navigation",{"v-bottom-navigation--active":f.value,"v-bottom-navigation--grow":t.grow,"v-bottom-navigation--shift":t.mode==="shift"},I.value,A.value,D.value,c.value,p.value,k.value,t.class],style:[r.value,W.value,{height:N(b.value),transform:`translateY(${N(f.value?0:100,"%")})`},P.value,t.style]},{default:()=>[s.default&&e("div",{class:"v-bottom-navigation__content"},[s.default()])]})),{}}}),pt={},V=t=>($("data-v-ff080838"),t=t(),w(),t),kt=V(()=>a("span",{class:"mt-1"},"テレビをみる",-1)),bt=V(()=>a("span",{class:"mt-1"},"ビデオをみる",-1)),yt=V(()=>a("span",{class:"mt-1"},"設定",-1));function St(t,l){const s=m("Icon");return i(),u(ft,{class:"bottom-navigation-container elevation-12",color:"primary",grow:"",active:""},{default:n(()=>[e(y,{class:o(["bottom-navigation-button",{"v-btn--active":t.$route.path.startsWith("/tv")}]),to:"/tv/"},{default:n(()=>[e(s,{icon:"fluent:tv-20-regular",width:"30px"}),kt]),_:1},8,["class"]),e(y,{class:o(["bottom-navigation-button",{"v-btn--active":t.$route.path.startsWith("/videos")}]),to:"/videos/"},{default:n(()=>[e(s,{icon:"fluent:movies-and-tv-20-regular",width:"30px"}),bt]),_:1},8,["class"]),e(y,{class:o(["bottom-navigation-button",{"v-btn--active":t.$route.path.startsWith("/settings")}]),to:"/settings/"},{default:n(()=>[e(s,{icon:"fluent:settings-20-regular",width:"30px"}),yt]),_:1},8,["class"])]),_:1})}const Ct=B(pt,[["render",St],["__scopeId","data-v-ff080838"]]);class Bt{static async fetchServerVersion(l=!1){const s=await x.get("/version");return s.type==="error"?(l===!1&&x.showGenericError(s,"バージョン情報を取得できませんでした。"),null):s.data}}const $t=ot("version",{state:()=>({server_version_info:null,last_updated_at:0}),getters:{client_version(){return S.version},server_version(){var t;return((t=this.server_version_info)==null?void 0:t.version)??null},latest_version(){var t;return((t=this.server_version_info)==null?void 0:t.latest_version)??null},is_client_develop_version(){return this.client_version.includes("-dev")},is_server_develop_version(){var t;return((t=this.server_version)==null?void 0:t.includes("-dev"))??!1},is_update_available(){return this.server_version===null||this.latest_version===null?!1:this.is_server_develop_version===!1&&this.server_version!==this.latest_version||this.is_server_develop_version===!0&&this.server_version.replace("-dev","")===this.latest_version},is_version_mismatch(){return this.server_version===null?!1:this.client_version!==this.server_version}},actions:{async fetchServerVersion(t=!1){if(this.server_version_info!==null&&t===!1)return S.time()-this.last_updated_at>60&&this.fetchServerVersion(!0),this.server_version_info;const l=await Bt.fetchServerVersion();return l===null?null:(this.server_version_info=l,this.last_updated_at=S.time(),this.server_version_info)}}}),wt=$t,Vt=rt({name:"Navigation",components:{BottomNavigation:Ct},computed:{...lt(wt)},async created(){await this.versionStore.fetchServerVersion()}}),d=t=>($("data-v-2980c68a"),t=t(),w(),t),It={class:"navigation-container elevation-8"},Dt={class:"navigation"},At={class:"navigation-scroll"},Nt=d(()=>a("span",{class:"navigation__link-text"},"テレビをみる",-1)),xt=d(()=>a("span",{class:"navigation__link-text"},"ビデオをみる",-1)),Et=d(()=>a("span",{class:"navigation__link-text"},"番組表",-1)),Pt=d(()=>a("span",{class:"navigation__link-text"},"録画予約",-1)),Wt=d(()=>a("span",{class:"navigation__link-text"},"マイリスト",-1)),zt=d(()=>a("span",{class:"navigation__link-text"},"キャプチャ",-1)),Rt=d(()=>a("span",{class:"navigation__link-text"},"設定",-1)),Tt={class:"navigation__link-text"};function Ft(t,l,s,I,D,A){const r=m("Icon"),c=m("router-link"),p=m("BottomNavigation"),k=ct("tooltip");return i(),C("div",null,[a("div",It,[a("nav",Dt,[a("div",At,[v((i(),u(c,{class:o(["navigation__link",{"navigation__link--active":t.$route.path.startsWith("/tv")}]),"active-class":"navigation__link--active",to:"/tv/"},{default:n(()=>[e(r,{class:"navigation__link-icon",icon:"fluent:tv-20-regular",width:"26px"}),Nt]),_:1},8,["class"])),[[_]]),v((i(),u(c,{class:o(["navigation__link",{"navigation__link--active":t.$route.path.startsWith("/videos")}]),"active-class":"navigation__link--active",to:"/videos/"},{default:n(()=>[e(r,{class:"navigation__link-icon",icon:"fluent:movies-and-tv-20-regular",width:"26px"}),xt]),_:1},8,["class"])),[[_]]),v((i(),u(c,{class:o(["navigation__link",{"navigation__link--active":t.$route.path.startsWith("/timetable")}]),"active-class":"navigation__link--active",to:"/timetable/"},{default:n(()=>[e(r,{class:"navigation__link-icon",icon:"fluent:calendar-ltr-20-regular",width:"26px"}),Et]),_:1},8,["class"])),[[_]]),v((i(),u(c,{class:o(["navigation__link",{"navigation__link--active":t.$route.path.startsWith("/reserves")}]),"active-class":"navigation__link--active",to:"/reserves/"},{default:n(()=>[e(r,{class:"navigation__link-icon",icon:"fluent:timer-16-regular",width:"26px",style:{padding:"0.5px"}}),Pt]),_:1},8,["class"])),[[_]]),v((i(),u(c,{class:o(["navigation__link",{"navigation__link--active":t.$route.path.startsWith("/mylist")}]),"active-class":"navigation__link--active",to:"/mylist/"},{default:n(()=>[e(r,{class:"navigation__link-icon",icon:"ic:round-playlist-play",width:"26px"}),Wt]),_:1},8,["class"])),[[_]]),v((i(),u(c,{class:o(["navigation__link",{"navigation__link--active":t.$route.path.startsWith("/captures")}]),"active-class":"navigation__link--active",to:"/captures/"},{default:n(()=>[e(r,{class:"navigation__link-icon",icon:"fluent:image-multiple-24-regular",width:"26px"}),zt]),_:1},8,["class"])),[[_]]),e(E),v((i(),u(c,{class:o(["navigation__link",{"navigation__link--active":t.$route.path.startsWith("/settings")}]),"active-class":"navigation__link--active",to:"/settings/"},{default:n(()=>[e(r,{class:"navigation__link-icon",icon:"fluent:settings-20-regular",width:"26px"}),Rt]),_:1},8,["class"])),[[_]]),v((i(),C("a",{class:o(["navigation__link",{"navigation__link--develop-version":t.versionStore.is_client_develop_version,"navigation__link--highlight":t.versionStore.is_update_available}]),"active-class":"navigation__link--active",href:"https://github.com/tsukumijima/KonomiTV"},[e(r,{class:"navigation__link-icon",icon:"fluent:info-16-regular",width:"26px"}),a("span",Tt,"version "+vt(t.versionStore.client_version),1)],2)),[[_],[k,t.versionStore.is_update_available?`アップデートがあります (version ${t.versionStore.latest_version})`:"",void 0,{top:!0}]])])])]),e(p)])}const jt=B(Vt,[["render",Ft],["__scopeId","data-v-2980c68a"]]);export{Ut as H,jt as N,Bt as V,wt as u}; diff --git a/client/dist/assets/NotFound-DmKC9dt8.js b/client/dist/assets/NotFound-DQeyXnhV.js similarity index 76% rename from client/dist/assets/NotFound-DmKC9dt8.js rename to client/dist/assets/NotFound-DQeyXnhV.js index 2dade5fc..9d70a3f7 100644 --- a/client/dist/assets/NotFound-DmKC9dt8.js +++ b/client/dist/assets/NotFound-DQeyXnhV.js @@ -1 +1 @@ -import{H as c,N as u}from"./Navigation-CsJWaG4R.js";import{d,_ as r,r as t,o as i,c as p,b as a,e,p as l,q as _}from"./index-D2zR81a8.js";import"./ssrBoot-BvljY2yG.js";const m=d({name:"NotFound",components:{HeaderBar:c,Navigation:u}}),f=o=>(l("data-v-2a77ddde"),o=o(),_(),o),v={class:"route-container"},B=f(()=>e("div",{class:"d-flex justify-center align-center w-100"},[e("div",{class:"d-flex justify-center align-center flex-column"},[e("h1",null,"Not Found, or Under Development..."),e("span",{class:"mt-4 text-text-darken-1"},"お探しのページは存在しないか、鋭意開発中です。")])],-1));function N(o,x,h,F,g,A){const n=t("HeaderBar"),s=t("Navigation");return i(),p("div",v,[a(n),e("main",null,[a(s),B])])}const I=r(m,[["render",N],["__scopeId","data-v-2a77ddde"]]);export{I as default}; +import{H as c,N as u}from"./Navigation-DZesdvbM.js";import{d,_ as r,r as t,o as i,c as p,b as a,e,p as l,q as _}from"./index-Dbi6R656.js";import"./ssrBoot-sWDXISB3.js";const m=d({name:"NotFound",components:{HeaderBar:c,Navigation:u}}),f=o=>(l("data-v-2a77ddde"),o=o(),_(),o),v={class:"route-container"},B=f(()=>e("div",{class:"d-flex justify-center align-center w-100"},[e("div",{class:"d-flex justify-center align-center flex-column"},[e("h1",null,"Not Found, or Under Development..."),e("span",{class:"mt-4 text-text-darken-1"},"お探しのページは存在しないか、鋭意開発中です。")])],-1));function N(o,x,h,F,g,A){const n=t("HeaderBar"),s=t("Navigation");return i(),p("div",v,[a(n),e("main",null,[a(s),B])])}const I=r(m,[["render",N],["__scopeId","data-v-2a77ddde"]]);export{I as default}; diff --git a/client/dist/assets/PlayerController-BUt1PTIZ.js b/client/dist/assets/PlayerController-CPRxjWAH.js similarity index 93% rename from client/dist/assets/PlayerController-BUt1PTIZ.js rename to client/dist/assets/PlayerController-CPRxjWAH.js index 5d63c5bb..24d0d818 100644 --- a/client/dist/assets/PlayerController-BUt1PTIZ.js +++ b/client/dist/assets/PlayerController-CPRxjWAH.js @@ -1,7 +1,7 @@ -var e2=Object.defineProperty;var t2=(_,e,s)=>e in _?e2(_,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):_[e]=s;var we=(_,e,s)=>(t2(_,typeof e!="symbol"?e+"":e,s),s),Pu=(_,e,s)=>{if(!e.has(_))throw TypeError("Cannot "+s)};var Mn=(_,e,s)=>(Pu(_,e,"read from private field"),s?s.call(_):e.get(_)),Bu=(_,e,s)=>{if(e.has(_))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(_):e.set(_,s)},Ol=(_,e,s,u)=>(Pu(_,e,"write to private field"),u?u.call(_,s):e.set(_,s),s);import{x as jo,y as nd,z as kf,A as Rf,B as If,C as Lf,D as Df,E as Of,G as kr,H as ea,I as i2,u as Sn,d as er,U as si,P as Vo,J as Rr,m as yr,_ as Wn,r as an,o as Zt,c as ai,w as Si,j as Tn,h as hn,i as _n,e as Dt,t as en,b as Ai,n as Yi,R as Ri,g as Xn,F as $n,v as rd,p as Ir,q as Lr,a as Mf,f as Eo,k as Bn,V as n2,l as ta,K as Pf,L as Jn,N as Rc,O as Ml,Q as Ho,S as sd,T as Es,W as Ic,X as Pl,M as As,Y as r2,Z as s2}from"./index-D2zR81a8.js";import{u as Ln,C as wo,a as a2}from"./ChannelsStore-eNnhxLya.js";import{V as zo,_ as o2}from"./ssrBoot-BvljY2yG.js";import{V as Bf}from"./VDialog-BE2JXbX2.js";import{V as l2,a as c2}from"./VCard-C5ODUzfZ.js";import{S as d2,a as u2}from"./swiper-cQLwFU5D.js";import{C as h2}from"./CommentMuteSettings-aK-5x8By.js";import{V as f2,a as Bl,b as Nl}from"./VSelect-BuCCGZYb.js";import{d as p2}from"./vuedraggable.umd-X59vE-3L.js";import{T as m2}from"./Twitter-Bph-nOIj.js";import{P as Js}from"./PlayerUtils-BMfVEgCY.js";const Nf=jo.reduce((_,e)=>(_[e]={type:[Boolean,String,Number],default:!1},_),{}),Ff=jo.reduce((_,e)=>{const s="offset"+nd(e);return _[s]={type:[String,Number],default:null},_},{}),Uf=jo.reduce((_,e)=>{const s="order"+nd(e);return _[s]={type:[String,Number],default:null},_},{}),Nu={col:Object.keys(Nf),offset:Object.keys(Ff),order:Object.keys(Uf)};function g2(_,e,s){let u=_;if(!(s==null||s===!1)){if(e){const y=e.replace(_,"");u+=`-${y}`}return _==="col"&&(u="v-"+u),_==="col"&&(s===""||s===!0)||(u+=`-${s}`),u.toLowerCase()}}const A2=["auto","start","end","center","baseline","stretch"],y2=kf({cols:{type:[Boolean,String,Number],default:!1},...Nf,offset:{type:[String,Number],default:null},...Ff,order:{type:[String,Number],default:null},...Uf,alignSelf:{type:String,default:null,validator:_=>A2.includes(_)},...Rf(),...If()},"VCol"),v2=Lf()({name:"VCol",props:y2(),setup(_,e){let{slots:s}=e;const u=Df(()=>{const y=[];let A;for(A in Nu)Nu[A].forEach(c=>{const p=_[c],r=g2(A,c,p);r&&y.push(r)});const l=y.some(c=>c.startsWith("v-col-"));return y.push({"v-col":!l||!_.cols,[`v-col-${_.cols}`]:_.cols,[`offset-${_.offset}`]:_.offset,[`order-${_.order}`]:_.order,[`align-self-${_.alignSelf}`]:_.alignSelf}),y});return()=>{var y;return Of(_.tag,{class:[u.value,_.class],style:_.style},(y=s.default)==null?void 0:y.call(s))}}}),ad=["start","end","center"],Gf=["space-between","space-around","space-evenly"];function od(_,e){return jo.reduce((s,u)=>{const y=_+nd(u);return s[y]=e(),s},{})}const b2=[...ad,"baseline","stretch"],jf=_=>b2.includes(_),Vf=od("align",()=>({type:String,default:null,validator:jf})),_2=[...ad,...Gf],Hf=_=>_2.includes(_),zf=od("justify",()=>({type:String,default:null,validator:Hf})),E2=[...ad,...Gf,"stretch"],Wf=_=>E2.includes(_),Kf=od("alignContent",()=>({type:String,default:null,validator:Wf})),Fu={align:Object.keys(Vf),justify:Object.keys(zf),alignContent:Object.keys(Kf)},w2={align:"align",justify:"justify",alignContent:"align-content"};function S2(_,e,s){let u=w2[_];if(s!=null){if(e){const y=e.replace(_,"");u+=`-${y}`}return u+=`-${s}`,u.toLowerCase()}}const T2=kf({dense:Boolean,noGutters:Boolean,align:{type:String,default:null,validator:jf},...Vf,justify:{type:String,default:null,validator:Hf},...zf,alignContent:{type:String,default:null,validator:Wf},...Kf,...Rf(),...If()},"VRow"),C2=Lf()({name:"VRow",props:T2(),setup(_,e){let{slots:s}=e;const u=Df(()=>{const y=[];let A;for(A in Fu)Fu[A].forEach(l=>{const c=_[l],p=S2(A,l,c);p&&y.push(p)});return y.push({"v-row--no-gutters":_.noGutters,"v-row--dense":_.dense,[`align-${_.align}`]:_.align,[`justify-${_.justify}`]:_.justify,[`align-content-${_.alignContent}`]:_.alignContent}),y});return()=>{var y;return Of(_.tag,{class:["v-row",u.value,_.class],style:_.style},(y=s.default)==null?void 0:y.call(s))}}});function x2(_){return{all:_=_||new Map,on:function(e,s){var u=_.get(e);u?u.push(s):_.set(e,[s])},off:function(e,s){var u=_.get(e);u&&(s?u.splice(u.indexOf(s)>>>0,1):_.set(e,[]))},emit:function(e,s){var u=_.get(e);u&&u.slice().map(function(y){y(s)}),(u=_.get("*"))&&u.slice().map(function(y){y(e,s)})}}}const k2={id:-1,file_path:"",file_hash:"",file_size:0,recording_start_time:null,recording_end_time:null,duration:0,container_format:"MPEG-TS",video_codec:"MPEG-2",video_codec_profile:"High",video_scan_type:"Interlaced",video_frame_rate:29.97,video_resolution_width:1440,video_resolution_height:1080,primary_audio_codec:"AAC-LC",primary_audio_channel:"Stereo",primary_audio_sampling_rate:48e3,secondary_audio_codec:null,secondary_audio_channel:null,secondary_audio_sampling_rate:null,cm_sections:[]},Uu={id:-1,recorded_video:k2,recording_start_margin:0,recording_end_margin:0,is_partially_recorded:!1,channel:null,network_id:null,service_id:null,event_id:null,series_id:null,series_broadcast_period_id:null,title:"取得中…",series_title:null,episode_number:null,subtitle:null,description:"取得中…",detail:{},start_time:"2000-01-01T00:00:00+09:00",end_time:"2000-01-01T00:00:00+09:00",duration:0,is_free:!0,genres:[],primary_audio_type:"2/0モード(ステレオ)",primary_audio_language:"日本語",secondary_audio_type:null,secondary_audio_language:null};class R2{static async fetchVideo(e){const s=await kr.get(`/videos/${e}`);return s.type==="error"?(kr.showGenericError(s,"録画番組情報を取得できませんでした。"),null):s.data}static async fetchVideoJikkyoComments(e){const s=await kr.get(`/videos/${e}/jikkyo`);return s.type==="error"?(kr.showGenericError(s,"過去ログコメントを取得できませんでした。"),{is_success:!1,comments:[],detail:"過去ログコメントを取得できませんでした。"}):(s.data.comments=s.data.comments.filter(u=>ea.isMutedComment(u.text,u.author,u.color,u.type,u.size)===!1),s.data)}}const I2=R2,L2=i2("player",{state:()=>({is_watching:!1,is_player_initialized:!1,event_emitter:x2(),recorded_program:Uu,is_virtual_keyboard_display:!1,is_fullscreen:!1,is_document_pip:!1,is_control_display:!0,is_panel_display:(()=>{const _=Sn();switch(_.settings.panel_display_state){case"AlwaysDisplay":return!0;case"AlwaysFold":return!1;case"RestorePreviousState":return _.settings.showed_panel_last_time}})(),tv_panel_active_tab:Sn().settings.tv_panel_active_tab,video_panel_active_tab:Sn().settings.video_panel_active_tab,twitter_active_tab:Sn().settings.twitter_active_tab,is_remocon_display:!1,is_zapping:!1,is_loading:!0,is_video_buffering:!0,is_video_paused:!1,is_background_display:!1,background_url:"",shortcut_key_modal:!1,live_stream_status:null,live_comment_init_failed_message:null,video_comment_init_failed_message:null,twitter_captures:[],twitter_selected_capture_blobs:[],twitter_zoom_capture_modal:!1,twitter_zoom_capture:null}),actions:{startWatching(){this.reset(),this.is_watching=!0},stopWatching(){this.reset(),this.is_watching=!1},reset(){this.is_watching=!1,this.is_player_initialized=!1,this.recorded_program=Uu,this.is_virtual_keyboard_display=!1,this.is_fullscreen=!1,this.is_document_pip=!1,this.is_control_display=!0,this.is_panel_display=(()=>{const _=Sn();switch(_.settings.panel_display_state){case"AlwaysDisplay":return!0;case"AlwaysFold":return!1;case"RestorePreviousState":return _.settings.showed_panel_last_time}})(),this.tv_panel_active_tab=Sn().settings.tv_panel_active_tab,this.video_panel_active_tab=Sn().settings.video_panel_active_tab,this.twitter_active_tab=Sn().settings.twitter_active_tab,this.is_remocon_display=!1,this.is_zapping=!1,this.is_loading=!0,this.is_video_buffering=!0,this.is_video_paused=!1,this.is_background_display=!1,this.background_url="",this.shortcut_key_modal=!1,this.live_stream_status=null,this.live_comment_init_failed_message=null,this.twitter_captures=[],this.twitter_zoom_capture_modal=!1,this.twitter_zoom_capture=null}}}),cn=L2,D2=er({name:"Watch-Header",props:{playback_mode:{type:String,required:!0}},data(){return{Utils:Object.freeze(si),ProgramUtils:Object.freeze(Vo),time:Rr().format(si.isSmartphoneHorizontal()?"HH:mm:ss":"YYYY/MM/DD HH:mm:ss"),time_interval_id:0}},computed:{...yr(Ln,cn)},created(){this.time_interval_id=window.setInterval(()=>{this.time=Rr().format(si.isSmartphoneHorizontal()?"HH:mm:ss":"YYYY/MM/DD HH:mm:ss")},1*1e3)},beforeUnmount(){window.clearInterval(this.time_interval_id)}}),O2=["src"],M2=["innerHTML"],P2={class:"watch-header__program-time"},B2={class:"watch-header__now"};function N2(_,e,s,u,y,A){const l=an("Icon"),c=an("router-link");return Zt(),ai("header",{class:Yi(["watch-header",{"watch-header--video":_.playback_mode==="Video"}])},[Si((Zt(),Tn(c,{class:"watch-header__back-icon",to:_.playback_mode==="Live"?"/tv/":"/videos/"},{default:hn(()=>[Ai(l,{icon:"fluent:arrow-left-12-filled",width:"25px"})]),_:1},8,["to"])),[[Ri]]),_.playback_mode==="Live"?(Zt(),ai("img",{key:0,class:"watch-header__broadcaster",src:`${_.Utils.api_base_url}/channels/${_.channelsStore.channel.current.id}/logo`},null,8,O2)):_n("",!0),Dt("span",{class:"watch-header__program-title",innerHTML:_.ProgramUtils.decorateProgramInfo(_.playback_mode==="Live"?_.channelsStore.channel.current.program_present:_.playerStore.recorded_program,"title")},null,8,M2),Dt("span",P2,en(_.ProgramUtils.getProgramTime(_.playback_mode==="Live"?_.channelsStore.channel.current.program_present:_.playerStore.recorded_program,!0)),1),Ai(zo),Dt("span",B2,en(_.time),1)],2)}const F2=Wn(D2,[["render",N2],["__scopeId","data-v-a6183c43"]]),U2={left_column:[{name:"全般",icon:"fluent:home-20-filled",icon_height:"22px",shortcuts:[{name:"数字キー/テンキーに対応するリモコン番号 (1~12) の地デジチャンネルに切り替える",keys:[{name:"1~9, 0, -(=), ^(~)",icon:!1}]},{name:"数字キー/テンキーに対応するリモコン番号 (1~12) の BS チャンネルに切り替える",keys:[{name:"Shift",icon:!1},{name:"1~9, 0, -(=), ^(~)",icon:!1}]},{name:"前のチャンネルに切り替える",keys:[{name:"fluent:arrow-up-12-filled",icon:!0}]},{name:"次のチャンネルに切り替える",keys:[{name:"fluent:arrow-down-12-filled",icon:!0}]},{name:"キーボードショートカットの一覧を表示する",keys:[{name:"/(?)",icon:!1}]}]},{name:"プレイヤー",icon:"fluent:play-20-filled",icon_height:"20px",shortcuts:[{name:"再生 / 一時停止の切り替え",keys:[{name:"Space",icon:!1}]},{name:"再生 / 一時停止の切り替え (キャプチャタブ表示時)",keys:[{name:"Shift",icon:!1},{name:"Space",icon:!1}]},{name:"停止して0.5秒早戻し",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-left-12-filled",icon:!0}]},{name:"停止して0.5秒早送り",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-right-12-filled",icon:!0}]},{name:"プレイヤーの音量を上げる",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-up-12-filled",icon:!0}]},{name:"プレイヤーの音量を下げる",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-down-12-filled",icon:!0}]},{name:"プレイヤーの音量をミュートする",keys:[{name:"Q",icon:!1}]},{name:"ライブストリームを同期する",keys:[{name:"W",icon:!1}]},{name:"プレイヤーを再起動する",keys:[{name:"R",icon:!1}]},{name:"フルスクリーンの切り替え",keys:[{name:"F",icon:!1}]},{name:"Picture-in-Picture の表示切り替え",keys:[{name:"E",icon:!1}]},{name:"字幕の表示切り替え",keys:[{name:"S",icon:!1}]},{name:"コメントの表示切り替え",keys:[{name:"D",icon:!1}]},{name:"映像をキャプチャする",keys:[{name:"C",icon:!1}]},{name:"映像をコメントを付けてキャプチャする",keys:[{name:"V",icon:!1}]},{name:"コメント入力フォームにフォーカスする",keys:[{name:"M",icon:!1}]},{name:"コメント入力フォームを閉じる",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"M",icon:!1}]},{name:"コメントを送信する",keys:[{name:"コメント入力フォームを表示",icon:!1},{name:"Enter",icon:!1}]}]}],right_column:[{name:"パネル",icon:"fluent:panel-right-20-filled",icon_height:"24px",shortcuts:[{name:"パネルの表示切り替え",keys:[{name:"P",icon:!1}]},{name:"番組情報タブを表示する",keys:[{name:"K",icon:!1}]},{name:"チャンネルタブを表示する",keys:[{name:"L",icon:!1}]},{name:"コメントタブを表示する",keys:[{name:";(+)",icon:!1}]},{name:"Twitter タブを表示する",keys:[{name:":(*)",icon:!1}]}]},{name:"Twitter",icon:"fa-brands:twitter",icon_height:"22px",shortcuts:[{name:"ツイート検索タブを表示する",keys:[{name:"[ (「)",icon:!1}]},{name:"タイムラインタブを表示する",keys:[{name:"] (」)",icon:!1}]},{name:"キャプチャタブを表示する",keys:[{name:"\(¥)",icon:!1}]},{name:"ツイート入力フォームにフォーカスを当てる/フォーカスを外す",keys:[{name:"Tab",icon:!1}]},{name:"キャプチャにフォーカスする",keys:[{name:"キャプチャタブを表示",icon:!1},{name:"fluent:arrow-up-12-filled;fluent:arrow-down-12-filled;fluent:arrow-left-12-filled;fluent:arrow-right-12-filled",icon:!0}]},{name:"キャプチャを拡大表示する/
キャプチャの拡大表示を閉じる",keys:[{name:"キャプチャにフォーカス",icon:!1},{name:"Enter",icon:!1}]},{name:"キャプチャを選択する/
キャプチャの選択を解除する",keys:[{name:"キャプチャにフォーカス",icon:!1},{name:"Space",icon:!1}]},{name:"クリップボード内の画像を
キャプチャとして取り込む",keys:[{name:"ツイート入力
フォームにフォーカス",icon:!1},{name:si.CtrlOrCmd(),icon:!1},{name:"V",icon:!1}]},{name:"ツイートを送信する",keys:[{name:"Twitter タブを表示",icon:!1},{name:si.CtrlOrCmd(),icon:!1},{name:"Enter",icon:!1}]}]},{name:"データ放送",icon:"",icon_height:"",shortcuts:[{name:'リモコンの ボタンを押す',keys:[{name:si.AltOrOption(),icon:!1},{name:"D",icon:!1}]},{name:"リモコンの戻るボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"Backspace",icon:!1}]},{name:"リモコンの決定ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"Enter",icon:!1}]},{name:"リモコンの ⬆ ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"fluent:arrow-up-12-filled",icon:!0}]},{name:"リモコンの ⬅️ ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"fluent:arrow-left-12-filled",icon:!0}]},{name:"リモコンの ➡ ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"fluent:arrow-right-12-filled",icon:!0}]},{name:"リモコンの ⬇ ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"fluent:arrow-down-12-filled",icon:!0}]},{name:"リモコンの 🟦 ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"F9",icon:!1}]},{name:"リモコンの 🟥 ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"F10",icon:!1}]},{name:"リモコンの 🟩 ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"F11",icon:!1}]},{name:"リモコンの 🟨 ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"F12",icon:!1}]}]}]},G2={left_column:[{name:"全般",icon:"fluent:home-20-filled",icon_height:"22px",shortcuts:[{name:"キーボードショートカットの一覧を表示する",keys:[{name:"/(?)",icon:!1}]}]},{name:"プレイヤー",icon:"fluent:play-20-filled",icon_height:"20px",shortcuts:[{name:"再生 / 一時停止の切り替え",keys:[{name:"Space",icon:!1}]},{name:"再生 / 一時停止の切り替え (キャプチャタブ表示時)",keys:[{name:"Shift",icon:!1},{name:"Space",icon:!1}]},{name:"5秒早戻し",keys:[{name:"fluent:arrow-left-12-filled",icon:!0}]},{name:"5秒早送り",keys:[{name:"fluent:arrow-right-12-filled",icon:!0}]},{name:"15秒早戻し",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-left-12-filled",icon:!0}]},{name:"15秒早送り",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-right-12-filled",icon:!0}]},{name:"30秒早戻し",keys:[{name:"Shift",icon:!1},{name:"fluent:arrow-left-12-filled",icon:!0}]},{name:"30秒早送り",keys:[{name:"Shift",icon:!1},{name:"fluent:arrow-right-12-filled",icon:!0}]},{name:"60秒早戻し",keys:[{name:si.AltOrOption(),icon:!1},{name:"fluent:arrow-left-12-filled",icon:!0}]},{name:"60秒早送り",keys:[{name:si.AltOrOption(),icon:!1},{name:"fluent:arrow-right-12-filled",icon:!0}]},{name:"プレイヤーの音量を上げる",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-up-12-filled",icon:!0}]},{name:"プレイヤーの音量を下げる",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-down-12-filled",icon:!0}]},{name:"プレイヤーの音量をミュートする",keys:[{name:"Q",icon:!1}]},{name:"プレイヤーを再起動する",keys:[{name:"R",icon:!1}]},{name:"フルスクリーンの切り替え",keys:[{name:"F",icon:!1}]},{name:"Picture-in-Picture の表示切り替え",keys:[{name:"E",icon:!1}]},{name:"字幕の表示切り替え",keys:[{name:"S",icon:!1}]},{name:"コメントの表示切り替え",keys:[{name:"D",icon:!1}]},{name:"映像をキャプチャする",keys:[{name:"C",icon:!1}]},{name:"映像をコメントを付けてキャプチャする",keys:[{name:"V",icon:!1}]}]}],right_column:[{name:"パネル",icon:"fluent:panel-right-20-filled",icon_height:"24px",shortcuts:[{name:"パネルの表示切り替え",keys:[{name:"P",icon:!1}]},{name:"番組情報タブを表示する",keys:[{name:"K",icon:!1}]},{name:"シリーズタブを表示する",keys:[{name:"L",icon:!1}]},{name:"コメントタブを表示する",keys:[{name:";(+)",icon:!1}]},{name:"Twitter タブを表示する",keys:[{name:":(*)",icon:!1}]}]},{name:"Twitter",icon:"fa-brands:twitter",icon_height:"22px",shortcuts:[{name:"ツイート検索タブを表示する",keys:[{name:"[ (「)",icon:!1}]},{name:"タイムラインタブを表示する",keys:[{name:"] (」)",icon:!1}]},{name:"キャプチャタブを表示する",keys:[{name:"\(¥)",icon:!1}]},{name:"ツイート入力フォームにフォーカスを当てる/フォーカスを外す",keys:[{name:"Tab",icon:!1}]},{name:"キャプチャにフォーカスする",keys:[{name:"キャプチャタブを表示",icon:!1},{name:"fluent:arrow-up-12-filled;fluent:arrow-down-12-filled;fluent:arrow-left-12-filled;fluent:arrow-right-12-filled",icon:!0}]},{name:"キャプチャを拡大表示する/
キャプチャの拡大表示を閉じる",keys:[{name:"キャプチャにフォーカス",icon:!1},{name:"Enter",icon:!1}]},{name:"キャプチャを選択する/
キャプチャの選択を解除する",keys:[{name:"キャプチャにフォーカス",icon:!1},{name:"Space",icon:!1}]},{name:"クリップボード内の画像を
キャプチャとして取り込む",keys:[{name:"ツイート入力
フォームにフォーカス",icon:!1},{name:si.CtrlOrCmd(),icon:!1},{name:"V",icon:!1}]},{name:"ツイートを送信する",keys:[{name:"Twitter タブを表示",icon:!1},{name:si.CtrlOrCmd(),icon:!1},{name:"Enter",icon:!1}]}]}]},j2=er({name:"KeyboardShortcutList",props:{playback_mode:{type:String,required:!0}},data(){return{Utils:Object.freeze(si),live_shortcut_list:structuredClone(U2),video_shortcut_list:structuredClone(G2)}},computed:{...yr(cn,Sn),shortcut_list(){return this.playback_mode==="Live"?this.live_shortcut_list:this.video_shortcut_list}},created(){this.settingsStore.settings.tv_channel_selection_requires_alt_key===!0&&(this.live_shortcut_list.left_column[0].shortcuts[0].keys.unshift({name:si.AltOrOption(),icon:!1}),this.live_shortcut_list.left_column[0].shortcuts[1].keys.unshift({name:si.AltOrOption(),icon:!1}))}}),qf=_=>(Ir("data-v-1077a2f6"),_=_(),Lr(),_),V2=qf(()=>Dt("span",{class:"ml-3"},"キーボードショートカット",-1)),H2={class:"px-5 pb-6"},z2={class:"text-subtitle-1 d-flex align-center font-weight-bold"},W2={key:1,width:"24px",height:"24px",viewBox:"0 0 512 512"},K2=qf(()=>Dt("path",{fill:"currentColor",d:"M248.039 381.326L355.039 67.8258C367.539 28.3257 395.039 34.3258 406.539 34.3258C431.039 34.3258 453.376 61.3258 441.039 96.8258C362.639 322.426 343.539 375.326 340.539 384.826C338.486 391.326 342.039 391.326 345.539 391.326C377.039 391.326 386.539 418.326 386.539 435.326C386.539 458.826 371.539 477.326 350.039 477.326H214.539C179.039 477.326 85.8269 431.3 88.0387 335.826C91.0387 206.326 192.039 183.326 243.539 183.326H296.539L265.539 272.326H243.539C185.539 272.326 174.113 314.826 176.039 334.326C180.039 374.826 215.039 389.814 237.039 390.326C244.539 390.5 246.039 386.826 248.039 381.326Z"},null,-1)),q2=[K2],Y2={class:"ml-2"},J2={class:"text-subtitle-2 mt-2 d-flex align-center font-weight-medium"},Q2=["innerHTML"],Z2={class:"ml-auto d-flex align-center flex-shrink-0"},X2={class:"shortcut-key"},$2=["innerHTML"],em={key:0,class:"shortcut-key-plus"};function tm(_,e,s,u,y,A){const l=an("Icon");return Zt(),Tn(Bf,{"max-width":"1050",transition:"slide-y-transition",modelValue:_.playerStore.shortcut_key_modal,"onUpdate:modelValue":e[1]||(e[1]=c=>_.playerStore.shortcut_key_modal=c)},{default:hn(()=>[Ai(c2,null,{default:hn(()=>[Ai(l2,{class:"px-5 pt-6 pb-3 d-flex align-center font-weight-bold"},{default:hn(()=>[Ai(l,{icon:"fluent:keyboard-20-filled",height:"28px"}),V2,Ai(zo),Si((Zt(),ai("div",{class:"d-flex align-center rounded-circle cursor-pointer px-2 py-2",onClick:e[0]||(e[0]=c=>_.playerStore.shortcut_key_modal=!1)},[Ai(l,{icon:"fluent:dismiss-12-filled",width:"23px",height:"23px"})])),[[Ri]])]),_:1}),Dt("div",H2,[Ai(C2,null,{default:hn(()=>[(Zt(!0),ai($n,null,Xn(_.shortcut_list,(c,p)=>(Zt(),Tn(v2,{cols:"6",key:p},{default:hn(()=>[(Zt(!0),ai($n,null,Xn(c,r=>(Zt(),ai("div",{class:"mt-3",key:r.name},[Dt("div",z2,[r.name!=="データ放送"?(Zt(),Tn(l,{key:0,icon:r.icon,height:r.icon_height},null,8,["icon","height"])):(Zt(),ai("svg",W2,q2)),Dt("span",Y2,en(r.name),1)]),(Zt(!0),ai($n,null,Xn(r.shortcuts,i=>(Zt(),ai("div",{class:"mt-3",key:i.name},[Dt("div",J2,[Dt("span",{class:"mr-2",innerHTML:i.name},null,8,Q2),Dt("div",Z2,[(Zt(!0),ai($n,null,Xn(i.keys,(t,n)=>(Zt(),ai("div",{class:"ml-auto d-flex align-center",key:t.name},[Dt("span",X2,[(Zt(!0),ai($n,null,Xn(t.name.split(";"),a=>Si((Zt(),Tn(l,{icon:a,height:"18px",key:a},null,8,["icon"])),[[rd,t.icon===!0]])),128)),t.icon===!1?(Zt(),ai("span",{key:0,innerHTML:t.name},null,8,$2)):_n("",!0)]),n(Ir("data-v-d342fbd9"),_=_(),Lr(),_),am=sm(()=>Dt("img",{class:"watch-navigation__icon-image",src:rm,width:"23px"},null,-1));function om(_,e,s,u,y,A){const l=an("router-link"),c=an("Icon"),p=Mf("tooltip");return Zt(),ai("nav",{class:"watch-navigation",onMousemove:e[0]||(e[0]=r=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:r})),onTouchmove:e[1]||(e[1]=r=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:r})),onClick:e[2]||(e[2]=r=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:r}))},[Si((Zt(),Tn(l,{class:"watch-navigation__icon",to:"/tv/"},{default:hn(()=>[am]),_:1})),[[Ri]]),Si((Zt(),Tn(l,{class:Yi(["watch-navigation__link",{"watch-navigation__link--active":_.$route.path.startsWith("/tv")}]),"active-class":"watch-navigation__link--active",to:"/tv/"},{default:hn(()=>[Ai(c,{class:"watch-navigation__link-icon",icon:"fluent:tv-20-regular",width:"26px"})]),_:1},8,["class"])),[[Ri],[p,"テレビをみる",void 0,{right:!0}]]),Si((Zt(),Tn(l,{class:Yi(["watch-navigation__link",{"watch-navigation__link--active":_.$route.path.startsWith("/videos")}]),"active-class":"watch-navigation__link--active",to:"/videos/"},{default:hn(()=>[Ai(c,{class:"watch-navigation__link-icon",icon:"fluent:movies-and-tv-20-regular",width:"26px"})]),_:1},8,["class"])),[[Ri],[p,"ビデオをみる",void 0,{right:!0}]]),Si((Zt(),Tn(l,{class:Yi(["watch-navigation__link",{"watch-navigation__link--active":_.$route.path.startsWith("/timetable")}]),"active-class":"watch-navigation__link--active",to:"/timetable/"},{default:hn(()=>[Ai(c,{class:"watch-navigation__link-icon",icon:"fluent:calendar-ltr-20-regular",width:"26px"})]),_:1},8,["class"])),[[Ri],[p,"番組表",void 0,{right:!0}]]),Si((Zt(),Tn(l,{class:Yi(["watch-navigation__link",{"watch-navigation__link--active":_.$route.path.startsWith("/reserves")}]),"active-class":"watch-navigation__link--active",to:"/reserves/"},{default:hn(()=>[Ai(c,{class:"watch-navigation__link-icon",icon:"fluent:timer-16-regular",width:"26px",style:{padding:"0.5px"}})]),_:1},8,["class"])),[[Ri],[p,"録画予約",void 0,{right:!0}]]),Si((Zt(),Tn(l,{class:Yi(["watch-navigation__link",{"watch-navigation__link--active":_.$route.path.startsWith("/mylist")}]),"active-class":"watch-navigation__link--active",to:"/mylist/"},{default:hn(()=>[Ai(c,{class:"watch-navigation__link-icon",icon:"ic:round-playlist-play",width:"26px"})]),_:1},8,["class"])),[[Ri],[p,"マイリスト",void 0,{right:!0}]]),Si((Zt(),Tn(l,{class:Yi(["watch-navigation__link",{"watch-navigation__link--active":_.$route.path.startsWith("/captures")}]),"active-class":"watch-navigation__link--active",to:"/captures/"},{default:hn(()=>[Ai(c,{class:"watch-navigation__link-icon",icon:"fluent:image-multiple-24-regular",width:"26px"})]),_:1},8,["class"])),[[Ri],[p,"キャプチャ",void 0,{right:!0}]]),Ai(zo),Si((Zt(),Tn(l,{class:Yi(["watch-navigation__link",{"watch-navigation__link--active":_.$route.path.startsWith("/settings")}]),"active-class":"watch-navigation__link--active",to:"/settings/"},{default:hn(()=>[Ai(c,{class:"watch-navigation__link-icon",icon:"fluent:settings-20-regular",width:"26px"})]),_:1},8,["class"])),[[Ri],[p,"設定",void 0,{right:!0}]])],32)}const lm=Wn(nm,[["render",om],["__scopeId","data-v-d342fbd9"]]),cm=er({name:"Panel-ChannelTab",components:{Swiper:d2,SwiperSlide:u2},data(){return{Utils:Object.freeze(si),ChannelUtils:Object.freeze(wo),ProgramUtils:Object.freeze(Vo),active_tab_index:0,swiper_instance:null}},computed:{...yr(Ln,cn)},watch:{active_tab_index(){var _,e;(_=this.swiper_instance)==null||_.updateAutoHeight(),(e=this.swiper_instance)==null||e.slideTo(this.active_tab_index)},async"playerStore.tv_panel_active_tab"(){var _;await si.sleep(.05),(_=this.swiper_instance)==null||_.updateAutoHeight()},async"playerStore.video_panel_active_tab"(){var _;await si.sleep(.05),(_=this.swiper_instance)==null||_.updateAutoHeight()}},async mounted(){var _,e,s;if(await si.sleep(.05),(_=this.swiper_instance)==null||_.updateAutoHeight(),(e=document.querySelector(".channels-list-container"))==null||e.addEventListener("scroll",()=>{var u;(u=this.swiper_instance)==null||u.updateAutoHeight()},{passive:!0}),this.playerStore.tv_panel_active_tab==="Channel")for(let u=0;u<20;u++)await si.sleep(.1),(s=this.swiper_instance)==null||s.updateAutoHeight()}}),Wo=_=>(Ir("data-v-4c8d1701"),_=_(),Lr(),_),dm={class:"channels-container channels-container--watch"},um={class:"channels-tab"},hm=Wo(()=>Dt("div",{class:"channels-tab__highlight"},null,-1)),fm={class:"channels-list-container"},pm={class:"channels"},mm={class:"channel__broadcaster"},gm=["src"],Am={class:"channel__broadcaster-content"},ym={class:"channel__broadcaster-name"},vm=Wo(()=>Dt("svg",{class:"iconify iconify--fa-solid",width:"9.63px",height:"11px",viewBox:"0 0 448 512"},[Dt("path",{fill:"currentColor",d:"M323.56 51.2c-20.8 19.3-39.58 39.59-56.22 59.97C240.08 73.62 206.28 35.53 168 0C69.74 91.17 0 209.96 0 281.6C0 408.85 100.29 512 224 512s224-103.15 224-230.4c0-53.27-51.98-163.14-124.44-230.4zm-19.47 340.65C282.43 407.01 255.72 416 226.86 416C154.71 416 96 368.26 96 290.75c0-38.61 24.31-72.63 72.79-130.75c6.93 7.98 98.83 125.34 98.83 125.34l58.63-66.88c4.14 6.85 7.91 13.55 11.27 19.97c27.35 52.19 15.81 118.97-33.43 153.42z"})],-1)),bm={class:"ml-1"},_m={class:"channel__program-present"},Em=["innerHTML"],wm={class:"channel__program-present-time"},Sm={class:"channel__program-following"},Tm={class:"channel__program-following-title"},Cm=Wo(()=>Dt("span",{class:"channel__program-following-title-decorate"},"NEXT",-1)),xm=Wo(()=>Dt("svg",{class:"channel__program-following-title-icon iconify iconify--fluent",width:"16px",height:"16px",viewBox:"0 0 20 20"},[Dt("path",{fill:"currentColor",d:"M10.018 5.486a1 1 0 0 1 1.592-.806l5.88 4.311a1.25 1.25 0 0 1 0 2.017l-5.88 4.311a1 1 0 0 1-1.592-.806v-3.16L4.61 15.319a1 1 0 0 1-1.592-.806V5.486A1 1 0 0 1 4.61 4.68l5.408 3.966v-3.16Z"})],-1)),km=["innerHTML"],Rm={class:"channel__program-following-time"},Im={class:"channel__progressbar"};function Lm(_,e,s,u,y,A){const l=an("router-link"),c=an("SwiperSlide"),p=an("Swiper");return Zt(),ai("div",dm,[Dt("div",um,[Dt("div",{class:"channels-tab__buttons",style:Eo({"--tab-length":Array.from(_.channelsStore.channels_list_with_pinned_for_watch).length,"--active-tab-index":_.active_tab_index})},[(Zt(!0),ai($n,null,Xn(Array.from(_.channelsStore.channels_list_with_pinned_for_watch),([r],i)=>(Zt(),Tn(n2,{variant:"flat",class:"channels-tab__button",key:r,onClick:t=>_.active_tab_index=i},{default:hn(()=>[Bn(en(r),1)]),_:2},1032,["onClick"]))),128)),hm],4)]),Dt("div",fm,[Ai(p,{class:"channels-list","space-between":32,"auto-height":!0,"touch-start-prevent-default":!1,observer:!0,"observe-parents":!0,onSwiper:e[0]||(e[0]=r=>_.swiper_instance=r),onSlideChange:e[1]||(e[1]=r=>_.active_tab_index=r.activeIndex)},{default:hn(()=>[(Zt(!0),ai($n,null,Xn(Array.from(_.channelsStore.channels_list_with_pinned_for_watch),([r,i])=>(Zt(),Tn(c,{key:r},{default:hn(()=>[Dt("div",pm,[(Zt(!0),ai($n,null,Xn(i,t=>Si((Zt(),Tn(l,{class:"channel",draggable:"false",key:t.id,to:`/tv/watch/${t.display_channel_id}`},{default:hn(()=>[Dt("div",mm,[Dt("img",{class:"channel__broadcaster-icon",src:`${_.Utils.api_base_url}/channels/${t.id}/logo`},null,8,gm),Dt("div",Am,[Dt("span",ym,"Ch: "+en(t.channel_number)+" "+en(t.name),1),Dt("div",{class:Yi(["channel__broadcaster-force",`channel__broadcaster-force--${_.ChannelUtils.getChannelForceType(t.jikkyo_force)}`])},[vm,Dt("span",bm,en(t.jikkyo_force??"--"),1)],2)])]),Dt("div",_m,[Dt("span",{class:"channel__program-present-title",innerHTML:_.ProgramUtils.decorateProgramInfo(t.program_present,"title")},null,8,Em),Dt("span",wm,en(_.ProgramUtils.getProgramTime(t.program_present)),1)]),Dt("div",Sm,[Dt("div",Tm,[Cm,xm,Dt("span",{class:"channel__program-following-title-text",innerHTML:_.ProgramUtils.decorateProgramInfo(t.program_following,"title")},null,8,km)]),Dt("span",Rm,en(_.ProgramUtils.getProgramTime(t.program_following)),1)]),Dt("div",Im,[Dt("div",{class:"channel__progressbar-progress",style:Eo(`width:${_.ProgramUtils.getProgramProgress(t.program_present)}%;`)},null,4)])]),_:2},1032,["to"])),[[Ri]])),128))])]),_:2},1024))),128))]),_:1})])])}const Dm=Wn(cm,[["render",Lm],["__scopeId","data-v-4c8d1701"]]),Om=er({name:"Panel-CommentTab",components:{CommentMuteSettings:h2},props:{playback_mode:{type:String,required:!0}},data(){return{Utils:Object.freeze(si),is_manual_scroll:!1,is_auto_scrolling:!1,comment_list:[],comment_list_element:null,is_comment_list_dropdown_display:!1,comment_list_dropdown_top:0,comment_list_dropdown_comment:null,comment_mute_settings_modal:!1,visibilitychange_listener:null}},computed:{...yr(Ln,cn)},watch:{"channelsStore.channel.current.id":{handler(){this.playback_mode==="Live"&&(this.comment_list=[])}}},mounted(){this.comment_list_element===null&&(this.comment_list_element=document.querySelector(".comment-list"));let _=!1;this.comment_list_element.onmousedown=A=>{if(this.comment_list_element===null)return;A.clientX-this.comment_list_element.getBoundingClientRect().left>this.comment_list_element.clientWidth&&(_=!0)},this.comment_list_element.onmouseup=A=>{if(this.comment_list_element===null)return;A.clientX-this.comment_list_element.getBoundingClientRect().left>this.comment_list_element.clientWidth&&(_=!1)};const e=()=>{_=!0,window.setTimeout(()=>_=!1,100)};let s=!1;this.comment_list_element.ontouchstart=()=>s=!0,this.comment_list_element.ontouchend=()=>s=!1,this.comment_list_element.ontouchmove=()=>s===!0?e():"",this.comment_list_element.onwheel=e,this.comment_list_element.onscroll=async()=>{this.comment_list_element!==null&&this.is_auto_scrolling===!1&&_===!0&&(this.is_manual_scroll=!0,await si.sleep(.1),this.comment_list_element.scrollTop+this.comment_list_element.offsetHeight>this.comment_list_element.scrollHeight-10&&(this.is_manual_scroll=!1))};const u=[],y=500;this.playerStore.event_emitter.on("CommentReceived",async A=>{if(A.is_initial_comments===!0)this.comment_list=[],this.comment_list.push(...A.comments),this.playback_mode==="Live"&&this.scrollCommentList();else{if(document.visibilityState==="hidden"){u.push(...A.comments);return}this.comment_list.length>=y&&this.is_manual_scroll===!1&&this.comment_list.splice(0,Math.max(0,this.comment_list.length-y)),this.comment_list.push(...A.comments),this.scrollCommentList()}}),this.playerStore.event_emitter.on("CommentSendCompleted",async A=>{this.comment_list.push(A.comment),this.scrollCommentList()}),this.visibilitychange_listener=()=>{if(document.visibilityState==="visible"){const A=this.comment_list.length+u.length;A>=y&&this.is_manual_scroll===!1&&this.comment_list.splice(0,Math.max(0,A-y)),this.comment_list.push(...u),u.length=0,this.scrollCommentList()}},document.addEventListener("visibilitychange",this.visibilitychange_listener)},beforeUnmount(){this.visibilitychange_listener!==null&&(document.removeEventListener("visibilitychange",this.visibilitychange_listener),this.visibilitychange_listener=null),this.playerStore.event_emitter.off("CommentReceived"),this.playerStore.event_emitter.off("CommentSendCompleted"),this.comment_list=[]},methods:{showCommentListDropdown(_,e){const s=this.$refs.comment_list_wrapper.getBoundingClientRect(),u=106,y=_.currentTarget.getBoundingClientRect();this.comment_list_dropdown_top=y.top-s.top,this.comment_list_dropdown_top+u>s.height&&(this.comment_list_dropdown_top=this.comment_list_dropdown_top-u+y.height),this.comment_list_dropdown_comment=e,this.is_comment_list_dropdown_display=!0},hideCommentListDropdown(){this.is_comment_list_dropdown_display=!1,this.comment_list=this.comment_list.filter(_=>ea.isMutedComment(_.text,_.user_id)===!1)},copyTextToClipboard(){this.comment_list_dropdown_comment!==null&&(navigator.clipboard.writeText(this.comment_list_dropdown_comment.text),this.hideCommentListDropdown())},addMutedKeywords(){this.comment_list_dropdown_comment!==null&&(ea.addMutedKeywords(this.comment_list_dropdown_comment.text),this.hideCommentListDropdown())},addMutedNiconicoUserIds(){this.comment_list_dropdown_comment!==null&&(ea.addMutedNiconicoUserIDs(this.comment_list_dropdown_comment.user_id),this.hideCommentListDropdown())},async scrollCommentList(_=!1){this.comment_list_element!==null&&(this.is_comment_list_dropdown_display===!0&&(this.is_manual_scroll=!0),this.is_manual_scroll!==!0&&(this.is_auto_scrolling=!0,window.requestAnimationFrame(()=>{var e,s;_===!0?(e=this.comment_list_element)==null||e.scrollTo({top:this.comment_list_element.scrollHeight,left:0,behavior:"smooth"}):(s=this.comment_list_element)==null||s.scrollTo(0,this.comment_list_element.scrollHeight)}),await si.sleep(.1),this.is_auto_scrolling=!1))}}}),vr=_=>(Ir("data-v-83eafc10"),_=_(),Lr(),_),Mm={class:"comment-container"},Pm={class:"comment-header"},Bm={class:"comment-header__title"},Nm=vr(()=>Dt("span",{class:"comment-header__title-text"},"コメント",-1)),Fm=vr(()=>Dt("span",{class:"ml-1"},"ミュート設定",-1)),Um={class:"comment-list-wrapper",ref:"comment_list_wrapper"},Gm=vr(()=>Dt("span",{class:"ml-2"},"クリップボードにコピー",-1)),jm=vr(()=>Dt("span",{class:"ml-2"},"このコメントをミュート",-1)),Vm=vr(()=>Dt("span",{class:"ml-2"},"このコメントの投稿者をミュート",-1)),Hm={class:"comment__text"},zm={class:"comment__time"},Wm=["onMouseup","onTouchend"],Km=vr(()=>Dt("svg",{class:"iconify iconify--fluent",width:"20px",height:"20px",viewBox:"0 0 20 20"},[Dt("path",{fill:"currentColor",d:"M10 6.5A1.75 1.75 0 1 1 10 3a1.75 1.75 0 0 1 0 3.5ZM10 17a1.75 1.75 0 1 1 0-3.5a1.75 1.75 0 0 1 0 3.5Zm-1.75-7a1.75 1.75 0 1 0 3.5 0a1.75 1.75 0 0 0-3.5 0Z"})],-1)),qm=[Km],Ym={key:0,class:"comment-announce"},Jm=vr(()=>Dt("div",{class:"comment-announce__heading"},"まだコメントがありません。",-1)),Qm=vr(()=>Dt("div",{class:"comment-announce__text"},[Dt("p",{class:"mt-0 mb-0"},"このチャンネルに対応するニコニコ実況のコメントが、リアルタイムで表示されます。")],-1)),Zm=[Jm,Qm],Xm={key:1,class:"comment-announce"},$m=vr(()=>Dt("div",{class:"comment-announce__heading"},"コメントがありません。",-1)),eg={class:"comment-announce__text"},tg={class:"mt-0 mb-0"},ig={key:2,class:"comment-announce"},ng=vr(()=>Dt("div",{class:"comment-announce__heading"},"まだコメントがありません。",-1)),rg=vr(()=>Dt("div",{class:"comment-announce__text"},[Dt("p",{class:"mt-0 mb-0"},"この録画番組に対応する、ニコニコ実況の過去ログコメントを取得しています...")],-1)),sg=[ng,rg],ag={key:3,class:"comment-announce"},og=vr(()=>Dt("div",{class:"comment-announce__heading"},"コメントがありません。",-1)),lg={class:"comment-announce__text"},cg={class:"mt-0 mb-0"};function dg(_,e,s,u,y,A){const l=an("Icon"),c=an("DynamicScrollerItem"),p=an("DynamicScroller"),r=an("CommentMuteSettings");return Zt(),ai("div",Mm,[Dt("section",Pm,[Dt("h2",Bm,[Ai(l,{class:"comment-header__title-icon",icon:"bi:chat-left-text-fill",height:"18.5px"}),Nm]),Si((Zt(),ai("button",{class:"comment-header__button ml-auto",onClick:e[0]||(e[0]=i=>_.comment_mute_settings_modal=!_.comment_mute_settings_modal)},[Ai(l,{icon:"heroicons-solid:filter",height:"11px"}),Fm])),[[Ri]])]),Dt("section",Um,[Dt("div",{class:Yi(["comment-list-dropdown",{"comment-list-dropdown--display":_.is_comment_list_dropdown_display}]),style:Eo({"--comment-list-dropdown-top":`${_.comment_list_dropdown_top}px`})},[Ai(f2,{style:{background:"rgb(var(--v-theme-background-lighten-1))"}},{default:hn(()=>[Ai(Bl,{density:"compact",style:{"min-height":"30px"},onClick:e[1]||(e[1]=i=>_.copyTextToClipboard())},{default:hn(()=>[Ai(Nl,{class:"d-flex align-center"},{default:hn(()=>[Ai(l,{icon:"fluent:clipboard-paste-20-filled",width:"20px"}),Gm]),_:1})]),_:1}),Ai(Bl,{density:"compact",style:{"min-height":"30px"},onClick:e[2]||(e[2]=i=>_.addMutedKeywords())},{default:hn(()=>[Ai(Nl,{class:"d-flex align-center"},{default:hn(()=>[Ai(l,{icon:"fluent:comment-dismiss-20-filled",width:"20px"}),jm]),_:1})]),_:1}),Ai(Bl,{density:"compact",style:{"min-height":"30px"},onClick:e[3]||(e[3]=i=>_.addMutedNiconicoUserIds())},{default:hn(()=>[Ai(Nl,{class:"d-flex align-center"},{default:hn(()=>[Ai(l,{icon:"fluent:person-prohibited-20-filled",width:"20px"}),Vm]),_:1})]),_:1})]),_:1})],6),Dt("div",{class:Yi(["comment-list-cover",{"comment-list-cover--display":_.is_comment_list_dropdown_display}]),onClick:e[4]||(e[4]=i=>_.hideCommentListDropdown())},null,2),Ai(p,{class:"comment-list",direction:"vertical",items:_.comment_list,"min-item-size":34},{default:hn(({item:i,active:t})=>[Ai(c,{item:i,active:t,"size-dependencies":[i.text]},{default:hn(()=>[Dt("div",{class:Yi(["comment",{"comment--my-post":i.my_post}])},[Dt("span",Hm,en(i.text),1),Dt("span",zm,en(i.time),1),Si((Zt(),ai("div",{class:"comment__icon",onMouseup:n=>_.showCommentListDropdown(n,i),onTouchend:n=>_.showCommentListDropdown(n,i)},qm,40,Wm)),[[Ri,!_.Utils.isTouchDevice()]])],2)]),_:2},1032,["item","active","size-dependencies"])]),_:1},8,["items"]),_.playback_mode==="Live"&&_.playerStore.live_comment_init_failed_message===null&&_.comment_list.length===0?(Zt(),ai("div",Ym,Zm)):_n("",!0),_.playback_mode==="Live"&&_.playerStore.live_comment_init_failed_message!==null&&_.comment_list.length===0?(Zt(),ai("div",Xm,[$m,Dt("div",eg,[Dt("p",tg,en(_.playerStore.live_comment_init_failed_message),1)])])):_n("",!0),_.playback_mode==="Video"&&_.playerStore.video_comment_init_failed_message===null&&_.comment_list.length===0?(Zt(),ai("div",ig,sg)):_n("",!0),_.playback_mode==="Video"&&_.playerStore.video_comment_init_failed_message!==null&&_.comment_list.length===0?(Zt(),ai("div",ag,[og,Dt("div",lg,[Dt("p",cg,en(_.playerStore.video_comment_init_failed_message),1)])])):_n("",!0)],512),Si((Zt(),ai("div",{class:Yi(["comment-scroll-button elevation-5",{"comment-scroll-button--display":_.is_manual_scroll}]),onClick:e[5]||(e[5]=i=>{_.is_manual_scroll=!1,_.scrollCommentList(!0)})},[Ai(l,{icon:"fluent:arrow-down-12-filled",height:"29px"})],2)),[[Ri]]),Ai(r,{modelValue:_.comment_mute_settings_modal,"onUpdate:modelValue":e[6]||(e[6]=i=>_.comment_mute_settings_modal=i)},null,8,["modelValue"])])}const ug=Wn(Om,[["render",dg],["__scopeId","data-v-83eafc10"]]),hg=er({name:"Panel-ProgramTab",data(){return{Utils:Object.freeze(si),ChannelUtils:Object.freeze(wo),ProgramUtils:Object.freeze(Vo)}},computed:{...yr(Ln)}}),ld=_=>(Ir("data-v-bbeca1ae"),_=_(),Lr(),_),fg={class:"program-container"},pg={class:"program-broadcaster"},mg=["src"],gg={class:"program-broadcaster__number"},Ag={class:"program-broadcaster__name"},yg={class:"program-info"},vg=["innerHTML"],bg={class:"program-info__time"},_g=["innerHTML"],Eg={class:"program-info__genre-container"},wg={class:"program-info__next"},Sg=ld(()=>Dt("span",{class:"program-info__next-decorate"},"NEXT",-1)),Tg=["innerHTML"],Cg={class:"program-info__next-time"},xg={class:"program-info__status"},kg=ld(()=>Dt("span",{class:"ml-2"},"勢い:",-1)),Rg={class:"ml-2"},Ig={class:"program-info__status-viewers ml-5"},Lg=ld(()=>Dt("span",{class:"ml-2"},"視聴数:",-1)),Dg={class:"ml-1"},Og={class:"program-detail-container"},Mg={class:"program-detail__heading"},Pg=["innerHTML"];function Bg(_,e,s,u,y,A){var c,p;const l=an("Icon");return Zt(),ai("div",fg,[Dt("section",pg,[Dt("img",{class:"program-broadcaster__icon",src:`${_.Utils.api_base_url}/channels/${_.channelsStore.channel.current.id}/logo`},null,8,mg),Dt("div",gg,"Ch: "+en(_.channelsStore.channel.current.channel_number),1),Dt("div",Ag,en(_.channelsStore.channel.current.name),1)]),Dt("section",yg,[Dt("h1",{class:"program-info__title",innerHTML:_.ProgramUtils.decorateProgramInfo(_.channelsStore.channel.current.program_present,"title")},null,8,vg),Dt("div",bg,en(_.ProgramUtils.getProgramTime(_.channelsStore.channel.current.program_present)),1),Dt("div",{class:"program-info__description",innerHTML:_.ProgramUtils.decorateProgramInfo(_.channelsStore.channel.current.program_present,"description")},null,8,_g),Dt("div",Eg,[(Zt(!0),ai($n,null,Xn(((c=_.channelsStore.channel.current.program_present)==null?void 0:c.genres)??[],(r,i)=>(Zt(),ai("div",{class:"program-info__genre",key:i},en(r.major)+" / "+en(r.middle),1))),128))]),Dt("div",wg,[Sg,Ai(l,{class:"program-info__next-icon",icon:"fluent:fast-forward-20-filled",width:"16px"})]),Dt("span",{class:"program-info__next-title",innerHTML:_.ProgramUtils.decorateProgramInfo(_.channelsStore.channel.current.program_following,"title")},null,8,Tg),Dt("div",Cg,en(_.ProgramUtils.getProgramTime(_.channelsStore.channel.current.program_following)),1),Dt("div",xg,[Dt("div",{class:Yi(["program-info__status-force",`program-info__status-force--${_.ChannelUtils.getChannelForceType(_.channelsStore.channel.current.jikkyo_force)}`])},[Ai(l,{icon:"fa-solid:fire-alt",height:"14px"}),kg,Dt("span",Rg,en(_.channelsStore.channel.current.jikkyo_force??"--")+" コメ/分",1)],2),Dt("div",Ig,[Ai(l,{icon:"fa-solid:eye",height:"14px"}),Lg,Dt("span",Dg,en(_.channelsStore.channel.current.viewer_count),1)])])]),Dt("section",Og,[(Zt(!0),ai($n,null,Xn(((p=_.channelsStore.channel.current.program_present)==null?void 0:p.detail)??{},(r,i)=>(Zt(),ai("div",{class:"program-detail",key:i},[Dt("h2",Mg,en(i),1),Dt("div",{class:"program-detail__text",innerHTML:_.Utils.URLtoLink(r)},null,8,Pg)]))),128))])])}const Ng=Wn(hg,[["render",Bg],["__scopeId","data-v-bbeca1ae"]]),Fg=er({name:"Panel-RecordedProgramTab",data(){return{Utils:Object.freeze(si),ProgramUtils:Object.freeze(Vo),comment_count:null}},computed:{...yr(cn)},created(){this.playerStore.event_emitter.on("CommentReceived",_=>{_.is_initial_comments===!0&&(this.comment_count=_.comments.length)})},beforeUnmount(){this.playerStore.event_emitter.off("CommentReceived")}}),Yf=_=>(Ir("data-v-ec2b0789"),_=_(),Lr(),_),Ug={class:"program-container"},Gg={class:"program-info"},jg=["innerHTML"],Vg={key:0,class:"program-info__broadcaster"},Hg=["src"],zg={class:"program-info__broadcaster-container"},Wg={class:"d-flex align-center"},Kg={class:"program-info__broadcaster-number"},qg={class:"program-info__broadcaster-name"},Yg={class:"program-info__broadcaster-time"},Jg=["innerHTML"],Qg={class:"program-info__genre-container"},Zg={class:"mt-5"},Xg={class:"program-info__status"},$g={class:"ml-2"},e3=Yf(()=>Dt("br",null,null,-1)),t3={class:"program-info__status"},i3=Yf(()=>Dt("span",{class:"ml-2"},"コメント数:",-1)),n3={class:"ml-2"},r3={class:"program-detail-container"},s3={class:"program-detail__heading"},a3=["innerHTML"];function o3(_,e,s,u,y,A){const l=an("Icon");return Zt(),ai("div",Ug,[Dt("section",Gg,[Dt("h1",{class:"program-info__title",innerHTML:_.ProgramUtils.decorateProgramInfo(_.playerStore.recorded_program,"title")},null,8,jg),_.playerStore.recorded_program.channel!==null?(Zt(),ai("div",Vg,[Dt("img",{class:"program-info__broadcaster-icon",src:`${_.Utils.api_base_url}/channels/${_.playerStore.recorded_program.channel.id}/logo`},null,8,Hg),Dt("div",zg,[Dt("div",Wg,[Dt("div",Kg,"Ch: "+en(_.playerStore.recorded_program.channel.channel_number),1),Dt("div",qg,en(_.playerStore.recorded_program.channel.name),1)]),Dt("div",Yg,en(_.ProgramUtils.getProgramTime(_.playerStore.recorded_program)),1)])])):_n("",!0),Dt("div",{class:"program-info__description",innerHTML:_.ProgramUtils.decorateProgramInfo(_.playerStore.recorded_program,"description")},null,8,Jg),Dt("div",Qg,[(Zt(!0),ai($n,null,Xn(_.playerStore.recorded_program.genres??[],(c,p)=>(Zt(),ai("div",{class:"program-info__genre",key:p},en(c.major)+" / "+en(c.middle),1))),128))]),Dt("div",Zg,[Dt("div",Xg,[Ai(l,{icon:"ic:round-date-range",height:"17px",style:{"margin-left":"-2px","margin-right":"-1.7px","margin-bottom":"-3px"}}),Dt("span",$g,"録画期間: "+en(_.playerStore.recorded_program.is_partially_recorded?"(一部のみ録画)":""),1),e3,Dt("span",null,en(_.ProgramUtils.getRecordingTime(_.playerStore.recorded_program)),1)]),Dt("div",t3,[Ai(l,{icon:"bi:chat-left-text-fill",height:"12.5px",style:{"margin-bottom":"-3px"}}),i3,Dt("span",n3,en(_.comment_count??"--"),1)])])]),Dt("section",r3,[(Zt(!0),ai($n,null,Xn(_.playerStore.recorded_program.detail??{},(c,p)=>(Zt(),ai("div",{class:"program-detail",key:p},[Dt("h2",s3,en(p),1),Dt("div",{class:"program-detail__text",innerHTML:_.Utils.URLtoLink(c)},null,8,a3)]))),128))])])}const l3=Wn(Fg,[["render",o3],["__scopeId","data-v-ec2b0789"]]),c3=er({name:"Panel-Remocon",props:{modelValue:{type:Boolean,required:!0}},emits:{"update:modelValue":_=>!0}}),cd=_=>(Ir("data-v-f40c5aaa"),_=_(),Lr(),_),d3={class:"remote-control-data-broadcasting remote-control-data-broadcasting--disabled"},u3={class:"remote-control__directional-key"},h3={class:"remote-control-button-up","data-arib-key-code":"1"},f3={class:"remote-control-button-left","data-arib-key-code":"3"},p3={class:"remote-control-button-select","data-arib-key-code":"18"},m3={class:"remote-control-button-right","data-arib-key-code":"4"},g3={class:"remote-control-button-down","data-arib-key-code":"2"},A3={class:"remote-control__control-key"},y3={class:"remote-control-button-data","data-arib-key-code":"20"},v3=cd(()=>Dt("svg",{width:"20px",height:"20px",viewBox:"0 0 512 512"},[Dt("path",{fill:"currentColor",d:"M248.039 381.326L355.039 67.8258C367.539 28.3257 395.039 34.3258 406.539 34.3258C431.039 34.3258 453.376 61.3258 441.039 96.8258C362.639 322.426 343.539 375.326 340.539 384.826C338.486 391.326 342.039 391.326 345.539 391.326C377.039 391.326 386.539 418.326 386.539 435.326C386.539 458.826 371.539 477.326 350.039 477.326H214.539C179.039 477.326 85.8269 431.3 88.0387 335.826C91.0387 206.326 192.039 183.326 243.539 183.326H296.539L265.539 272.326H243.539C185.539 272.326 174.113 314.826 176.039 334.326C180.039 374.826 215.039 389.814 237.039 390.326C244.539 390.5 246.039 386.826 248.039 381.326Z"})],-1)),b3=cd(()=>Dt("span",{class:"ml-1"},"データ",-1)),_3=[v3,b3],E3={class:"remote-control-button-back","data-arib-key-code":"19"},w3=cd(()=>Dt("span",{class:"ml-1"},"戻る",-1)),S3={class:"remote-control-button-blue bg-blue-darken-3","data-arib-key-code":"21"},T3={class:"remote-control-button-red bg-red-darken-3","data-arib-key-code":"22"},C3={class:"remote-control-button-green bg-green-darken-3","data-arib-key-code":"23"},x3={class:"remote-control-button-yellow bg-yellow-darken-3 text-text","data-arib-key-code":"24"},k3={class:"remote-control__number-key"},R3={"data-remocon-id":"1","data-arib-key-code":"6"},I3={"data-remocon-id":"2","data-arib-key-code":"7"},L3={"data-remocon-id":"3","data-arib-key-code":"8"},D3={"data-remocon-id":"4","data-arib-key-code":"9"},O3={"data-remocon-id":"5","data-arib-key-code":"10"},M3={"data-remocon-id":"6","data-arib-key-code":"11"},P3={"data-remocon-id":"7","data-arib-key-code":"12"},B3={"data-remocon-id":"8","data-arib-key-code":"13"},N3={"data-remocon-id":"9","data-arib-key-code":"14"},F3={"data-remocon-id":"10","data-arib-key-code":"15"},U3={"data-remocon-id":"11","data-arib-key-code":"16"},G3={"data-remocon-id":"12","data-arib-key-code":"17"};function j3(_,e,s,u,y,A){const l=an("Icon");return Zt(),ai("div",{class:Yi(["remote-control-container",{"remote-control-container--showing":_.modelValue}]),onClick:e[2]||(e[2]=c=>_.$emit("update:modelValue",!1))},[Dt("div",{class:"remote-control elevation-6",onClick:e[1]||(e[1]=ta(()=>{},["stop"]))},[Si((Zt(),ai("div",{class:"remote-control__close d-flex align-center rounded-circle cursor-pointer px-2 py-2",onClick:e[0]||(e[0]=c=>_.$emit("update:modelValue",!1))},[Ai(l,{icon:"fluent:dismiss-12-filled",width:"23px",height:"23px"})])),[[Ri]]),Dt("div",d3,[Ai(Pf,{indeterminate:"",size:"60",width:"6",class:"remote-control__loading"}),Dt("div",u3,[Si((Zt(),ai("button",h3,[Ai(l,{icon:"fluent:chevron-up-12-filled",width:"26px",height:"26px"})])),[[Ri]]),Si((Zt(),ai("button",f3,[Ai(l,{icon:"fluent:chevron-left-12-filled",width:"26px",height:"26px"})])),[[Ri]]),Si((Zt(),ai("button",p3,[Bn(" 決定 ")])),[[Ri]]),Si((Zt(),ai("button",m3,[Ai(l,{icon:"fluent:chevron-right-12-filled",width:"26px",height:"26px"})])),[[Ri]]),Si((Zt(),ai("button",g3,[Ai(l,{icon:"fluent:chevron-down-12-filled",width:"26px",height:"26px"})])),[[Ri]])]),Dt("div",A3,[Si((Zt(),ai("button",y3,_3)),[[Ri]]),Si((Zt(),ai("button",E3,[Ai(l,{icon:"fluent:arrow-left-12-filled",width:"20px"}),w3])),[[Ri]]),Si((Zt(),ai("button",S3,[Bn("青")])),[[Ri]]),Si((Zt(),ai("button",T3,[Bn("赤")])),[[Ri]]),Si((Zt(),ai("button",C3,[Bn("緑")])),[[Ri]]),Si((Zt(),ai("button",x3,[Bn("黄")])),[[Ri]])])]),Dt("div",k3,[Si((Zt(),ai("button",R3,[Bn("1")])),[[Ri]]),Si((Zt(),ai("button",I3,[Bn("2")])),[[Ri]]),Si((Zt(),ai("button",L3,[Bn("3")])),[[Ri]]),Si((Zt(),ai("button",D3,[Bn("4")])),[[Ri]]),Si((Zt(),ai("button",O3,[Bn("5")])),[[Ri]]),Si((Zt(),ai("button",M3,[Bn("6")])),[[Ri]]),Si((Zt(),ai("button",P3,[Bn("7")])),[[Ri]]),Si((Zt(),ai("button",B3,[Bn("8")])),[[Ri]]),Si((Zt(),ai("button",N3,[Bn("9")])),[[Ri]]),Si((Zt(),ai("button",F3,[Bn("10")])),[[Ri]]),Si((Zt(),ai("button",U3,[Bn("11")])),[[Ri]]),Si((Zt(),ai("button",G3,[Bn("12")])),[[Ri]])])])],2)}const V3=Wn(c3,[["render",j3],["__scopeId","data-v-f40c5aaa"]]),H3=er({name:"Panel-SeriesTab",data(){return{Utils:Object.freeze(si)}},computed:{...yr(cn)}}),z3={class:"series-container"};function W3(_,e,s,u,y,A){return Zt(),ai("div",z3," 鋭意実装中… ")}const K3=Wn(H3,[["render",W3],["__scopeId","data-v-4d1178da"]]),Cs=_=>(Ir("data-v-e5c539a9"),_=_(),Lr(),_),q3={class:"tab-content tab-content--capture"},Y3={class:"zoom-capture-modal"},J3=["src"],Q3=["href","download"],Z3={class:"captures"},X3=["onClick"],$3=["src"],eA=Cs(()=>Dt("div",{class:"capture__disabled-cover"},null,-1)),tA={class:"capture__selected-number"},iA=Cs(()=>Dt("svg",{class:"capture__selected-checkmark iconify iconify--fluent",width:"1em",height:"1em",viewBox:"0 0 16 16"},[Dt("path",{fill:"currentColor",d:"M8 2a6 6 0 1 1 0 12A6 6 0 0 1 8 2Zm2.12 4.164L7.25 9.042L5.854 7.646a.5.5 0 1 0-.708.708l1.75 1.75a.5.5 0 0 0 .708 0l3.224-3.234a.5.5 0 0 0-.708-.706Z"})],-1)),nA=Cs(()=>Dt("div",{class:"capture__selected-border"},null,-1)),rA=Cs(()=>Dt("div",{class:"capture__focused-border"},null,-1)),sA=["onClick"],aA=Cs(()=>Dt("svg",{class:"iconify iconify--fluent",width:"32px",height:"32px",viewBox:"0 0 16 16"},[Dt("path",{fill:"currentColor",d:"M7 4.5a.5.5 0 0 0-1 0V6H4.5a.5.5 0 0 0 0 1H6v1.5a.5.5 0 0 0 1 0V7h1.5a.5.5 0 0 0 0-1H7V4.5ZM6.5 11a4.481 4.481 0 0 0 2.809-.984l3.837 3.838a.5.5 0 0 0 .708-.708L10.016 9.31A4.5 4.5 0 1 0 6.5 11Zm0-8a3.5 3.5 0 1 1 0 7a3.5 3.5 0 0 1 0-7Z"})],-1)),oA=[aA],lA={class:"capture-announce"},cA=Cs(()=>Dt("div",{class:"capture-announce__heading"},"まだキャプチャがありません。",-1)),dA=Cs(()=>Dt("div",{class:"capture-announce__text"},[Dt("p",{class:"mt-0 mb-0"},"プレイヤーのキャプチャボタンやショートカットキーでキャプチャを撮ると、ここに表示されます。"),Dt("p",{class:"mt-2 mb-0"},"表示されたキャプチャを選択してからツイートすると、キャプチャを付けてツイートできます。")],-1)),uA=[cA,dA],hA=er({__name:"Captures",setup(_){const e=cn();function s(u){e.twitter_selected_capture_blobs.length<4&&u.selected===!1?(u.selected=!0,e.twitter_selected_capture_blobs.push(u.blob)):(e.twitter_selected_capture_blobs=e.twitter_selected_capture_blobs.filter(y=>y!==u.blob),u.selected=!1)}return(u,y)=>{const A=an("Icon");return Zt(),ai("div",q3,[Ai(Bf,{"content-class":"zoom-capture-modal-container","max-width":"980",transition:"slide-y-transition",modelValue:Jn(e).twitter_zoom_capture_modal,"onUpdate:modelValue":y[0]||(y[0]=l=>Jn(e).twitter_zoom_capture_modal=l)},{default:hn(()=>[Dt("div",Y3,[Dt("img",{class:"zoom-capture-modal__image",src:Jn(e).twitter_zoom_capture?Jn(e).twitter_zoom_capture.image_url:""},null,8,J3),Si((Zt(),ai("a",{class:"zoom-capture-modal__download",href:Jn(e).twitter_zoom_capture?Jn(e).twitter_zoom_capture.image_url:"",download:Jn(e).twitter_zoom_capture?Jn(e).twitter_zoom_capture.filename:""},[Ai(A,{icon:"fa6-solid:download",width:"45px"})],8,Q3)),[[Ri]])])]),_:1},8,["modelValue"]),Dt("div",Z3,[(Zt(!0),ai($n,null,Xn(Jn(e).twitter_captures,l=>(Zt(),ai("div",{class:Yi(["capture",{"capture--selected":l.selected,"capture--focused":l.focused,"capture--disabled":!l.selected&&Jn(e).twitter_selected_capture_blobs.length>=4}]),key:l.image_url,onClick:c=>s(l)},[Dt("img",{class:"capture__image",src:l.image_url},null,8,$3),eA,Dt("div",tA,en(Jn(e).twitter_selected_capture_blobs.findIndex(c=>c===l.blob)+1),1),iA,nA,rA,Si((Zt(),ai("div",{class:"capture__zoom",onClick:ta(c=>{Jn(e).twitter_zoom_capture_modal=!0,Jn(e).twitter_zoom_capture=l},["prevent","stop"]),onMousedown:y[1]||(y[1]=ta(()=>{},["prevent","stop"]))},oA,40,sA)),[[Ri]])],10,X3))),128))]),Si(Dt("div",lA,uA,512),[[rd,Jn(e).twitter_captures.length===0]])])}}}),fA=Wn(hA,[["__scopeId","data-v-e5c539a9"]]),pA={},mA={class:"tab-content tab-content--search"},gA=Dt("div",{class:"search px-4"}," リアルタイム検索機能は鋭意開発中です。 ",-1),AA=[gA];function yA(_,e){return Zt(),ai("div",mA,AA)}const vA=Wn(pA,[["render",yA]]),bA={},_A={class:"tab-content tab-content--timeline"},EA=Dt("div",{class:"search px-4"}," タイムライン機能は鋭意開発中です。 ",-1),wA=[EA];function SA(_,e){return Zt(),ai("div",_A,wA)}const TA=Wn(bA,[["render",SA]]),CA=er({name:"Panel-TwitterTab",components:{draggable:p2,TwitterCaptures:fA,TwitterSearch:vA,TwitterTimeline:TA},props:{playback_mode:{type:String,required:!0}},data(){return{Utils:Object.freeze(si),is_logged_in_twitter:!1,selected_twitter_account:null,is_twitter_account_list_display:!1,saved_twitter_hashtags:Sn().settings.saved_twitter_hashtags.map((_,e)=>({id:si.time()+e,text:_,editing:!1})),is_hashtag_list_display:!1,captures_element:null,is_tweet_hashtag_form_focused:!1,is_tweet_text_form_focused:!1,tweet_hashtag:"",tweet_text:"",tweet_letter_remain_count:140,is_tweet_sending:!1}},computed:{...yr(Ln,cn,Sn,Rc),is_tweet_button_disabled(){return this.is_logged_in_twitter===!1||this.tweet_letter_remain_count<0||(this.tweet_text.trim()===""||this.tweet_letter_remain_count===140)&&this.playerStore.twitter_selected_capture_blobs.length===0}},watch:{"channelsStore.channel.current.name":{handler(_,e){if(this.playback_mode==="Live"){const s=wo.getChannelHashtag(e)??"";this.tweet_hashtag=this.formatHashtag(this.tweet_hashtag.replaceAll(s,"")),this.updateTweetLetterCount(),this.settingsStore.settings.reset_hashtag_when_program_switches===!0&&(this.tweet_hashtag=this.formatHashtag(""),this.updateTweetLetterCount())}}},"channelsStore.channel.current.program_present":{deep:!0,handler(_,e){this.playback_mode==="Live"&&(_==null?void 0:_.id)!==(e==null?void 0:e.id)&&this.settingsStore.settings.reset_hashtag_when_program_switches===!0&&(this.tweet_hashtag=this.formatHashtag(""),this.updateTweetLetterCount())}},saved_twitter_hashtags:{deep:!0,handler(){this.settingsStore.settings.saved_twitter_hashtags=this.saved_twitter_hashtags.map(_=>_.text)}}},async created(){if(await this.userStore.fetchUser(),this.userStore.is_logged_in===!0&&this.userStore.user&&this.userStore.user.twitter_accounts.length>0){this.is_logged_in_twitter=!0,(this.settingsStore.settings.selected_twitter_account_id===null||!this.userStore.user.twitter_accounts.some(e=>e.id===this.settingsStore.settings.selected_twitter_account_id))&&(this.settingsStore.settings.selected_twitter_account_id=this.userStore.user.twitter_accounts[0].id);const _=this.userStore.user.twitter_accounts.findIndex(e=>e.id===this.settingsStore.settings.selected_twitter_account_id);this.selected_twitter_account=this.userStore.user.twitter_accounts[_]}this.tweet_hashtag=this.formatHashtag(this.tweet_hashtag),this.updateTweetLetterCount(),this.playerStore.event_emitter.on("CaptureCompleted",async _=>{this.addCaptureList(_.capture,_.filename)})},beforeUnmount(){for(const _ of this.playerStore.twitter_captures)URL.revokeObjectURL(_.image_url);this.playerStore.event_emitter.off("CaptureCompleted")},methods:{updateTweetLetterCount(){this.tweet_letter_remain_count=140-[...this.tweet_hashtag].length-[...this.tweet_text].length},pasteClipboardData(_){if(_.clipboardData!==null){for(const e of _.clipboardData.items)if(e.type.startsWith("image/")){const s=e.getAsFile();s&&this.addCaptureList(s,s.name)}}},clickHashtagListButton(){this.is_hashtag_list_display=!this.is_hashtag_list_display;for(const _ of this.saved_twitter_hashtags)_.editing=!1},clickHashtag(_){this.tweet_hashtag=_.text,this.tweet_hashtag=this.formatHashtag(this.tweet_hashtag),this.updateTweetLetterCount(),window.setTimeout(()=>this.is_hashtag_list_display=!1,150)},clickAccountButton(){if(!this.is_logged_in_twitter){document.fullscreenElement&&document.exitFullscreen(),this.$router.push({path:"/settings/twitter"});return}this.is_twitter_account_list_display=!this.is_twitter_account_list_display,this.is_twitter_account_list_display===!0&&(this.is_hashtag_list_display=!1)},updateSelectedTwitterAccount(_){this.settingsStore.settings.selected_twitter_account_id=_.id,this.selected_twitter_account=_,window.setTimeout(()=>this.is_twitter_account_list_display=!1,150)},addCaptureList(_,e){this.captures_element===null&&(this.captures_element=document.querySelector(".tab-content--capture")),this.playerStore.twitter_captures.length>100&&(URL.revokeObjectURL(this.playerStore.twitter_captures[0].image_url),this.playerStore.twitter_selected_capture_blobs=this.playerStore.twitter_selected_capture_blobs.filter(u=>u!==this.playerStore.twitter_captures[0].blob),this.playerStore.twitter_captures.shift());const s=URL.createObjectURL(_);this.playerStore.twitter_captures.push({blob:_,filename:e,image_url:s,selected:!1,focused:!1}),this.$nextTick(()=>{this.captures_element!==null&&this.captures_element.scrollTo({top:this.captures_element.scrollHeight,behavior:"smooth"})})},async drawProgramTitleOnCapture(_){var A;const e=await createImageBitmap(_),s="OffscreenCanvas"in window?new OffscreenCanvas(e.width,e.height):document.createElement("canvas"),u=s.getContext("2d",{alpha:!1,desynchronized:!0,willReadFrequently:!1});u.drawImage(e,0,0),e.close(),u.font='bold 22px "Open Sans", "YakuHanJPs", "Twemoji", "Hiragino Sans", "Noto Sans JP", sans-serif',u.fillStyle="rgba(255, 255, 255, 70%)",u.shadowColor="rgba(0, 0, 0, 100%)",u.shadowBlur=4,u.shadowOffsetX=0,u.shadowOffsetY=0;let y;switch(this.playback_mode==="Live"?y=((A=this.channelsStore.channel.current.program_present)==null?void 0:A.title)??"放送休止":y=this.playerStore.recorded_program.title,this.settingsStore.settings.tweet_capture_watermark_position){case"TopLeft":{u.textAlign="left",u.textBaseline="top",u.fillText(y,16,12);break}case"TopRight":{u.textAlign="right",u.textBaseline="top",u.fillText(y,s.width-16,12);break}case"BottomLeft":{u.textAlign="left",u.textBaseline="bottom",u.fillText(y,16,s.height-12);break}case"BottomRight":{u.textAlign="right",u.textBaseline="bottom",u.fillText(y,s.width-16,s.height-12);break}}return s instanceof OffscreenCanvas?await s.convertToBlob({type:"image/jpeg",quality:1}):new Promise((l,c)=>s.toBlob(p=>{p===null?c():l(p)},"image/jpeg",1))},formatHashtag(_,e=!1){const s=_.trim().replaceAll("♯","#").replaceAll("#","#").replace(/#{2,}/g,"#").replaceAll(" "," ").replaceAll(/ +/g," ").split(" ").filter(u=>u!=="");for(let u in s)s[u].startsWith("#")||(s[u]=`#${s[u]}`);if(this.playback_mode==="Live"&&this.settingsStore.settings.auto_add_watching_channel_hashtag===!0&&e===!1){const u=wo.getChannelHashtag(this.channelsStore.channel.current.name);u!==null&&s.includes(u)===!1&&s.push(u)}return s.join(" ")},async sendTweet(){if(this.selected_twitter_account===null||this.is_tweet_sending===!0)return;this.is_tweet_sending=!0,this.tweet_hashtag=this.formatHashtag(this.tweet_hashtag);const _=this.tweet_hashtag;this.updateTweetLetterCount();let e=this.tweet_text;if(_!=="")switch(this.settingsStore.settings.tweet_hashtag_position){case"Prepend":{e=`${_} ${this.tweet_text}`;break}case"Append":{e=`${this.tweet_text} ${_}`;break}case"PrependWithLineBreak":{e=`${_} +var t2=Object.defineProperty;var i2=(_,e,s)=>e in _?t2(_,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):_[e]=s;var we=(_,e,s)=>(i2(_,typeof e!="symbol"?e+"":e,s),s),Pu=(_,e,s)=>{if(!e.has(_))throw TypeError("Cannot "+s)};var Mn=(_,e,s)=>(Pu(_,e,"read from private field"),s?s.call(_):e.get(_)),Bu=(_,e,s)=>{if(e.has(_))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(_):e.set(_,s)},Ol=(_,e,s,u)=>(Pu(_,e,"write to private field"),u?u.call(_,s):e.set(_,s),s);import{x as jo,y as nd,z as kf,A as Rf,B as If,C as Lf,D as Df,E as Of,G as kr,H as ea,I as n2,u as Sn,d as er,U as si,P as Vo,J as Rr,m as yr,_ as Wn,r as an,o as Zt,c as ai,w as Si,j as Tn,h as hn,i as _n,e as Dt,t as en,b as Ai,n as Yi,R as Ri,g as Xn,F as $n,v as rd,p as Ir,q as Lr,a as Mf,f as Eo,k as Bn,V as r2,l as ta,K as Pf,L as Jn,N as Rc,O as Ml,Q as Ho,S as sd,T as Es,W as Ic,X as Pl,M as As,Y as s2,Z as a2}from"./index-Dbi6R656.js";import{u as Ln,C as wo,a as o2}from"./ChannelsStore-DchOc5Uo.js";import{V as zo,_ as l2}from"./ssrBoot-sWDXISB3.js";import{V as Bf}from"./VDialog-B1HdJyP2.js";import{V as c2,a as d2}from"./VCard-BBvTbBT9.js";import{S as u2,a as h2}from"./swiper-BjXfmU5J.js";import{C as f2}from"./CommentMuteSettings-B8qrNY4M.js";import{V as p2,a as Bl,b as Nl}from"./VSelect-dbg9h4rI.js";import{d as m2}from"./vuedraggable.umd-Dq96441i.js";import{T as g2}from"./Twitter-DX_Loh3n.js";import{P as Js}from"./PlayerUtils-BMfVEgCY.js";const Nf=jo.reduce((_,e)=>(_[e]={type:[Boolean,String,Number],default:!1},_),{}),Ff=jo.reduce((_,e)=>{const s="offset"+nd(e);return _[s]={type:[String,Number],default:null},_},{}),Uf=jo.reduce((_,e)=>{const s="order"+nd(e);return _[s]={type:[String,Number],default:null},_},{}),Nu={col:Object.keys(Nf),offset:Object.keys(Ff),order:Object.keys(Uf)};function A2(_,e,s){let u=_;if(!(s==null||s===!1)){if(e){const A=e.replace(_,"");u+=`-${A}`}return _==="col"&&(u="v-"+u),_==="col"&&(s===""||s===!0)||(u+=`-${s}`),u.toLowerCase()}}const y2=["auto","start","end","center","baseline","stretch"],v2=kf({cols:{type:[Boolean,String,Number],default:!1},...Nf,offset:{type:[String,Number],default:null},...Ff,order:{type:[String,Number],default:null},...Uf,alignSelf:{type:String,default:null,validator:_=>y2.includes(_)},...Rf(),...If()},"VCol"),b2=Lf()({name:"VCol",props:v2(),setup(_,e){let{slots:s}=e;const u=Df(()=>{const A=[];let y;for(y in Nu)Nu[y].forEach(c=>{const p=_[c],r=A2(y,c,p);r&&A.push(r)});const l=A.some(c=>c.startsWith("v-col-"));return A.push({"v-col":!l||!_.cols,[`v-col-${_.cols}`]:_.cols,[`offset-${_.offset}`]:_.offset,[`order-${_.order}`]:_.order,[`align-self-${_.alignSelf}`]:_.alignSelf}),A});return()=>{var A;return Of(_.tag,{class:[u.value,_.class],style:_.style},(A=s.default)==null?void 0:A.call(s))}}}),ad=["start","end","center"],Gf=["space-between","space-around","space-evenly"];function od(_,e){return jo.reduce((s,u)=>{const A=_+nd(u);return s[A]=e(),s},{})}const _2=[...ad,"baseline","stretch"],jf=_=>_2.includes(_),Vf=od("align",()=>({type:String,default:null,validator:jf})),E2=[...ad,...Gf],Hf=_=>E2.includes(_),zf=od("justify",()=>({type:String,default:null,validator:Hf})),w2=[...ad,...Gf,"stretch"],Wf=_=>w2.includes(_),Kf=od("alignContent",()=>({type:String,default:null,validator:Wf})),Fu={align:Object.keys(Vf),justify:Object.keys(zf),alignContent:Object.keys(Kf)},S2={align:"align",justify:"justify",alignContent:"align-content"};function T2(_,e,s){let u=S2[_];if(s!=null){if(e){const A=e.replace(_,"");u+=`-${A}`}return u+=`-${s}`,u.toLowerCase()}}const C2=kf({dense:Boolean,noGutters:Boolean,align:{type:String,default:null,validator:jf},...Vf,justify:{type:String,default:null,validator:Hf},...zf,alignContent:{type:String,default:null,validator:Wf},...Kf,...Rf(),...If()},"VRow"),x2=Lf()({name:"VRow",props:C2(),setup(_,e){let{slots:s}=e;const u=Df(()=>{const A=[];let y;for(y in Fu)Fu[y].forEach(l=>{const c=_[l],p=T2(y,l,c);p&&A.push(p)});return A.push({"v-row--no-gutters":_.noGutters,"v-row--dense":_.dense,[`align-${_.align}`]:_.align,[`justify-${_.justify}`]:_.justify,[`align-content-${_.alignContent}`]:_.alignContent}),A});return()=>{var A;return Of(_.tag,{class:["v-row",u.value,_.class],style:_.style},(A=s.default)==null?void 0:A.call(s))}}});function k2(_){return{all:_=_||new Map,on:function(e,s){var u=_.get(e);u?u.push(s):_.set(e,[s])},off:function(e,s){var u=_.get(e);u&&(s?u.splice(u.indexOf(s)>>>0,1):_.set(e,[]))},emit:function(e,s){var u=_.get(e);u&&u.slice().map(function(A){A(s)}),(u=_.get("*"))&&u.slice().map(function(A){A(e,s)})}}}const R2={id:-1,file_path:"",file_hash:"",file_size:0,recording_start_time:null,recording_end_time:null,duration:0,container_format:"MPEG-TS",video_codec:"MPEG-2",video_codec_profile:"High",video_scan_type:"Interlaced",video_frame_rate:29.97,video_resolution_width:1440,video_resolution_height:1080,primary_audio_codec:"AAC-LC",primary_audio_channel:"Stereo",primary_audio_sampling_rate:48e3,secondary_audio_codec:null,secondary_audio_channel:null,secondary_audio_sampling_rate:null,cm_sections:[]},Uu={id:-1,recorded_video:R2,recording_start_margin:0,recording_end_margin:0,is_partially_recorded:!1,channel:null,network_id:null,service_id:null,event_id:null,series_id:null,series_broadcast_period_id:null,title:"取得中…",series_title:null,episode_number:null,subtitle:null,description:"取得中…",detail:{},start_time:"2000-01-01T00:00:00+09:00",end_time:"2000-01-01T00:00:00+09:00",duration:0,is_free:!0,genres:[],primary_audio_type:"2/0モード(ステレオ)",primary_audio_language:"日本語",secondary_audio_type:null,secondary_audio_language:null};class I2{static async fetchVideo(e){const s=await kr.get(`/videos/${e}`);return s.type==="error"?(kr.showGenericError(s,"録画番組情報を取得できませんでした。"),null):s.data}static async fetchVideoJikkyoComments(e){const s=await kr.get(`/videos/${e}/jikkyo`);return s.type==="error"?(kr.showGenericError(s,"過去ログコメントを取得できませんでした。"),{is_success:!1,comments:[],detail:"過去ログコメントを取得できませんでした。"}):(s.data.comments=s.data.comments.filter(u=>ea.isMutedComment(u.text,u.author,u.color,u.type,u.size)===!1),s.data)}}const L2=I2,D2=n2("player",{state:()=>({is_watching:!1,is_player_initialized:!1,event_emitter:k2(),recorded_program:Uu,is_virtual_keyboard_display:!1,is_fullscreen:!1,is_document_pip:!1,is_control_display:!0,is_panel_display:(()=>{const _=Sn();switch(_.settings.panel_display_state){case"AlwaysDisplay":return!0;case"AlwaysFold":return!1;case"RestorePreviousState":return _.settings.showed_panel_last_time}})(),tv_panel_active_tab:Sn().settings.tv_panel_active_tab,video_panel_active_tab:Sn().settings.video_panel_active_tab,twitter_active_tab:Sn().settings.twitter_active_tab,is_remocon_display:!1,is_zapping:!1,is_loading:!0,is_video_buffering:!0,is_video_paused:!1,is_background_display:!1,background_url:"",shortcut_key_modal:!1,live_stream_status:null,live_comment_init_failed_message:null,video_comment_init_failed_message:null,twitter_captures:[],twitter_selected_capture_blobs:[],twitter_zoom_capture_modal:!1,twitter_zoom_capture:null}),actions:{startWatching(){this.reset(),this.is_watching=!0},stopWatching(){this.reset(),this.is_watching=!1},reset(){this.is_watching=!1,this.is_player_initialized=!1,this.recorded_program=Uu,this.is_virtual_keyboard_display=!1,this.is_fullscreen=!1,this.is_document_pip=!1,this.is_control_display=!0,this.is_panel_display=(()=>{const _=Sn();switch(_.settings.panel_display_state){case"AlwaysDisplay":return!0;case"AlwaysFold":return!1;case"RestorePreviousState":return _.settings.showed_panel_last_time}})(),this.tv_panel_active_tab=Sn().settings.tv_panel_active_tab,this.video_panel_active_tab=Sn().settings.video_panel_active_tab,this.twitter_active_tab=Sn().settings.twitter_active_tab,this.is_remocon_display=!1,this.is_zapping=!1,this.is_loading=!0,this.is_video_buffering=!0,this.is_video_paused=!1,this.is_background_display=!1,this.background_url="",this.shortcut_key_modal=!1,this.live_stream_status=null,this.live_comment_init_failed_message=null,this.twitter_captures=[],this.twitter_zoom_capture_modal=!1,this.twitter_zoom_capture=null}}}),cn=D2,O2=er({name:"Watch-Header",props:{playback_mode:{type:String,required:!0}},data(){return{Utils:Object.freeze(si),ProgramUtils:Object.freeze(Vo),time:Rr().format(si.isSmartphoneHorizontal()?"HH:mm:ss":"YYYY/MM/DD HH:mm:ss"),time_interval_id:0}},computed:{...yr(Ln,cn)},created(){this.time_interval_id=window.setInterval(()=>{this.time=Rr().format(si.isSmartphoneHorizontal()?"HH:mm:ss":"YYYY/MM/DD HH:mm:ss")},1*1e3)},beforeUnmount(){window.clearInterval(this.time_interval_id)}}),M2=["src"],P2=["innerHTML"],B2={class:"watch-header__program-time"},N2={class:"watch-header__now"};function F2(_,e,s,u,A,y){const l=an("Icon"),c=an("router-link");return Zt(),ai("header",{class:Yi(["watch-header",{"watch-header--video":_.playback_mode==="Video"}])},[Si((Zt(),Tn(c,{class:"watch-header__back-icon",to:_.playback_mode==="Live"?"/tv/":"/videos/"},{default:hn(()=>[Ai(l,{icon:"fluent:arrow-left-12-filled",width:"25px"})]),_:1},8,["to"])),[[Ri]]),_.playback_mode==="Live"?(Zt(),ai("img",{key:0,class:"watch-header__broadcaster",src:`${_.Utils.api_base_url}/channels/${_.channelsStore.channel.current.id}/logo`},null,8,M2)):_n("",!0),Dt("span",{class:"watch-header__program-title",innerHTML:_.ProgramUtils.decorateProgramInfo(_.playback_mode==="Live"?_.channelsStore.channel.current.program_present:_.playerStore.recorded_program,"title")},null,8,P2),Dt("span",B2,en(_.ProgramUtils.getProgramTime(_.playback_mode==="Live"?_.channelsStore.channel.current.program_present:_.playerStore.recorded_program,!0)),1),Ai(zo),Dt("span",N2,en(_.time),1)],2)}const U2=Wn(O2,[["render",F2],["__scopeId","data-v-a6183c43"]]),G2={left_column:[{name:"全般",icon:"fluent:home-20-filled",icon_height:"22px",shortcuts:[{name:"数字キー/テンキーに対応するリモコン番号 (1~12) の地デジチャンネルに切り替える",keys:[{name:"1~9, 0, -(=), ^(~)",icon:!1}]},{name:"数字キー/テンキーに対応するリモコン番号 (1~12) の BS チャンネルに切り替える",keys:[{name:"Shift",icon:!1},{name:"1~9, 0, -(=), ^(~)",icon:!1}]},{name:"前のチャンネルに切り替える",keys:[{name:"fluent:arrow-up-12-filled",icon:!0}]},{name:"次のチャンネルに切り替える",keys:[{name:"fluent:arrow-down-12-filled",icon:!0}]},{name:"キーボードショートカットの一覧を表示する",keys:[{name:"/(?)",icon:!1}]}]},{name:"プレイヤー",icon:"fluent:play-20-filled",icon_height:"20px",shortcuts:[{name:"再生 / 一時停止の切り替え",keys:[{name:"Space",icon:!1}]},{name:"再生 / 一時停止の切り替え (キャプチャタブ表示時)",keys:[{name:"Shift",icon:!1},{name:"Space",icon:!1}]},{name:"停止して0.5秒早戻し",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-left-12-filled",icon:!0}]},{name:"停止して0.5秒早送り",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-right-12-filled",icon:!0}]},{name:"プレイヤーの音量を上げる",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-up-12-filled",icon:!0}]},{name:"プレイヤーの音量を下げる",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-down-12-filled",icon:!0}]},{name:"プレイヤーの音量をミュートする",keys:[{name:"Q",icon:!1}]},{name:"ライブストリームを同期する",keys:[{name:"W",icon:!1}]},{name:"プレイヤーを再起動する",keys:[{name:"R",icon:!1}]},{name:"フルスクリーンの切り替え",keys:[{name:"F",icon:!1}]},{name:"Picture-in-Picture の表示切り替え",keys:[{name:"E",icon:!1}]},{name:"字幕の表示切り替え",keys:[{name:"S",icon:!1}]},{name:"コメントの表示切り替え",keys:[{name:"D",icon:!1}]},{name:"映像をキャプチャする",keys:[{name:"C",icon:!1}]},{name:"映像をコメントを付けてキャプチャする",keys:[{name:"V",icon:!1}]},{name:"コメント入力フォームにフォーカスする",keys:[{name:"M",icon:!1}]},{name:"コメント入力フォームを閉じる",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"M",icon:!1}]},{name:"コメントを送信する",keys:[{name:"コメント入力フォームを表示",icon:!1},{name:"Enter",icon:!1}]}]}],right_column:[{name:"パネル",icon:"fluent:panel-right-20-filled",icon_height:"24px",shortcuts:[{name:"パネルの表示切り替え",keys:[{name:"P",icon:!1}]},{name:"番組情報タブを表示する",keys:[{name:"K",icon:!1}]},{name:"チャンネルタブを表示する",keys:[{name:"L",icon:!1}]},{name:"コメントタブを表示する",keys:[{name:";(+)",icon:!1}]},{name:"Twitter タブを表示する",keys:[{name:":(*)",icon:!1}]}]},{name:"Twitter",icon:"fa-brands:twitter",icon_height:"22px",shortcuts:[{name:"ツイート検索タブを表示する",keys:[{name:"[ (「)",icon:!1}]},{name:"タイムラインタブを表示する",keys:[{name:"] (」)",icon:!1}]},{name:"キャプチャタブを表示する",keys:[{name:"\(¥)",icon:!1}]},{name:"ツイート入力フォームにフォーカスを当てる/フォーカスを外す",keys:[{name:"Tab",icon:!1}]},{name:"キャプチャにフォーカスする",keys:[{name:"キャプチャタブを表示",icon:!1},{name:"fluent:arrow-up-12-filled;fluent:arrow-down-12-filled;fluent:arrow-left-12-filled;fluent:arrow-right-12-filled",icon:!0}]},{name:"キャプチャを拡大表示する/
キャプチャの拡大表示を閉じる",keys:[{name:"キャプチャにフォーカス",icon:!1},{name:"Enter",icon:!1}]},{name:"キャプチャを選択する/
キャプチャの選択を解除する",keys:[{name:"キャプチャにフォーカス",icon:!1},{name:"Space",icon:!1}]},{name:"クリップボード内の画像を
キャプチャとして取り込む",keys:[{name:"ツイート入力
フォームにフォーカス",icon:!1},{name:si.CtrlOrCmd(),icon:!1},{name:"V",icon:!1}]},{name:"ツイートを送信する",keys:[{name:"Twitter タブを表示",icon:!1},{name:si.CtrlOrCmd(),icon:!1},{name:"Enter",icon:!1}]}]},{name:"データ放送",icon:"",icon_height:"",shortcuts:[{name:'リモコンの ボタンを押す',keys:[{name:si.AltOrOption(),icon:!1},{name:"D",icon:!1}]},{name:"リモコンの戻るボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"Backspace",icon:!1}]},{name:"リモコンの決定ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"Enter",icon:!1}]},{name:"リモコンの ⬆ ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"fluent:arrow-up-12-filled",icon:!0}]},{name:"リモコンの ⬅️ ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"fluent:arrow-left-12-filled",icon:!0}]},{name:"リモコンの ➡ ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"fluent:arrow-right-12-filled",icon:!0}]},{name:"リモコンの ⬇ ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"fluent:arrow-down-12-filled",icon:!0}]},{name:"リモコンの 🟦 ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"F9",icon:!1}]},{name:"リモコンの 🟥 ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"F10",icon:!1}]},{name:"リモコンの 🟩 ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"F11",icon:!1}]},{name:"リモコンの 🟨 ボタンを押す",keys:[{name:si.AltOrOption(),icon:!1},{name:"F12",icon:!1}]}]}]},j2={left_column:[{name:"全般",icon:"fluent:home-20-filled",icon_height:"22px",shortcuts:[{name:"キーボードショートカットの一覧を表示する",keys:[{name:"/(?)",icon:!1}]}]},{name:"プレイヤー",icon:"fluent:play-20-filled",icon_height:"20px",shortcuts:[{name:"再生 / 一時停止の切り替え",keys:[{name:"Space",icon:!1}]},{name:"再生 / 一時停止の切り替え (キャプチャタブ表示時)",keys:[{name:"Shift",icon:!1},{name:"Space",icon:!1}]},{name:"5秒早戻し",keys:[{name:"fluent:arrow-left-12-filled",icon:!0}]},{name:"5秒早送り",keys:[{name:"fluent:arrow-right-12-filled",icon:!0}]},{name:"15秒早戻し",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-left-12-filled",icon:!0}]},{name:"15秒早送り",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-right-12-filled",icon:!0}]},{name:"30秒早戻し",keys:[{name:"Shift",icon:!1},{name:"fluent:arrow-left-12-filled",icon:!0}]},{name:"30秒早送り",keys:[{name:"Shift",icon:!1},{name:"fluent:arrow-right-12-filled",icon:!0}]},{name:"60秒早戻し",keys:[{name:si.AltOrOption(),icon:!1},{name:"fluent:arrow-left-12-filled",icon:!0}]},{name:"60秒早送り",keys:[{name:si.AltOrOption(),icon:!1},{name:"fluent:arrow-right-12-filled",icon:!0}]},{name:"プレイヤーの音量を上げる",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-up-12-filled",icon:!0}]},{name:"プレイヤーの音量を下げる",keys:[{name:si.CtrlOrCmd(),icon:!1},{name:"fluent:arrow-down-12-filled",icon:!0}]},{name:"プレイヤーの音量をミュートする",keys:[{name:"Q",icon:!1}]},{name:"プレイヤーを再起動する",keys:[{name:"R",icon:!1}]},{name:"フルスクリーンの切り替え",keys:[{name:"F",icon:!1}]},{name:"Picture-in-Picture の表示切り替え",keys:[{name:"E",icon:!1}]},{name:"字幕の表示切り替え",keys:[{name:"S",icon:!1}]},{name:"コメントの表示切り替え",keys:[{name:"D",icon:!1}]},{name:"映像をキャプチャする",keys:[{name:"C",icon:!1}]},{name:"映像をコメントを付けてキャプチャする",keys:[{name:"V",icon:!1}]}]}],right_column:[{name:"パネル",icon:"fluent:panel-right-20-filled",icon_height:"24px",shortcuts:[{name:"パネルの表示切り替え",keys:[{name:"P",icon:!1}]},{name:"番組情報タブを表示する",keys:[{name:"K",icon:!1}]},{name:"シリーズタブを表示する",keys:[{name:"L",icon:!1}]},{name:"コメントタブを表示する",keys:[{name:";(+)",icon:!1}]},{name:"Twitter タブを表示する",keys:[{name:":(*)",icon:!1}]}]},{name:"Twitter",icon:"fa-brands:twitter",icon_height:"22px",shortcuts:[{name:"ツイート検索タブを表示する",keys:[{name:"[ (「)",icon:!1}]},{name:"タイムラインタブを表示する",keys:[{name:"] (」)",icon:!1}]},{name:"キャプチャタブを表示する",keys:[{name:"\(¥)",icon:!1}]},{name:"ツイート入力フォームにフォーカスを当てる/フォーカスを外す",keys:[{name:"Tab",icon:!1}]},{name:"キャプチャにフォーカスする",keys:[{name:"キャプチャタブを表示",icon:!1},{name:"fluent:arrow-up-12-filled;fluent:arrow-down-12-filled;fluent:arrow-left-12-filled;fluent:arrow-right-12-filled",icon:!0}]},{name:"キャプチャを拡大表示する/
キャプチャの拡大表示を閉じる",keys:[{name:"キャプチャにフォーカス",icon:!1},{name:"Enter",icon:!1}]},{name:"キャプチャを選択する/
キャプチャの選択を解除する",keys:[{name:"キャプチャにフォーカス",icon:!1},{name:"Space",icon:!1}]},{name:"クリップボード内の画像を
キャプチャとして取り込む",keys:[{name:"ツイート入力
フォームにフォーカス",icon:!1},{name:si.CtrlOrCmd(),icon:!1},{name:"V",icon:!1}]},{name:"ツイートを送信する",keys:[{name:"Twitter タブを表示",icon:!1},{name:si.CtrlOrCmd(),icon:!1},{name:"Enter",icon:!1}]}]}]},V2=er({name:"KeyboardShortcutList",props:{playback_mode:{type:String,required:!0}},data(){return{Utils:Object.freeze(si),live_shortcut_list:structuredClone(G2),video_shortcut_list:structuredClone(j2)}},computed:{...yr(cn,Sn),shortcut_list(){return this.playback_mode==="Live"?this.live_shortcut_list:this.video_shortcut_list}},created(){this.settingsStore.settings.tv_channel_selection_requires_alt_key===!0&&(this.live_shortcut_list.left_column[0].shortcuts[0].keys.unshift({name:si.AltOrOption(),icon:!1}),this.live_shortcut_list.left_column[0].shortcuts[1].keys.unshift({name:si.AltOrOption(),icon:!1}))}}),qf=_=>(Ir("data-v-1077a2f6"),_=_(),Lr(),_),H2=qf(()=>Dt("span",{class:"ml-3"},"キーボードショートカット",-1)),z2={class:"px-5 pb-6"},W2={class:"text-subtitle-1 d-flex align-center font-weight-bold"},K2={key:1,width:"24px",height:"24px",viewBox:"0 0 512 512"},q2=qf(()=>Dt("path",{fill:"currentColor",d:"M248.039 381.326L355.039 67.8258C367.539 28.3257 395.039 34.3258 406.539 34.3258C431.039 34.3258 453.376 61.3258 441.039 96.8258C362.639 322.426 343.539 375.326 340.539 384.826C338.486 391.326 342.039 391.326 345.539 391.326C377.039 391.326 386.539 418.326 386.539 435.326C386.539 458.826 371.539 477.326 350.039 477.326H214.539C179.039 477.326 85.8269 431.3 88.0387 335.826C91.0387 206.326 192.039 183.326 243.539 183.326H296.539L265.539 272.326H243.539C185.539 272.326 174.113 314.826 176.039 334.326C180.039 374.826 215.039 389.814 237.039 390.326C244.539 390.5 246.039 386.826 248.039 381.326Z"},null,-1)),Y2=[q2],J2={class:"ml-2"},Q2={class:"text-subtitle-2 mt-2 d-flex align-center font-weight-medium"},Z2=["innerHTML"],X2={class:"ml-auto d-flex align-center flex-shrink-0"},$2={class:"shortcut-key"},em=["innerHTML"],tm={key:0,class:"shortcut-key-plus"};function im(_,e,s,u,A,y){const l=an("Icon");return Zt(),Tn(Bf,{"max-width":"1050",transition:"slide-y-transition",modelValue:_.playerStore.shortcut_key_modal,"onUpdate:modelValue":e[1]||(e[1]=c=>_.playerStore.shortcut_key_modal=c)},{default:hn(()=>[Ai(d2,null,{default:hn(()=>[Ai(c2,{class:"px-5 pt-6 pb-3 d-flex align-center font-weight-bold"},{default:hn(()=>[Ai(l,{icon:"fluent:keyboard-20-filled",height:"28px"}),H2,Ai(zo),Si((Zt(),ai("div",{class:"d-flex align-center rounded-circle cursor-pointer px-2 py-2",onClick:e[0]||(e[0]=c=>_.playerStore.shortcut_key_modal=!1)},[Ai(l,{icon:"fluent:dismiss-12-filled",width:"23px",height:"23px"})])),[[Ri]])]),_:1}),Dt("div",z2,[Ai(x2,null,{default:hn(()=>[(Zt(!0),ai($n,null,Xn(_.shortcut_list,(c,p)=>(Zt(),Tn(b2,{cols:"6",key:p},{default:hn(()=>[(Zt(!0),ai($n,null,Xn(c,r=>(Zt(),ai("div",{class:"mt-3",key:r.name},[Dt("div",W2,[r.name!=="データ放送"?(Zt(),Tn(l,{key:0,icon:r.icon,height:r.icon_height},null,8,["icon","height"])):(Zt(),ai("svg",K2,Y2)),Dt("span",J2,en(r.name),1)]),(Zt(!0),ai($n,null,Xn(r.shortcuts,i=>(Zt(),ai("div",{class:"mt-3",key:i.name},[Dt("div",Q2,[Dt("span",{class:"mr-2",innerHTML:i.name},null,8,Z2),Dt("div",X2,[(Zt(!0),ai($n,null,Xn(i.keys,(t,n)=>(Zt(),ai("div",{class:"ml-auto d-flex align-center",key:t.name},[Dt("span",$2,[(Zt(!0),ai($n,null,Xn(t.name.split(";"),a=>Si((Zt(),Tn(l,{icon:a,height:"18px",key:a},null,8,["icon"])),[[rd,t.icon===!0]])),128)),t.icon===!1?(Zt(),ai("span",{key:0,innerHTML:t.name},null,8,em)):_n("",!0)]),n(Ir("data-v-d342fbd9"),_=_(),Lr(),_),om=am(()=>Dt("img",{class:"watch-navigation__icon-image",src:sm,width:"23px"},null,-1));function lm(_,e,s,u,A,y){const l=an("router-link"),c=an("Icon"),p=Mf("tooltip");return Zt(),ai("nav",{class:"watch-navigation",onMousemove:e[0]||(e[0]=r=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:r})),onTouchmove:e[1]||(e[1]=r=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:r})),onClick:e[2]||(e[2]=r=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:r}))},[Si((Zt(),Tn(l,{class:"watch-navigation__icon",to:"/tv/"},{default:hn(()=>[om]),_:1})),[[Ri]]),Si((Zt(),Tn(l,{class:Yi(["watch-navigation__link",{"watch-navigation__link--active":_.$route.path.startsWith("/tv")}]),"active-class":"watch-navigation__link--active",to:"/tv/"},{default:hn(()=>[Ai(c,{class:"watch-navigation__link-icon",icon:"fluent:tv-20-regular",width:"26px"})]),_:1},8,["class"])),[[Ri],[p,"テレビをみる",void 0,{right:!0}]]),Si((Zt(),Tn(l,{class:Yi(["watch-navigation__link",{"watch-navigation__link--active":_.$route.path.startsWith("/videos")}]),"active-class":"watch-navigation__link--active",to:"/videos/"},{default:hn(()=>[Ai(c,{class:"watch-navigation__link-icon",icon:"fluent:movies-and-tv-20-regular",width:"26px"})]),_:1},8,["class"])),[[Ri],[p,"ビデオをみる",void 0,{right:!0}]]),Si((Zt(),Tn(l,{class:Yi(["watch-navigation__link",{"watch-navigation__link--active":_.$route.path.startsWith("/timetable")}]),"active-class":"watch-navigation__link--active",to:"/timetable/"},{default:hn(()=>[Ai(c,{class:"watch-navigation__link-icon",icon:"fluent:calendar-ltr-20-regular",width:"26px"})]),_:1},8,["class"])),[[Ri],[p,"番組表",void 0,{right:!0}]]),Si((Zt(),Tn(l,{class:Yi(["watch-navigation__link",{"watch-navigation__link--active":_.$route.path.startsWith("/reserves")}]),"active-class":"watch-navigation__link--active",to:"/reserves/"},{default:hn(()=>[Ai(c,{class:"watch-navigation__link-icon",icon:"fluent:timer-16-regular",width:"26px",style:{padding:"0.5px"}})]),_:1},8,["class"])),[[Ri],[p,"録画予約",void 0,{right:!0}]]),Si((Zt(),Tn(l,{class:Yi(["watch-navigation__link",{"watch-navigation__link--active":_.$route.path.startsWith("/mylist")}]),"active-class":"watch-navigation__link--active",to:"/mylist/"},{default:hn(()=>[Ai(c,{class:"watch-navigation__link-icon",icon:"ic:round-playlist-play",width:"26px"})]),_:1},8,["class"])),[[Ri],[p,"マイリスト",void 0,{right:!0}]]),Si((Zt(),Tn(l,{class:Yi(["watch-navigation__link",{"watch-navigation__link--active":_.$route.path.startsWith("/captures")}]),"active-class":"watch-navigation__link--active",to:"/captures/"},{default:hn(()=>[Ai(c,{class:"watch-navigation__link-icon",icon:"fluent:image-multiple-24-regular",width:"26px"})]),_:1},8,["class"])),[[Ri],[p,"キャプチャ",void 0,{right:!0}]]),Ai(zo),Si((Zt(),Tn(l,{class:Yi(["watch-navigation__link",{"watch-navigation__link--active":_.$route.path.startsWith("/settings")}]),"active-class":"watch-navigation__link--active",to:"/settings/"},{default:hn(()=>[Ai(c,{class:"watch-navigation__link-icon",icon:"fluent:settings-20-regular",width:"26px"})]),_:1},8,["class"])),[[Ri],[p,"設定",void 0,{right:!0}]])],32)}const cm=Wn(rm,[["render",lm],["__scopeId","data-v-d342fbd9"]]),dm=er({name:"Panel-ChannelTab",components:{Swiper:u2,SwiperSlide:h2},data(){return{Utils:Object.freeze(si),ChannelUtils:Object.freeze(wo),ProgramUtils:Object.freeze(Vo),active_tab_index:0,swiper_instance:null}},computed:{...yr(Ln,cn)},watch:{active_tab_index(){var _,e;(_=this.swiper_instance)==null||_.updateAutoHeight(),(e=this.swiper_instance)==null||e.slideTo(this.active_tab_index)},async"playerStore.tv_panel_active_tab"(){var _;await si.sleep(.05),(_=this.swiper_instance)==null||_.updateAutoHeight()},async"playerStore.video_panel_active_tab"(){var _;await si.sleep(.05),(_=this.swiper_instance)==null||_.updateAutoHeight()}},async mounted(){var _,e,s;if(await si.sleep(.05),(_=this.swiper_instance)==null||_.updateAutoHeight(),(e=document.querySelector(".channels-list-container"))==null||e.addEventListener("scroll",()=>{var u;(u=this.swiper_instance)==null||u.updateAutoHeight()},{passive:!0}),this.playerStore.tv_panel_active_tab==="Channel")for(let u=0;u<20;u++)await si.sleep(.1),(s=this.swiper_instance)==null||s.updateAutoHeight()}}),Wo=_=>(Ir("data-v-4c8d1701"),_=_(),Lr(),_),um={class:"channels-container channels-container--watch"},hm={class:"channels-tab"},fm=Wo(()=>Dt("div",{class:"channels-tab__highlight"},null,-1)),pm={class:"channels-list-container"},mm={class:"channels"},gm={class:"channel__broadcaster"},Am=["src"],ym={class:"channel__broadcaster-content"},vm={class:"channel__broadcaster-name"},bm=Wo(()=>Dt("svg",{class:"iconify iconify--fa-solid",width:"9.63px",height:"11px",viewBox:"0 0 448 512"},[Dt("path",{fill:"currentColor",d:"M323.56 51.2c-20.8 19.3-39.58 39.59-56.22 59.97C240.08 73.62 206.28 35.53 168 0C69.74 91.17 0 209.96 0 281.6C0 408.85 100.29 512 224 512s224-103.15 224-230.4c0-53.27-51.98-163.14-124.44-230.4zm-19.47 340.65C282.43 407.01 255.72 416 226.86 416C154.71 416 96 368.26 96 290.75c0-38.61 24.31-72.63 72.79-130.75c6.93 7.98 98.83 125.34 98.83 125.34l58.63-66.88c4.14 6.85 7.91 13.55 11.27 19.97c27.35 52.19 15.81 118.97-33.43 153.42z"})],-1)),_m={class:"ml-1"},Em={class:"channel__program-present"},wm=["innerHTML"],Sm={class:"channel__program-present-time"},Tm={class:"channel__program-following"},Cm={class:"channel__program-following-title"},xm=Wo(()=>Dt("span",{class:"channel__program-following-title-decorate"},"NEXT",-1)),km=Wo(()=>Dt("svg",{class:"channel__program-following-title-icon iconify iconify--fluent",width:"16px",height:"16px",viewBox:"0 0 20 20"},[Dt("path",{fill:"currentColor",d:"M10.018 5.486a1 1 0 0 1 1.592-.806l5.88 4.311a1.25 1.25 0 0 1 0 2.017l-5.88 4.311a1 1 0 0 1-1.592-.806v-3.16L4.61 15.319a1 1 0 0 1-1.592-.806V5.486A1 1 0 0 1 4.61 4.68l5.408 3.966v-3.16Z"})],-1)),Rm=["innerHTML"],Im={class:"channel__program-following-time"},Lm={class:"channel__progressbar"};function Dm(_,e,s,u,A,y){const l=an("router-link"),c=an("SwiperSlide"),p=an("Swiper");return Zt(),ai("div",um,[Dt("div",hm,[Dt("div",{class:"channels-tab__buttons",style:Eo({"--tab-length":Array.from(_.channelsStore.channels_list_with_pinned_for_watch).length,"--active-tab-index":_.active_tab_index})},[(Zt(!0),ai($n,null,Xn(Array.from(_.channelsStore.channels_list_with_pinned_for_watch),([r],i)=>(Zt(),Tn(r2,{variant:"flat",class:"channels-tab__button",key:r,onClick:t=>_.active_tab_index=i},{default:hn(()=>[Bn(en(r),1)]),_:2},1032,["onClick"]))),128)),fm],4)]),Dt("div",pm,[Ai(p,{class:"channels-list","space-between":32,"auto-height":!0,"touch-start-prevent-default":!1,observer:!0,"observe-parents":!0,onSwiper:e[0]||(e[0]=r=>_.swiper_instance=r),onSlideChange:e[1]||(e[1]=r=>_.active_tab_index=r.activeIndex)},{default:hn(()=>[(Zt(!0),ai($n,null,Xn(Array.from(_.channelsStore.channels_list_with_pinned_for_watch),([r,i])=>(Zt(),Tn(c,{key:r},{default:hn(()=>[Dt("div",mm,[(Zt(!0),ai($n,null,Xn(i,t=>Si((Zt(),Tn(l,{class:"channel",draggable:"false",key:t.id,to:`/tv/watch/${t.display_channel_id}`},{default:hn(()=>[Dt("div",gm,[Dt("img",{class:"channel__broadcaster-icon",src:`${_.Utils.api_base_url}/channels/${t.id}/logo`},null,8,Am),Dt("div",ym,[Dt("span",vm,"Ch: "+en(t.channel_number)+" "+en(t.name),1),Dt("div",{class:Yi(["channel__broadcaster-force",`channel__broadcaster-force--${_.ChannelUtils.getChannelForceType(t.jikkyo_force)}`])},[bm,Dt("span",_m,en(t.jikkyo_force??"--"),1)],2)])]),Dt("div",Em,[Dt("span",{class:"channel__program-present-title",innerHTML:_.ProgramUtils.decorateProgramInfo(t.program_present,"title")},null,8,wm),Dt("span",Sm,en(_.ProgramUtils.getProgramTime(t.program_present)),1)]),Dt("div",Tm,[Dt("div",Cm,[xm,km,Dt("span",{class:"channel__program-following-title-text",innerHTML:_.ProgramUtils.decorateProgramInfo(t.program_following,"title")},null,8,Rm)]),Dt("span",Im,en(_.ProgramUtils.getProgramTime(t.program_following)),1)]),Dt("div",Lm,[Dt("div",{class:"channel__progressbar-progress",style:Eo(`width:${_.ProgramUtils.getProgramProgress(t.program_present)}%;`)},null,4)])]),_:2},1032,["to"])),[[Ri]])),128))])]),_:2},1024))),128))]),_:1})])])}const Om=Wn(dm,[["render",Dm],["__scopeId","data-v-4c8d1701"]]),Mm=er({name:"Panel-CommentTab",components:{CommentMuteSettings:f2},props:{playback_mode:{type:String,required:!0}},data(){return{Utils:Object.freeze(si),is_manual_scroll:!1,is_auto_scrolling:!1,comment_list:[],comment_list_element:null,is_comment_list_dropdown_display:!1,comment_list_dropdown_top:0,comment_list_dropdown_comment:null,comment_mute_settings_modal:!1,visibilitychange_listener:null}},computed:{...yr(Ln,cn)},watch:{"channelsStore.channel.current.id":{handler(){this.playback_mode==="Live"&&(this.comment_list=[])}}},mounted(){this.comment_list_element===null&&(this.comment_list_element=document.querySelector(".comment-list"));let _=!1;this.comment_list_element.onmousedown=y=>{if(this.comment_list_element===null)return;y.clientX-this.comment_list_element.getBoundingClientRect().left>this.comment_list_element.clientWidth&&(_=!0)},this.comment_list_element.onmouseup=y=>{if(this.comment_list_element===null)return;y.clientX-this.comment_list_element.getBoundingClientRect().left>this.comment_list_element.clientWidth&&(_=!1)};const e=()=>{_=!0,window.setTimeout(()=>_=!1,100)};let s=!1;this.comment_list_element.ontouchstart=()=>s=!0,this.comment_list_element.ontouchend=()=>s=!1,this.comment_list_element.ontouchmove=()=>s===!0?e():"",this.comment_list_element.onwheel=e,this.comment_list_element.onscroll=async()=>{this.comment_list_element!==null&&this.is_auto_scrolling===!1&&_===!0&&(this.is_manual_scroll=!0,await si.sleep(.1),this.comment_list_element.scrollTop+this.comment_list_element.offsetHeight>this.comment_list_element.scrollHeight-10&&(this.is_manual_scroll=!1))};const u=[],A=500;this.playerStore.event_emitter.on("CommentReceived",async y=>{if(y.is_initial_comments===!0)this.comment_list=[],this.comment_list.push(...y.comments),this.playback_mode==="Live"&&this.scrollCommentList();else{if(document.visibilityState==="hidden"){u.push(...y.comments);return}this.comment_list.length>=A&&this.is_manual_scroll===!1&&this.comment_list.splice(0,Math.max(0,this.comment_list.length-A)),this.comment_list.push(...y.comments),this.scrollCommentList()}}),this.playerStore.event_emitter.on("CommentSendCompleted",async y=>{this.comment_list.push(y.comment),this.scrollCommentList()}),this.visibilitychange_listener=()=>{if(document.visibilityState==="visible"){const y=this.comment_list.length+u.length;y>=A&&this.is_manual_scroll===!1&&this.comment_list.splice(0,Math.max(0,y-A)),this.comment_list.push(...u),u.length=0,this.scrollCommentList()}},document.addEventListener("visibilitychange",this.visibilitychange_listener)},beforeUnmount(){this.visibilitychange_listener!==null&&(document.removeEventListener("visibilitychange",this.visibilitychange_listener),this.visibilitychange_listener=null),this.playerStore.event_emitter.off("CommentReceived"),this.playerStore.event_emitter.off("CommentSendCompleted"),this.comment_list=[]},methods:{showCommentListDropdown(_,e){const s=this.$refs.comment_list_wrapper.getBoundingClientRect(),u=106,A=_.currentTarget.getBoundingClientRect();this.comment_list_dropdown_top=A.top-s.top,this.comment_list_dropdown_top+u>s.height&&(this.comment_list_dropdown_top=this.comment_list_dropdown_top-u+A.height),this.comment_list_dropdown_comment=e,this.is_comment_list_dropdown_display=!0},hideCommentListDropdown(){this.is_comment_list_dropdown_display=!1,this.comment_list=this.comment_list.filter(_=>ea.isMutedComment(_.text,_.user_id)===!1)},copyTextToClipboard(){this.comment_list_dropdown_comment!==null&&(navigator.clipboard.writeText(this.comment_list_dropdown_comment.text),this.hideCommentListDropdown())},addMutedKeywords(){this.comment_list_dropdown_comment!==null&&(ea.addMutedKeywords(this.comment_list_dropdown_comment.text),this.hideCommentListDropdown())},addMutedNiconicoUserIds(){this.comment_list_dropdown_comment!==null&&(ea.addMutedNiconicoUserIDs(this.comment_list_dropdown_comment.user_id),this.hideCommentListDropdown())},async scrollCommentList(_=!1){if(this.comment_list_element===null||(this.is_comment_list_dropdown_display===!0&&(this.is_manual_scroll=!0),this.is_manual_scroll===!0))return;this.is_auto_scrolling=!0;const e=(s=3)=>{s<=0||window.requestAnimationFrame(()=>{var u,A;_===!0?(u=this.comment_list_element)==null||u.scrollTo({top:this.comment_list_element.scrollHeight,left:0,behavior:"smooth"}):(A=this.comment_list_element)==null||A.scrollTo(0,this.comment_list_element.scrollHeight),e(s-1)})};e(),await si.sleep(.1),this.is_auto_scrolling=!1}}}),vr=_=>(Ir("data-v-8c440ba2"),_=_(),Lr(),_),Pm={class:"comment-container"},Bm={class:"comment-header"},Nm={class:"comment-header__title"},Fm=vr(()=>Dt("span",{class:"comment-header__title-text"},"コメント",-1)),Um=vr(()=>Dt("span",{class:"ml-1"},"ミュート設定",-1)),Gm={class:"comment-list-wrapper",ref:"comment_list_wrapper"},jm=vr(()=>Dt("span",{class:"ml-2"},"クリップボードにコピー",-1)),Vm=vr(()=>Dt("span",{class:"ml-2"},"このコメントをミュート",-1)),Hm=vr(()=>Dt("span",{class:"ml-2"},"このコメントの投稿者をミュート",-1)),zm={class:"comment__text"},Wm={class:"comment__time"},Km=["onMouseup","onTouchend"],qm=vr(()=>Dt("svg",{class:"iconify iconify--fluent",width:"20px",height:"20px",viewBox:"0 0 20 20"},[Dt("path",{fill:"currentColor",d:"M10 6.5A1.75 1.75 0 1 1 10 3a1.75 1.75 0 0 1 0 3.5ZM10 17a1.75 1.75 0 1 1 0-3.5a1.75 1.75 0 0 1 0 3.5Zm-1.75-7a1.75 1.75 0 1 0 3.5 0a1.75 1.75 0 0 0-3.5 0Z"})],-1)),Ym=[qm],Jm={key:0,class:"comment-announce"},Qm=vr(()=>Dt("div",{class:"comment-announce__heading"},"まだコメントがありません。",-1)),Zm=vr(()=>Dt("div",{class:"comment-announce__text"},[Dt("p",{class:"mt-0 mb-0"},"このチャンネルに対応するニコニコ実況のコメントが、リアルタイムで表示されます。")],-1)),Xm=[Qm,Zm],$m={key:1,class:"comment-announce"},eg=vr(()=>Dt("div",{class:"comment-announce__heading"},"コメントがありません。",-1)),tg={class:"comment-announce__text"},ig={class:"mt-0 mb-0"},ng={key:2,class:"comment-announce"},rg=vr(()=>Dt("div",{class:"comment-announce__heading"},"まだコメントがありません。",-1)),sg=vr(()=>Dt("div",{class:"comment-announce__text"},[Dt("p",{class:"mt-0 mb-0"},"この録画番組に対応する、ニコニコ実況の過去ログコメントを取得しています...")],-1)),ag=[rg,sg],og={key:3,class:"comment-announce"},lg=vr(()=>Dt("div",{class:"comment-announce__heading"},"コメントがありません。",-1)),cg={class:"comment-announce__text"},dg={class:"mt-0 mb-0"};function ug(_,e,s,u,A,y){const l=an("Icon"),c=an("DynamicScrollerItem"),p=an("DynamicScroller"),r=an("CommentMuteSettings");return Zt(),ai("div",Pm,[Dt("section",Bm,[Dt("h2",Nm,[Ai(l,{class:"comment-header__title-icon",icon:"bi:chat-left-text-fill",height:"18.5px"}),Fm]),Si((Zt(),ai("button",{class:"comment-header__button ml-auto",onClick:e[0]||(e[0]=i=>_.comment_mute_settings_modal=!_.comment_mute_settings_modal)},[Ai(l,{icon:"heroicons-solid:filter",height:"11px"}),Um])),[[Ri]])]),Dt("section",Gm,[Dt("div",{class:Yi(["comment-list-dropdown",{"comment-list-dropdown--display":_.is_comment_list_dropdown_display}]),style:Eo({"--comment-list-dropdown-top":`${_.comment_list_dropdown_top}px`})},[Ai(p2,{style:{background:"rgb(var(--v-theme-background-lighten-1))"}},{default:hn(()=>[Ai(Bl,{density:"compact",style:{"min-height":"30px"},onClick:e[1]||(e[1]=i=>_.copyTextToClipboard())},{default:hn(()=>[Ai(Nl,{class:"d-flex align-center"},{default:hn(()=>[Ai(l,{icon:"fluent:clipboard-paste-20-filled",width:"20px"}),jm]),_:1})]),_:1}),Ai(Bl,{density:"compact",style:{"min-height":"30px"},onClick:e[2]||(e[2]=i=>_.addMutedKeywords())},{default:hn(()=>[Ai(Nl,{class:"d-flex align-center"},{default:hn(()=>[Ai(l,{icon:"fluent:comment-dismiss-20-filled",width:"20px"}),Vm]),_:1})]),_:1}),Ai(Bl,{density:"compact",style:{"min-height":"30px"},onClick:e[3]||(e[3]=i=>_.addMutedNiconicoUserIds())},{default:hn(()=>[Ai(Nl,{class:"d-flex align-center"},{default:hn(()=>[Ai(l,{icon:"fluent:person-prohibited-20-filled",width:"20px"}),Hm]),_:1})]),_:1})]),_:1})],6),Dt("div",{class:Yi(["comment-list-cover",{"comment-list-cover--display":_.is_comment_list_dropdown_display}]),onClick:e[4]||(e[4]=i=>_.hideCommentListDropdown())},null,2),Ai(p,{class:"comment-list",direction:"vertical",items:_.comment_list,"min-item-size":34},{default:hn(({item:i,active:t})=>[Ai(c,{item:i,active:t,"size-dependencies":[i.text]},{default:hn(()=>[Dt("div",{class:Yi(["comment",{"comment--my-post":i.my_post}])},[Dt("span",zm,en(i.text),1),Dt("span",Wm,en(i.time),1),Si((Zt(),ai("div",{class:"comment__icon",onMouseup:n=>_.showCommentListDropdown(n,i),onTouchend:n=>_.showCommentListDropdown(n,i)},Ym,40,Km)),[[Ri,!_.Utils.isTouchDevice()]])],2)]),_:2},1032,["item","active","size-dependencies"])]),_:1},8,["items"]),_.playback_mode==="Live"&&_.playerStore.live_comment_init_failed_message===null&&_.comment_list.length===0?(Zt(),ai("div",Jm,Xm)):_n("",!0),_.playback_mode==="Live"&&_.playerStore.live_comment_init_failed_message!==null&&_.comment_list.length===0?(Zt(),ai("div",$m,[eg,Dt("div",tg,[Dt("p",ig,en(_.playerStore.live_comment_init_failed_message),1)])])):_n("",!0),_.playback_mode==="Video"&&_.playerStore.video_comment_init_failed_message===null&&_.comment_list.length===0?(Zt(),ai("div",ng,ag)):_n("",!0),_.playback_mode==="Video"&&_.playerStore.video_comment_init_failed_message!==null&&_.comment_list.length===0?(Zt(),ai("div",og,[lg,Dt("div",cg,[Dt("p",dg,en(_.playerStore.video_comment_init_failed_message),1)])])):_n("",!0)],512),Si((Zt(),ai("div",{class:Yi(["comment-scroll-button elevation-5",{"comment-scroll-button--display":_.is_manual_scroll}]),onClick:e[5]||(e[5]=i=>{_.is_manual_scroll=!1,_.scrollCommentList(!0)})},[Ai(l,{icon:"fluent:arrow-down-12-filled",height:"29px"})],2)),[[Ri]]),Ai(r,{modelValue:_.comment_mute_settings_modal,"onUpdate:modelValue":e[6]||(e[6]=i=>_.comment_mute_settings_modal=i)},null,8,["modelValue"])])}const hg=Wn(Mm,[["render",ug],["__scopeId","data-v-8c440ba2"]]),fg=er({name:"Panel-ProgramTab",data(){return{Utils:Object.freeze(si),ChannelUtils:Object.freeze(wo),ProgramUtils:Object.freeze(Vo)}},computed:{...yr(Ln)}}),ld=_=>(Ir("data-v-bbeca1ae"),_=_(),Lr(),_),pg={class:"program-container"},mg={class:"program-broadcaster"},gg=["src"],Ag={class:"program-broadcaster__number"},yg={class:"program-broadcaster__name"},vg={class:"program-info"},bg=["innerHTML"],_g={class:"program-info__time"},Eg=["innerHTML"],wg={class:"program-info__genre-container"},Sg={class:"program-info__next"},Tg=ld(()=>Dt("span",{class:"program-info__next-decorate"},"NEXT",-1)),Cg=["innerHTML"],xg={class:"program-info__next-time"},kg={class:"program-info__status"},Rg=ld(()=>Dt("span",{class:"ml-2"},"勢い:",-1)),Ig={class:"ml-2"},Lg={class:"program-info__status-viewers ml-5"},Dg=ld(()=>Dt("span",{class:"ml-2"},"視聴数:",-1)),Og={class:"ml-1"},Mg={class:"program-detail-container"},Pg={class:"program-detail__heading"},Bg=["innerHTML"];function Ng(_,e,s,u,A,y){var c,p;const l=an("Icon");return Zt(),ai("div",pg,[Dt("section",mg,[Dt("img",{class:"program-broadcaster__icon",src:`${_.Utils.api_base_url}/channels/${_.channelsStore.channel.current.id}/logo`},null,8,gg),Dt("div",Ag,"Ch: "+en(_.channelsStore.channel.current.channel_number),1),Dt("div",yg,en(_.channelsStore.channel.current.name),1)]),Dt("section",vg,[Dt("h1",{class:"program-info__title",innerHTML:_.ProgramUtils.decorateProgramInfo(_.channelsStore.channel.current.program_present,"title")},null,8,bg),Dt("div",_g,en(_.ProgramUtils.getProgramTime(_.channelsStore.channel.current.program_present)),1),Dt("div",{class:"program-info__description",innerHTML:_.ProgramUtils.decorateProgramInfo(_.channelsStore.channel.current.program_present,"description")},null,8,Eg),Dt("div",wg,[(Zt(!0),ai($n,null,Xn(((c=_.channelsStore.channel.current.program_present)==null?void 0:c.genres)??[],(r,i)=>(Zt(),ai("div",{class:"program-info__genre",key:i},en(r.major)+" / "+en(r.middle),1))),128))]),Dt("div",Sg,[Tg,Ai(l,{class:"program-info__next-icon",icon:"fluent:fast-forward-20-filled",width:"16px"})]),Dt("span",{class:"program-info__next-title",innerHTML:_.ProgramUtils.decorateProgramInfo(_.channelsStore.channel.current.program_following,"title")},null,8,Cg),Dt("div",xg,en(_.ProgramUtils.getProgramTime(_.channelsStore.channel.current.program_following)),1),Dt("div",kg,[Dt("div",{class:Yi(["program-info__status-force",`program-info__status-force--${_.ChannelUtils.getChannelForceType(_.channelsStore.channel.current.jikkyo_force)}`])},[Ai(l,{icon:"fa-solid:fire-alt",height:"14px"}),Rg,Dt("span",Ig,en(_.channelsStore.channel.current.jikkyo_force??"--")+" コメ/分",1)],2),Dt("div",Lg,[Ai(l,{icon:"fa-solid:eye",height:"14px"}),Dg,Dt("span",Og,en(_.channelsStore.channel.current.viewer_count),1)])])]),Dt("section",Mg,[(Zt(!0),ai($n,null,Xn(((p=_.channelsStore.channel.current.program_present)==null?void 0:p.detail)??{},(r,i)=>(Zt(),ai("div",{class:"program-detail",key:i},[Dt("h2",Pg,en(i),1),Dt("div",{class:"program-detail__text",innerHTML:_.Utils.URLtoLink(r)},null,8,Bg)]))),128))])])}const Fg=Wn(fg,[["render",Ng],["__scopeId","data-v-bbeca1ae"]]),Ug=er({name:"Panel-RecordedProgramTab",data(){return{Utils:Object.freeze(si),ProgramUtils:Object.freeze(Vo),comment_count:null}},computed:{...yr(cn)},created(){this.playerStore.event_emitter.on("CommentReceived",_=>{_.is_initial_comments===!0&&(this.comment_count=_.comments.length)})},beforeUnmount(){this.playerStore.event_emitter.off("CommentReceived")}}),Yf=_=>(Ir("data-v-ec2b0789"),_=_(),Lr(),_),Gg={class:"program-container"},jg={class:"program-info"},Vg=["innerHTML"],Hg={key:0,class:"program-info__broadcaster"},zg=["src"],Wg={class:"program-info__broadcaster-container"},Kg={class:"d-flex align-center"},qg={class:"program-info__broadcaster-number"},Yg={class:"program-info__broadcaster-name"},Jg={class:"program-info__broadcaster-time"},Qg=["innerHTML"],Zg={class:"program-info__genre-container"},Xg={class:"mt-5"},$g={class:"program-info__status"},e3={class:"ml-2"},t3=Yf(()=>Dt("br",null,null,-1)),i3={class:"program-info__status"},n3=Yf(()=>Dt("span",{class:"ml-2"},"コメント数:",-1)),r3={class:"ml-2"},s3={class:"program-detail-container"},a3={class:"program-detail__heading"},o3=["innerHTML"];function l3(_,e,s,u,A,y){const l=an("Icon");return Zt(),ai("div",Gg,[Dt("section",jg,[Dt("h1",{class:"program-info__title",innerHTML:_.ProgramUtils.decorateProgramInfo(_.playerStore.recorded_program,"title")},null,8,Vg),_.playerStore.recorded_program.channel!==null?(Zt(),ai("div",Hg,[Dt("img",{class:"program-info__broadcaster-icon",src:`${_.Utils.api_base_url}/channels/${_.playerStore.recorded_program.channel.id}/logo`},null,8,zg),Dt("div",Wg,[Dt("div",Kg,[Dt("div",qg,"Ch: "+en(_.playerStore.recorded_program.channel.channel_number),1),Dt("div",Yg,en(_.playerStore.recorded_program.channel.name),1)]),Dt("div",Jg,en(_.ProgramUtils.getProgramTime(_.playerStore.recorded_program)),1)])])):_n("",!0),Dt("div",{class:"program-info__description",innerHTML:_.ProgramUtils.decorateProgramInfo(_.playerStore.recorded_program,"description")},null,8,Qg),Dt("div",Zg,[(Zt(!0),ai($n,null,Xn(_.playerStore.recorded_program.genres??[],(c,p)=>(Zt(),ai("div",{class:"program-info__genre",key:p},en(c.major)+" / "+en(c.middle),1))),128))]),Dt("div",Xg,[Dt("div",$g,[Ai(l,{icon:"ic:round-date-range",height:"17px",style:{"margin-left":"-2px","margin-right":"-1.7px","margin-bottom":"-3px"}}),Dt("span",e3,"録画期間: "+en(_.playerStore.recorded_program.is_partially_recorded?"(一部のみ録画)":""),1),t3,Dt("span",null,en(_.ProgramUtils.getRecordingTime(_.playerStore.recorded_program)),1)]),Dt("div",i3,[Ai(l,{icon:"bi:chat-left-text-fill",height:"12.5px",style:{"margin-bottom":"-3px"}}),n3,Dt("span",r3,en(_.comment_count??"--"),1)])])]),Dt("section",s3,[(Zt(!0),ai($n,null,Xn(_.playerStore.recorded_program.detail??{},(c,p)=>(Zt(),ai("div",{class:"program-detail",key:p},[Dt("h2",a3,en(p),1),Dt("div",{class:"program-detail__text",innerHTML:_.Utils.URLtoLink(c)},null,8,o3)]))),128))])])}const c3=Wn(Ug,[["render",l3],["__scopeId","data-v-ec2b0789"]]),d3=er({name:"Panel-Remocon",props:{modelValue:{type:Boolean,required:!0}},emits:{"update:modelValue":_=>!0}}),cd=_=>(Ir("data-v-f40c5aaa"),_=_(),Lr(),_),u3={class:"remote-control-data-broadcasting remote-control-data-broadcasting--disabled"},h3={class:"remote-control__directional-key"},f3={class:"remote-control-button-up","data-arib-key-code":"1"},p3={class:"remote-control-button-left","data-arib-key-code":"3"},m3={class:"remote-control-button-select","data-arib-key-code":"18"},g3={class:"remote-control-button-right","data-arib-key-code":"4"},A3={class:"remote-control-button-down","data-arib-key-code":"2"},y3={class:"remote-control__control-key"},v3={class:"remote-control-button-data","data-arib-key-code":"20"},b3=cd(()=>Dt("svg",{width:"20px",height:"20px",viewBox:"0 0 512 512"},[Dt("path",{fill:"currentColor",d:"M248.039 381.326L355.039 67.8258C367.539 28.3257 395.039 34.3258 406.539 34.3258C431.039 34.3258 453.376 61.3258 441.039 96.8258C362.639 322.426 343.539 375.326 340.539 384.826C338.486 391.326 342.039 391.326 345.539 391.326C377.039 391.326 386.539 418.326 386.539 435.326C386.539 458.826 371.539 477.326 350.039 477.326H214.539C179.039 477.326 85.8269 431.3 88.0387 335.826C91.0387 206.326 192.039 183.326 243.539 183.326H296.539L265.539 272.326H243.539C185.539 272.326 174.113 314.826 176.039 334.326C180.039 374.826 215.039 389.814 237.039 390.326C244.539 390.5 246.039 386.826 248.039 381.326Z"})],-1)),_3=cd(()=>Dt("span",{class:"ml-1"},"データ",-1)),E3=[b3,_3],w3={class:"remote-control-button-back","data-arib-key-code":"19"},S3=cd(()=>Dt("span",{class:"ml-1"},"戻る",-1)),T3={class:"remote-control-button-blue bg-blue-darken-3","data-arib-key-code":"21"},C3={class:"remote-control-button-red bg-red-darken-3","data-arib-key-code":"22"},x3={class:"remote-control-button-green bg-green-darken-3","data-arib-key-code":"23"},k3={class:"remote-control-button-yellow bg-yellow-darken-3 text-text","data-arib-key-code":"24"},R3={class:"remote-control__number-key"},I3={"data-remocon-id":"1","data-arib-key-code":"6"},L3={"data-remocon-id":"2","data-arib-key-code":"7"},D3={"data-remocon-id":"3","data-arib-key-code":"8"},O3={"data-remocon-id":"4","data-arib-key-code":"9"},M3={"data-remocon-id":"5","data-arib-key-code":"10"},P3={"data-remocon-id":"6","data-arib-key-code":"11"},B3={"data-remocon-id":"7","data-arib-key-code":"12"},N3={"data-remocon-id":"8","data-arib-key-code":"13"},F3={"data-remocon-id":"9","data-arib-key-code":"14"},U3={"data-remocon-id":"10","data-arib-key-code":"15"},G3={"data-remocon-id":"11","data-arib-key-code":"16"},j3={"data-remocon-id":"12","data-arib-key-code":"17"};function V3(_,e,s,u,A,y){const l=an("Icon");return Zt(),ai("div",{class:Yi(["remote-control-container",{"remote-control-container--showing":_.modelValue}]),onClick:e[2]||(e[2]=c=>_.$emit("update:modelValue",!1))},[Dt("div",{class:"remote-control elevation-6",onClick:e[1]||(e[1]=ta(()=>{},["stop"]))},[Si((Zt(),ai("div",{class:"remote-control__close d-flex align-center rounded-circle cursor-pointer px-2 py-2",onClick:e[0]||(e[0]=c=>_.$emit("update:modelValue",!1))},[Ai(l,{icon:"fluent:dismiss-12-filled",width:"23px",height:"23px"})])),[[Ri]]),Dt("div",u3,[Ai(Pf,{indeterminate:"",size:"60",width:"6",class:"remote-control__loading"}),Dt("div",h3,[Si((Zt(),ai("button",f3,[Ai(l,{icon:"fluent:chevron-up-12-filled",width:"26px",height:"26px"})])),[[Ri]]),Si((Zt(),ai("button",p3,[Ai(l,{icon:"fluent:chevron-left-12-filled",width:"26px",height:"26px"})])),[[Ri]]),Si((Zt(),ai("button",m3,[Bn(" 決定 ")])),[[Ri]]),Si((Zt(),ai("button",g3,[Ai(l,{icon:"fluent:chevron-right-12-filled",width:"26px",height:"26px"})])),[[Ri]]),Si((Zt(),ai("button",A3,[Ai(l,{icon:"fluent:chevron-down-12-filled",width:"26px",height:"26px"})])),[[Ri]])]),Dt("div",y3,[Si((Zt(),ai("button",v3,E3)),[[Ri]]),Si((Zt(),ai("button",w3,[Ai(l,{icon:"fluent:arrow-left-12-filled",width:"20px"}),S3])),[[Ri]]),Si((Zt(),ai("button",T3,[Bn("青")])),[[Ri]]),Si((Zt(),ai("button",C3,[Bn("赤")])),[[Ri]]),Si((Zt(),ai("button",x3,[Bn("緑")])),[[Ri]]),Si((Zt(),ai("button",k3,[Bn("黄")])),[[Ri]])])]),Dt("div",R3,[Si((Zt(),ai("button",I3,[Bn("1")])),[[Ri]]),Si((Zt(),ai("button",L3,[Bn("2")])),[[Ri]]),Si((Zt(),ai("button",D3,[Bn("3")])),[[Ri]]),Si((Zt(),ai("button",O3,[Bn("4")])),[[Ri]]),Si((Zt(),ai("button",M3,[Bn("5")])),[[Ri]]),Si((Zt(),ai("button",P3,[Bn("6")])),[[Ri]]),Si((Zt(),ai("button",B3,[Bn("7")])),[[Ri]]),Si((Zt(),ai("button",N3,[Bn("8")])),[[Ri]]),Si((Zt(),ai("button",F3,[Bn("9")])),[[Ri]]),Si((Zt(),ai("button",U3,[Bn("10")])),[[Ri]]),Si((Zt(),ai("button",G3,[Bn("11")])),[[Ri]]),Si((Zt(),ai("button",j3,[Bn("12")])),[[Ri]])])])],2)}const H3=Wn(d3,[["render",V3],["__scopeId","data-v-f40c5aaa"]]),z3=er({name:"Panel-SeriesTab",data(){return{Utils:Object.freeze(si)}},computed:{...yr(cn)}}),W3={class:"series-container"};function K3(_,e,s,u,A,y){return Zt(),ai("div",W3," 鋭意実装中… ")}const q3=Wn(z3,[["render",K3],["__scopeId","data-v-4d1178da"]]),Cs=_=>(Ir("data-v-e5c539a9"),_=_(),Lr(),_),Y3={class:"tab-content tab-content--capture"},J3={class:"zoom-capture-modal"},Q3=["src"],Z3=["href","download"],X3={class:"captures"},$3=["onClick"],eA=["src"],tA=Cs(()=>Dt("div",{class:"capture__disabled-cover"},null,-1)),iA={class:"capture__selected-number"},nA=Cs(()=>Dt("svg",{class:"capture__selected-checkmark iconify iconify--fluent",width:"1em",height:"1em",viewBox:"0 0 16 16"},[Dt("path",{fill:"currentColor",d:"M8 2a6 6 0 1 1 0 12A6 6 0 0 1 8 2Zm2.12 4.164L7.25 9.042L5.854 7.646a.5.5 0 1 0-.708.708l1.75 1.75a.5.5 0 0 0 .708 0l3.224-3.234a.5.5 0 0 0-.708-.706Z"})],-1)),rA=Cs(()=>Dt("div",{class:"capture__selected-border"},null,-1)),sA=Cs(()=>Dt("div",{class:"capture__focused-border"},null,-1)),aA=["onClick"],oA=Cs(()=>Dt("svg",{class:"iconify iconify--fluent",width:"32px",height:"32px",viewBox:"0 0 16 16"},[Dt("path",{fill:"currentColor",d:"M7 4.5a.5.5 0 0 0-1 0V6H4.5a.5.5 0 0 0 0 1H6v1.5a.5.5 0 0 0 1 0V7h1.5a.5.5 0 0 0 0-1H7V4.5ZM6.5 11a4.481 4.481 0 0 0 2.809-.984l3.837 3.838a.5.5 0 0 0 .708-.708L10.016 9.31A4.5 4.5 0 1 0 6.5 11Zm0-8a3.5 3.5 0 1 1 0 7a3.5 3.5 0 0 1 0-7Z"})],-1)),lA=[oA],cA={class:"capture-announce"},dA=Cs(()=>Dt("div",{class:"capture-announce__heading"},"まだキャプチャがありません。",-1)),uA=Cs(()=>Dt("div",{class:"capture-announce__text"},[Dt("p",{class:"mt-0 mb-0"},"プレイヤーのキャプチャボタンやショートカットキーでキャプチャを撮ると、ここに表示されます。"),Dt("p",{class:"mt-2 mb-0"},"表示されたキャプチャを選択してからツイートすると、キャプチャを付けてツイートできます。")],-1)),hA=[dA,uA],fA=er({__name:"Captures",setup(_){const e=cn();function s(u){e.twitter_selected_capture_blobs.length<4&&u.selected===!1?(u.selected=!0,e.twitter_selected_capture_blobs.push(u.blob)):(e.twitter_selected_capture_blobs=e.twitter_selected_capture_blobs.filter(A=>A!==u.blob),u.selected=!1)}return(u,A)=>{const y=an("Icon");return Zt(),ai("div",Y3,[Ai(Bf,{"content-class":"zoom-capture-modal-container","max-width":"980",transition:"slide-y-transition",modelValue:Jn(e).twitter_zoom_capture_modal,"onUpdate:modelValue":A[0]||(A[0]=l=>Jn(e).twitter_zoom_capture_modal=l)},{default:hn(()=>[Dt("div",J3,[Dt("img",{class:"zoom-capture-modal__image",src:Jn(e).twitter_zoom_capture?Jn(e).twitter_zoom_capture.image_url:""},null,8,Q3),Si((Zt(),ai("a",{class:"zoom-capture-modal__download",href:Jn(e).twitter_zoom_capture?Jn(e).twitter_zoom_capture.image_url:"",download:Jn(e).twitter_zoom_capture?Jn(e).twitter_zoom_capture.filename:""},[Ai(y,{icon:"fa6-solid:download",width:"45px"})],8,Z3)),[[Ri]])])]),_:1},8,["modelValue"]),Dt("div",X3,[(Zt(!0),ai($n,null,Xn(Jn(e).twitter_captures,l=>(Zt(),ai("div",{class:Yi(["capture",{"capture--selected":l.selected,"capture--focused":l.focused,"capture--disabled":!l.selected&&Jn(e).twitter_selected_capture_blobs.length>=4}]),key:l.image_url,onClick:c=>s(l)},[Dt("img",{class:"capture__image",src:l.image_url},null,8,eA),tA,Dt("div",iA,en(Jn(e).twitter_selected_capture_blobs.findIndex(c=>c===l.blob)+1),1),nA,rA,sA,Si((Zt(),ai("div",{class:"capture__zoom",onClick:ta(c=>{Jn(e).twitter_zoom_capture_modal=!0,Jn(e).twitter_zoom_capture=l},["prevent","stop"]),onMousedown:A[1]||(A[1]=ta(()=>{},["prevent","stop"]))},lA,40,aA)),[[Ri]])],10,$3))),128))]),Si(Dt("div",cA,hA,512),[[rd,Jn(e).twitter_captures.length===0]])])}}}),pA=Wn(fA,[["__scopeId","data-v-e5c539a9"]]),mA={},gA={class:"tab-content tab-content--search"},AA=Dt("div",{class:"search px-4"}," リアルタイム検索機能は鋭意開発中です。 ",-1),yA=[AA];function vA(_,e){return Zt(),ai("div",gA,yA)}const bA=Wn(mA,[["render",vA]]),_A={},EA={class:"tab-content tab-content--timeline"},wA=Dt("div",{class:"search px-4"}," タイムライン機能は鋭意開発中です。 ",-1),SA=[wA];function TA(_,e){return Zt(),ai("div",EA,SA)}const CA=Wn(_A,[["render",TA]]),xA=er({name:"Panel-TwitterTab",components:{draggable:m2,TwitterCaptures:pA,TwitterSearch:bA,TwitterTimeline:CA},props:{playback_mode:{type:String,required:!0}},data(){return{Utils:Object.freeze(si),is_logged_in_twitter:!1,selected_twitter_account:null,is_twitter_account_list_display:!1,saved_twitter_hashtags:Sn().settings.saved_twitter_hashtags.map((_,e)=>({id:si.time()+e,text:_,editing:!1})),is_hashtag_list_display:!1,captures_element:null,is_tweet_hashtag_form_focused:!1,is_tweet_text_form_focused:!1,tweet_hashtag:"",tweet_text:"",tweet_letter_remain_count:140,is_tweet_sending:!1}},computed:{...yr(Ln,cn,Sn,Rc),is_tweet_button_disabled(){return this.is_logged_in_twitter===!1||this.tweet_letter_remain_count<0||(this.tweet_text.trim()===""||this.tweet_letter_remain_count===140)&&this.playerStore.twitter_selected_capture_blobs.length===0}},watch:{"channelsStore.channel.current.name":{handler(_,e){if(this.playback_mode==="Live"){const s=wo.getChannelHashtag(e)??"";this.tweet_hashtag=this.formatHashtag(this.tweet_hashtag.replaceAll(s,"")),this.updateTweetLetterCount(),this.settingsStore.settings.reset_hashtag_when_program_switches===!0&&(this.tweet_hashtag=this.formatHashtag(""),this.updateTweetLetterCount())}}},"channelsStore.channel.current.program_present":{deep:!0,handler(_,e){this.playback_mode==="Live"&&(_==null?void 0:_.id)!==(e==null?void 0:e.id)&&this.settingsStore.settings.reset_hashtag_when_program_switches===!0&&(this.tweet_hashtag=this.formatHashtag(""),this.updateTweetLetterCount())}},saved_twitter_hashtags:{deep:!0,handler(){this.settingsStore.settings.saved_twitter_hashtags=this.saved_twitter_hashtags.map(_=>_.text)}}},async created(){if(await this.userStore.fetchUser(),this.userStore.is_logged_in===!0&&this.userStore.user&&this.userStore.user.twitter_accounts.length>0){this.is_logged_in_twitter=!0,(this.settingsStore.settings.selected_twitter_account_id===null||!this.userStore.user.twitter_accounts.some(e=>e.id===this.settingsStore.settings.selected_twitter_account_id))&&(this.settingsStore.settings.selected_twitter_account_id=this.userStore.user.twitter_accounts[0].id);const _=this.userStore.user.twitter_accounts.findIndex(e=>e.id===this.settingsStore.settings.selected_twitter_account_id);this.selected_twitter_account=this.userStore.user.twitter_accounts[_]}this.tweet_hashtag=this.formatHashtag(this.tweet_hashtag),this.updateTweetLetterCount(),this.playerStore.event_emitter.on("CaptureCompleted",async _=>{this.addCaptureList(_.capture,_.filename)})},beforeUnmount(){for(const _ of this.playerStore.twitter_captures)URL.revokeObjectURL(_.image_url);this.playerStore.event_emitter.off("CaptureCompleted")},methods:{updateTweetLetterCount(){this.tweet_letter_remain_count=140-[...this.tweet_hashtag].length-[...this.tweet_text].length},pasteClipboardData(_){if(_.clipboardData!==null){for(const e of _.clipboardData.items)if(e.type.startsWith("image/")){const s=e.getAsFile();s&&this.addCaptureList(s,s.name)}}},clickHashtagListButton(){this.is_hashtag_list_display=!this.is_hashtag_list_display;for(const _ of this.saved_twitter_hashtags)_.editing=!1},clickHashtag(_){this.tweet_hashtag=_.text,this.tweet_hashtag=this.formatHashtag(this.tweet_hashtag),this.updateTweetLetterCount(),window.setTimeout(()=>this.is_hashtag_list_display=!1,150)},clickAccountButton(){if(!this.is_logged_in_twitter){document.fullscreenElement&&document.exitFullscreen(),this.$router.push({path:"/settings/twitter"});return}this.is_twitter_account_list_display=!this.is_twitter_account_list_display,this.is_twitter_account_list_display===!0&&(this.is_hashtag_list_display=!1)},updateSelectedTwitterAccount(_){this.settingsStore.settings.selected_twitter_account_id=_.id,this.selected_twitter_account=_,window.setTimeout(()=>this.is_twitter_account_list_display=!1,150)},addCaptureList(_,e){this.captures_element===null&&(this.captures_element=document.querySelector(".tab-content--capture")),this.playerStore.twitter_captures.length>100&&(URL.revokeObjectURL(this.playerStore.twitter_captures[0].image_url),this.playerStore.twitter_selected_capture_blobs=this.playerStore.twitter_selected_capture_blobs.filter(u=>u!==this.playerStore.twitter_captures[0].blob),this.playerStore.twitter_captures.shift());const s=URL.createObjectURL(_);this.playerStore.twitter_captures.push({blob:_,filename:e,image_url:s,selected:!1,focused:!1}),this.$nextTick(()=>{this.captures_element!==null&&this.captures_element.scrollTo({top:this.captures_element.scrollHeight,behavior:"smooth"})})},async drawProgramTitleOnCapture(_){var y;const e=await createImageBitmap(_),s="OffscreenCanvas"in window?new OffscreenCanvas(e.width,e.height):document.createElement("canvas"),u=s.getContext("2d",{alpha:!1,desynchronized:!0,willReadFrequently:!1});u.drawImage(e,0,0),e.close(),u.font='bold 22px "Open Sans", "YakuHanJPs", "Twemoji", "Hiragino Sans", "Noto Sans JP", sans-serif',u.fillStyle="rgba(255, 255, 255, 70%)",u.shadowColor="rgba(0, 0, 0, 100%)",u.shadowBlur=4,u.shadowOffsetX=0,u.shadowOffsetY=0;let A;switch(this.playback_mode==="Live"?A=((y=this.channelsStore.channel.current.program_present)==null?void 0:y.title)??"放送休止":A=this.playerStore.recorded_program.title,this.settingsStore.settings.tweet_capture_watermark_position){case"TopLeft":{u.textAlign="left",u.textBaseline="top",u.fillText(A,16,12);break}case"TopRight":{u.textAlign="right",u.textBaseline="top",u.fillText(A,s.width-16,12);break}case"BottomLeft":{u.textAlign="left",u.textBaseline="bottom",u.fillText(A,16,s.height-12);break}case"BottomRight":{u.textAlign="right",u.textBaseline="bottom",u.fillText(A,s.width-16,s.height-12);break}}return s instanceof OffscreenCanvas?await s.convertToBlob({type:"image/jpeg",quality:1}):new Promise((l,c)=>s.toBlob(p=>{p===null?c():l(p)},"image/jpeg",1))},formatHashtag(_,e=!1){const s=_.trim().replaceAll("♯","#").replaceAll("#","#").replace(/#{2,}/g,"#").replaceAll(" "," ").replaceAll(/ +/g," ").split(" ").filter(u=>u!=="");for(let u in s)s[u].startsWith("#")||(s[u]=`#${s[u]}`);if(this.playback_mode==="Live"&&this.settingsStore.settings.auto_add_watching_channel_hashtag===!0&&e===!1){const u=wo.getChannelHashtag(this.channelsStore.channel.current.name);u!==null&&s.includes(u)===!1&&s.push(u)}return s.join(" ")},async sendTweet(){if(this.selected_twitter_account===null||this.is_tweet_sending===!0)return;this.is_tweet_sending=!0,this.tweet_hashtag=this.formatHashtag(this.tweet_hashtag);const _=this.tweet_hashtag;this.updateTweetLetterCount();let e=this.tweet_text;if(_!=="")switch(this.settingsStore.settings.tweet_hashtag_position){case"Prepend":{e=`${_} ${this.tweet_text}`;break}case"Append":{e=`${this.tweet_text} ${_}`;break}case"PrependWithLineBreak":{e=`${_} ${this.tweet_text}`;break}case"AppendWithLineBreak":{e=`${this.tweet_text} -${_}`;break}}const s=[];for(let u of this.playerStore.twitter_selected_capture_blobs)this.settingsStore.settings.tweet_capture_watermark_position!=="None"&&(u=await this.drawProgramTitleOnCapture(u)),s.push(u);this.tweet_text="",this.updateTweetLetterCount();for(const u of this.playerStore.twitter_captures)u.selected=!1,u.focused=!1;this.playerStore.twitter_selected_capture_blobs=[],m2.sendTweet(this.selected_twitter_account.screen_name,e,s).then(u=>{this.playerStore.event_emitter.emit("SendNotification",{message:u.message,color:u.is_error?"#FF6F6A":void 0})}),this.is_tweet_sending=!1,this.settingsStore.settings.fold_panel_after_sending_tweet===!0&&(this.playerStore.is_panel_display=!1,this.$refs.tweet_text.blur())}}}),Dr=_=>(Ir("data-v-894b4344"),_=_(),Lr(),_),xA={class:"twitter-container"},kA={class:"tab-container"},RA={class:"tab-button-container"},IA=Dr(()=>Dt("span",{class:"tab-button__text"},"ツイート検索",-1)),LA=Dr(()=>Dt("span",{class:"tab-button__text"},"タイムライン",-1)),DA=Dr(()=>Dt("span",{class:"tab-button__text"},"キャプチャ",-1)),OA={class:"tweet-form__hashtag"},MA={class:"tweet-form__control"},PA=["src"],BA={class:"account-button__screen-name"},NA={class:"limit-meter"},FA={class:"limit-meter__content"},UA=["disabled"],GA=Dr(()=>Dt("span",{class:"ml-1"},"ツイート",-1)),jA={class:"hashtag-heading"},VA={class:"hashtag-heading__text"},HA=Dr(()=>Dt("span",{class:"ml-1"},"ハッシュタグリスト",-1)),zA=Dr(()=>Dt("span",{class:"ml-1"},"追加",-1)),WA=["onClick"],KA=["onUpdate:modelValue","disabled"],qA=["onClick"],YA={key:0,class:"iconify iconify--fluent",width:"17px",height:"17px",viewBox:"0 0 16 16"},JA=Dr(()=>Dt("path",{fill:"currentColor",d:"M10.529 1.764a2.621 2.621 0 1 1 3.707 3.707l-.779.779L9.75 2.543l.779-.779ZM9.043 3.25L2.657 9.636a2.955 2.955 0 0 0-.772 1.354l-.87 3.386a.5.5 0 0 0 .61.608l3.385-.869a2.95 2.95 0 0 0 1.354-.772l6.386-6.386L9.043 3.25Z"},null,-1)),QA=[JA],ZA={key:1,class:"iconify iconify--fluent",width:"17px",height:"17px",viewBox:"0 0 16 16"},XA=Dr(()=>Dt("path",{fill:"currentColor",d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032Z"},null,-1)),$A=[XA],ey=["onClick"],ty=Dr(()=>Dt("svg",{class:"iconify iconify--fluent",width:"17px",height:"17px",viewBox:"0 0 16 16"},[Dt("path",{fill:"currentColor",d:"M7 3h2a1 1 0 0 0-2 0ZM6 3a2 2 0 1 1 4 0h4a.5.5 0 0 1 0 1h-.564l-1.205 8.838A2.5 2.5 0 0 1 9.754 15H6.246a2.5 2.5 0 0 1-2.477-2.162L2.564 4H2a.5.5 0 0 1 0-1h4Zm1 3.5a.5.5 0 0 0-1 0v5a.5.5 0 0 0 1 0v-5ZM9.5 6a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 1 0v-5a.5.5 0 0 0-.5-.5Z"})],-1)),iy=[ty],ny=Dr(()=>Dt("div",{class:"hashtag__sort-handle"},[Dt("svg",{class:"iconify iconify--material-symbols",width:"17px",height:"17px",viewBox:"0 0 24 24"},[Dt("path",{fill:"currentColor",d:"M5 15q-.425 0-.713-.288T4 14q0-.425.288-.713T5 13h14q.425 0 .713.288T20 14q0 .425-.288.713T19 15H5Zm0-4q-.425 0-.713-.288T4 10q0-.425.288-.713T5 9h14q.425 0 .713.288T20 10q0 .425-.288.713T19 11H5Z"})])],-1)),ry=["onClick"],sy=["src"],ay={class:"twitter-account__info"},oy={class:"twitter-account__name"},ly={class:"twitter-account__screen-name"},cy={class:"twitter-account__check iconify iconify--fluent",width:"24px",height:"24px",viewBox:"0 0 16 16"},dy=Dr(()=>Dt("path",{fill:"currentColor",d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032Z"},null,-1)),uy=[dy];function hy(_,e,s,u,y,A){var t,n;const l=an("TwitterSearch"),c=an("TwitterTimeline"),p=an("TwitterCaptures"),r=an("Icon"),i=an("draggable");return Zt(),ai("div",xA,[Dt("div",kA,[Ai(l,{class:Yi({"tab-content--active":_.playerStore.twitter_active_tab==="Search"})},null,8,["class"]),Ai(c,{class:Yi({"tab-content--active":_.playerStore.twitter_active_tab==="Timeline"})},null,8,["class"]),Ai(p,{class:Yi({"tab-content--active":_.playerStore.twitter_active_tab==="Capture"})},null,8,["class"])]),Dt("div",RA,[Si((Zt(),ai("div",{class:Yi(["tab-button",{"tab-button--active":_.playerStore.twitter_active_tab==="Search"}]),onClick:e[0]||(e[0]=a=>_.playerStore.twitter_active_tab="Search")},[Ai(r,{icon:"fluent:search-16-filled",height:"18px"}),IA],2)),[[Ri]]),Si((Zt(),ai("div",{class:Yi(["tab-button",{"tab-button--active":_.playerStore.twitter_active_tab==="Timeline"}]),onClick:e[1]||(e[1]=a=>_.playerStore.twitter_active_tab="Timeline")},[Ai(r,{icon:"fluent:home-16-regular",height:"18px"}),LA],2)),[[Ri]]),Si((Zt(),ai("div",{class:Yi(["tab-button",{"tab-button--active":_.playerStore.twitter_active_tab==="Capture"}]),onClick:e[2]||(e[2]=a=>_.playerStore.twitter_active_tab="Capture")},[Ai(r,{icon:"fluent:image-copy-20-regular",height:"18px"}),DA],2)),[[Ri]])]),Dt("div",{class:Yi(["tweet-form",{"tweet-form--focused":_.is_tweet_hashtag_form_focused||_.is_tweet_text_form_focused,"tweet-form--virtual-keyboard-display":_.playerStore.is_virtual_keyboard_display&&(_.Utils.hasActiveElementClass("tweet-form__hashtag-form")||_.Utils.hasActiveElementClass("tweet-form__textarea"))&&(_.is_hashtag_list_display=!1,!0)}])},[Dt("div",OA,[Si(Dt("input",{class:"tweet-form__hashtag-form",type:"search",placeholder:"#ハッシュタグ",spellcheck:"false","onUpdate:modelValue":e[3]||(e[3]=a=>_.tweet_hashtag=a),onInput:e[4]||(e[4]=a=>_.updateTweetLetterCount()),onFocus:e[5]||(e[5]=a=>_.is_tweet_hashtag_form_focused=!0),onBlur:e[6]||(e[6]=a=>_.is_tweet_hashtag_form_focused=!1),onChange:e[7]||(e[7]=a=>{_.tweet_hashtag=_.formatHashtag(_.tweet_hashtag),_.updateTweetLetterCount()})},null,544),[[Ml,_.tweet_hashtag]]),Si((Zt(),ai("div",{class:"tweet-form__hashtag-list-button",onClick:e[8]||(e[8]=a=>_.clickHashtagListButton())},[Ai(r,{icon:"fluent:clipboard-text-ltr-32-regular",height:"22px"})])),[[Ri]])]),Si(Dt("textarea",{class:"tweet-form__textarea",placeholder:"ツイート",spellcheck:"false","onUpdate:modelValue":e[9]||(e[9]=a=>_.tweet_text=a),ref:"tweet_text",onInput:e[10]||(e[10]=a=>_.updateTweetLetterCount()),onPaste:e[11]||(e[11]=a=>_.pasteClipboardData(a)),onFocus:e[12]||(e[12]=a=>_.is_tweet_text_form_focused=!0),onBlur:e[13]||(e[13]=a=>_.is_tweet_text_form_focused=!1)},` - `,544),[[Ml,_.tweet_text]]),Dt("div",MA,[Si((Zt(),ai("div",{class:Yi(["account-button",{"account-button--no-login":!_.is_logged_in_twitter}]),onClick:e[14]||(e[14]=a=>_.clickAccountButton())},[Dt("img",{class:"account-button__icon",src:_.is_logged_in_twitter?(t=_.selected_twitter_account)==null?void 0:t.icon_url:"/assets/images/account-icon-default.png"},null,8,PA),Dt("span",BA,en(_.is_logged_in_twitter?`@${(n=_.selected_twitter_account)==null?void 0:n.screen_name}`:"連携されていません"),1),Ai(r,{class:"account-button__menu",icon:"fluent:more-circle-20-regular",width:"22px"})],2)),[[Ri]]),Dt("div",NA,[Dt("div",{class:Yi(["limit-meter__content",{"limit-meter__content--yellow":_.tweet_letter_remain_count<=20,"limit-meter__content--red":_.tweet_letter_remain_count<=0}])},[Ai(r,{icon:"fa-brands:twitter",width:"12px",style:{"margin-right":"-2px"}}),Dt("span",null,en(_.tweet_letter_remain_count),1)],2),Dt("div",FA,[Ai(r,{icon:"fluent:image-16-filled",width:"14px"}),Dt("span",null,en(_.playerStore.twitter_selected_capture_blobs.length)+"/4",1)])]),Si((Zt(),ai("button",{class:"tweet-button",disabled:_.is_tweet_button_disabled,onClick:e[15]||(e[15]=a=>_.is_tweet_button_disabled===!1&&_.sendTweet()),onTouchstart:e[16]||(e[16]=a=>_.is_tweet_button_disabled===!1&&_.sendTweet())},[Ai(r,{icon:"fa-brands:twitter",height:"16px"}),GA],40,UA)),[[Ri]])])],2),Dt("div",{class:Yi(["hashtag-list",{"hashtag-list--display":_.is_hashtag_list_display,"hashtag-list--virtual-keyboard-display":_.playerStore.is_virtual_keyboard_display&&_.Utils.hasActiveElementClass("hashtag__input")}])},[Dt("div",jA,[Dt("div",VA,[Ai(r,{icon:"charm:hash",width:"17px"}),HA]),Si((Zt(),ai("button",{class:"hashtag-heading__add-button",onClick:e[17]||(e[17]=a=>_.saved_twitter_hashtags.push({id:_.Utils.time(),text:"#ここにハッシュタグを入力",editing:!1}))},[Ai(r,{icon:"fluent:add-12-filled",width:"17px"}),zA])),[[Ri]])]),Ai(i,{class:"hashtag-container",handle:".hashtag__sort-handle","item-key":"id",modelValue:_.saved_twitter_hashtags,"onUpdate:modelValue":e[19]||(e[19]=a=>_.saved_twitter_hashtags=a)},{item:hn(({element:a})=>[Si((Zt(),ai("div",{class:Yi(["hashtag",{"hashtag--editing":a.editing}]),onClick:o=>_.clickHashtag(a)},[Si(Dt("input",{type:"search",class:"hashtag__input",spellcheck:"false","onUpdate:modelValue":o=>a.text=o,disabled:!a.editing,onClick:e[18]||(e[18]=ta(()=>{},["stop"]))},null,8,KA),[[Ml,a.text]]),Si((Zt(),ai("button",{class:"hashtag__edit-button",onClick:ta(o=>{a.editing=!a.editing,a.text=_.formatHashtag(a.text,!0),_.updateTweetLetterCount()},["prevent","stop"])},[a.editing===!1?(Zt(),ai("svg",YA,QA)):_n("",!0),a.editing===!0?(Zt(),ai("svg",ZA,$A)):_n("",!0)],8,qA)),[[Ri]]),Si((Zt(),ai("button",{class:"hashtag__delete-button",onClick:ta(o=>_.saved_twitter_hashtags.splice(_.saved_twitter_hashtags.indexOf(a),1),["prevent","stop"])},iy,8,ey)),[[Ri]]),ny],10,WA)),[[Ri,!a.editing]])]),_:1},8,["modelValue"])],2),Dt("div",{class:Yi(["twitter-account-list",{"twitter-account-list--display":_.is_twitter_account_list_display}])},[(Zt(!0),ai($n,null,Xn(_.userStore.user?_.userStore.user.twitter_accounts:[],a=>Si((Zt(),ai("div",{class:"twitter-account",key:a.id,onClick:o=>_.updateSelectedTwitterAccount(a)},[Dt("img",{class:"twitter-account__icon",src:a.icon_url},null,8,sy),Dt("div",ay,[Dt("div",oy,en(a.name),1),Dt("div",ly,"@"+en(a.screen_name),1)]),Si((Zt(),ai("svg",cy,uy,512)),[[rd,a.id===_.settingsStore.settings.selected_twitter_account_id]])],8,ry)),[[Ri]])),128))],2)])}const fy=Wn(CA,[["render",hy],["__scopeId","data-v-894b4344"]]),py=er({name:"Watch-Panel",components:{Channel:Dm,Comment:ug,Program:Ng,RecordedProgram:l3,Remocon:V3,Series:K3,Twitter:fy},props:{playback_mode:{type:String,required:!0}},data(){return{Utils:Object.freeze(si)}},computed:{...yr(Ln,cn),panel_active_tab(){return this.playback_mode==="Live"?this.playerStore.tv_panel_active_tab:this.playerStore.video_panel_active_tab}}}),xs=_=>(Ir("data-v-02bb8a53"),_=_(),Lr(),_),my={class:"watch-panel__header"},gy=xs(()=>Dt("span",{class:"panel-close-button__text"},"閉じる",-1)),Ay={key:0,class:"panel-broadcaster"},yy=["src"],vy={class:"panel-broadcaster__number"},by={class:"panel-broadcaster__name"},_y={class:"watch-panel__content-container"},Ey={class:"watch-panel__navigation"},wy=xs(()=>Dt("span",{class:"panel-navigation-button__text"},"番組情報",-1)),Sy=xs(()=>Dt("span",{class:"panel-navigation-button__text"},"番組情報",-1)),Ty=xs(()=>Dt("span",{class:"panel-navigation-button__text"},"チャンネル",-1)),Cy=xs(()=>Dt("span",{class:"panel-navigation-button__text"},"シリーズ",-1)),xy=xs(()=>Dt("span",{class:"panel-navigation-button__text"},"コメント",-1)),ky=xs(()=>Dt("span",{class:"panel-navigation-button__text"},"Twitter",-1));function Ry(_,e,s,u,y,A){const l=an("Icon"),c=an("Program"),p=an("RecordedProgram"),r=an("Channel"),i=an("Series"),t=an("Comment"),n=an("Twitter"),a=an("Remocon");return Zt(),ai("div",{class:"watch-panel",onMousemove:e[9]||(e[9]=o=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:o}))},[Dt("div",my,[Si((Zt(),ai("div",{class:"panel-close-button",onClick:e[0]||(e[0]=o=>_.playerStore.is_panel_display=!1)},[Ai(l,{class:"panel-close-button__icon",icon:"akar-icons:chevron-right",width:"25px"}),gy])),[[Ri]]),Ai(zo),_.playback_mode==="Live"?(Zt(),ai("div",Ay,[Dt("img",{class:"panel-broadcaster__icon",src:`${_.Utils.api_base_url}/channels/${_.channelsStore.channel.current.id}/logo`},null,8,yy),Dt("div",vy,en(_.channelsStore.channel.current.channel_number),1),Dt("div",by,en(_.channelsStore.channel.current.name),1)])):_n("",!0)]),Dt("div",_y,[_.playback_mode==="Live"?(Zt(),Tn(c,{key:0,class:Yi(["watch-panel__content",{"watch-panel__content--active":_.panel_active_tab==="Program"}])},null,8,["class"])):_n("",!0),_.playback_mode==="Video"?(Zt(),Tn(p,{key:1,class:Yi(["watch-panel__content",{"watch-panel__content--active":_.panel_active_tab==="RecordedProgram"}])},null,8,["class"])):_n("",!0),_.playback_mode==="Live"?(Zt(),Tn(r,{key:2,class:Yi(["watch-panel__content",{"watch-panel__content--active":_.panel_active_tab==="Channel"}])},null,8,["class"])):_n("",!0),_.playback_mode==="Video"?(Zt(),Tn(i,{key:3,class:Yi(["watch-panel__content",{"watch-panel__content--active":_.panel_active_tab==="Series"}])},null,8,["class"])):_n("",!0),Ai(t,{class:Yi(["watch-panel__content",{"watch-panel__content--active":_.panel_active_tab==="Comment"}]),playback_mode:_.playback_mode},null,8,["playback_mode","class"]),Ai(n,{class:Yi(["watch-panel__content",{"watch-panel__content--active":_.panel_active_tab==="Twitter"}]),playback_mode:_.playback_mode},null,8,["playback_mode","class"]),_.playback_mode==="Live"?Si((Zt(),ai("button",{key:4,class:Yi(["watch-panel__content-remocon-button elevation-8",{"watch-panel__content-remocon-button--active":_.panel_active_tab==="Program"||_.panel_active_tab==="Channel"}]),onClick:e[1]||(e[1]=o=>_.playerStore.is_remocon_display=!_.playerStore.is_remocon_display)},[Ai(l,{class:"panel-close-button__icon",icon:"material-symbols:remote-gen",width:"25px"})],2)),[[Ri]]):_n("",!0),_.playback_mode==="Live"?(Zt(),Tn(a,{key:5,class:"watch-panel__remocon",modelValue:(_.panel_active_tab==="Program"||_.panel_active_tab==="Channel")&&_.playerStore.is_remocon_display===!0,"onUpdate:modelValue":e[2]||(e[2]=o=>_.playerStore.is_remocon_display=o)},null,8,["modelValue"])):_n("",!0)]),Dt("div",Ey,[_.playback_mode==="Live"?Si((Zt(),ai("div",{key:0,class:Yi(["panel-navigation-button",{"panel-navigation-button--active":_.panel_active_tab==="Program"}]),onClick:e[3]||(e[3]=o=>_.playerStore.tv_panel_active_tab="Program")},[Ai(l,{class:"panel-navigation-button__icon",icon:"fa-solid:info-circle",width:"33px"}),wy],2)),[[Ri]]):_n("",!0),_.playback_mode==="Video"?Si((Zt(),ai("div",{key:1,class:Yi(["panel-navigation-button",{"panel-navigation-button--active":_.panel_active_tab==="RecordedProgram"}]),onClick:e[4]||(e[4]=o=>_.playerStore.video_panel_active_tab="RecordedProgram")},[Ai(l,{class:"panel-navigation-button__icon",icon:"fa-solid:info-circle",width:"33px"}),Sy],2)),[[Ri]]):_n("",!0),_.playback_mode==="Live"?Si((Zt(),ai("div",{key:2,class:Yi(["panel-navigation-button",{"panel-navigation-button--active":_.panel_active_tab==="Channel"}]),onClick:e[5]||(e[5]=o=>_.playerStore.tv_panel_active_tab="Channel")},[Ai(l,{class:"panel-navigation-button__icon",icon:"fa-solid:broadcast-tower",width:"34px"}),Ty],2)),[[Ri]]):_n("",!0),_.playback_mode==="Video"?Si((Zt(),ai("div",{key:3,class:Yi(["panel-navigation-button",{"panel-navigation-button--active":_.panel_active_tab==="Series"}]),onClick:e[6]||(e[6]=o=>_.playerStore.video_panel_active_tab="Series")},[Ai(l,{class:"panel-navigation-button__icon",icon:"fluent:video-clip-multiple-16-filled",width:"34px",style:{width:"39px",height:"39px","margin-top":"-4px","margin-bottom":"-4px"}}),Cy],2)),[[Ri]]):_n("",!0),Si((Zt(),ai("div",{class:Yi(["panel-navigation-button",{"panel-navigation-button--active":_.panel_active_tab==="Comment"}]),onClick:e[7]||(e[7]=o=>_.playback_mode==="Live"?_.playerStore.tv_panel_active_tab="Comment":_.playerStore.video_panel_active_tab="Comment")},[Ai(l,{class:"panel-navigation-button__icon",icon:"bi:chat-left-text-fill",width:"29px"}),xy],2)),[[Ri]]),Si((Zt(),ai("div",{class:Yi(["panel-navigation-button",{"panel-navigation-button--active":_.panel_active_tab==="Twitter"}]),onClick:e[8]||(e[8]=o=>_.playback_mode==="Live"?_.playerStore.tv_panel_active_tab="Twitter":_.playerStore.video_panel_active_tab="Twitter")},[Ai(l,{class:"panel-navigation-button__icon",icon:"fa-brands:twitter",width:"34px"}),ky],2)),[[Ri]])])],32)}const Iy=Wn(py,[["render",Ry],["__scopeId","data-v-02bb8a53"]]),Ly=er({name:"Watch-Player",props:{playback_mode:{type:String,required:!0}},data(){return{Utils:Object.freeze(si)}},computed:{...yr(Ln,cn)}}),Jf=_=>(Ir("data-v-19d3454d"),_=_(),Lr(),_),Dy={class:"watch-player__background-wrapper"},Oy=Jf(()=>Dt("img",{class:"watch-player__background-logo",src:o2},null,-1)),My=[Oy],Py=Jf(()=>Dt("div",{class:"watch-player__dplayer"},null,-1));function By(_,e,s,u,y,A){const l=an("Icon"),c=Mf("tooltip");return Zt(),ai("div",{class:Yi(["watch-player",{"watch-player--loading":_.playerStore.is_loading,"watch-player--virtual-keyboard-display":_.playerStore.is_virtual_keyboard_display&&_.Utils.hasActiveElementClass("dplayer-comment-input"),"watch-player--video":_.playback_mode==="Video"}])},[Dt("div",Dy,[Dt("div",{class:Yi(["watch-player__background",{"watch-player__background--display":_.playerStore.is_background_display}]),style:Eo({backgroundImage:`url(${_.playerStore.background_url})`})},My,6)]),Ai(Pf,{indeterminate:"",size:"60",width:"6",class:Yi(["watch-player__buffering",{"watch-player__buffering--display":_.playerStore.is_video_buffering}])},null,8,["class"]),Py,Dt("div",{class:"watch-player__button",onMousemove:e[3]||(e[3]=p=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:p})),onTouchmove:e[4]||(e[4]=p=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:p})),onClick:e[5]||(e[5]=p=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:p}))},[_.playback_mode==="Live"?Si((Zt(),ai("div",{key:0,class:"switch-button switch-button-up",onClick:e[0]||(e[0]=p=>{_.playerStore.is_zapping=!0,_.$router.push({path:`/tv/watch/${_.channelsStore.channel.previous.display_channel_id}`})})},[Ai(l,{class:"switch-button-icon",icon:"fluent:ios-arrow-left-24-filled",width:"32px",style:{transform:"rotate(90deg)"}})])),[[Ri],[c,"前のチャンネル",void 0,{top:!0}]]):_n("",!0),Si((Zt(),ai("div",{class:Yi(["switch-button switch-button-panel",{"switch-button-panel--open":_.playerStore.is_panel_display}]),onClick:e[1]||(e[1]=p=>_.playerStore.is_panel_display=!_.playerStore.is_panel_display)},[Ai(l,{class:"switch-button-icon",icon:"fluent:navigation-16-filled",width:"32px"})],2)),[[Ri]]),_.playback_mode==="Live"?Si((Zt(),ai("div",{key:1,class:"switch-button switch-button-down",onClick:e[2]||(e[2]=p=>{_.playerStore.is_zapping=!0,_.$router.push({path:`/tv/watch/${_.channelsStore.channel.next.display_channel_id}`})})},[Ai(l,{class:"switch-button-icon",icon:"fluent:ios-arrow-right-24-filled",width:"33px",style:{transform:"rotate(90deg)"}})])),[[Ri],[c,"次のチャンネル",void 0,{bottom:!0}]]):_n("",!0)],32)],2)}const Ny=Wn(Ly,[["render",By],["__scopeId","data-v-19d3454d"]]),Fy=er({name:"Watch",components:{KeyboardShortcutList:im,WatchHeader:F2,WatchNavigation:lm,WatchPanel:Iy,WatchPlayer:Ny},props:{playback_mode:{type:String,required:!0}},data(){return{Utils:Object.freeze(si)}},computed:{...yr(cn,Sn)},watch:{"playerStore.is_panel_display":{handler(){this.settingsStore.settings.showed_panel_last_time=this.playerStore.is_panel_display}}},created(){"virtualKeyboard"in navigator&&(navigator.virtualKeyboard.overlaysContent=!0,navigator.virtualKeyboard.ongeometrychange=_=>{_.target.boundingRect.width===0&&_.target.boundingRect.height===0?this.playerStore.is_virtual_keyboard_display=!1:this.playerStore.is_virtual_keyboard_display=!0}),this.playerStore.startWatching()},beforeUnmount(){this.playerStore.stopWatching(),"virtualKeyboard"in navigator&&(navigator.virtualKeyboard.overlaysContent=!1)}}),Uy={class:"route-container"};function Gy(_,e,s,u,y,A){const l=an("WatchNavigation"),c=an("WatchHeader"),p=an("WatchPlayer"),r=an("WatchPanel"),i=an("KeyboardShortcutList");return Zt(),ai("div",Uy,[Dt("main",{class:Yi(["watch-container",{"watch-container--control-display":_.playerStore.is_control_display,"watch-container--panel-display":_.Utils.isSmartphoneVertical()||_.Utils.isTabletVertical()?!0:_.playerStore.is_panel_display,"watch-container--fullscreen":_.playerStore.is_fullscreen,"watch-container--document-pip":_.playerStore.is_document_pip,"watch-container--video":_.playback_mode==="Video"}])},[Ai(l),Dt("div",{class:"watch-content",onMousemove:e[0]||(e[0]=t=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:t,is_player_region_event:!0})),onTouchmove:e[1]||(e[1]=t=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:t,is_player_region_event:!0})),onClick:e[2]||(e[2]=t=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:t,is_player_region_event:!0}))},[Ai(c,{playback_mode:_.playback_mode},null,8,["playback_mode"]),Ai(p,{playback_mode:_.playback_mode},null,8,["playback_mode"])],32),Ai(r,{playback_mode:_.playback_mode},null,8,["playback_mode"])],2),Ai(i,{playback_mode:_.playback_mode},null,8,["playback_mode"])])}const R6=Wn(Fy,[["render",Gy],["__scopeId","data-v-db02acbf"]]);var Fl={exports:{}},Ul={},sa={},Qf={},dd=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},s=Symbol("test"),u=Object(s);if(typeof s=="string"||Object.prototype.toString.call(s)!=="[object Symbol]"||Object.prototype.toString.call(u)!=="[object Symbol]")return!1;var y=42;e[s]=y;for(s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var A=Object.getOwnPropertySymbols(e);if(A.length!==1||A[0]!==s||!Object.prototype.propertyIsEnumerable.call(e,s))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,s);if(l.value!==y||l.enumerable!==!0)return!1}return!0},jy=dd,ud=function(){return jy()&&!!Symbol.toStringTag},Vy=Error,Hy=EvalError,zy=RangeError,Wy=ReferenceError,Zf=SyntaxError,Ko=TypeError,Ky=URIError,Gu=typeof Symbol<"u"&&Symbol,qy=dd,Yy=function(){return typeof Gu!="function"||typeof Symbol!="function"||typeof Gu("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:qy()},Gl={__proto__:null,foo:{}},Jy=Object,Qy=function(){return{__proto__:Gl}.foo===Gl.foo&&!(Gl instanceof Jy)},Zy="Function.prototype.bind called on incompatible ",Xy=Object.prototype.toString,$y=Math.max,ev="[object Function]",ju=function(e,s){for(var u=[],y=0;y"u"||!Nn?sn:Nn(Uint8Array),Ss={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?sn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?sn:ArrayBuffer,"%ArrayIteratorPrototype%":Us&&Nn?Nn([][Symbol.iterator]()):sn,"%AsyncFromSyncIteratorPrototype%":sn,"%AsyncFunction%":qs,"%AsyncGenerator%":qs,"%AsyncGeneratorFunction%":qs,"%AsyncIteratorPrototype%":qs,"%Atomics%":typeof Atomics>"u"?sn:Atomics,"%BigInt%":typeof BigInt>"u"?sn:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?sn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?sn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?sn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":cv,"%eval%":eval,"%EvalError%":dv,"%Float32Array%":typeof Float32Array>"u"?sn:Float32Array,"%Float64Array%":typeof Float64Array>"u"?sn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?sn:FinalizationRegistry,"%Function%":Xf,"%GeneratorFunction%":qs,"%Int8Array%":typeof Int8Array>"u"?sn:Int8Array,"%Int16Array%":typeof Int16Array>"u"?sn:Int16Array,"%Int32Array%":typeof Int32Array>"u"?sn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Us&&Nn?Nn(Nn([][Symbol.iterator]())):sn,"%JSON%":typeof JSON=="object"?JSON:sn,"%Map%":typeof Map>"u"?sn:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Us||!Nn?sn:Nn(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?sn:Promise,"%Proxy%":typeof Proxy>"u"?sn:Proxy,"%RangeError%":uv,"%ReferenceError%":hv,"%Reflect%":typeof Reflect>"u"?sn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?sn:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Us||!Nn?sn:Nn(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?sn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Us&&Nn?Nn(""[Symbol.iterator]()):sn,"%Symbol%":Us?Symbol:sn,"%SyntaxError%":aa,"%ThrowTypeError%":pv,"%TypedArray%":gv,"%TypeError%":ia,"%Uint8Array%":typeof Uint8Array>"u"?sn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?sn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?sn:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?sn:Uint32Array,"%URIError%":fv,"%WeakMap%":typeof WeakMap>"u"?sn:WeakMap,"%WeakRef%":typeof WeakRef>"u"?sn:WeakRef,"%WeakSet%":typeof WeakSet>"u"?sn:WeakSet};if(Nn)try{null.error}catch(_){var Av=Nn(Nn(_));Ss["%Error.prototype%"]=Av}var yv=function _(e){var s;if(e==="%AsyncFunction%")s=jl("async function () {}");else if(e==="%GeneratorFunction%")s=jl("function* () {}");else if(e==="%AsyncGeneratorFunction%")s=jl("async function* () {}");else if(e==="%AsyncGenerator%"){var u=_("%AsyncGeneratorFunction%");u&&(s=u.prototype)}else if(e==="%AsyncIteratorPrototype%"){var y=_("%AsyncGenerator%");y&&Nn&&(s=Nn(y.prototype))}return Ss[e]=s,s},Vu={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Oa=hd,So=lv,vv=Oa.call(Function.call,Array.prototype.concat),bv=Oa.call(Function.apply,Array.prototype.splice),Hu=Oa.call(Function.call,String.prototype.replace),To=Oa.call(Function.call,String.prototype.slice),_v=Oa.call(Function.call,RegExp.prototype.exec),Ev=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,wv=/\\(\\)?/g,Sv=function(e){var s=To(e,0,1),u=To(e,-1);if(s==="%"&&u!=="%")throw new aa("invalid intrinsic syntax, expected closing `%`");if(u==="%"&&s!=="%")throw new aa("invalid intrinsic syntax, expected opening `%`");var y=[];return Hu(e,Ev,function(A,l,c,p){y[y.length]=c?Hu(p,wv,"$1"):l||A}),y},Tv=function(e,s){var u=e,y;if(So(Vu,u)&&(y=Vu[u],u="%"+y[0]+"%"),So(Ss,u)){var A=Ss[u];if(A===qs&&(A=yv(u)),typeof A>"u"&&!s)throw new ia("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:y,name:u,value:A}}throw new aa("intrinsic "+e+" does not exist!")},Ma=function(e,s){if(typeof e!="string"||e.length===0)throw new ia("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof s!="boolean")throw new ia('"allowMissing" argument must be a boolean');if(_v(/^%?[^%]*%?$/,e)===null)throw new aa("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var u=Sv(e),y=u.length>0?u[0]:"",A=Tv("%"+y+"%",s),l=A.name,c=A.value,p=!1,r=A.alias;r&&(y=r[0],bv(u,vv([0,1],r)));for(var i=1,t=!0;i=u.length){var d=ws(c,n);t=!!d,t&&"get"in d&&!("originalValue"in d.get)?c=d.get:c=c[n]}else t=So(c,n),c=c[n];t&&!p&&(Ss[l]=c)}}return c},$f={exports:{}},Hl,zu;function fd(){if(zu)return Hl;zu=1;var _=Ma,e=_("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Hl=e,Hl}var Cv=Ma,lo=Cv("%Object.getOwnPropertyDescriptor%",!0);if(lo)try{lo([],"length")}catch{lo=null}var pd=lo,Wu=fd(),xv=Zf,Gs=Ko,Ku=pd,ep=function(e,s,u){if(!e||typeof e!="object"&&typeof e!="function")throw new Gs("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new Gs("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Gs("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Gs("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Gs("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Gs("`loose`, if provided, must be a boolean");var y=arguments.length>3?arguments[3]:null,A=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,p=!!Ku&&Ku(e,s);if(Wu)Wu(e,s,{configurable:l===null&&p?p.configurable:!l,enumerable:y===null&&p?p.enumerable:!y,value:u,writable:A===null&&p?p.writable:!A});else if(c||!y&&!A&&!l)e[s]=u;else throw new xv("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Lc=fd(),tp=function(){return!!Lc};tp.hasArrayLengthDefineBug=function(){if(!Lc)return null;try{return Lc([],"length",{value:1}).length!==1}catch{return!0}};var ip=tp,kv=Ma,qu=ep,Rv=ip(),Yu=pd,Ju=Ko,Iv=kv("%Math.floor%"),Lv=function(e,s){if(typeof e!="function")throw new Ju("`fn` is not a function");if(typeof s!="number"||s<0||s>4294967295||Iv(s)!==s)throw new Ju("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],y=!0,A=!0;if("length"in e&&Yu){var l=Yu(e,"length");l&&!l.configurable&&(y=!1),l&&!l.writable&&(A=!1)}return(y||A||!u)&&(Rv?qu(e,"length",s,!0,!0):qu(e,"length",s)),e};(function(_){var e=hd,s=Ma,u=Lv,y=Ko,A=s("%Function.prototype.apply%"),l=s("%Function.prototype.call%"),c=s("%Reflect.apply%",!0)||e.call(l,A),p=fd(),r=s("%Math.max%");_.exports=function(n){if(typeof n!="function")throw new y("a function is required");var a=c(e,l,arguments);return u(a,1+r(0,n.length-(arguments.length-1)),!0)};var i=function(){return c(e,A,arguments)};p?p(_.exports,"apply",{value:i}):_.exports.apply=i})($f);var qo=$f.exports,np=Ma,rp=qo,Dv=rp(np("String.prototype.indexOf")),Yo=function(e,s){var u=np(e,!!s);return typeof u=="function"&&Dv(e,".prototype.")>-1?rp(u):u},Ov=ud(),Mv=Yo,Dc=Mv("Object.prototype.toString"),Jo=function(e){return Ov&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Dc(e)==="[object Arguments]"},sp=function(e){return Jo(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Dc(e)!=="[object Array]"&&Dc(e.callee)==="[object Function]"},Pv=function(){return Jo(arguments)}();Jo.isLegacyArguments=sp;var Bv=Pv?Jo:sp,Nv=Object.prototype.toString,Fv=Function.prototype.toString,Uv=/^\s*(?:function)?\*/,ap=ud(),zl=Object.getPrototypeOf,Gv=function(){if(!ap)return!1;try{return Function("return function*() {}")()}catch{}},Wl,jv=function(e){if(typeof e!="function")return!1;if(Uv.test(Fv.call(e)))return!0;if(!ap){var s=Nv.call(e);return s==="[object GeneratorFunction]"}if(!zl)return!1;if(typeof Wl>"u"){var u=Gv();Wl=u?zl(u):!1}return zl(e)===Wl},op=Function.prototype.toString,Qs=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Oc,co;if(typeof Qs=="function"&&typeof Object.defineProperty=="function")try{Oc=Object.defineProperty({},"length",{get:function(){throw co}}),co={},Qs(function(){throw 42},null,Oc)}catch(_){_!==co&&(Qs=null)}else Qs=null;var Vv=/^\s*class\b/,Mc=function(e){try{var s=op.call(e);return Vv.test(s)}catch{return!1}},Kl=function(e){try{return Mc(e)?!1:(op.call(e),!0)}catch{return!1}},uo=Object.prototype.toString,Hv="[object Object]",zv="[object Function]",Wv="[object GeneratorFunction]",Kv="[object HTMLAllCollection]",qv="[object HTML document.all class]",Yv="[object HTMLCollection]",Jv=typeof Symbol=="function"&&!!Symbol.toStringTag,Qv=!(0 in[,]),Pc=function(){return!1};if(typeof document=="object"){var Zv=document.all;uo.call(Zv)===uo.call(document.all)&&(Pc=function(e){if((Qv||!e)&&(typeof e>"u"||typeof e=="object"))try{var s=uo.call(e);return(s===Kv||s===qv||s===Yv||s===Hv)&&e("")==null}catch{}return!1})}var Xv=Qs?function(e){if(Pc(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Qs(e,null,Oc)}catch(s){if(s!==co)return!1}return!Mc(e)&&Kl(e)}:function(e){if(Pc(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(Jv)return Kl(e);if(Mc(e))return!1;var s=uo.call(e);return s!==zv&&s!==Wv&&!/^\[object HTML/.test(s)?!1:Kl(e)},$v=Xv,eb=Object.prototype.toString,lp=Object.prototype.hasOwnProperty,tb=function(e,s,u){for(var y=0,A=e.length;y=3&&(y=u),eb.call(e)==="[object Array]"?tb(e,s,y):typeof e=="string"?ib(e,s,y):nb(e,s,y)},sb=rb,ab=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],ql=ab,ob=typeof globalThis>"u"?Ho:globalThis,lb=function(){for(var e=[],s=0;s"u"?Ho:globalThis,Bc=cb(),gd=md("String.prototype.slice"),Yl=Object.getPrototypeOf,ub=md("Array.prototype.indexOf",!0)||function(e,s){for(var u=0;u-1?s:s!=="Object"?!1:fb(e)}return ho?hb(e):null},pb=dp,mb=function(e){return!!pb(e)};(function(_){var e=Bv,s=jv,u=dp,y=mb;function A(Oe){return Oe.call.bind(Oe)}var l=typeof BigInt<"u",c=typeof Symbol<"u",p=A(Object.prototype.toString),r=A(Number.prototype.valueOf),i=A(String.prototype.valueOf),t=A(Boolean.prototype.valueOf);if(l)var n=A(BigInt.prototype.valueOf);if(c)var a=A(Symbol.prototype.valueOf);function o(Oe,pt){if(typeof Oe!="object")return!1;try{return pt(Oe),!0}catch{return!1}}_.isArgumentsObject=e,_.isGeneratorFunction=s,_.isTypedArray=y;function d(Oe){return typeof Promise<"u"&&Oe instanceof Promise||Oe!==null&&typeof Oe=="object"&&typeof Oe.then=="function"&&typeof Oe.catch=="function"}_.isPromise=d;function g(Oe){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Oe):y(Oe)||z(Oe)}_.isArrayBufferView=g;function m(Oe){return u(Oe)==="Uint8Array"}_.isUint8Array=m;function v(Oe){return u(Oe)==="Uint8ClampedArray"}_.isUint8ClampedArray=v;function b(Oe){return u(Oe)==="Uint16Array"}_.isUint16Array=b;function w(Oe){return u(Oe)==="Uint32Array"}_.isUint32Array=w;function C(Oe){return u(Oe)==="Int8Array"}_.isInt8Array=C;function D(Oe){return u(Oe)==="Int16Array"}_.isInt16Array=D;function R(Oe){return u(Oe)==="Int32Array"}_.isInt32Array=R;function T(Oe){return u(Oe)==="Float32Array"}_.isFloat32Array=T;function P(Oe){return u(Oe)==="Float64Array"}_.isFloat64Array=P;function L(Oe){return u(Oe)==="BigInt64Array"}_.isBigInt64Array=L;function I(Oe){return u(Oe)==="BigUint64Array"}_.isBigUint64Array=I;function x(Oe){return p(Oe)==="[object Map]"}x.working=typeof Map<"u"&&x(new Map);function O(Oe){return typeof Map>"u"?!1:x.working?x(Oe):Oe instanceof Map}_.isMap=O;function G(Oe){return p(Oe)==="[object Set]"}G.working=typeof Set<"u"&&G(new Set);function J(Oe){return typeof Set>"u"?!1:G.working?G(Oe):Oe instanceof Set}_.isSet=J;function te(Oe){return p(Oe)==="[object WeakMap]"}te.working=typeof WeakMap<"u"&&te(new WeakMap);function le(Oe){return typeof WeakMap>"u"?!1:te.working?te(Oe):Oe instanceof WeakMap}_.isWeakMap=le;function ne(Oe){return p(Oe)==="[object WeakSet]"}ne.working=typeof WeakSet<"u"&&ne(new WeakSet);function ee(Oe){return ne(Oe)}_.isWeakSet=ee;function M(Oe){return p(Oe)==="[object ArrayBuffer]"}M.working=typeof ArrayBuffer<"u"&&M(new ArrayBuffer);function Y(Oe){return typeof ArrayBuffer>"u"?!1:M.working?M(Oe):Oe instanceof ArrayBuffer}_.isArrayBuffer=Y;function j(Oe){return p(Oe)==="[object DataView]"}j.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&j(new DataView(new ArrayBuffer(1),0,1));function z(Oe){return typeof DataView>"u"?!1:j.working?j(Oe):Oe instanceof DataView}_.isDataView=z;var q=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Z(Oe){return p(Oe)==="[object SharedArrayBuffer]"}function X(Oe){return typeof q>"u"?!1:(typeof Z.working>"u"&&(Z.working=Z(new q)),Z.working?Z(Oe):Oe instanceof q)}_.isSharedArrayBuffer=X;function oe(Oe){return p(Oe)==="[object AsyncFunction]"}_.isAsyncFunction=oe;function he(Oe){return p(Oe)==="[object Map Iterator]"}_.isMapIterator=he;function ie(Oe){return p(Oe)==="[object Set Iterator]"}_.isSetIterator=ie;function fe(Oe){return p(Oe)==="[object Generator]"}_.isGeneratorObject=fe;function se(Oe){return p(Oe)==="[object WebAssembly.Module]"}_.isWebAssemblyCompiledModule=se;function Ee(Oe){return o(Oe,r)}_.isNumberObject=Ee;function He(Oe){return o(Oe,i)}_.isStringObject=He;function Ie(Oe){return o(Oe,t)}_.isBooleanObject=Ie;function at(Oe){return l&&o(Oe,n)}_.isBigIntObject=at;function je(Oe){return c&&o(Oe,a)}_.isSymbolObject=je;function ht(Oe){return Ee(Oe)||He(Oe)||Ie(Oe)||at(Oe)||je(Oe)}_.isBoxedPrimitive=ht;function _e(Oe){return typeof Uint8Array<"u"&&(Y(Oe)||X(Oe))}_.isAnyArrayBuffer=_e,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Oe){Object.defineProperty(_,Oe,{enumerable:!1,value:function(){throw new Error(Oe+" is not supported in userland")}})})})(Qf);var gb=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"},Nc={exports:{}};typeof Object.create=="function"?Nc.exports=function(e,s){s&&(e.super_=s,e.prototype=Object.create(s.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Nc.exports=function(e,s){if(s){e.super_=s;var u=function(){};u.prototype=s.prototype,e.prototype=new u,e.prototype.constructor=e}};var Ab=Nc.exports;(function(_){var e={},s=Object.getOwnPropertyDescriptors||function(q){for(var Z=Object.keys(q),X={},oe=0;oe=oe)return fe;switch(fe){case"%s":return String(X[Z++]);case"%d":return Number(X[Z++]);case"%j":try{return JSON.stringify(X[Z++])}catch{return"[Circular]"}default:return fe}}),ie=X[Z];Z"u")return function(){return _.deprecate(z,q).apply(this,arguments)};var Z=!1;function X(){if(!Z){if(process.throwDeprecation)throw new Error(q);process.traceDeprecation?console.trace(q):console.error(q),Z=!0}return z.apply(this,arguments)}return X};var y={},A=/^$/;if(e.NODE_DEBUG){var l=e.NODE_DEBUG;l=l.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),A=new RegExp("^"+l+"$","i")}_.debuglog=function(z){if(z=z.toUpperCase(),!y[z])if(A.test(z)){var q=process.pid;y[z]=function(){var Z=_.format.apply(_,arguments);console.error("%s %d: %s",z,q,Z)}}else y[z]=function(){};return y[z]};function c(z,q){var Z={seen:[],stylize:r};return arguments.length>=3&&(Z.depth=arguments[2]),arguments.length>=4&&(Z.colors=arguments[3]),v(q)?Z.showHidden=q:q&&_._extend(Z,q),T(Z.showHidden)&&(Z.showHidden=!1),T(Z.depth)&&(Z.depth=2),T(Z.colors)&&(Z.colors=!1),T(Z.customInspect)&&(Z.customInspect=!0),Z.colors&&(Z.stylize=p),t(Z,z,Z.depth)}_.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function p(z,q){var Z=c.styles[q];return Z?"\x1B["+c.colors[Z][0]+"m"+z+"\x1B["+c.colors[Z][1]+"m":z}function r(z,q){return z}function i(z){var q={};return z.forEach(function(Z,X){q[Z]=!0}),q}function t(z,q,Z){if(z.customInspect&&q&&O(q.inspect)&&q.inspect!==_.inspect&&!(q.constructor&&q.constructor.prototype===q)){var X=q.inspect(Z,z);return D(X)||(X=t(z,X,Z)),X}var oe=n(z,q);if(oe)return oe;var he=Object.keys(q),ie=i(he);if(z.showHidden&&(he=Object.getOwnPropertyNames(q)),x(q)&&(he.indexOf("message")>=0||he.indexOf("description")>=0))return a(q);if(he.length===0){if(O(q)){var fe=q.name?": "+q.name:"";return z.stylize("[Function"+fe+"]","special")}if(P(q))return z.stylize(RegExp.prototype.toString.call(q),"regexp");if(I(q))return z.stylize(Date.prototype.toString.call(q),"date");if(x(q))return a(q)}var se="",Ee=!1,He=["{","}"];if(m(q)&&(Ee=!0,He=["[","]"]),O(q)){var Ie=q.name?": "+q.name:"";se=" [Function"+Ie+"]"}if(P(q)&&(se=" "+RegExp.prototype.toString.call(q)),I(q)&&(se=" "+Date.prototype.toUTCString.call(q)),x(q)&&(se=" "+a(q)),he.length===0&&(!Ee||q.length==0))return He[0]+se+He[1];if(Z<0)return P(q)?z.stylize(RegExp.prototype.toString.call(q),"regexp"):z.stylize("[Object]","special");z.seen.push(q);var at;return Ee?at=o(z,q,Z,ie,he):at=he.map(function(je){return d(z,q,Z,ie,je,Ee)}),z.seen.pop(),g(at,se,He)}function n(z,q){if(T(q))return z.stylize("undefined","undefined");if(D(q)){var Z="'"+JSON.stringify(q).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return z.stylize(Z,"string")}if(C(q))return z.stylize(""+q,"number");if(v(q))return z.stylize(""+q,"boolean");if(b(q))return z.stylize("null","null")}function a(z){return"["+Error.prototype.toString.call(z)+"]"}function o(z,q,Z,X,oe){for(var he=[],ie=0,fe=q.length;ie{this.playerStore.event_emitter.emit("SendNotification",{message:u.message,color:u.is_error?"#FF6F6A":void 0})}),this.is_tweet_sending=!1,this.settingsStore.settings.fold_panel_after_sending_tweet===!0&&(this.playerStore.is_panel_display=!1,this.$refs.tweet_text.blur())}}}),Dr=_=>(Ir("data-v-894b4344"),_=_(),Lr(),_),kA={class:"twitter-container"},RA={class:"tab-container"},IA={class:"tab-button-container"},LA=Dr(()=>Dt("span",{class:"tab-button__text"},"ツイート検索",-1)),DA=Dr(()=>Dt("span",{class:"tab-button__text"},"タイムライン",-1)),OA=Dr(()=>Dt("span",{class:"tab-button__text"},"キャプチャ",-1)),MA={class:"tweet-form__hashtag"},PA={class:"tweet-form__control"},BA=["src"],NA={class:"account-button__screen-name"},FA={class:"limit-meter"},UA={class:"limit-meter__content"},GA=["disabled"],jA=Dr(()=>Dt("span",{class:"ml-1"},"ツイート",-1)),VA={class:"hashtag-heading"},HA={class:"hashtag-heading__text"},zA=Dr(()=>Dt("span",{class:"ml-1"},"ハッシュタグリスト",-1)),WA=Dr(()=>Dt("span",{class:"ml-1"},"追加",-1)),KA=["onClick"],qA=["onUpdate:modelValue","disabled"],YA=["onClick"],JA={key:0,class:"iconify iconify--fluent",width:"17px",height:"17px",viewBox:"0 0 16 16"},QA=Dr(()=>Dt("path",{fill:"currentColor",d:"M10.529 1.764a2.621 2.621 0 1 1 3.707 3.707l-.779.779L9.75 2.543l.779-.779ZM9.043 3.25L2.657 9.636a2.955 2.955 0 0 0-.772 1.354l-.87 3.386a.5.5 0 0 0 .61.608l3.385-.869a2.95 2.95 0 0 0 1.354-.772l6.386-6.386L9.043 3.25Z"},null,-1)),ZA=[QA],XA={key:1,class:"iconify iconify--fluent",width:"17px",height:"17px",viewBox:"0 0 16 16"},$A=Dr(()=>Dt("path",{fill:"currentColor",d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032Z"},null,-1)),ey=[$A],ty=["onClick"],iy=Dr(()=>Dt("svg",{class:"iconify iconify--fluent",width:"17px",height:"17px",viewBox:"0 0 16 16"},[Dt("path",{fill:"currentColor",d:"M7 3h2a1 1 0 0 0-2 0ZM6 3a2 2 0 1 1 4 0h4a.5.5 0 0 1 0 1h-.564l-1.205 8.838A2.5 2.5 0 0 1 9.754 15H6.246a2.5 2.5 0 0 1-2.477-2.162L2.564 4H2a.5.5 0 0 1 0-1h4Zm1 3.5a.5.5 0 0 0-1 0v5a.5.5 0 0 0 1 0v-5ZM9.5 6a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 1 0v-5a.5.5 0 0 0-.5-.5Z"})],-1)),ny=[iy],ry=Dr(()=>Dt("div",{class:"hashtag__sort-handle"},[Dt("svg",{class:"iconify iconify--material-symbols",width:"17px",height:"17px",viewBox:"0 0 24 24"},[Dt("path",{fill:"currentColor",d:"M5 15q-.425 0-.713-.288T4 14q0-.425.288-.713T5 13h14q.425 0 .713.288T20 14q0 .425-.288.713T19 15H5Zm0-4q-.425 0-.713-.288T4 10q0-.425.288-.713T5 9h14q.425 0 .713.288T20 10q0 .425-.288.713T19 11H5Z"})])],-1)),sy=["onClick"],ay=["src"],oy={class:"twitter-account__info"},ly={class:"twitter-account__name"},cy={class:"twitter-account__screen-name"},dy={class:"twitter-account__check iconify iconify--fluent",width:"24px",height:"24px",viewBox:"0 0 16 16"},uy=Dr(()=>Dt("path",{fill:"currentColor",d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032Z"},null,-1)),hy=[uy];function fy(_,e,s,u,A,y){var t,n;const l=an("TwitterSearch"),c=an("TwitterTimeline"),p=an("TwitterCaptures"),r=an("Icon"),i=an("draggable");return Zt(),ai("div",kA,[Dt("div",RA,[Ai(l,{class:Yi({"tab-content--active":_.playerStore.twitter_active_tab==="Search"})},null,8,["class"]),Ai(c,{class:Yi({"tab-content--active":_.playerStore.twitter_active_tab==="Timeline"})},null,8,["class"]),Ai(p,{class:Yi({"tab-content--active":_.playerStore.twitter_active_tab==="Capture"})},null,8,["class"])]),Dt("div",IA,[Si((Zt(),ai("div",{class:Yi(["tab-button",{"tab-button--active":_.playerStore.twitter_active_tab==="Search"}]),onClick:e[0]||(e[0]=a=>_.playerStore.twitter_active_tab="Search")},[Ai(r,{icon:"fluent:search-16-filled",height:"18px"}),LA],2)),[[Ri]]),Si((Zt(),ai("div",{class:Yi(["tab-button",{"tab-button--active":_.playerStore.twitter_active_tab==="Timeline"}]),onClick:e[1]||(e[1]=a=>_.playerStore.twitter_active_tab="Timeline")},[Ai(r,{icon:"fluent:home-16-regular",height:"18px"}),DA],2)),[[Ri]]),Si((Zt(),ai("div",{class:Yi(["tab-button",{"tab-button--active":_.playerStore.twitter_active_tab==="Capture"}]),onClick:e[2]||(e[2]=a=>_.playerStore.twitter_active_tab="Capture")},[Ai(r,{icon:"fluent:image-copy-20-regular",height:"18px"}),OA],2)),[[Ri]])]),Dt("div",{class:Yi(["tweet-form",{"tweet-form--focused":_.is_tweet_hashtag_form_focused||_.is_tweet_text_form_focused,"tweet-form--virtual-keyboard-display":_.playerStore.is_virtual_keyboard_display&&(_.Utils.hasActiveElementClass("tweet-form__hashtag-form")||_.Utils.hasActiveElementClass("tweet-form__textarea"))&&(_.is_hashtag_list_display=!1,!0)}])},[Dt("div",MA,[Si(Dt("input",{class:"tweet-form__hashtag-form",type:"search",placeholder:"#ハッシュタグ",spellcheck:"false","onUpdate:modelValue":e[3]||(e[3]=a=>_.tweet_hashtag=a),onInput:e[4]||(e[4]=a=>_.updateTweetLetterCount()),onFocus:e[5]||(e[5]=a=>_.is_tweet_hashtag_form_focused=!0),onBlur:e[6]||(e[6]=a=>_.is_tweet_hashtag_form_focused=!1),onChange:e[7]||(e[7]=a=>{_.tweet_hashtag=_.formatHashtag(_.tweet_hashtag),_.updateTweetLetterCount()})},null,544),[[Ml,_.tweet_hashtag]]),Si((Zt(),ai("div",{class:"tweet-form__hashtag-list-button",onClick:e[8]||(e[8]=a=>_.clickHashtagListButton())},[Ai(r,{icon:"fluent:clipboard-text-ltr-32-regular",height:"22px"})])),[[Ri]])]),Si(Dt("textarea",{class:"tweet-form__textarea",placeholder:"ツイート",spellcheck:"false","onUpdate:modelValue":e[9]||(e[9]=a=>_.tweet_text=a),ref:"tweet_text",onInput:e[10]||(e[10]=a=>_.updateTweetLetterCount()),onPaste:e[11]||(e[11]=a=>_.pasteClipboardData(a)),onFocus:e[12]||(e[12]=a=>_.is_tweet_text_form_focused=!0),onBlur:e[13]||(e[13]=a=>_.is_tweet_text_form_focused=!1)},` + `,544),[[Ml,_.tweet_text]]),Dt("div",PA,[Si((Zt(),ai("div",{class:Yi(["account-button",{"account-button--no-login":!_.is_logged_in_twitter}]),onClick:e[14]||(e[14]=a=>_.clickAccountButton())},[Dt("img",{class:"account-button__icon",src:_.is_logged_in_twitter?(t=_.selected_twitter_account)==null?void 0:t.icon_url:"/assets/images/account-icon-default.png"},null,8,BA),Dt("span",NA,en(_.is_logged_in_twitter?`@${(n=_.selected_twitter_account)==null?void 0:n.screen_name}`:"連携されていません"),1),Ai(r,{class:"account-button__menu",icon:"fluent:more-circle-20-regular",width:"22px"})],2)),[[Ri]]),Dt("div",FA,[Dt("div",{class:Yi(["limit-meter__content",{"limit-meter__content--yellow":_.tweet_letter_remain_count<=20,"limit-meter__content--red":_.tweet_letter_remain_count<=0}])},[Ai(r,{icon:"fa-brands:twitter",width:"12px",style:{"margin-right":"-2px"}}),Dt("span",null,en(_.tweet_letter_remain_count),1)],2),Dt("div",UA,[Ai(r,{icon:"fluent:image-16-filled",width:"14px"}),Dt("span",null,en(_.playerStore.twitter_selected_capture_blobs.length)+"/4",1)])]),Si((Zt(),ai("button",{class:"tweet-button",disabled:_.is_tweet_button_disabled,onClick:e[15]||(e[15]=a=>_.is_tweet_button_disabled===!1&&_.sendTweet()),onTouchstart:e[16]||(e[16]=a=>_.is_tweet_button_disabled===!1&&_.sendTweet())},[Ai(r,{icon:"fa-brands:twitter",height:"16px"}),jA],40,GA)),[[Ri]])])],2),Dt("div",{class:Yi(["hashtag-list",{"hashtag-list--display":_.is_hashtag_list_display,"hashtag-list--virtual-keyboard-display":_.playerStore.is_virtual_keyboard_display&&_.Utils.hasActiveElementClass("hashtag__input")}])},[Dt("div",VA,[Dt("div",HA,[Ai(r,{icon:"charm:hash",width:"17px"}),zA]),Si((Zt(),ai("button",{class:"hashtag-heading__add-button",onClick:e[17]||(e[17]=a=>_.saved_twitter_hashtags.push({id:_.Utils.time(),text:"#ここにハッシュタグを入力",editing:!1}))},[Ai(r,{icon:"fluent:add-12-filled",width:"17px"}),WA])),[[Ri]])]),Ai(i,{class:"hashtag-container",handle:".hashtag__sort-handle","item-key":"id",modelValue:_.saved_twitter_hashtags,"onUpdate:modelValue":e[19]||(e[19]=a=>_.saved_twitter_hashtags=a)},{item:hn(({element:a})=>[Si((Zt(),ai("div",{class:Yi(["hashtag",{"hashtag--editing":a.editing}]),onClick:o=>_.clickHashtag(a)},[Si(Dt("input",{type:"search",class:"hashtag__input",spellcheck:"false","onUpdate:modelValue":o=>a.text=o,disabled:!a.editing,onClick:e[18]||(e[18]=ta(()=>{},["stop"]))},null,8,qA),[[Ml,a.text]]),Si((Zt(),ai("button",{class:"hashtag__edit-button",onClick:ta(o=>{a.editing=!a.editing,a.text=_.formatHashtag(a.text,!0),_.updateTweetLetterCount()},["prevent","stop"])},[a.editing===!1?(Zt(),ai("svg",JA,ZA)):_n("",!0),a.editing===!0?(Zt(),ai("svg",XA,ey)):_n("",!0)],8,YA)),[[Ri]]),Si((Zt(),ai("button",{class:"hashtag__delete-button",onClick:ta(o=>_.saved_twitter_hashtags.splice(_.saved_twitter_hashtags.indexOf(a),1),["prevent","stop"])},ny,8,ty)),[[Ri]]),ry],10,KA)),[[Ri,!a.editing]])]),_:1},8,["modelValue"])],2),Dt("div",{class:Yi(["twitter-account-list",{"twitter-account-list--display":_.is_twitter_account_list_display}])},[(Zt(!0),ai($n,null,Xn(_.userStore.user?_.userStore.user.twitter_accounts:[],a=>Si((Zt(),ai("div",{class:"twitter-account",key:a.id,onClick:o=>_.updateSelectedTwitterAccount(a)},[Dt("img",{class:"twitter-account__icon",src:a.icon_url},null,8,ay),Dt("div",oy,[Dt("div",ly,en(a.name),1),Dt("div",cy,"@"+en(a.screen_name),1)]),Si((Zt(),ai("svg",dy,hy,512)),[[rd,a.id===_.settingsStore.settings.selected_twitter_account_id]])],8,sy)),[[Ri]])),128))],2)])}const py=Wn(xA,[["render",fy],["__scopeId","data-v-894b4344"]]),my=er({name:"Watch-Panel",components:{Channel:Om,Comment:hg,Program:Fg,RecordedProgram:c3,Remocon:H3,Series:q3,Twitter:py},props:{playback_mode:{type:String,required:!0}},data(){return{Utils:Object.freeze(si)}},computed:{...yr(Ln,cn),panel_active_tab(){return this.playback_mode==="Live"?this.playerStore.tv_panel_active_tab:this.playerStore.video_panel_active_tab}}}),xs=_=>(Ir("data-v-02bb8a53"),_=_(),Lr(),_),gy={class:"watch-panel__header"},Ay=xs(()=>Dt("span",{class:"panel-close-button__text"},"閉じる",-1)),yy={key:0,class:"panel-broadcaster"},vy=["src"],by={class:"panel-broadcaster__number"},_y={class:"panel-broadcaster__name"},Ey={class:"watch-panel__content-container"},wy={class:"watch-panel__navigation"},Sy=xs(()=>Dt("span",{class:"panel-navigation-button__text"},"番組情報",-1)),Ty=xs(()=>Dt("span",{class:"panel-navigation-button__text"},"番組情報",-1)),Cy=xs(()=>Dt("span",{class:"panel-navigation-button__text"},"チャンネル",-1)),xy=xs(()=>Dt("span",{class:"panel-navigation-button__text"},"シリーズ",-1)),ky=xs(()=>Dt("span",{class:"panel-navigation-button__text"},"コメント",-1)),Ry=xs(()=>Dt("span",{class:"panel-navigation-button__text"},"Twitter",-1));function Iy(_,e,s,u,A,y){const l=an("Icon"),c=an("Program"),p=an("RecordedProgram"),r=an("Channel"),i=an("Series"),t=an("Comment"),n=an("Twitter"),a=an("Remocon");return Zt(),ai("div",{class:"watch-panel",onMousemove:e[9]||(e[9]=o=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:o}))},[Dt("div",gy,[Si((Zt(),ai("div",{class:"panel-close-button",onClick:e[0]||(e[0]=o=>_.playerStore.is_panel_display=!1)},[Ai(l,{class:"panel-close-button__icon",icon:"akar-icons:chevron-right",width:"25px"}),Ay])),[[Ri]]),Ai(zo),_.playback_mode==="Live"?(Zt(),ai("div",yy,[Dt("img",{class:"panel-broadcaster__icon",src:`${_.Utils.api_base_url}/channels/${_.channelsStore.channel.current.id}/logo`},null,8,vy),Dt("div",by,en(_.channelsStore.channel.current.channel_number),1),Dt("div",_y,en(_.channelsStore.channel.current.name),1)])):_n("",!0)]),Dt("div",Ey,[_.playback_mode==="Live"?(Zt(),Tn(c,{key:0,class:Yi(["watch-panel__content",{"watch-panel__content--active":_.panel_active_tab==="Program"}])},null,8,["class"])):_n("",!0),_.playback_mode==="Video"?(Zt(),Tn(p,{key:1,class:Yi(["watch-panel__content",{"watch-panel__content--active":_.panel_active_tab==="RecordedProgram"}])},null,8,["class"])):_n("",!0),_.playback_mode==="Live"?(Zt(),Tn(r,{key:2,class:Yi(["watch-panel__content",{"watch-panel__content--active":_.panel_active_tab==="Channel"}])},null,8,["class"])):_n("",!0),_.playback_mode==="Video"?(Zt(),Tn(i,{key:3,class:Yi(["watch-panel__content",{"watch-panel__content--active":_.panel_active_tab==="Series"}])},null,8,["class"])):_n("",!0),Ai(t,{class:Yi(["watch-panel__content",{"watch-panel__content--active":_.panel_active_tab==="Comment"}]),playback_mode:_.playback_mode},null,8,["playback_mode","class"]),Ai(n,{class:Yi(["watch-panel__content",{"watch-panel__content--active":_.panel_active_tab==="Twitter"}]),playback_mode:_.playback_mode},null,8,["playback_mode","class"]),_.playback_mode==="Live"?Si((Zt(),ai("button",{key:4,class:Yi(["watch-panel__content-remocon-button elevation-8",{"watch-panel__content-remocon-button--active":_.panel_active_tab==="Program"||_.panel_active_tab==="Channel"}]),onClick:e[1]||(e[1]=o=>_.playerStore.is_remocon_display=!_.playerStore.is_remocon_display)},[Ai(l,{class:"panel-close-button__icon",icon:"material-symbols:remote-gen",width:"25px"})],2)),[[Ri]]):_n("",!0),_.playback_mode==="Live"?(Zt(),Tn(a,{key:5,class:"watch-panel__remocon",modelValue:(_.panel_active_tab==="Program"||_.panel_active_tab==="Channel")&&_.playerStore.is_remocon_display===!0,"onUpdate:modelValue":e[2]||(e[2]=o=>_.playerStore.is_remocon_display=o)},null,8,["modelValue"])):_n("",!0)]),Dt("div",wy,[_.playback_mode==="Live"?Si((Zt(),ai("div",{key:0,class:Yi(["panel-navigation-button",{"panel-navigation-button--active":_.panel_active_tab==="Program"}]),onClick:e[3]||(e[3]=o=>_.playerStore.tv_panel_active_tab="Program")},[Ai(l,{class:"panel-navigation-button__icon",icon:"fa-solid:info-circle",width:"33px"}),Sy],2)),[[Ri]]):_n("",!0),_.playback_mode==="Video"?Si((Zt(),ai("div",{key:1,class:Yi(["panel-navigation-button",{"panel-navigation-button--active":_.panel_active_tab==="RecordedProgram"}]),onClick:e[4]||(e[4]=o=>_.playerStore.video_panel_active_tab="RecordedProgram")},[Ai(l,{class:"panel-navigation-button__icon",icon:"fa-solid:info-circle",width:"33px"}),Ty],2)),[[Ri]]):_n("",!0),_.playback_mode==="Live"?Si((Zt(),ai("div",{key:2,class:Yi(["panel-navigation-button",{"panel-navigation-button--active":_.panel_active_tab==="Channel"}]),onClick:e[5]||(e[5]=o=>_.playerStore.tv_panel_active_tab="Channel")},[Ai(l,{class:"panel-navigation-button__icon",icon:"fa-solid:broadcast-tower",width:"34px"}),Cy],2)),[[Ri]]):_n("",!0),_.playback_mode==="Video"?Si((Zt(),ai("div",{key:3,class:Yi(["panel-navigation-button",{"panel-navigation-button--active":_.panel_active_tab==="Series"}]),onClick:e[6]||(e[6]=o=>_.playerStore.video_panel_active_tab="Series")},[Ai(l,{class:"panel-navigation-button__icon",icon:"fluent:video-clip-multiple-16-filled",width:"34px",style:{width:"39px",height:"39px","margin-top":"-4px","margin-bottom":"-4px"}}),xy],2)),[[Ri]]):_n("",!0),Si((Zt(),ai("div",{class:Yi(["panel-navigation-button",{"panel-navigation-button--active":_.panel_active_tab==="Comment"}]),onClick:e[7]||(e[7]=o=>_.playback_mode==="Live"?_.playerStore.tv_panel_active_tab="Comment":_.playerStore.video_panel_active_tab="Comment")},[Ai(l,{class:"panel-navigation-button__icon",icon:"bi:chat-left-text-fill",width:"29px"}),ky],2)),[[Ri]]),Si((Zt(),ai("div",{class:Yi(["panel-navigation-button",{"panel-navigation-button--active":_.panel_active_tab==="Twitter"}]),onClick:e[8]||(e[8]=o=>_.playback_mode==="Live"?_.playerStore.tv_panel_active_tab="Twitter":_.playerStore.video_panel_active_tab="Twitter")},[Ai(l,{class:"panel-navigation-button__icon",icon:"fa-brands:twitter",width:"34px"}),Ry],2)),[[Ri]])])],32)}const Ly=Wn(my,[["render",Iy],["__scopeId","data-v-02bb8a53"]]),Dy=er({name:"Watch-Player",props:{playback_mode:{type:String,required:!0}},data(){return{Utils:Object.freeze(si)}},computed:{...yr(Ln,cn)}}),Jf=_=>(Ir("data-v-19d3454d"),_=_(),Lr(),_),Oy={class:"watch-player__background-wrapper"},My=Jf(()=>Dt("img",{class:"watch-player__background-logo",src:l2},null,-1)),Py=[My],By=Jf(()=>Dt("div",{class:"watch-player__dplayer"},null,-1));function Ny(_,e,s,u,A,y){const l=an("Icon"),c=Mf("tooltip");return Zt(),ai("div",{class:Yi(["watch-player",{"watch-player--loading":_.playerStore.is_loading,"watch-player--virtual-keyboard-display":_.playerStore.is_virtual_keyboard_display&&_.Utils.hasActiveElementClass("dplayer-comment-input"),"watch-player--video":_.playback_mode==="Video"}])},[Dt("div",Oy,[Dt("div",{class:Yi(["watch-player__background",{"watch-player__background--display":_.playerStore.is_background_display}]),style:Eo({backgroundImage:`url(${_.playerStore.background_url})`})},Py,6)]),Ai(Pf,{indeterminate:"",size:"60",width:"6",class:Yi(["watch-player__buffering",{"watch-player__buffering--display":_.playerStore.is_video_buffering}])},null,8,["class"]),By,Dt("div",{class:"watch-player__button",onMousemove:e[3]||(e[3]=p=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:p})),onTouchmove:e[4]||(e[4]=p=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:p})),onClick:e[5]||(e[5]=p=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:p}))},[_.playback_mode==="Live"?Si((Zt(),ai("div",{key:0,class:"switch-button switch-button-up",onClick:e[0]||(e[0]=p=>{_.playerStore.is_zapping=!0,_.$router.push({path:`/tv/watch/${_.channelsStore.channel.previous.display_channel_id}`})})},[Ai(l,{class:"switch-button-icon",icon:"fluent:ios-arrow-left-24-filled",width:"32px",style:{transform:"rotate(90deg)"}})])),[[Ri],[c,"前のチャンネル",void 0,{top:!0}]]):_n("",!0),Si((Zt(),ai("div",{class:Yi(["switch-button switch-button-panel",{"switch-button-panel--open":_.playerStore.is_panel_display}]),onClick:e[1]||(e[1]=p=>_.playerStore.is_panel_display=!_.playerStore.is_panel_display)},[Ai(l,{class:"switch-button-icon",icon:"fluent:navigation-16-filled",width:"32px"})],2)),[[Ri]]),_.playback_mode==="Live"?Si((Zt(),ai("div",{key:1,class:"switch-button switch-button-down",onClick:e[2]||(e[2]=p=>{_.playerStore.is_zapping=!0,_.$router.push({path:`/tv/watch/${_.channelsStore.channel.next.display_channel_id}`})})},[Ai(l,{class:"switch-button-icon",icon:"fluent:ios-arrow-right-24-filled",width:"33px",style:{transform:"rotate(90deg)"}})])),[[Ri],[c,"次のチャンネル",void 0,{bottom:!0}]]):_n("",!0)],32)],2)}const Fy=Wn(Dy,[["render",Ny],["__scopeId","data-v-19d3454d"]]),Uy=er({name:"Watch",components:{KeyboardShortcutList:nm,WatchHeader:U2,WatchNavigation:cm,WatchPanel:Ly,WatchPlayer:Fy},props:{playback_mode:{type:String,required:!0}},data(){return{Utils:Object.freeze(si)}},computed:{...yr(cn,Sn)},watch:{"playerStore.is_panel_display":{handler(){this.settingsStore.settings.showed_panel_last_time=this.playerStore.is_panel_display}}},created(){"virtualKeyboard"in navigator&&(navigator.virtualKeyboard.overlaysContent=!0,navigator.virtualKeyboard.ongeometrychange=_=>{_.target.boundingRect.width===0&&_.target.boundingRect.height===0?this.playerStore.is_virtual_keyboard_display=!1:this.playerStore.is_virtual_keyboard_display=!0}),this.playerStore.startWatching()},beforeUnmount(){this.playerStore.stopWatching(),"virtualKeyboard"in navigator&&(navigator.virtualKeyboard.overlaysContent=!1)}}),Gy={class:"route-container"};function jy(_,e,s,u,A,y){const l=an("WatchNavigation"),c=an("WatchHeader"),p=an("WatchPlayer"),r=an("WatchPanel"),i=an("KeyboardShortcutList");return Zt(),ai("div",Gy,[Dt("main",{class:Yi(["watch-container",{"watch-container--control-display":_.playerStore.is_control_display,"watch-container--panel-display":_.Utils.isSmartphoneVertical()||_.Utils.isTabletVertical()?!0:_.playerStore.is_panel_display,"watch-container--fullscreen":_.playerStore.is_fullscreen,"watch-container--document-pip":_.playerStore.is_document_pip,"watch-container--video":_.playback_mode==="Video"}])},[Ai(l),Dt("div",{class:"watch-content",onMousemove:e[0]||(e[0]=t=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:t,is_player_region_event:!0})),onTouchmove:e[1]||(e[1]=t=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:t,is_player_region_event:!0})),onClick:e[2]||(e[2]=t=>_.playerStore.event_emitter.emit("SetControlDisplayTimer",{event:t,is_player_region_event:!0}))},[Ai(c,{playback_mode:_.playback_mode},null,8,["playback_mode"]),Ai(p,{playback_mode:_.playback_mode},null,8,["playback_mode"])],32),Ai(r,{playback_mode:_.playback_mode},null,8,["playback_mode"])],2),Ai(i,{playback_mode:_.playback_mode},null,8,["playback_mode"])])}const I6=Wn(Uy,[["render",jy],["__scopeId","data-v-db02acbf"]]);var Fl={exports:{}},Ul={},sa={},Qf={},dd=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},s=Symbol("test"),u=Object(s);if(typeof s=="string"||Object.prototype.toString.call(s)!=="[object Symbol]"||Object.prototype.toString.call(u)!=="[object Symbol]")return!1;var A=42;e[s]=A;for(s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var y=Object.getOwnPropertySymbols(e);if(y.length!==1||y[0]!==s||!Object.prototype.propertyIsEnumerable.call(e,s))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,s);if(l.value!==A||l.enumerable!==!0)return!1}return!0},Vy=dd,ud=function(){return Vy()&&!!Symbol.toStringTag},Hy=Error,zy=EvalError,Wy=RangeError,Ky=ReferenceError,Zf=SyntaxError,Ko=TypeError,qy=URIError,Gu=typeof Symbol<"u"&&Symbol,Yy=dd,Jy=function(){return typeof Gu!="function"||typeof Symbol!="function"||typeof Gu("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Yy()},Gl={__proto__:null,foo:{}},Qy=Object,Zy=function(){return{__proto__:Gl}.foo===Gl.foo&&!(Gl instanceof Qy)},Xy="Function.prototype.bind called on incompatible ",$y=Object.prototype.toString,ev=Math.max,tv="[object Function]",ju=function(e,s){for(var u=[],A=0;A"u"||!Nn?sn:Nn(Uint8Array),Ss={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?sn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?sn:ArrayBuffer,"%ArrayIteratorPrototype%":Us&&Nn?Nn([][Symbol.iterator]()):sn,"%AsyncFromSyncIteratorPrototype%":sn,"%AsyncFunction%":qs,"%AsyncGenerator%":qs,"%AsyncGeneratorFunction%":qs,"%AsyncIteratorPrototype%":qs,"%Atomics%":typeof Atomics>"u"?sn:Atomics,"%BigInt%":typeof BigInt>"u"?sn:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?sn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?sn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?sn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":dv,"%eval%":eval,"%EvalError%":uv,"%Float32Array%":typeof Float32Array>"u"?sn:Float32Array,"%Float64Array%":typeof Float64Array>"u"?sn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?sn:FinalizationRegistry,"%Function%":Xf,"%GeneratorFunction%":qs,"%Int8Array%":typeof Int8Array>"u"?sn:Int8Array,"%Int16Array%":typeof Int16Array>"u"?sn:Int16Array,"%Int32Array%":typeof Int32Array>"u"?sn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Us&&Nn?Nn(Nn([][Symbol.iterator]())):sn,"%JSON%":typeof JSON=="object"?JSON:sn,"%Map%":typeof Map>"u"?sn:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Us||!Nn?sn:Nn(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?sn:Promise,"%Proxy%":typeof Proxy>"u"?sn:Proxy,"%RangeError%":hv,"%ReferenceError%":fv,"%Reflect%":typeof Reflect>"u"?sn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?sn:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Us||!Nn?sn:Nn(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?sn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Us&&Nn?Nn(""[Symbol.iterator]()):sn,"%Symbol%":Us?Symbol:sn,"%SyntaxError%":aa,"%ThrowTypeError%":mv,"%TypedArray%":Av,"%TypeError%":ia,"%Uint8Array%":typeof Uint8Array>"u"?sn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?sn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?sn:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?sn:Uint32Array,"%URIError%":pv,"%WeakMap%":typeof WeakMap>"u"?sn:WeakMap,"%WeakRef%":typeof WeakRef>"u"?sn:WeakRef,"%WeakSet%":typeof WeakSet>"u"?sn:WeakSet};if(Nn)try{null.error}catch(_){var yv=Nn(Nn(_));Ss["%Error.prototype%"]=yv}var vv=function _(e){var s;if(e==="%AsyncFunction%")s=jl("async function () {}");else if(e==="%GeneratorFunction%")s=jl("function* () {}");else if(e==="%AsyncGeneratorFunction%")s=jl("async function* () {}");else if(e==="%AsyncGenerator%"){var u=_("%AsyncGeneratorFunction%");u&&(s=u.prototype)}else if(e==="%AsyncIteratorPrototype%"){var A=_("%AsyncGenerator%");A&&Nn&&(s=Nn(A.prototype))}return Ss[e]=s,s},Vu={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Oa=hd,So=cv,bv=Oa.call(Function.call,Array.prototype.concat),_v=Oa.call(Function.apply,Array.prototype.splice),Hu=Oa.call(Function.call,String.prototype.replace),To=Oa.call(Function.call,String.prototype.slice),Ev=Oa.call(Function.call,RegExp.prototype.exec),wv=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Sv=/\\(\\)?/g,Tv=function(e){var s=To(e,0,1),u=To(e,-1);if(s==="%"&&u!=="%")throw new aa("invalid intrinsic syntax, expected closing `%`");if(u==="%"&&s!=="%")throw new aa("invalid intrinsic syntax, expected opening `%`");var A=[];return Hu(e,wv,function(y,l,c,p){A[A.length]=c?Hu(p,Sv,"$1"):l||y}),A},Cv=function(e,s){var u=e,A;if(So(Vu,u)&&(A=Vu[u],u="%"+A[0]+"%"),So(Ss,u)){var y=Ss[u];if(y===qs&&(y=vv(u)),typeof y>"u"&&!s)throw new ia("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:A,name:u,value:y}}throw new aa("intrinsic "+e+" does not exist!")},Ma=function(e,s){if(typeof e!="string"||e.length===0)throw new ia("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof s!="boolean")throw new ia('"allowMissing" argument must be a boolean');if(Ev(/^%?[^%]*%?$/,e)===null)throw new aa("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var u=Tv(e),A=u.length>0?u[0]:"",y=Cv("%"+A+"%",s),l=y.name,c=y.value,p=!1,r=y.alias;r&&(A=r[0],_v(u,bv([0,1],r)));for(var i=1,t=!0;i=u.length){var d=ws(c,n);t=!!d,t&&"get"in d&&!("originalValue"in d.get)?c=d.get:c=c[n]}else t=So(c,n),c=c[n];t&&!p&&(Ss[l]=c)}}return c},$f={exports:{}},Hl,zu;function fd(){if(zu)return Hl;zu=1;var _=Ma,e=_("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Hl=e,Hl}var xv=Ma,lo=xv("%Object.getOwnPropertyDescriptor%",!0);if(lo)try{lo([],"length")}catch{lo=null}var pd=lo,Wu=fd(),kv=Zf,Gs=Ko,Ku=pd,ep=function(e,s,u){if(!e||typeof e!="object"&&typeof e!="function")throw new Gs("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new Gs("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Gs("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Gs("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Gs("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Gs("`loose`, if provided, must be a boolean");var A=arguments.length>3?arguments[3]:null,y=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,p=!!Ku&&Ku(e,s);if(Wu)Wu(e,s,{configurable:l===null&&p?p.configurable:!l,enumerable:A===null&&p?p.enumerable:!A,value:u,writable:y===null&&p?p.writable:!y});else if(c||!A&&!y&&!l)e[s]=u;else throw new kv("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Lc=fd(),tp=function(){return!!Lc};tp.hasArrayLengthDefineBug=function(){if(!Lc)return null;try{return Lc([],"length",{value:1}).length!==1}catch{return!0}};var ip=tp,Rv=Ma,qu=ep,Iv=ip(),Yu=pd,Ju=Ko,Lv=Rv("%Math.floor%"),Dv=function(e,s){if(typeof e!="function")throw new Ju("`fn` is not a function");if(typeof s!="number"||s<0||s>4294967295||Lv(s)!==s)throw new Ju("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],A=!0,y=!0;if("length"in e&&Yu){var l=Yu(e,"length");l&&!l.configurable&&(A=!1),l&&!l.writable&&(y=!1)}return(A||y||!u)&&(Iv?qu(e,"length",s,!0,!0):qu(e,"length",s)),e};(function(_){var e=hd,s=Ma,u=Dv,A=Ko,y=s("%Function.prototype.apply%"),l=s("%Function.prototype.call%"),c=s("%Reflect.apply%",!0)||e.call(l,y),p=fd(),r=s("%Math.max%");_.exports=function(n){if(typeof n!="function")throw new A("a function is required");var a=c(e,l,arguments);return u(a,1+r(0,n.length-(arguments.length-1)),!0)};var i=function(){return c(e,y,arguments)};p?p(_.exports,"apply",{value:i}):_.exports.apply=i})($f);var qo=$f.exports,np=Ma,rp=qo,Ov=rp(np("String.prototype.indexOf")),Yo=function(e,s){var u=np(e,!!s);return typeof u=="function"&&Ov(e,".prototype.")>-1?rp(u):u},Mv=ud(),Pv=Yo,Dc=Pv("Object.prototype.toString"),Jo=function(e){return Mv&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Dc(e)==="[object Arguments]"},sp=function(e){return Jo(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Dc(e)!=="[object Array]"&&Dc(e.callee)==="[object Function]"},Bv=function(){return Jo(arguments)}();Jo.isLegacyArguments=sp;var Nv=Bv?Jo:sp,Fv=Object.prototype.toString,Uv=Function.prototype.toString,Gv=/^\s*(?:function)?\*/,ap=ud(),zl=Object.getPrototypeOf,jv=function(){if(!ap)return!1;try{return Function("return function*() {}")()}catch{}},Wl,Vv=function(e){if(typeof e!="function")return!1;if(Gv.test(Uv.call(e)))return!0;if(!ap){var s=Fv.call(e);return s==="[object GeneratorFunction]"}if(!zl)return!1;if(typeof Wl>"u"){var u=jv();Wl=u?zl(u):!1}return zl(e)===Wl},op=Function.prototype.toString,Qs=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Oc,co;if(typeof Qs=="function"&&typeof Object.defineProperty=="function")try{Oc=Object.defineProperty({},"length",{get:function(){throw co}}),co={},Qs(function(){throw 42},null,Oc)}catch(_){_!==co&&(Qs=null)}else Qs=null;var Hv=/^\s*class\b/,Mc=function(e){try{var s=op.call(e);return Hv.test(s)}catch{return!1}},Kl=function(e){try{return Mc(e)?!1:(op.call(e),!0)}catch{return!1}},uo=Object.prototype.toString,zv="[object Object]",Wv="[object Function]",Kv="[object GeneratorFunction]",qv="[object HTMLAllCollection]",Yv="[object HTML document.all class]",Jv="[object HTMLCollection]",Qv=typeof Symbol=="function"&&!!Symbol.toStringTag,Zv=!(0 in[,]),Pc=function(){return!1};if(typeof document=="object"){var Xv=document.all;uo.call(Xv)===uo.call(document.all)&&(Pc=function(e){if((Zv||!e)&&(typeof e>"u"||typeof e=="object"))try{var s=uo.call(e);return(s===qv||s===Yv||s===Jv||s===zv)&&e("")==null}catch{}return!1})}var $v=Qs?function(e){if(Pc(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Qs(e,null,Oc)}catch(s){if(s!==co)return!1}return!Mc(e)&&Kl(e)}:function(e){if(Pc(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(Qv)return Kl(e);if(Mc(e))return!1;var s=uo.call(e);return s!==Wv&&s!==Kv&&!/^\[object HTML/.test(s)?!1:Kl(e)},eb=$v,tb=Object.prototype.toString,lp=Object.prototype.hasOwnProperty,ib=function(e,s,u){for(var A=0,y=e.length;A=3&&(A=u),tb.call(e)==="[object Array]"?ib(e,s,A):typeof e=="string"?nb(e,s,A):rb(e,s,A)},ab=sb,ob=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],ql=ob,lb=typeof globalThis>"u"?Ho:globalThis,cb=function(){for(var e=[],s=0;s"u"?Ho:globalThis,Bc=db(),gd=md("String.prototype.slice"),Yl=Object.getPrototypeOf,hb=md("Array.prototype.indexOf",!0)||function(e,s){for(var u=0;u-1?s:s!=="Object"?!1:pb(e)}return ho?fb(e):null},mb=dp,gb=function(e){return!!mb(e)};(function(_){var e=Nv,s=Vv,u=dp,A=gb;function y(Oe){return Oe.call.bind(Oe)}var l=typeof BigInt<"u",c=typeof Symbol<"u",p=y(Object.prototype.toString),r=y(Number.prototype.valueOf),i=y(String.prototype.valueOf),t=y(Boolean.prototype.valueOf);if(l)var n=y(BigInt.prototype.valueOf);if(c)var a=y(Symbol.prototype.valueOf);function o(Oe,pt){if(typeof Oe!="object")return!1;try{return pt(Oe),!0}catch{return!1}}_.isArgumentsObject=e,_.isGeneratorFunction=s,_.isTypedArray=A;function d(Oe){return typeof Promise<"u"&&Oe instanceof Promise||Oe!==null&&typeof Oe=="object"&&typeof Oe.then=="function"&&typeof Oe.catch=="function"}_.isPromise=d;function g(Oe){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Oe):A(Oe)||z(Oe)}_.isArrayBufferView=g;function m(Oe){return u(Oe)==="Uint8Array"}_.isUint8Array=m;function v(Oe){return u(Oe)==="Uint8ClampedArray"}_.isUint8ClampedArray=v;function b(Oe){return u(Oe)==="Uint16Array"}_.isUint16Array=b;function w(Oe){return u(Oe)==="Uint32Array"}_.isUint32Array=w;function C(Oe){return u(Oe)==="Int8Array"}_.isInt8Array=C;function D(Oe){return u(Oe)==="Int16Array"}_.isInt16Array=D;function R(Oe){return u(Oe)==="Int32Array"}_.isInt32Array=R;function T(Oe){return u(Oe)==="Float32Array"}_.isFloat32Array=T;function P(Oe){return u(Oe)==="Float64Array"}_.isFloat64Array=P;function L(Oe){return u(Oe)==="BigInt64Array"}_.isBigInt64Array=L;function I(Oe){return u(Oe)==="BigUint64Array"}_.isBigUint64Array=I;function x(Oe){return p(Oe)==="[object Map]"}x.working=typeof Map<"u"&&x(new Map);function O(Oe){return typeof Map>"u"?!1:x.working?x(Oe):Oe instanceof Map}_.isMap=O;function G(Oe){return p(Oe)==="[object Set]"}G.working=typeof Set<"u"&&G(new Set);function J(Oe){return typeof Set>"u"?!1:G.working?G(Oe):Oe instanceof Set}_.isSet=J;function te(Oe){return p(Oe)==="[object WeakMap]"}te.working=typeof WeakMap<"u"&&te(new WeakMap);function le(Oe){return typeof WeakMap>"u"?!1:te.working?te(Oe):Oe instanceof WeakMap}_.isWeakMap=le;function ne(Oe){return p(Oe)==="[object WeakSet]"}ne.working=typeof WeakSet<"u"&&ne(new WeakSet);function ee(Oe){return ne(Oe)}_.isWeakSet=ee;function M(Oe){return p(Oe)==="[object ArrayBuffer]"}M.working=typeof ArrayBuffer<"u"&&M(new ArrayBuffer);function Y(Oe){return typeof ArrayBuffer>"u"?!1:M.working?M(Oe):Oe instanceof ArrayBuffer}_.isArrayBuffer=Y;function j(Oe){return p(Oe)==="[object DataView]"}j.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&j(new DataView(new ArrayBuffer(1),0,1));function z(Oe){return typeof DataView>"u"?!1:j.working?j(Oe):Oe instanceof DataView}_.isDataView=z;var q=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Z(Oe){return p(Oe)==="[object SharedArrayBuffer]"}function X(Oe){return typeof q>"u"?!1:(typeof Z.working>"u"&&(Z.working=Z(new q)),Z.working?Z(Oe):Oe instanceof q)}_.isSharedArrayBuffer=X;function oe(Oe){return p(Oe)==="[object AsyncFunction]"}_.isAsyncFunction=oe;function he(Oe){return p(Oe)==="[object Map Iterator]"}_.isMapIterator=he;function ie(Oe){return p(Oe)==="[object Set Iterator]"}_.isSetIterator=ie;function fe(Oe){return p(Oe)==="[object Generator]"}_.isGeneratorObject=fe;function se(Oe){return p(Oe)==="[object WebAssembly.Module]"}_.isWebAssemblyCompiledModule=se;function Ee(Oe){return o(Oe,r)}_.isNumberObject=Ee;function He(Oe){return o(Oe,i)}_.isStringObject=He;function Ie(Oe){return o(Oe,t)}_.isBooleanObject=Ie;function at(Oe){return l&&o(Oe,n)}_.isBigIntObject=at;function je(Oe){return c&&o(Oe,a)}_.isSymbolObject=je;function ht(Oe){return Ee(Oe)||He(Oe)||Ie(Oe)||at(Oe)||je(Oe)}_.isBoxedPrimitive=ht;function _e(Oe){return typeof Uint8Array<"u"&&(Y(Oe)||X(Oe))}_.isAnyArrayBuffer=_e,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Oe){Object.defineProperty(_,Oe,{enumerable:!1,value:function(){throw new Error(Oe+" is not supported in userland")}})})})(Qf);var Ab=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"},Nc={exports:{}};typeof Object.create=="function"?Nc.exports=function(e,s){s&&(e.super_=s,e.prototype=Object.create(s.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Nc.exports=function(e,s){if(s){e.super_=s;var u=function(){};u.prototype=s.prototype,e.prototype=new u,e.prototype.constructor=e}};var yb=Nc.exports;(function(_){var e={},s=Object.getOwnPropertyDescriptors||function(q){for(var Z=Object.keys(q),X={},oe=0;oe=oe)return fe;switch(fe){case"%s":return String(X[Z++]);case"%d":return Number(X[Z++]);case"%j":try{return JSON.stringify(X[Z++])}catch{return"[Circular]"}default:return fe}}),ie=X[Z];Z"u")return function(){return _.deprecate(z,q).apply(this,arguments)};var Z=!1;function X(){if(!Z){if(process.throwDeprecation)throw new Error(q);process.traceDeprecation?console.trace(q):console.error(q),Z=!0}return z.apply(this,arguments)}return X};var A={},y=/^$/;if(e.NODE_DEBUG){var l=e.NODE_DEBUG;l=l.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),y=new RegExp("^"+l+"$","i")}_.debuglog=function(z){if(z=z.toUpperCase(),!A[z])if(y.test(z)){var q=process.pid;A[z]=function(){var Z=_.format.apply(_,arguments);console.error("%s %d: %s",z,q,Z)}}else A[z]=function(){};return A[z]};function c(z,q){var Z={seen:[],stylize:r};return arguments.length>=3&&(Z.depth=arguments[2]),arguments.length>=4&&(Z.colors=arguments[3]),v(q)?Z.showHidden=q:q&&_._extend(Z,q),T(Z.showHidden)&&(Z.showHidden=!1),T(Z.depth)&&(Z.depth=2),T(Z.colors)&&(Z.colors=!1),T(Z.customInspect)&&(Z.customInspect=!0),Z.colors&&(Z.stylize=p),t(Z,z,Z.depth)}_.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function p(z,q){var Z=c.styles[q];return Z?"\x1B["+c.colors[Z][0]+"m"+z+"\x1B["+c.colors[Z][1]+"m":z}function r(z,q){return z}function i(z){var q={};return z.forEach(function(Z,X){q[Z]=!0}),q}function t(z,q,Z){if(z.customInspect&&q&&O(q.inspect)&&q.inspect!==_.inspect&&!(q.constructor&&q.constructor.prototype===q)){var X=q.inspect(Z,z);return D(X)||(X=t(z,X,Z)),X}var oe=n(z,q);if(oe)return oe;var he=Object.keys(q),ie=i(he);if(z.showHidden&&(he=Object.getOwnPropertyNames(q)),x(q)&&(he.indexOf("message")>=0||he.indexOf("description")>=0))return a(q);if(he.length===0){if(O(q)){var fe=q.name?": "+q.name:"";return z.stylize("[Function"+fe+"]","special")}if(P(q))return z.stylize(RegExp.prototype.toString.call(q),"regexp");if(I(q))return z.stylize(Date.prototype.toString.call(q),"date");if(x(q))return a(q)}var se="",Ee=!1,He=["{","}"];if(m(q)&&(Ee=!0,He=["[","]"]),O(q)){var Ie=q.name?": "+q.name:"";se=" [Function"+Ie+"]"}if(P(q)&&(se=" "+RegExp.prototype.toString.call(q)),I(q)&&(se=" "+Date.prototype.toUTCString.call(q)),x(q)&&(se=" "+a(q)),he.length===0&&(!Ee||q.length==0))return He[0]+se+He[1];if(Z<0)return P(q)?z.stylize(RegExp.prototype.toString.call(q),"regexp"):z.stylize("[Object]","special");z.seen.push(q);var at;return Ee?at=o(z,q,Z,ie,he):at=he.map(function(je){return d(z,q,Z,ie,je,Ee)}),z.seen.pop(),g(at,se,He)}function n(z,q){if(T(q))return z.stylize("undefined","undefined");if(D(q)){var Z="'"+JSON.stringify(q).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return z.stylize(Z,"string")}if(C(q))return z.stylize(""+q,"number");if(v(q))return z.stylize(""+q,"boolean");if(b(q))return z.stylize("null","null")}function a(z){return"["+Error.prototype.toString.call(z)+"]"}function o(z,q,Z,X,oe){for(var he=[],ie=0,fe=q.length;ie-1&&(he?fe=fe.split(` `).map(function(Ee){return" "+Ee}).join(` `).slice(2):fe=` @@ -10,7 +10,7 @@ ${_}`;break}}const s=[];for(let u of this.playerStore.twitter_selected_capture_b `))):fe=z.stylize("[Circular]","special")),T(ie)){if(he&&oe.match(/^\d+$/))return fe;ie=JSON.stringify(""+oe),ie.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ie=ie.slice(1,-1),ie=z.stylize(ie,"name")):(ie=ie.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ie=z.stylize(ie,"string"))}return ie+": "+fe}function g(z,q,Z){var X=z.reduce(function(oe,he){return he.indexOf(` `)>=0,oe+he.replace(/\u001b\[\d\d?m/g,"").length+1},0);return X>60?Z[0]+(q===""?"":q+` `)+" "+z.join(`, - `)+" "+Z[1]:Z[0]+q+" "+z.join(", ")+" "+Z[1]}_.types=Qf;function m(z){return Array.isArray(z)}_.isArray=m;function v(z){return typeof z=="boolean"}_.isBoolean=v;function b(z){return z===null}_.isNull=b;function w(z){return z==null}_.isNullOrUndefined=w;function C(z){return typeof z=="number"}_.isNumber=C;function D(z){return typeof z=="string"}_.isString=D;function R(z){return typeof z=="symbol"}_.isSymbol=R;function T(z){return z===void 0}_.isUndefined=T;function P(z){return L(z)&&J(z)==="[object RegExp]"}_.isRegExp=P,_.types.isRegExp=P;function L(z){return typeof z=="object"&&z!==null}_.isObject=L;function I(z){return L(z)&&J(z)==="[object Date]"}_.isDate=I,_.types.isDate=I;function x(z){return L(z)&&(J(z)==="[object Error]"||z instanceof Error)}_.isError=x,_.types.isNativeError=x;function O(z){return typeof z=="function"}_.isFunction=O;function G(z){return z===null||typeof z=="boolean"||typeof z=="number"||typeof z=="string"||typeof z=="symbol"||typeof z>"u"}_.isPrimitive=G,_.isBuffer=gb;function J(z){return Object.prototype.toString.call(z)}function te(z){return z<10?"0"+z.toString(10):z.toString(10)}var le=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ne(){var z=new Date,q=[te(z.getHours()),te(z.getMinutes()),te(z.getSeconds())].join(":");return[z.getDate(),le[z.getMonth()],q].join(" ")}_.log=function(){console.log("%s - %s",ne(),_.format.apply(_,arguments))},_.inherits=Ab,_._extend=function(z,q){if(!q||!L(q))return z;for(var Z=Object.keys(q),X=Z.length;X--;)z[Z[X]]=q[Z[X]];return z};function ee(z,q){return Object.prototype.hasOwnProperty.call(z,q)}var M=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;_.promisify=function(q){if(typeof q!="function")throw new TypeError('The "original" argument must be of type Function');if(M&&q[M]){var Z=q[M];if(typeof Z!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Z,M,{value:Z,enumerable:!1,writable:!1,configurable:!0}),Z}function Z(){for(var X,oe,he=new Promise(function(se,Ee){X=se,oe=Ee}),ie=[],fe=0;fe"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function r(v){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(w){return w.__proto__||Object.getPrototypeOf(w)},r(v)}var i={},t,n;function a(v,b,w){w||(w=Error);function C(R,T,P){return typeof b=="string"?b:b(R,T,P)}var D=function(R){u(P,R);var T=A(P);function P(L,I,x){var O;return s(this,P),O=T.call(this,C(L,I,x)),O.code=v,O}return e(P)}(w);i[v]=D}function o(v,b){if(Array.isArray(v)){var w=v.length;return v=v.map(function(C){return String(C)}),w>2?"one of ".concat(b," ").concat(v.slice(0,w-1).join(", "),", or ")+v[w-1]:w===2?"one of ".concat(b," ").concat(v[0]," or ").concat(v[1]):"of ".concat(b," ").concat(v[0])}else return"of ".concat(b," ").concat(String(v))}function d(v,b,w){return v.substr(0,b.length)===b}function g(v,b,w){return(w===void 0||w>v.length)&&(w=v.length),v.substring(w-b.length,w)===b}function m(v,b,w){return typeof w!="number"&&(w=0),w+b.length>v.length?!1:v.indexOf(b,w)!==-1}return a("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),a("ERR_INVALID_ARG_TYPE",function(v,b,w){t===void 0&&(t=Fc()),t(typeof v=="string","'name' must be a string");var C;typeof b=="string"&&d(b,"not ")?(C="must not be",b=b.replace(/^not /,"")):C="must be";var D;if(g(v," argument"))D="The ".concat(v," ").concat(C," ").concat(o(b,"type"));else{var R=m(v,".")?"property":"argument";D='The "'.concat(v,'" ').concat(R," ").concat(C," ").concat(o(b,"type"))}return D+=". Received type ".concat(_(w)),D},TypeError),a("ERR_INVALID_ARG_VALUE",function(v,b){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";n===void 0&&(n=sa);var C=n.inspect(b);return C.length>128&&(C="".concat(C.slice(0,128),"...")),"The argument '".concat(v,"' ").concat(w,". Received ").concat(C)},TypeError),a("ERR_INVALID_RETURN_VALUE",function(v,b,w){var C;return w&&w.constructor&&w.constructor.name?C="instance of ".concat(w.constructor.name):C="type ".concat(_(w)),"Expected ".concat(v,' to be returned from the "').concat(b,'"')+" function but got ".concat(C,".")},TypeError),a("ERR_MISSING_ARGS",function(){for(var v=arguments.length,b=new Array(v),w=0;w0,"At least one arg needs to be specified");var C="The ",D=b.length;switch(b=b.map(function(R){return'"'.concat(R,'"')}),D){case 1:C+="".concat(b[0]," argument");break;case 2:C+="".concat(b[0]," and ").concat(b[1]," arguments");break;default:C+=b.slice(0,D-1).join(", "),C+=", and ".concat(b[D-1]," arguments");break}return"".concat(C," must be specified")},TypeError),Ul.codes=i,Ul}var Jl,$u;function yb(){if($u)return Jl;$u=1;function _(ee,M){var Y=Object.keys(ee);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(ee);M&&(j=j.filter(function(z){return Object.getOwnPropertyDescriptor(ee,z).enumerable})),Y.push.apply(Y,j)}return Y}function e(ee){for(var M=1;M"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function d(ee){return Function.toString.call(ee).indexOf("[native code]")!==-1}function g(ee,M){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,z){return j.__proto__=z,j},g(ee,M)}function m(ee){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Y){return Y.__proto__||Object.getPrototypeOf(Y)},m(ee)}function v(ee){"@babel/helpers - typeof";return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},v(ee)}var b=sa,w=b.inspect,C=up(),D=C.codes.ERR_INVALID_ARG_TYPE;function R(ee,M,Y){return(Y===void 0||Y>ee.length)&&(Y=ee.length),ee.substring(Y-M.length,Y)===M}function T(ee,M){if(M=Math.floor(M),ee.length==0||M==0)return"";var Y=ee.length*M;for(M=Math.floor(Math.log(M)/Math.log(2));M;)ee+=ee,M--;return ee+=ee.substring(0,Y-ee.length),ee}var P="",L="",I="",x="",O={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},G=10;function J(ee){var M=Object.keys(ee),Y=Object.create(Object.getPrototypeOf(ee));return M.forEach(function(j){Y[j]=ee[j]}),Object.defineProperty(Y,"message",{value:ee.message}),Y}function te(ee){return w(ee,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function le(ee,M,Y){var j="",z="",q=0,Z="",X=!1,oe=te(ee),he=oe.split(` + `)+" "+Z[1]:Z[0]+q+" "+z.join(", ")+" "+Z[1]}_.types=Qf;function m(z){return Array.isArray(z)}_.isArray=m;function v(z){return typeof z=="boolean"}_.isBoolean=v;function b(z){return z===null}_.isNull=b;function w(z){return z==null}_.isNullOrUndefined=w;function C(z){return typeof z=="number"}_.isNumber=C;function D(z){return typeof z=="string"}_.isString=D;function R(z){return typeof z=="symbol"}_.isSymbol=R;function T(z){return z===void 0}_.isUndefined=T;function P(z){return L(z)&&J(z)==="[object RegExp]"}_.isRegExp=P,_.types.isRegExp=P;function L(z){return typeof z=="object"&&z!==null}_.isObject=L;function I(z){return L(z)&&J(z)==="[object Date]"}_.isDate=I,_.types.isDate=I;function x(z){return L(z)&&(J(z)==="[object Error]"||z instanceof Error)}_.isError=x,_.types.isNativeError=x;function O(z){return typeof z=="function"}_.isFunction=O;function G(z){return z===null||typeof z=="boolean"||typeof z=="number"||typeof z=="string"||typeof z=="symbol"||typeof z>"u"}_.isPrimitive=G,_.isBuffer=Ab;function J(z){return Object.prototype.toString.call(z)}function te(z){return z<10?"0"+z.toString(10):z.toString(10)}var le=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ne(){var z=new Date,q=[te(z.getHours()),te(z.getMinutes()),te(z.getSeconds())].join(":");return[z.getDate(),le[z.getMonth()],q].join(" ")}_.log=function(){console.log("%s - %s",ne(),_.format.apply(_,arguments))},_.inherits=yb,_._extend=function(z,q){if(!q||!L(q))return z;for(var Z=Object.keys(q),X=Z.length;X--;)z[Z[X]]=q[Z[X]];return z};function ee(z,q){return Object.prototype.hasOwnProperty.call(z,q)}var M=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;_.promisify=function(q){if(typeof q!="function")throw new TypeError('The "original" argument must be of type Function');if(M&&q[M]){var Z=q[M];if(typeof Z!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Z,M,{value:Z,enumerable:!1,writable:!1,configurable:!0}),Z}function Z(){for(var X,oe,he=new Promise(function(se,Ee){X=se,oe=Ee}),ie=[],fe=0;fe"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function r(v){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(w){return w.__proto__||Object.getPrototypeOf(w)},r(v)}var i={},t,n;function a(v,b,w){w||(w=Error);function C(R,T,P){return typeof b=="string"?b:b(R,T,P)}var D=function(R){u(P,R);var T=y(P);function P(L,I,x){var O;return s(this,P),O=T.call(this,C(L,I,x)),O.code=v,O}return e(P)}(w);i[v]=D}function o(v,b){if(Array.isArray(v)){var w=v.length;return v=v.map(function(C){return String(C)}),w>2?"one of ".concat(b," ").concat(v.slice(0,w-1).join(", "),", or ")+v[w-1]:w===2?"one of ".concat(b," ").concat(v[0]," or ").concat(v[1]):"of ".concat(b," ").concat(v[0])}else return"of ".concat(b," ").concat(String(v))}function d(v,b,w){return v.substr(0,b.length)===b}function g(v,b,w){return(w===void 0||w>v.length)&&(w=v.length),v.substring(w-b.length,w)===b}function m(v,b,w){return typeof w!="number"&&(w=0),w+b.length>v.length?!1:v.indexOf(b,w)!==-1}return a("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),a("ERR_INVALID_ARG_TYPE",function(v,b,w){t===void 0&&(t=Fc()),t(typeof v=="string","'name' must be a string");var C;typeof b=="string"&&d(b,"not ")?(C="must not be",b=b.replace(/^not /,"")):C="must be";var D;if(g(v," argument"))D="The ".concat(v," ").concat(C," ").concat(o(b,"type"));else{var R=m(v,".")?"property":"argument";D='The "'.concat(v,'" ').concat(R," ").concat(C," ").concat(o(b,"type"))}return D+=". Received type ".concat(_(w)),D},TypeError),a("ERR_INVALID_ARG_VALUE",function(v,b){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";n===void 0&&(n=sa);var C=n.inspect(b);return C.length>128&&(C="".concat(C.slice(0,128),"...")),"The argument '".concat(v,"' ").concat(w,". Received ").concat(C)},TypeError),a("ERR_INVALID_RETURN_VALUE",function(v,b,w){var C;return w&&w.constructor&&w.constructor.name?C="instance of ".concat(w.constructor.name):C="type ".concat(_(w)),"Expected ".concat(v,' to be returned from the "').concat(b,'"')+" function but got ".concat(C,".")},TypeError),a("ERR_MISSING_ARGS",function(){for(var v=arguments.length,b=new Array(v),w=0;w0,"At least one arg needs to be specified");var C="The ",D=b.length;switch(b=b.map(function(R){return'"'.concat(R,'"')}),D){case 1:C+="".concat(b[0]," argument");break;case 2:C+="".concat(b[0]," and ").concat(b[1]," arguments");break;default:C+=b.slice(0,D-1).join(", "),C+=", and ".concat(b[D-1]," arguments");break}return"".concat(C," must be specified")},TypeError),Ul.codes=i,Ul}var Jl,$u;function vb(){if($u)return Jl;$u=1;function _(ee,M){var Y=Object.keys(ee);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(ee);M&&(j=j.filter(function(z){return Object.getOwnPropertyDescriptor(ee,z).enumerable})),Y.push.apply(Y,j)}return Y}function e(ee){for(var M=1;M"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function d(ee){return Function.toString.call(ee).indexOf("[native code]")!==-1}function g(ee,M){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,z){return j.__proto__=z,j},g(ee,M)}function m(ee){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Y){return Y.__proto__||Object.getPrototypeOf(Y)},m(ee)}function v(ee){"@babel/helpers - typeof";return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},v(ee)}var b=sa,w=b.inspect,C=up(),D=C.codes.ERR_INVALID_ARG_TYPE;function R(ee,M,Y){return(Y===void 0||Y>ee.length)&&(Y=ee.length),ee.substring(Y-M.length,Y)===M}function T(ee,M){if(M=Math.floor(M),ee.length==0||M==0)return"";var Y=ee.length*M;for(M=Math.floor(Math.log(M)/Math.log(2));M;)ee+=ee,M--;return ee+=ee.substring(0,Y-ee.length),ee}var P="",L="",I="",x="",O={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},G=10;function J(ee){var M=Object.keys(ee),Y=Object.create(Object.getPrototypeOf(ee));return M.forEach(function(j){Y[j]=ee[j]}),Object.defineProperty(Y,"message",{value:ee.message}),Y}function te(ee){return w(ee,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function le(ee,M,Y){var j="",z="",q=0,Z="",X=!1,oe=te(ee),he=oe.split(` `),ie=te(M).split(` `),fe=0,se="";if(Y==="strictEqual"&&v(ee)==="object"&&v(M)==="object"&&ee!==null&&M!==null&&(Y="strictEqualObject"),he.length===1&&ie.length===1&&he[0]!==ie[0]){var Ee=he[0].length+ie[0].length;if(Ee<=G){if((v(ee)!=="object"||ee===null)&&(v(M)!=="object"||M===null)&&(ee!==0||M!==0))return"".concat(O[Y],` @@ -56,13 +56,13 @@ ${_}`;break}}const s=[];for(let u of this.playerStore.twitter_selected_capture_b should equal -`):Ie=" ".concat(X," ").concat(Ie)),q=Y.call(this,"".concat(He).concat(Ie))}return Error.stackTraceLimit=fe,q.generatedMessage=!Z,Object.defineProperty(t(q),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),q.code="ERR_ASSERTION",q.actual=he,q.expected=ie,q.operator=X,Error.captureStackTrace&&Error.captureStackTrace(t(q),oe),q.stack,q.name="AssertionError",i(q)}return A(j,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:M,value:function(q,Z){return w(this,e(e({},Z),{},{customInspect:!1,depth:0}))}}]),j}(n(Error),w.custom);return Jl=ne,Jl}var eh=Object.prototype.toString,hp=function(e){var s=eh.call(e),u=s==="[object Arguments]";return u||(u=s!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&eh.call(e.callee)==="[object Function]"),u},Ql,th;function vb(){if(th)return Ql;th=1;var _;if(!Object.keys){var e=Object.prototype.hasOwnProperty,s=Object.prototype.toString,u=hp,y=Object.prototype.propertyIsEnumerable,A=!y.call({toString:null},"toString"),l=y.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(n){var a=n.constructor;return a&&a.prototype===n},r={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},i=function(){if(typeof window>"u")return!1;for(var n in window)try{if(!r["$"+n]&&e.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{p(window[n])}catch{return!0}}catch{return!0}return!1}(),t=function(n){if(typeof window>"u"||!i)return p(n);try{return p(n)}catch{return!1}};_=function(a){var o=a!==null&&typeof a=="object",d=s.call(a)==="[object Function]",g=u(a),m=o&&s.call(a)==="[object String]",v=[];if(!o&&!d&&!g)throw new TypeError("Object.keys called on a non-object");var b=l&&d;if(m&&a.length>0&&!e.call(a,0))for(var w=0;w0)for(var C=0;C2?arguments[2]:{},n=_(i);e&&(n=u.call(n,Object.getOwnPropertySymbols(i)));for(var a=0;aue.length)&&(W=ue.length);for(var ke=0,Ae=new Array(W);ke10)return!0;for(var W=0;W57)return!0}return ue.length===10&&ue>=Math.pow(2,32)}function ne(ue){return Object.keys(ue).filter(le).concat(t(ue).filter(Object.prototype.propertyIsEnumerable.bind(ue)))}/*! +`):Ie=" ".concat(X," ").concat(Ie)),q=Y.call(this,"".concat(He).concat(Ie))}return Error.stackTraceLimit=fe,q.generatedMessage=!Z,Object.defineProperty(t(q),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),q.code="ERR_ASSERTION",q.actual=he,q.expected=ie,q.operator=X,Error.captureStackTrace&&Error.captureStackTrace(t(q),oe),q.stack,q.name="AssertionError",i(q)}return y(j,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:M,value:function(q,Z){return w(this,e(e({},Z),{},{customInspect:!1,depth:0}))}}]),j}(n(Error),w.custom);return Jl=ne,Jl}var eh=Object.prototype.toString,hp=function(e){var s=eh.call(e),u=s==="[object Arguments]";return u||(u=s!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&eh.call(e.callee)==="[object Function]"),u},Ql,th;function bb(){if(th)return Ql;th=1;var _;if(!Object.keys){var e=Object.prototype.hasOwnProperty,s=Object.prototype.toString,u=hp,A=Object.prototype.propertyIsEnumerable,y=!A.call({toString:null},"toString"),l=A.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(n){var a=n.constructor;return a&&a.prototype===n},r={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},i=function(){if(typeof window>"u")return!1;for(var n in window)try{if(!r["$"+n]&&e.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{p(window[n])}catch{return!0}}catch{return!0}return!1}(),t=function(n){if(typeof window>"u"||!i)return p(n);try{return p(n)}catch{return!1}};_=function(a){var o=a!==null&&typeof a=="object",d=s.call(a)==="[object Function]",g=u(a),m=o&&s.call(a)==="[object String]",v=[];if(!o&&!d&&!g)throw new TypeError("Object.keys called on a non-object");var b=l&&d;if(m&&a.length>0&&!e.call(a,0))for(var w=0;w0)for(var C=0;C2?arguments[2]:{},n=_(i);e&&(n=u.call(n,Object.getOwnPropertySymbols(i)));for(var a=0;aue.length)&&(W=ue.length);for(var ke=0,Ae=new Array(W);ke10)return!0;for(var W=0;W57)return!0}return ue.length===10&&ue>=Math.pow(2,32)}function ne(ue){return Object.keys(ue).filter(le).concat(t(ue).filter(Object.prototype.propertyIsEnumerable.bind(ue)))}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */function ee(ue,W){if(ue===W)return 0;for(var ke=ue.length,Ae=W.length,Ye=0,lt=Math.min(ke,Ae);Ye1?X-1:0),he=1;he1?X-1:0),he=1;he1?X-1:0),he=1;he1?X-1:0),he=1;he(()=>{var s={368:(l,c,p)=>{var r=p(454);l.exports=function(i){var t,n="",a=(i=i||{}).video,o=i.options,d=r.$escape,g=i.tran,m=i.icons,v=r.$each,b=(i.$value,i.$index,i.index);return n+=`
+`));var se=new i({actual:q,expected:Z,message:X,operator:he,stackStartFn:oe});throw se.generatedMessage=fe,se}}R.match=function q(Z,X,oe){j(Z,X,oe,q,"match")},R.doesNotMatch=function q(Z,X,oe){j(Z,X,oe,q,"doesNotMatch")};function z(){for(var q=arguments.length,Z=new Array(q),X=0;X(()=>{var s={368:(l,c,p)=>{var r=p(454);l.exports=function(i){var t,n="",a=(i=i||{}).video,o=i.options,d=r.$escape,g=i.tran,m=i.icons,v=r.$each,b=(i.$value,i.$index,i.index);return n+=`
`,t=p(953)(a),n+=t,n+=` @@ -2168,54 +2168,54 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho \v\f\r                 \u2028\u2029\uFEFF`},9575:function(i,t,n){var a=n(2109),o=n(7293),d=n(3331),g=n(9670),m=n(1400),v=n(7466),b=n(6707),w=d.ArrayBuffer,C=d.DataView,D=w.prototype.slice;a({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:o(function(){return!new w(2).slice(1,void 0).byteLength})},{slice:function(R,T){if(D!==void 0&&T===void 0)return D.call(g(this),R);for(var P=g(this).byteLength,L=m(R,P),I=m(T===void 0?P:T,P),x=new(b(this,w))(v(I-L)),O=new C(this),G=new C(x),J=0;L=51||!o(function(){var G=[];return G[T]=!1,G.concat()[0]!==G}),x=C("concat"),O=function(G){if(!g(G))return!1;var J=G[T];return J!==void 0?!!J:d(G)};a({target:"Array",proto:!0,forced:!I||!x},{concat:function(G){var J,te,le,ne,ee,M=m(this),Y=w(M,0),j=0;for(J=-1,le=arguments.length;JP)throw TypeError(L);for(te=0;te=P)throw TypeError(L);b(Y,j++,ee)}return Y.length=j,Y}})},3290:function(i,t,n){var a=n(2109),o=n(1285),d=n(1223);a({target:"Array",proto:!0},{fill:o}),d("fill")},7327:function(i,t,n){var a=n(2109),o=n(2092).filter,d=n(1194),g=n(9207),m=d("filter"),v=g("filter");a({target:"Array",proto:!0,forced:!m||!v},{filter:function(b){return o(this,b,arguments.length>1?arguments[1]:void 0)}})},4553:function(i,t,n){var a=n(2109),o=n(2092).findIndex,d=n(1223),g=n(9207),m="findIndex",v=!0,b=g(m);m in[]&&Array(1).findIndex(function(){v=!1}),a({target:"Array",proto:!0,forced:v||!b},{findIndex:function(w){return o(this,w,arguments.length>1?arguments[1]:void 0)}}),d(m)},9826:function(i,t,n){var a=n(2109),o=n(2092).find,d=n(1223),g=n(9207),m="find",v=!0,b=g(m);m in[]&&Array(1).find(function(){v=!1}),a({target:"Array",proto:!0,forced:v||!b},{find:function(w){return o(this,w,arguments.length>1?arguments[1]:void 0)}}),d(m)},9554:function(i,t,n){var a=n(2109),o=n(8533);a({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})},6699:function(i,t,n){var a=n(2109),o=n(1318).includes,d=n(1223);a({target:"Array",proto:!0,forced:!n(9207)("indexOf",{ACCESSORS:!0,1:0})},{includes:function(g){return o(this,g,arguments.length>1?arguments[1]:void 0)}}),d("includes")},6992:function(i,t,n){var a=n(5656),o=n(1223),d=n(7497),g=n(9909),m=n(654),v="Array Iterator",b=g.set,w=g.getterFor(v);i.exports=m(Array,"Array",function(C,D){b(this,{type:v,target:a(C),index:0,kind:D})},function(){var C=w(this),D=C.target,R=C.kind,T=C.index++;return!D||T>=D.length?(C.target=void 0,{value:void 0,done:!0}):R=="keys"?{value:T,done:!1}:R=="values"?{value:D[T],done:!1}:{value:[T,D[T]],done:!1}},"values"),d.Arguments=d.Array,o("keys"),o("values"),o("entries")},7042:function(i,t,n){var a=n(2109),o=n(111),d=n(3157),g=n(1400),m=n(7466),v=n(5656),b=n(6135),w=n(5112),C=n(1194),D=n(9207),R=C("slice"),T=D("slice",{ACCESSORS:!0,0:0,1:2}),P=w("species"),L=[].slice,I=Math.max;a({target:"Array",proto:!0,forced:!R||!T},{slice:function(x,O){var G,J,te,le=v(this),ne=m(le.length),ee=g(x,ne),M=g(O===void 0?ne:O,ne);if(d(le)&&(typeof(G=le.constructor)!="function"||G!==Array&&!d(G.prototype)?o(G)&&(G=G[P])===null&&(G=void 0):G=void 0,G===Array||G===void 0))return L.call(le,ee,M);for(J=new(G===void 0?Array:G)(I(M-ee,0)),te=0;ee1?arguments[1]:void 0)}})},2707:function(i,t,n){var a=n(2109),o=n(3099),d=n(7908),g=n(7293),m=n(9341),v=[],b=v.sort,w=g(function(){v.sort(void 0)}),C=g(function(){v.sort(null)}),D=m("sort");a({target:"Array",proto:!0,forced:w||!C||!D},{sort:function(R){return R===void 0?b.call(d(this)):b.call(d(this),o(R))}})},561:function(i,t,n){var a=n(2109),o=n(1400),d=n(9958),g=n(7466),m=n(7908),v=n(5417),b=n(6135),w=n(1194),C=n(9207),D=w("splice"),R=C("splice",{ACCESSORS:!0,0:0,1:2}),T=Math.max,P=Math.min,L=9007199254740991,I="Maximum allowed length exceeded";a({target:"Array",proto:!0,forced:!D||!R},{splice:function(x,O){var G,J,te,le,ne,ee,M=m(this),Y=g(M.length),j=o(x,Y),z=arguments.length;if(z===0?G=J=0:z===1?(G=0,J=Y-j):(G=z-2,J=P(T(d(O),0),Y-j)),Y+G-J>L)throw TypeError(I);for(te=v(M,J),le=0;leY-J+G;le--)delete M[le-1]}else if(G>J)for(le=Y-J;le>j;le--)ee=le+G-1,(ne=le+J-1)in M?M[ee]=M[ne]:delete M[ee];for(le=0;le2){if((Y=(ie=L(ie)).charCodeAt(0))===43||Y===45){if((j=ie.charCodeAt(2))===88||j===120)return NaN}else if(Y===48){switch(ie.charCodeAt(1)){case 66:case 98:z=2,q=49;break;case 79:case 111:z=8,q=55;break;default:return+ie}for(X=(Z=ie.slice(2)).length,oe=0;oeq)return NaN;return parseInt(Z,z)}}return+ie};if(d(I,!x(" 0o1")||!x("0b1")||x("+0x1"))){for(var te,le=function(M){var Y=arguments.length<1?0:M,j=this;return j instanceof le&&(G?C(function(){O.valueOf.call(j)}):v(j)!=I)?b(new x(J(Y)),j,le):J(Y)},ne=a?R(x):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),ee=0;ne.length>ee;ee++)m(x,te=ne[ee])&&!m(le,te)&&P(le,te,T(x,te));le.prototype=O,O.constructor=le,g(o,I,le)}},5192:function(i,t,n){n(2109)({target:"Number",stat:!0},{isFinite:n(7023)})},4363:function(i,t,n){n(2109)({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991})},9494:function(i,t,n){var a=n(2109),o=n(3009);a({target:"Number",stat:!0,forced:Number.parseInt!=o},{parseInt:o})},9720:function(i,t,n){var a=n(2109),o=n(4699).entries;a({target:"Object",stat:!0},{entries:function(d){return o(d)}})},489:function(i,t,n){var a=n(2109),o=n(7293),d=n(7908),g=n(9518),m=n(8544);a({target:"Object",stat:!0,forced:o(function(){g(1)}),sham:!m},{getPrototypeOf:function(v){return g(d(v))}})},8304:function(i,t,n){n(2109)({target:"Object",stat:!0},{setPrototypeOf:n(7674)})},1539:function(i,t,n){var a=n(1694),o=n(1320),d=n(288);a||o(Object.prototype,"toString",d,{unsafe:!0})},4916:function(i,t,n){var a=n(2109),o=n(2261);a({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},9714:function(i,t,n){var a=n(1320),o=n(9670),d=n(7293),g=n(7066),m="toString",v=RegExp.prototype,b=v.toString,w=d(function(){return b.call({source:"a",flags:"b"})!="/a/b"}),C=b.name!=m;(w||C)&&a(RegExp.prototype,m,function(){var D=o(this),R=String(D.source),T=D.flags;return"/"+R+"/"+String(T===void 0&&D instanceof RegExp&&!("flags"in v)?g.call(D):T)},{unsafe:!0})},189:function(i,t,n){var a=n(7710),o=n(5631);i.exports=a("Set",function(d){return function(){return d(this,arguments.length?arguments[0]:void 0)}},o)},2023:function(i,t,n){var a=n(2109),o=n(3929),d=n(4488);a({target:"String",proto:!0,forced:!n(4964)("includes")},{includes:function(g){return!!~String(d(this)).indexOf(o(g),arguments.length>1?arguments[1]:void 0)}})},8783:function(i,t,n){var a=n(8710).charAt,o=n(9909),d=n(654),g="String Iterator",m=o.set,v=o.getterFor(g);d(String,"String",function(b){m(this,{type:g,string:String(b),index:0})},function(){var b,w=v(this),C=w.string,D=w.index;return D>=C.length?{value:void 0,done:!0}:(b=a(C,D),w.index+=b.length,{value:b,done:!1})})},3112:function(i,t,n){var a=n(2109),o=n(6650).start;a({target:"String",proto:!0,forced:n(4986)},{padStart:function(d){return o(this,d,arguments.length>1?arguments[1]:void 0)}})},5306:function(i,t,n){var a=n(7007),o=n(9670),d=n(7466),g=n(9958),m=n(4488),v=n(1530),b=n(647),w=n(7651),C=Math.max,D=Math.min;a("replace",2,function(R,T,P,L){var I=L.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,x=L.REPLACE_KEEPS_$0,O=I?"$":"$0";return[function(G,J){var te=m(this),le=G==null?void 0:G[R];return le!==void 0?le.call(G,te,J):T.call(String(te),G,J)},function(G,J){if(!I&&x||typeof J=="string"&&J.indexOf(O)===-1){var te=P(T,G,this,J);if(te.done)return te.value}var le=o(G),ne=String(this),ee=typeof J=="function";ee||(J=String(J));var M=le.global;if(M){var Y=le.unicode;le.lastIndex=0}for(var j=[];;){var z=w(le,ne);if(z===null||(j.push(z),!M))break;String(z[0])===""&&(le.lastIndex=v(ne,d(le.lastIndex),Y))}for(var q,Z="",X=0,oe=0;oe=X&&(Z+=ne.slice(X,ie)+Ie,X=ie+he.length)}return Z+ne.slice(X)}]})},1817:function(i,t,n){var a=n(2109),o=n(9781),d=n(7854),g=n(6656),m=n(111),v=n(3070).f,b=n(9920),w=d.Symbol;if(o&&typeof w=="function"&&(!("description"in w.prototype)||w().description!==void 0)){var C={},D=function(){var I=arguments.length<1||arguments[0]===void 0?void 0:String(arguments[0]),x=this instanceof D?new w(I):I===void 0?w():w(I);return I===""&&(C[x]=!0),x};b(D,w);var R=D.prototype=w.prototype;R.constructor=D;var T=R.toString,P=String(w("test"))=="Symbol(test)",L=/^Symbol\((.*)\)[^)]+$/;v(R,"description",{configurable:!0,get:function(){var I=m(this)?this.valueOf():this,x=T.call(I);if(g(C,I))return"";var O=P?x.slice(7,-1):x.replace(L,"$1");return O===""?void 0:O}}),a({global:!0,forced:!0},{Symbol:D})}},2526:function(i,t,n){var a=n(2109),o=n(7854),d=n(5005),g=n(1913),m=n(9781),v=n(133),b=n(3307),w=n(7293),C=n(6656),D=n(3157),R=n(111),T=n(9670),P=n(7908),L=n(5656),I=n(7593),x=n(9114),O=n(30),G=n(1956),J=n(8006),te=n(1156),le=n(5181),ne=n(1236),ee=n(3070),M=n(5296),Y=n(8880),j=n(1320),z=n(2309),q=n(6200),Z=n(3501),X=n(9711),oe=n(5112),he=n(6061),ie=n(7235),fe=n(8003),se=n(9909),Ee=n(2092).forEach,He=q("hidden"),Ie="Symbol",at=oe("toPrimitive"),je=se.set,ht=se.getterFor(Ie),_e=Object.prototype,Oe=o.Symbol,pt=d("JSON","stringify"),vt=ne.f,tt=ee.f,pe=te.f,ue=M.f,W=z("symbols"),ke=z("op-symbols"),Ae=z("string-to-symbol-registry"),Ye=z("symbol-to-string-registry"),lt=z("wks"),mt=o.QObject,Ue=!mt||!mt.prototype||!mt.prototype.findChild,Ve=m&&w(function(){return O(tt({},"a",{get:function(){return tt(this,"a",{value:7}).a}})).a!=7})?function($e,Be,it){var Ne=vt(_e,Be);Ne&&delete _e[Be],tt($e,Be,it),Ne&&$e!==_e&&tt(_e,Be,Ne)}:tt,De=function($e,Be){var it=W[$e]=O(Oe.prototype);return je(it,{type:Ie,tag:$e,description:Be}),m||(it.description=Be),it},Re=b?function($e){return typeof $e=="symbol"}:function($e){return Object($e)instanceof Oe},ut=function($e,Be,it){$e===_e&&ut(ke,Be,it),T($e);var Ne=I(Be,!0);return T(it),C(W,Ne)?(it.enumerable?(C($e,He)&&$e[He][Ne]&&($e[He][Ne]=!1),it=O(it,{enumerable:x(0,!1)})):(C($e,He)||tt($e,He,x(1,{})),$e[He][Ne]=!0),Ve($e,Ne,it)):tt($e,Ne,it)},gt=function($e,Be){T($e);var it=L(Be),Ne=G(it).concat(Je(it));return Ee(Ne,function(Qe){m&&!Ce.call(it,Qe)||ut($e,Qe,it[Qe])}),$e},Ce=function($e){var Be=I($e,!0),it=ue.call(this,Be);return!(this===_e&&C(W,Be)&&!C(ke,Be))&&(!(it||!C(this,Be)||!C(W,Be)||C(this,He)&&this[He][Be])||it)},ze=function($e,Be){var it=L($e),Ne=I(Be,!0);if(it!==_e||!C(W,Ne)||C(ke,Ne)){var Qe=vt(it,Ne);return!Qe||!C(W,Ne)||C(it,He)&&it[He][Ne]||(Qe.enumerable=!0),Qe}},At=function($e){var Be=pe(L($e)),it=[];return Ee(Be,function(Ne){C(W,Ne)||C(Z,Ne)||it.push(Ne)}),it},Je=function($e){var Be=$e===_e,it=pe(Be?ke:L($e)),Ne=[];return Ee(it,function(Qe){!C(W,Qe)||Be&&!C(_e,Qe)||Ne.push(W[Qe])}),Ne};v||(j((Oe=function(){if(this instanceof Oe)throw TypeError("Symbol is not a constructor");var $e=arguments.length&&arguments[0]!==void 0?String(arguments[0]):void 0,Be=X($e),it=function(Ne){this===_e&&it.call(ke,Ne),C(this,He)&&C(this[He],Be)&&(this[He][Be]=!1),Ve(this,Be,x(1,Ne))};return m&&Ue&&Ve(_e,Be,{configurable:!0,set:it}),De(Be,$e)}).prototype,"toString",function(){return ht(this).tag}),j(Oe,"withoutSetter",function($e){return De(X($e),$e)}),M.f=Ce,ee.f=ut,ne.f=ze,J.f=te.f=At,le.f=Je,he.f=function($e){return De(oe($e),$e)},m&&(tt(Oe.prototype,"description",{configurable:!0,get:function(){return ht(this).description}}),g||j(_e,"propertyIsEnumerable",Ce,{unsafe:!0}))),a({global:!0,wrap:!0,forced:!v,sham:!v},{Symbol:Oe}),Ee(G(lt),function($e){ie($e)}),a({target:Ie,stat:!0,forced:!v},{for:function($e){var Be=String($e);if(C(Ae,Be))return Ae[Be];var it=Oe(Be);return Ae[Be]=it,Ye[it]=Be,it},keyFor:function($e){if(!Re($e))throw TypeError($e+" is not a symbol");if(C(Ye,$e))return Ye[$e]},useSetter:function(){Ue=!0},useSimple:function(){Ue=!1}}),a({target:"Object",stat:!0,forced:!v,sham:!m},{create:function($e,Be){return Be===void 0?O($e):gt(O($e),Be)},defineProperty:ut,defineProperties:gt,getOwnPropertyDescriptor:ze}),a({target:"Object",stat:!0,forced:!v},{getOwnPropertyNames:At,getOwnPropertySymbols:Je}),a({target:"Object",stat:!0,forced:w(function(){le.f(1)})},{getOwnPropertySymbols:function($e){return le.f(P($e))}}),pt&&a({target:"JSON",stat:!0,forced:!v||w(function(){var $e=Oe();return pt([$e])!="[null]"||pt({a:$e})!="{}"||pt(Object($e))!="{}"})},{stringify:function($e,Be,it){for(var Ne,Qe=[$e],Me=1;arguments.length>Me;)Qe.push(arguments[Me++]);if(Ne=Be,(R(Be)||$e!==void 0)&&!Re($e))return D(Be)||(Be=function(Se,K){if(typeof Ne=="function"&&(K=Ne.call(this,Se,K)),!Re(K))return K}),Qe[1]=Be,pt.apply(null,Qe)}}),Oe.prototype[at]||Y(Oe.prototype,at,Oe.prototype.valueOf),fe(Oe,Ie),Z[He]=!0},2990:function(i,t,n){var a=n(260),o=n(1048),d=a.aTypedArray;(0,a.exportTypedArrayMethod)("copyWithin",function(g,m){return o.call(d(this),g,m,arguments.length>2?arguments[2]:void 0)})},8927:function(i,t,n){var a=n(260),o=n(2092).every,d=a.aTypedArray;(0,a.exportTypedArrayMethod)("every",function(g){return o(d(this),g,arguments.length>1?arguments[1]:void 0)})},3105:function(i,t,n){var a=n(260),o=n(1285),d=a.aTypedArray;(0,a.exportTypedArrayMethod)("fill",function(g){return o.apply(d(this),arguments)})},5035:function(i,t,n){var a=n(260),o=n(2092).filter,d=n(6707),g=a.aTypedArray,m=a.aTypedArrayConstructor;(0,a.exportTypedArrayMethod)("filter",function(v){for(var b=o(g(this),v,arguments.length>1?arguments[1]:void 0),w=d(this,this.constructor),C=0,D=b.length,R=new(m(w))(D);D>C;)R[C]=b[C++];return R})},7174:function(i,t,n){var a=n(260),o=n(2092).findIndex,d=a.aTypedArray;(0,a.exportTypedArrayMethod)("findIndex",function(g){return o(d(this),g,arguments.length>1?arguments[1]:void 0)})},4345:function(i,t,n){var a=n(260),o=n(2092).find,d=a.aTypedArray;(0,a.exportTypedArrayMethod)("find",function(g){return o(d(this),g,arguments.length>1?arguments[1]:void 0)})},2846:function(i,t,n){var a=n(260),o=n(2092).forEach,d=a.aTypedArray;(0,a.exportTypedArrayMethod)("forEach",function(g){o(d(this),g,arguments.length>1?arguments[1]:void 0)})},4731:function(i,t,n){var a=n(260),o=n(1318).includes,d=a.aTypedArray;(0,a.exportTypedArrayMethod)("includes",function(g){return o(d(this),g,arguments.length>1?arguments[1]:void 0)})},7209:function(i,t,n){var a=n(260),o=n(1318).indexOf,d=a.aTypedArray;(0,a.exportTypedArrayMethod)("indexOf",function(g){return o(d(this),g,arguments.length>1?arguments[1]:void 0)})},6319:function(i,t,n){var a=n(7854),o=n(260),d=n(6992),g=n(5112)("iterator"),m=a.Uint8Array,v=d.values,b=d.keys,w=d.entries,C=o.aTypedArray,D=o.exportTypedArrayMethod,R=m&&m.prototype[g],T=!!R&&(R.name=="values"||R.name==null),P=function(){return v.call(C(this))};D("entries",function(){return w.call(C(this))}),D("keys",function(){return b.call(C(this))}),D("values",P,!T),D(g,P,!T)},8867:function(i,t,n){var a=n(260),o=a.aTypedArray,d=a.exportTypedArrayMethod,g=[].join;d("join",function(m){return g.apply(o(this),arguments)})},7789:function(i,t,n){var a=n(260),o=n(6583),d=a.aTypedArray;(0,a.exportTypedArrayMethod)("lastIndexOf",function(g){return o.apply(d(this),arguments)})},3739:function(i,t,n){var a=n(260),o=n(2092).map,d=n(6707),g=a.aTypedArray,m=a.aTypedArrayConstructor;(0,a.exportTypedArrayMethod)("map",function(v){return o(g(this),v,arguments.length>1?arguments[1]:void 0,function(b,w){return new(m(d(b,b.constructor)))(w)})})},4483:function(i,t,n){var a=n(260),o=n(3671).right,d=a.aTypedArray;(0,a.exportTypedArrayMethod)("reduceRight",function(g){return o(d(this),g,arguments.length,arguments.length>1?arguments[1]:void 0)})},9368:function(i,t,n){var a=n(260),o=n(3671).left,d=a.aTypedArray;(0,a.exportTypedArrayMethod)("reduce",function(g){return o(d(this),g,arguments.length,arguments.length>1?arguments[1]:void 0)})},2056:function(i,t,n){var a=n(260),o=a.aTypedArray,d=a.exportTypedArrayMethod,g=Math.floor;d("reverse",function(){for(var m,v=this,b=o(v).length,w=g(b/2),C=0;C1?arguments[1]:void 0,1),C=this.length,D=g(b),R=o(D.length),T=0;if(R+w>C)throw RangeError("Wrong length");for(;TT;)L[T]=D[T++];return L},d(function(){new Int8Array(1).slice()}))},7462:function(i,t,n){var a=n(260),o=n(2092).some,d=a.aTypedArray;(0,a.exportTypedArrayMethod)("some",function(g){return o(d(this),g,arguments.length>1?arguments[1]:void 0)})},3824:function(i,t,n){var a=n(260),o=a.aTypedArray,d=a.exportTypedArrayMethod,g=[].sort;d("sort",function(m){return g.call(o(this),m)})},5021:function(i,t,n){var a=n(260),o=n(7466),d=n(1400),g=n(6707),m=a.aTypedArray;(0,a.exportTypedArrayMethod)("subarray",function(v,b){var w=m(this),C=w.length,D=d(v,C);return new(g(w,w.constructor))(w.buffer,w.byteOffset+D*w.BYTES_PER_ELEMENT,o((b===void 0?C:d(b,C))-D))})},2974:function(i,t,n){var a=n(7854),o=n(260),d=n(7293),g=a.Int8Array,m=o.aTypedArray,v=o.exportTypedArrayMethod,b=[].toLocaleString,w=[].slice,C=!!g&&d(function(){b.call(new g(1))});v("toLocaleString",function(){return b.apply(C?w.call(m(this)):m(this),arguments)},d(function(){return[1,2].toLocaleString()!=new g([1,2]).toLocaleString()})||!d(function(){g.prototype.toLocaleString.call([1,2])}))},5016:function(i,t,n){var a=n(260).exportTypedArrayMethod,o=n(7293),d=n(7854).Uint8Array,g=d&&d.prototype||{},m=[].toString,v=[].join;o(function(){m.call({})})&&(m=function(){return v.call(this)});var b=g.toString!=m;a("toString",m,b)},2472:function(i,t,n){n(9843)("Uint8",function(a){return function(o,d,g){return a(this,o,d,g)}})},4747:function(i,t,n){var a=n(7854),o=n(8324),d=n(8533),g=n(8880);for(var m in o){var v=a[m],b=v&&v.prototype;if(b&&b.forEach!==d)try{g(b,"forEach",d)}catch{b.forEach=d}}},3948:function(i,t,n){var a=n(7854),o=n(8324),d=n(6992),g=n(8880),m=n(5112),v=m("iterator"),b=m("toStringTag"),w=d.values;for(var C in o){var D=a[C],R=D&&D.prototype;if(R){if(R[v]!==w)try{g(R,v,w)}catch{R[v]=w}if(R[b]||g(R,b,C),o[C]){for(var T in d)if(R[T]!==d[T])try{g(R,T,d[T])}catch{R[T]=d[T]}}}}}},p={};function r(i){if(p[i])return p[i].exports;var t=p[i]={exports:{}};return c[i](t,t.exports,r),t.exports}return r.d=function(i,t){for(var n in t)r.o(t,n)&&!r.o(i,n)&&Object.defineProperty(i,n,{enumerable:!0,get:t[n]})},r.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),r.o=function(i,t){return Object.prototype.hasOwnProperty.call(i,t)},r.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r(9798)}()},13:(l,c,p)=>{/*! art-template@runtime | https://github.com/aui/art-template */var r=typeof self<"u"?self:typeof window<"u"?window:p.g!==void 0?p.g:{},i=Object.create(r),t=/["&'<>]/;function n(a){return typeof a!="string"&&(a=a==null?"":typeof a=="function"?n(a.call(a)):JSON.stringify(a)),a}i.$escape=function(a){return function(o){var d=""+o,g=t.exec(d);if(!g)return o;var m="",v=void 0,b=void 0,w=void 0;for(v=g.index,b=0;v{l.exports=p(13)},66:l=>{l.exports=function(c){var p=[];return p.toString=function(){return this.map(function(r){var i="",t=r[5]!==void 0;return r[4]&&(i+="@supports (".concat(r[4],") {")),r[2]&&(i+="@media ".concat(r[2]," {")),t&&(i+="@layer".concat(r[5].length>0?" ".concat(r[5]):""," {")),i+=c(r),t&&(i+="}"),r[2]&&(i+="}"),r[4]&&(i+="}"),i}).join("")},p.i=function(r,i,t,n,a){typeof r=="string"&&(r=[[null,r,void 0]]);var o={};if(t)for(var d=0;d0?" ".concat(v[5]):""," {").concat(v[1],"}")),v[5]=a),i&&(v[2]&&(v[1]="@media ".concat(v[2]," {").concat(v[1],"}")),v[2]=i),n&&(v[4]?(v[1]="@supports (".concat(v[4],") {").concat(v[1],"}"),v[4]=n):v[4]="".concat(n)),p.push(v))}},p}},236:l=>{l.exports=function(c){var p=c[1],r=c[3];if(!r)return p;if(typeof btoa=="function"){var i=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),t="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(i),n="/*# ".concat(t," */");return[p].concat([n]).join(` `)}return[p].join(` `)}},379:l=>{var c=[];function p(t){for(var n=-1,a=0;a{var c={};l.exports=function(p,r){var i=function(t){if(c[t]===void 0){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch{n=null}c[t]=n}return c[t]}(p);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(r)}},216:l=>{l.exports=function(c){var p=document.createElement("style");return c.setAttributes(p,c.attributes),c.insert(p,c.options),p}},565:(l,c,p)=>{l.exports=function(r){var i=p.nc;i&&r.setAttribute("nonce",i)}},795:l=>{l.exports=function(c){if(typeof document>"u")return{update:function(){},remove:function(){}};var p=c.insertStyleElement(c);return{update:function(r){(function(i,t,n){var a="";n.supports&&(a+="@supports (".concat(n.supports,") {")),n.media&&(a+="@media ".concat(n.media," {"));var o=n.layer!==void 0;o&&(a+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),a+=n.css,o&&(a+="}"),n.media&&(a+="}"),n.supports&&(a+="}");var d=n.sourceMap;d&&typeof btoa<"u"&&(a+=` -/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(d))))," */")),t.styleTagTransform(a,i,t.options)})(p,c,r)},remove:function(){(function(r){if(r.parentNode===null)return!1;r.parentNode.removeChild(r)})(p)}}}},589:l=>{l.exports=function(c,p){if(p.styleSheet)p.styleSheet.cssText=c;else{for(;p.firstChild;)p.removeChild(p.firstChild);p.appendChild(document.createTextNode(c))}}},597:l=>{l.exports=''},704:l=>{l.exports=''},409:l=>{l.exports=''},243:l=>{l.exports=''},478:l=>{l.exports=''},885:l=>{l.exports=''},189:l=>{l.exports=''},783:l=>{l.exports=''},241:l=>{l.exports=''},863:l=>{l.exports=''},112:l=>{l.exports=''},310:l=>{l.exports=''},723:l=>{l.exports=''},355:l=>{l.exports=''},7:l=>{l.exports=''},381:l=>{l.exports=''},916:l=>{l.exports=''},531:l=>{l.exports=''},223:l=>{l.exports=''},813:l=>{l.exports=''},480:l=>{l.exports=''},848:l=>{l.exports=''}},u={};function y(l){var c=u[l];if(c!==void 0)return c.exports;var p=u[l]={id:l,exports:{}};return s[l].call(p.exports,p,p.exports,y),p.exports}y.n=l=>{var c=l&&l.__esModule?()=>l.default:()=>l;return y.d(c,{a:c}),c},y.d=(l,c)=>{for(var p in c)y.o(c,p)&&!y.o(l,p)&&Object.defineProperty(l,p,{enumerable:!0,get:c[p]})},y.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),y.o=(l,c)=>Object.prototype.hasOwnProperty.call(l,c),y.nc=void 0;var A={};return(()=>{y.d(A,{default:()=>is});var l=y(379),c=y.n(l),p=y(795),r=y.n(p),i=y(569),t=y.n(i),n=y(565),a=y.n(n),o=y(216),d=y.n(o),g=y(589),m=y.n(g),v=y(869),b={};b.styleTagTransform=m(),b.setAttributes=a(),b.insert=t().bind(null,"head"),b.domAPI=r(),b.insertStyleElement=d(),c()(v.Z,b),v.Z&&v.Z.locals&&v.Z.locals;function w(ge,Le){return function(){return ge.apply(Le,arguments)}}const{toString:C}=Object.prototype,{getPrototypeOf:D}=Object,R=(T=Object.create(null),ge=>{const Le=C.call(ge);return T[Le]||(T[Le]=Le.slice(8,-1).toLowerCase())});var T;const P=ge=>(ge=ge.toLowerCase(),Le=>R(Le)===ge),L=ge=>Le=>typeof Le===ge,{isArray:I}=Array,x=L("undefined"),O=P("ArrayBuffer"),G=L("string"),J=L("function"),te=L("number"),le=ge=>ge!==null&&typeof ge=="object",ne=ge=>{if(R(ge)!=="object")return!1;const Le=D(ge);return!(Le!==null&&Le!==Object.prototype&&Object.getPrototypeOf(Le)!==null||Symbol.toStringTag in ge||Symbol.iterator in ge)},ee=P("Date"),M=P("File"),Y=P("Blob"),j=P("FileList"),z=P("URLSearchParams");function q(ge,Le,{allOwnKeys:Xe=!1}={}){if(ge==null)return;let ft,_t;if(typeof ge!="object"&&(ge=[ge]),I(ge))for(ft=0,_t=ge.length;ft<_t;ft++)Le.call(null,ge[ft],ft,ge);else{const Ct=Xe?Object.getOwnPropertyNames(ge):Object.keys(ge),Pt=Ct.length;let ci;for(ft=0;ft0;)if(ft=Xe[_t],Le===ft.toLowerCase())return ft;return null}const X=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Ho,oe=ge=>!x(ge)&&ge!==X,he=(ie=typeof Uint8Array<"u"&&D(Uint8Array),ge=>ie&&ge instanceof ie);var ie;const fe=P("HTMLFormElement"),se=(({hasOwnProperty:ge})=>(Le,Xe)=>ge.call(Le,Xe))(Object.prototype),Ee=P("RegExp"),He=(ge,Le)=>{const Xe=Object.getOwnPropertyDescriptors(ge),ft={};q(Xe,(_t,Ct)=>{let Pt;(Pt=Le(_t,Ct,ge))!==!1&&(ft[Ct]=Pt||_t)}),Object.defineProperties(ge,ft)},Ie="abcdefghijklmnopqrstuvwxyz",at="0123456789",je={DIGIT:at,ALPHA:Ie,ALPHA_DIGIT:Ie+Ie.toUpperCase()+at},ht=P("AsyncFunction"),_e={isArray:I,isArrayBuffer:O,isBuffer:function(ge){return ge!==null&&!x(ge)&&ge.constructor!==null&&!x(ge.constructor)&&J(ge.constructor.isBuffer)&&ge.constructor.isBuffer(ge)},isFormData:ge=>{let Le;return ge&&(typeof FormData=="function"&&ge instanceof FormData||J(ge.append)&&((Le=R(ge))==="formdata"||Le==="object"&&J(ge.toString)&&ge.toString()==="[object FormData]"))},isArrayBufferView:function(ge){let Le;return Le=typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ge):ge&&ge.buffer&&O(ge.buffer),Le},isString:G,isNumber:te,isBoolean:ge=>ge===!0||ge===!1,isObject:le,isPlainObject:ne,isUndefined:x,isDate:ee,isFile:M,isBlob:Y,isRegExp:Ee,isFunction:J,isStream:ge=>le(ge)&&J(ge.pipe),isURLSearchParams:z,isTypedArray:he,isFileList:j,forEach:q,merge:function ge(){const{caseless:Le}=oe(this)&&this||{},Xe={},ft=(_t,Ct)=>{const Pt=Le&&Z(Xe,Ct)||Ct;ne(Xe[Pt])&&ne(_t)?Xe[Pt]=ge(Xe[Pt],_t):ne(_t)?Xe[Pt]=ge({},_t):I(_t)?Xe[Pt]=_t.slice():Xe[Pt]=_t};for(let _t=0,Ct=arguments.length;_t(q(Le,(_t,Ct)=>{Xe&&J(_t)?ge[Ct]=w(_t,Xe):ge[Ct]=_t},{allOwnKeys:ft}),ge),trim:ge=>ge.trim?ge.trim():ge.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:ge=>(ge.charCodeAt(0)===65279&&(ge=ge.slice(1)),ge),inherits:(ge,Le,Xe,ft)=>{ge.prototype=Object.create(Le.prototype,ft),ge.prototype.constructor=ge,Object.defineProperty(ge,"super",{value:Le.prototype}),Xe&&Object.assign(ge.prototype,Xe)},toFlatObject:(ge,Le,Xe,ft)=>{let _t,Ct,Pt;const ci={};if(Le=Le||{},ge==null)return Le;do{for(_t=Object.getOwnPropertyNames(ge),Ct=_t.length;Ct-- >0;)Pt=_t[Ct],ft&&!ft(Pt,ge,Le)||ci[Pt]||(Le[Pt]=ge[Pt],ci[Pt]=!0);ge=Xe!==!1&&D(ge)}while(ge&&(!Xe||Xe(ge,Le))&&ge!==Object.prototype);return Le},kindOf:R,kindOfTest:P,endsWith:(ge,Le,Xe)=>{ge=String(ge),(Xe===void 0||Xe>ge.length)&&(Xe=ge.length),Xe-=Le.length;const ft=ge.indexOf(Le,Xe);return ft!==-1&&ft===Xe},toArray:ge=>{if(!ge)return null;if(I(ge))return ge;let Le=ge.length;if(!te(Le))return null;const Xe=new Array(Le);for(;Le-- >0;)Xe[Le]=ge[Le];return Xe},forEachEntry:(ge,Le)=>{const Xe=(ge&&ge[Symbol.iterator]).call(ge);let ft;for(;(ft=Xe.next())&&!ft.done;){const _t=ft.value;Le.call(ge,_t[0],_t[1])}},matchAll:(ge,Le)=>{let Xe;const ft=[];for(;(Xe=ge.exec(Le))!==null;)ft.push(Xe);return ft},isHTMLForm:fe,hasOwnProperty:se,hasOwnProp:se,reduceDescriptors:He,freezeMethods:ge=>{He(ge,(Le,Xe)=>{if(J(ge)&&["arguments","caller","callee"].indexOf(Xe)!==-1)return!1;const ft=ge[Xe];J(ft)&&(Le.enumerable=!1,"writable"in Le?Le.writable=!1:Le.set||(Le.set=()=>{throw Error("Can not rewrite read-only method '"+Xe+"'")}))})},toObjectSet:(ge,Le)=>{const Xe={},ft=_t=>{_t.forEach(Ct=>{Xe[Ct]=!0})};return I(ge)?ft(ge):ft(String(ge).split(Le)),Xe},toCamelCase:ge=>ge.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(Le,Xe,ft){return Xe.toUpperCase()+ft}),noop:()=>{},toFiniteNumber:(ge,Le)=>(ge=+ge,Number.isFinite(ge)?ge:Le),findKey:Z,global:X,isContextDefined:oe,ALPHABET:je,generateString:(ge=16,Le=je.ALPHA_DIGIT)=>{let Xe="";const{length:ft}=Le;for(;ge--;)Xe+=Le[Math.random()*ft|0];return Xe},isSpecCompliantForm:function(ge){return!!(ge&&J(ge.append)&&ge[Symbol.toStringTag]==="FormData"&&ge[Symbol.iterator])},toJSONObject:ge=>{const Le=new Array(10),Xe=(ft,_t)=>{if(le(ft)){if(Le.indexOf(ft)>=0)return;if(!("toJSON"in ft)){Le[_t]=ft;const Ct=I(ft)?[]:{};return q(ft,(Pt,ci)=>{const hi=Xe(Pt,_t+1);!x(hi)&&(Ct[ci]=hi)}),Le[_t]=void 0,Ct}}return ft};return Xe(ge,0)},isAsyncFn:ht,isThenable:ge=>ge&&(le(ge)||J(ge))&&J(ge.then)&&J(ge.catch)};function Oe(ge,Le,Xe,ft,_t){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=ge,this.name="AxiosError",Le&&(this.code=Le),Xe&&(this.config=Xe),ft&&(this.request=ft),_t&&(this.response=_t)}_e.inherits(Oe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:_e.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const pt=Oe.prototype,vt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(ge=>{vt[ge]={value:ge}}),Object.defineProperties(Oe,vt),Object.defineProperty(pt,"isAxiosError",{value:!0}),Oe.from=(ge,Le,Xe,ft,_t,Ct)=>{const Pt=Object.create(pt);return _e.toFlatObject(ge,Pt,function(ci){return ci!==Error.prototype},ci=>ci!=="isAxiosError"),Oe.call(Pt,ge.message,Le,Xe,ft,_t),Pt.cause=ge,Pt.name=ge.name,Ct&&Object.assign(Pt,Ct),Pt};const tt=Oe;function pe(ge){return _e.isPlainObject(ge)||_e.isArray(ge)}function ue(ge){return _e.endsWith(ge,"[]")?ge.slice(0,-2):ge}function W(ge,Le,Xe){return ge?ge.concat(Le).map(function(ft,_t){return ft=ue(ft),!Xe&&_t?"["+ft+"]":ft}).join(Xe?".":""):Le}const ke=_e.toFlatObject(_e,{},null,function(ge){return/^is[A-Z]/.test(ge)}),Ae=function(ge,Le,Xe){if(!_e.isObject(ge))throw new TypeError("target must be an object");Le=Le||new FormData;const ft=(Xe=_e.toFlatObject(Xe,{metaTokens:!0,dots:!1,indexes:!1},!1,function(bi,pi){return!_e.isUndefined(pi[bi])})).metaTokens,_t=Xe.visitor||Xt,Ct=Xe.dots,Pt=Xe.indexes,ci=(Xe.Blob||typeof Blob<"u"&&Blob)&&_e.isSpecCompliantForm(Le);if(!_e.isFunction(_t))throw new TypeError("visitor must be a function");function hi(bi){if(bi===null)return"";if(_e.isDate(bi))return bi.toISOString();if(!ci&&_e.isBlob(bi))throw new tt("Blob is not supported. Use a Buffer instead.");return _e.isArrayBuffer(bi)||_e.isTypedArray(bi)?ci&&typeof Blob=="function"?new Blob([bi]):Buffer.from(bi):bi}function Xt(bi,pi,Di){let On=bi;if(bi&&!Di&&typeof bi=="object"){if(_e.endsWith(pi,"{}"))pi=ft?pi:pi.slice(0,-2),bi=JSON.stringify(bi);else if(_e.isArray(bi)&&function(Ji){return _e.isArray(Ji)&&!Ji.some(pe)}(bi)||(_e.isFileList(bi)||_e.endsWith(pi,"[]"))&&(On=_e.toArray(bi)))return pi=ue(pi),On.forEach(function(Ji,tn){!_e.isUndefined(Ji)&&Ji!==null&&Le.append(Pt===!0?W([pi],tn,Ct):Pt===null?pi:pi+"[]",hi(Ji))}),!1}return!!pe(bi)||(Le.append(W(Di,pi,Ct),hi(bi)),!1)}const _i=[],Ui=Object.assign(ke,{defaultVisitor:Xt,convertValue:hi,isVisitable:pe});if(!_e.isObject(ge))throw new TypeError("data must be an object");return function bi(pi,Di){if(!_e.isUndefined(pi)){if(_i.indexOf(pi)!==-1)throw Error("Circular reference detected in "+Di.join("."));_i.push(pi),_e.forEach(pi,function(On,Ji){(!(_e.isUndefined(On)||On===null)&&_t.call(Le,On,_e.isString(Ji)?Ji.trim():Ji,Di,Ui))===!0&&bi(On,Di?Di.concat(Ji):[Ji])}),_i.pop()}}(ge),Le};function Ye(ge){const Le={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(ge).replace(/[!'()~]|%20|%00/g,function(Xe){return Le[Xe]})}function lt(ge,Le){this._pairs=[],ge&&Ae(ge,this,Le)}const mt=lt.prototype;mt.append=function(ge,Le){this._pairs.push([ge,Le])},mt.toString=function(ge){const Le=ge?function(Xe){return ge.call(this,Xe,Ye)}:Ye;return this._pairs.map(function(Xe){return Le(Xe[0])+"="+Le(Xe[1])},"").join("&")};const Ue=lt;function Ve(ge){return encodeURIComponent(ge).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function De(ge,Le,Xe){if(!Le)return ge;const ft=Xe&&Xe.encode||Ve,_t=Xe&&Xe.serialize;let Ct;if(Ct=_t?_t(Le,Xe):_e.isURLSearchParams(Le)?Le.toString():new Ue(Le,Xe).toString(ft),Ct){const Pt=ge.indexOf("#");Pt!==-1&&(ge=ge.slice(0,Pt)),ge+=(ge.indexOf("?")===-1?"?":"&")+Ct}return ge}const Re=class{constructor(){this.handlers=[]}use(ge,Le,Xe){return this.handlers.push({fulfilled:ge,rejected:Le,synchronous:!!Xe&&Xe.synchronous,runWhen:Xe?Xe.runWhen:null}),this.handlers.length-1}eject(ge){this.handlers[ge]&&(this.handlers[ge]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(ge){_e.forEach(this.handlers,function(Le){Le!==null&&ge(Le)})}},ut={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},gt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ue,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},isStandardBrowserEnv:(()=>{let ge;return(typeof navigator>"u"||(ge=navigator.product)!=="ReactNative"&&ge!=="NativeScript"&&ge!=="NS")&&typeof window<"u"&&typeof document<"u"})(),isStandardBrowserWebWorkerEnv:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",protocols:["http","https","file","blob","url","data"]},Ce=function(ge){function Le(Xe,ft,_t,Ct){let Pt=Xe[Ct++];const ci=Number.isFinite(+Pt),hi=Ct>=Xe.length;return Pt=!Pt&&_e.isArray(_t)?_t.length:Pt,hi?(_e.hasOwnProp(_t,Pt)?_t[Pt]=[_t[Pt],ft]:_t[Pt]=ft,!ci):(_t[Pt]&&_e.isObject(_t[Pt])||(_t[Pt]=[]),Le(Xe,ft,_t[Pt],Ct)&&_e.isArray(_t[Pt])&&(_t[Pt]=function(Xt){const _i={},Ui=Object.keys(Xt);let bi;const pi=Ui.length;let Di;for(bi=0;bi{Le(function(Ct){return _e.matchAll(/\w+|\[(\w*)]/g,Ct).map(Pt=>Pt[0]==="[]"?"":Pt[1]||Pt[0])}(ft),_t,Xe,0)}),Xe}return null},ze={transitional:ut,adapter:["xhr","http"],transformRequest:[function(ge,Le){const Xe=Le.getContentType()||"",ft=Xe.indexOf("application/json")>-1,_t=_e.isObject(ge);if(_t&&_e.isHTMLForm(ge)&&(ge=new FormData(ge)),_e.isFormData(ge))return ft&&ft?JSON.stringify(Ce(ge)):ge;if(_e.isArrayBuffer(ge)||_e.isBuffer(ge)||_e.isStream(ge)||_e.isFile(ge)||_e.isBlob(ge))return ge;if(_e.isArrayBufferView(ge))return ge.buffer;if(_e.isURLSearchParams(ge))return Le.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),ge.toString();let Ct;if(_t){if(Xe.indexOf("application/x-www-form-urlencoded")>-1)return function(Pt,ci){return Ae(Pt,new gt.classes.URLSearchParams,Object.assign({visitor:function(hi,Xt,_i,Ui){return gt.isNode&&_e.isBuffer(hi)?(this.append(Xt,hi.toString("base64")),!1):Ui.defaultVisitor.apply(this,arguments)}},ci))}(ge,this.formSerializer).toString();if((Ct=_e.isFileList(ge))||Xe.indexOf("multipart/form-data")>-1){const Pt=this.env&&this.env.FormData;return Ae(Ct?{"files[]":ge}:ge,Pt&&new Pt,this.formSerializer)}}return _t||ft?(Le.setContentType("application/json",!1),function(Pt,ci,hi){if(_e.isString(Pt))try{return(ci||JSON.parse)(Pt),_e.trim(Pt)}catch(Xt){if(Xt.name!=="SyntaxError")throw Xt}return(hi||JSON.stringify)(Pt)}(ge)):ge}],transformResponse:[function(ge){const Le=this.transitional||ze.transitional,Xe=Le&&Le.forcedJSONParsing,ft=this.responseType==="json";if(ge&&_e.isString(ge)&&(Xe&&!this.responseType||ft)){const _t=!(Le&&Le.silentJSONParsing)&&ft;try{return JSON.parse(ge)}catch(Ct){if(_t)throw Ct.name==="SyntaxError"?tt.from(Ct,tt.ERR_BAD_RESPONSE,this,null,this.response):Ct}}return ge}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:gt.classes.FormData,Blob:gt.classes.Blob},validateStatus:function(ge){return ge>=200&&ge<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_e.forEach(["delete","get","head","post","put","patch"],ge=>{ze.headers[ge]={}});const At=ze,Je=_e.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),$e=Symbol("internals");function Be(ge){return ge&&String(ge).trim().toLowerCase()}function it(ge){return ge===!1||ge==null?ge:_e.isArray(ge)?ge.map(it):String(ge)}function Ne(ge,Le,Xe,ft,_t){return _e.isFunction(ft)?ft.call(this,Le,Xe):(_t&&(Le=Xe),_e.isString(Le)?_e.isString(ft)?Le.indexOf(ft)!==-1:_e.isRegExp(ft)?ft.test(Le):void 0:void 0)}class Qe{constructor(Le){Le&&this.set(Le)}set(Le,Xe,ft){const _t=this;function Ct(ci,hi,Xt){const _i=Be(hi);if(!_i)throw new Error("header name must be a non-empty string");const Ui=_e.findKey(_t,_i);(!Ui||_t[Ui]===void 0||Xt===!0||Xt===void 0&&_t[Ui]!==!1)&&(_t[Ui||hi]=it(ci))}const Pt=(ci,hi)=>_e.forEach(ci,(Xt,_i)=>Ct(Xt,_i,hi));return _e.isPlainObject(Le)||Le instanceof this.constructor?Pt(Le,Xe):_e.isString(Le)&&(Le=Le.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(Le.trim())?Pt((ci=>{const hi={};let Xt,_i,Ui;return ci&&ci.split(` +/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(d))))," */")),t.styleTagTransform(a,i,t.options)})(p,c,r)},remove:function(){(function(r){if(r.parentNode===null)return!1;r.parentNode.removeChild(r)})(p)}}}},589:l=>{l.exports=function(c,p){if(p.styleSheet)p.styleSheet.cssText=c;else{for(;p.firstChild;)p.removeChild(p.firstChild);p.appendChild(document.createTextNode(c))}}},597:l=>{l.exports=''},704:l=>{l.exports=''},409:l=>{l.exports=''},243:l=>{l.exports=''},478:l=>{l.exports=''},885:l=>{l.exports=''},189:l=>{l.exports=''},783:l=>{l.exports=''},241:l=>{l.exports=''},863:l=>{l.exports=''},112:l=>{l.exports=''},310:l=>{l.exports=''},723:l=>{l.exports=''},355:l=>{l.exports=''},7:l=>{l.exports=''},381:l=>{l.exports=''},916:l=>{l.exports=''},531:l=>{l.exports=''},223:l=>{l.exports=''},813:l=>{l.exports=''},480:l=>{l.exports=''},848:l=>{l.exports=''}},u={};function A(l){var c=u[l];if(c!==void 0)return c.exports;var p=u[l]={id:l,exports:{}};return s[l].call(p.exports,p,p.exports,A),p.exports}A.n=l=>{var c=l&&l.__esModule?()=>l.default:()=>l;return A.d(c,{a:c}),c},A.d=(l,c)=>{for(var p in c)A.o(c,p)&&!A.o(l,p)&&Object.defineProperty(l,p,{enumerable:!0,get:c[p]})},A.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),A.o=(l,c)=>Object.prototype.hasOwnProperty.call(l,c),A.nc=void 0;var y={};return(()=>{A.d(y,{default:()=>is});var l=A(379),c=A.n(l),p=A(795),r=A.n(p),i=A(569),t=A.n(i),n=A(565),a=A.n(n),o=A(216),d=A.n(o),g=A(589),m=A.n(g),v=A(869),b={};b.styleTagTransform=m(),b.setAttributes=a(),b.insert=t().bind(null,"head"),b.domAPI=r(),b.insertStyleElement=d(),c()(v.Z,b),v.Z&&v.Z.locals&&v.Z.locals;function w(ge,Le){return function(){return ge.apply(Le,arguments)}}const{toString:C}=Object.prototype,{getPrototypeOf:D}=Object,R=(T=Object.create(null),ge=>{const Le=C.call(ge);return T[Le]||(T[Le]=Le.slice(8,-1).toLowerCase())});var T;const P=ge=>(ge=ge.toLowerCase(),Le=>R(Le)===ge),L=ge=>Le=>typeof Le===ge,{isArray:I}=Array,x=L("undefined"),O=P("ArrayBuffer"),G=L("string"),J=L("function"),te=L("number"),le=ge=>ge!==null&&typeof ge=="object",ne=ge=>{if(R(ge)!=="object")return!1;const Le=D(ge);return!(Le!==null&&Le!==Object.prototype&&Object.getPrototypeOf(Le)!==null||Symbol.toStringTag in ge||Symbol.iterator in ge)},ee=P("Date"),M=P("File"),Y=P("Blob"),j=P("FileList"),z=P("URLSearchParams");function q(ge,Le,{allOwnKeys:Xe=!1}={}){if(ge==null)return;let ft,_t;if(typeof ge!="object"&&(ge=[ge]),I(ge))for(ft=0,_t=ge.length;ft<_t;ft++)Le.call(null,ge[ft],ft,ge);else{const Ct=Xe?Object.getOwnPropertyNames(ge):Object.keys(ge),Pt=Ct.length;let ci;for(ft=0;ft0;)if(ft=Xe[_t],Le===ft.toLowerCase())return ft;return null}const X=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Ho,oe=ge=>!x(ge)&&ge!==X,he=(ie=typeof Uint8Array<"u"&&D(Uint8Array),ge=>ie&&ge instanceof ie);var ie;const fe=P("HTMLFormElement"),se=(({hasOwnProperty:ge})=>(Le,Xe)=>ge.call(Le,Xe))(Object.prototype),Ee=P("RegExp"),He=(ge,Le)=>{const Xe=Object.getOwnPropertyDescriptors(ge),ft={};q(Xe,(_t,Ct)=>{let Pt;(Pt=Le(_t,Ct,ge))!==!1&&(ft[Ct]=Pt||_t)}),Object.defineProperties(ge,ft)},Ie="abcdefghijklmnopqrstuvwxyz",at="0123456789",je={DIGIT:at,ALPHA:Ie,ALPHA_DIGIT:Ie+Ie.toUpperCase()+at},ht=P("AsyncFunction"),_e={isArray:I,isArrayBuffer:O,isBuffer:function(ge){return ge!==null&&!x(ge)&&ge.constructor!==null&&!x(ge.constructor)&&J(ge.constructor.isBuffer)&&ge.constructor.isBuffer(ge)},isFormData:ge=>{let Le;return ge&&(typeof FormData=="function"&&ge instanceof FormData||J(ge.append)&&((Le=R(ge))==="formdata"||Le==="object"&&J(ge.toString)&&ge.toString()==="[object FormData]"))},isArrayBufferView:function(ge){let Le;return Le=typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ge):ge&&ge.buffer&&O(ge.buffer),Le},isString:G,isNumber:te,isBoolean:ge=>ge===!0||ge===!1,isObject:le,isPlainObject:ne,isUndefined:x,isDate:ee,isFile:M,isBlob:Y,isRegExp:Ee,isFunction:J,isStream:ge=>le(ge)&&J(ge.pipe),isURLSearchParams:z,isTypedArray:he,isFileList:j,forEach:q,merge:function ge(){const{caseless:Le}=oe(this)&&this||{},Xe={},ft=(_t,Ct)=>{const Pt=Le&&Z(Xe,Ct)||Ct;ne(Xe[Pt])&&ne(_t)?Xe[Pt]=ge(Xe[Pt],_t):ne(_t)?Xe[Pt]=ge({},_t):I(_t)?Xe[Pt]=_t.slice():Xe[Pt]=_t};for(let _t=0,Ct=arguments.length;_t(q(Le,(_t,Ct)=>{Xe&&J(_t)?ge[Ct]=w(_t,Xe):ge[Ct]=_t},{allOwnKeys:ft}),ge),trim:ge=>ge.trim?ge.trim():ge.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:ge=>(ge.charCodeAt(0)===65279&&(ge=ge.slice(1)),ge),inherits:(ge,Le,Xe,ft)=>{ge.prototype=Object.create(Le.prototype,ft),ge.prototype.constructor=ge,Object.defineProperty(ge,"super",{value:Le.prototype}),Xe&&Object.assign(ge.prototype,Xe)},toFlatObject:(ge,Le,Xe,ft)=>{let _t,Ct,Pt;const ci={};if(Le=Le||{},ge==null)return Le;do{for(_t=Object.getOwnPropertyNames(ge),Ct=_t.length;Ct-- >0;)Pt=_t[Ct],ft&&!ft(Pt,ge,Le)||ci[Pt]||(Le[Pt]=ge[Pt],ci[Pt]=!0);ge=Xe!==!1&&D(ge)}while(ge&&(!Xe||Xe(ge,Le))&&ge!==Object.prototype);return Le},kindOf:R,kindOfTest:P,endsWith:(ge,Le,Xe)=>{ge=String(ge),(Xe===void 0||Xe>ge.length)&&(Xe=ge.length),Xe-=Le.length;const ft=ge.indexOf(Le,Xe);return ft!==-1&&ft===Xe},toArray:ge=>{if(!ge)return null;if(I(ge))return ge;let Le=ge.length;if(!te(Le))return null;const Xe=new Array(Le);for(;Le-- >0;)Xe[Le]=ge[Le];return Xe},forEachEntry:(ge,Le)=>{const Xe=(ge&&ge[Symbol.iterator]).call(ge);let ft;for(;(ft=Xe.next())&&!ft.done;){const _t=ft.value;Le.call(ge,_t[0],_t[1])}},matchAll:(ge,Le)=>{let Xe;const ft=[];for(;(Xe=ge.exec(Le))!==null;)ft.push(Xe);return ft},isHTMLForm:fe,hasOwnProperty:se,hasOwnProp:se,reduceDescriptors:He,freezeMethods:ge=>{He(ge,(Le,Xe)=>{if(J(ge)&&["arguments","caller","callee"].indexOf(Xe)!==-1)return!1;const ft=ge[Xe];J(ft)&&(Le.enumerable=!1,"writable"in Le?Le.writable=!1:Le.set||(Le.set=()=>{throw Error("Can not rewrite read-only method '"+Xe+"'")}))})},toObjectSet:(ge,Le)=>{const Xe={},ft=_t=>{_t.forEach(Ct=>{Xe[Ct]=!0})};return I(ge)?ft(ge):ft(String(ge).split(Le)),Xe},toCamelCase:ge=>ge.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(Le,Xe,ft){return Xe.toUpperCase()+ft}),noop:()=>{},toFiniteNumber:(ge,Le)=>(ge=+ge,Number.isFinite(ge)?ge:Le),findKey:Z,global:X,isContextDefined:oe,ALPHABET:je,generateString:(ge=16,Le=je.ALPHA_DIGIT)=>{let Xe="";const{length:ft}=Le;for(;ge--;)Xe+=Le[Math.random()*ft|0];return Xe},isSpecCompliantForm:function(ge){return!!(ge&&J(ge.append)&&ge[Symbol.toStringTag]==="FormData"&&ge[Symbol.iterator])},toJSONObject:ge=>{const Le=new Array(10),Xe=(ft,_t)=>{if(le(ft)){if(Le.indexOf(ft)>=0)return;if(!("toJSON"in ft)){Le[_t]=ft;const Ct=I(ft)?[]:{};return q(ft,(Pt,ci)=>{const hi=Xe(Pt,_t+1);!x(hi)&&(Ct[ci]=hi)}),Le[_t]=void 0,Ct}}return ft};return Xe(ge,0)},isAsyncFn:ht,isThenable:ge=>ge&&(le(ge)||J(ge))&&J(ge.then)&&J(ge.catch)};function Oe(ge,Le,Xe,ft,_t){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=ge,this.name="AxiosError",Le&&(this.code=Le),Xe&&(this.config=Xe),ft&&(this.request=ft),_t&&(this.response=_t)}_e.inherits(Oe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:_e.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const pt=Oe.prototype,vt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(ge=>{vt[ge]={value:ge}}),Object.defineProperties(Oe,vt),Object.defineProperty(pt,"isAxiosError",{value:!0}),Oe.from=(ge,Le,Xe,ft,_t,Ct)=>{const Pt=Object.create(pt);return _e.toFlatObject(ge,Pt,function(ci){return ci!==Error.prototype},ci=>ci!=="isAxiosError"),Oe.call(Pt,ge.message,Le,Xe,ft,_t),Pt.cause=ge,Pt.name=ge.name,Ct&&Object.assign(Pt,Ct),Pt};const tt=Oe;function pe(ge){return _e.isPlainObject(ge)||_e.isArray(ge)}function ue(ge){return _e.endsWith(ge,"[]")?ge.slice(0,-2):ge}function W(ge,Le,Xe){return ge?ge.concat(Le).map(function(ft,_t){return ft=ue(ft),!Xe&&_t?"["+ft+"]":ft}).join(Xe?".":""):Le}const ke=_e.toFlatObject(_e,{},null,function(ge){return/^is[A-Z]/.test(ge)}),Ae=function(ge,Le,Xe){if(!_e.isObject(ge))throw new TypeError("target must be an object");Le=Le||new FormData;const ft=(Xe=_e.toFlatObject(Xe,{metaTokens:!0,dots:!1,indexes:!1},!1,function(bi,pi){return!_e.isUndefined(pi[bi])})).metaTokens,_t=Xe.visitor||Xt,Ct=Xe.dots,Pt=Xe.indexes,ci=(Xe.Blob||typeof Blob<"u"&&Blob)&&_e.isSpecCompliantForm(Le);if(!_e.isFunction(_t))throw new TypeError("visitor must be a function");function hi(bi){if(bi===null)return"";if(_e.isDate(bi))return bi.toISOString();if(!ci&&_e.isBlob(bi))throw new tt("Blob is not supported. Use a Buffer instead.");return _e.isArrayBuffer(bi)||_e.isTypedArray(bi)?ci&&typeof Blob=="function"?new Blob([bi]):Buffer.from(bi):bi}function Xt(bi,pi,Di){let On=bi;if(bi&&!Di&&typeof bi=="object"){if(_e.endsWith(pi,"{}"))pi=ft?pi:pi.slice(0,-2),bi=JSON.stringify(bi);else if(_e.isArray(bi)&&function(Ji){return _e.isArray(Ji)&&!Ji.some(pe)}(bi)||(_e.isFileList(bi)||_e.endsWith(pi,"[]"))&&(On=_e.toArray(bi)))return pi=ue(pi),On.forEach(function(Ji,tn){!_e.isUndefined(Ji)&&Ji!==null&&Le.append(Pt===!0?W([pi],tn,Ct):Pt===null?pi:pi+"[]",hi(Ji))}),!1}return!!pe(bi)||(Le.append(W(Di,pi,Ct),hi(bi)),!1)}const _i=[],Ui=Object.assign(ke,{defaultVisitor:Xt,convertValue:hi,isVisitable:pe});if(!_e.isObject(ge))throw new TypeError("data must be an object");return function bi(pi,Di){if(!_e.isUndefined(pi)){if(_i.indexOf(pi)!==-1)throw Error("Circular reference detected in "+Di.join("."));_i.push(pi),_e.forEach(pi,function(On,Ji){(!(_e.isUndefined(On)||On===null)&&_t.call(Le,On,_e.isString(Ji)?Ji.trim():Ji,Di,Ui))===!0&&bi(On,Di?Di.concat(Ji):[Ji])}),_i.pop()}}(ge),Le};function Ye(ge){const Le={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(ge).replace(/[!'()~]|%20|%00/g,function(Xe){return Le[Xe]})}function lt(ge,Le){this._pairs=[],ge&&Ae(ge,this,Le)}const mt=lt.prototype;mt.append=function(ge,Le){this._pairs.push([ge,Le])},mt.toString=function(ge){const Le=ge?function(Xe){return ge.call(this,Xe,Ye)}:Ye;return this._pairs.map(function(Xe){return Le(Xe[0])+"="+Le(Xe[1])},"").join("&")};const Ue=lt;function Ve(ge){return encodeURIComponent(ge).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function De(ge,Le,Xe){if(!Le)return ge;const ft=Xe&&Xe.encode||Ve,_t=Xe&&Xe.serialize;let Ct;if(Ct=_t?_t(Le,Xe):_e.isURLSearchParams(Le)?Le.toString():new Ue(Le,Xe).toString(ft),Ct){const Pt=ge.indexOf("#");Pt!==-1&&(ge=ge.slice(0,Pt)),ge+=(ge.indexOf("?")===-1?"?":"&")+Ct}return ge}const Re=class{constructor(){this.handlers=[]}use(ge,Le,Xe){return this.handlers.push({fulfilled:ge,rejected:Le,synchronous:!!Xe&&Xe.synchronous,runWhen:Xe?Xe.runWhen:null}),this.handlers.length-1}eject(ge){this.handlers[ge]&&(this.handlers[ge]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(ge){_e.forEach(this.handlers,function(Le){Le!==null&&ge(Le)})}},ut={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},gt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ue,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},isStandardBrowserEnv:(()=>{let ge;return(typeof navigator>"u"||(ge=navigator.product)!=="ReactNative"&&ge!=="NativeScript"&&ge!=="NS")&&typeof window<"u"&&typeof document<"u"})(),isStandardBrowserWebWorkerEnv:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",protocols:["http","https","file","blob","url","data"]},Ce=function(ge){function Le(Xe,ft,_t,Ct){let Pt=Xe[Ct++];const ci=Number.isFinite(+Pt),hi=Ct>=Xe.length;return Pt=!Pt&&_e.isArray(_t)?_t.length:Pt,hi?(_e.hasOwnProp(_t,Pt)?_t[Pt]=[_t[Pt],ft]:_t[Pt]=ft,!ci):(_t[Pt]&&_e.isObject(_t[Pt])||(_t[Pt]=[]),Le(Xe,ft,_t[Pt],Ct)&&_e.isArray(_t[Pt])&&(_t[Pt]=function(Xt){const _i={},Ui=Object.keys(Xt);let bi;const pi=Ui.length;let Di;for(bi=0;bi{Le(function(Ct){return _e.matchAll(/\w+|\[(\w*)]/g,Ct).map(Pt=>Pt[0]==="[]"?"":Pt[1]||Pt[0])}(ft),_t,Xe,0)}),Xe}return null},ze={transitional:ut,adapter:["xhr","http"],transformRequest:[function(ge,Le){const Xe=Le.getContentType()||"",ft=Xe.indexOf("application/json")>-1,_t=_e.isObject(ge);if(_t&&_e.isHTMLForm(ge)&&(ge=new FormData(ge)),_e.isFormData(ge))return ft&&ft?JSON.stringify(Ce(ge)):ge;if(_e.isArrayBuffer(ge)||_e.isBuffer(ge)||_e.isStream(ge)||_e.isFile(ge)||_e.isBlob(ge))return ge;if(_e.isArrayBufferView(ge))return ge.buffer;if(_e.isURLSearchParams(ge))return Le.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),ge.toString();let Ct;if(_t){if(Xe.indexOf("application/x-www-form-urlencoded")>-1)return function(Pt,ci){return Ae(Pt,new gt.classes.URLSearchParams,Object.assign({visitor:function(hi,Xt,_i,Ui){return gt.isNode&&_e.isBuffer(hi)?(this.append(Xt,hi.toString("base64")),!1):Ui.defaultVisitor.apply(this,arguments)}},ci))}(ge,this.formSerializer).toString();if((Ct=_e.isFileList(ge))||Xe.indexOf("multipart/form-data")>-1){const Pt=this.env&&this.env.FormData;return Ae(Ct?{"files[]":ge}:ge,Pt&&new Pt,this.formSerializer)}}return _t||ft?(Le.setContentType("application/json",!1),function(Pt,ci,hi){if(_e.isString(Pt))try{return(ci||JSON.parse)(Pt),_e.trim(Pt)}catch(Xt){if(Xt.name!=="SyntaxError")throw Xt}return(hi||JSON.stringify)(Pt)}(ge)):ge}],transformResponse:[function(ge){const Le=this.transitional||ze.transitional,Xe=Le&&Le.forcedJSONParsing,ft=this.responseType==="json";if(ge&&_e.isString(ge)&&(Xe&&!this.responseType||ft)){const _t=!(Le&&Le.silentJSONParsing)&&ft;try{return JSON.parse(ge)}catch(Ct){if(_t)throw Ct.name==="SyntaxError"?tt.from(Ct,tt.ERR_BAD_RESPONSE,this,null,this.response):Ct}}return ge}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:gt.classes.FormData,Blob:gt.classes.Blob},validateStatus:function(ge){return ge>=200&&ge<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_e.forEach(["delete","get","head","post","put","patch"],ge=>{ze.headers[ge]={}});const At=ze,Je=_e.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),$e=Symbol("internals");function Be(ge){return ge&&String(ge).trim().toLowerCase()}function it(ge){return ge===!1||ge==null?ge:_e.isArray(ge)?ge.map(it):String(ge)}function Ne(ge,Le,Xe,ft,_t){return _e.isFunction(ft)?ft.call(this,Le,Xe):(_t&&(Le=Xe),_e.isString(Le)?_e.isString(ft)?Le.indexOf(ft)!==-1:_e.isRegExp(ft)?ft.test(Le):void 0:void 0)}class Qe{constructor(Le){Le&&this.set(Le)}set(Le,Xe,ft){const _t=this;function Ct(ci,hi,Xt){const _i=Be(hi);if(!_i)throw new Error("header name must be a non-empty string");const Ui=_e.findKey(_t,_i);(!Ui||_t[Ui]===void 0||Xt===!0||Xt===void 0&&_t[Ui]!==!1)&&(_t[Ui||hi]=it(ci))}const Pt=(ci,hi)=>_e.forEach(ci,(Xt,_i)=>Ct(Xt,_i,hi));return _e.isPlainObject(Le)||Le instanceof this.constructor?Pt(Le,Xe):_e.isString(Le)&&(Le=Le.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(Le.trim())?Pt((ci=>{const hi={};let Xt,_i,Ui;return ci&&ci.split(` `).forEach(function(bi){Ui=bi.indexOf(":"),Xt=bi.substring(0,Ui).trim().toLowerCase(),_i=bi.substring(Ui+1).trim(),!Xt||hi[Xt]&&Je[Xt]||(Xt==="set-cookie"?hi[Xt]?hi[Xt].push(_i):hi[Xt]=[_i]:hi[Xt]=hi[Xt]?hi[Xt]+", "+_i:_i)}),hi})(Le),Xe):Le!=null&&Ct(Xe,Le,ft),this}get(Le,Xe){if(Le=Be(Le)){const ft=_e.findKey(this,Le);if(ft){const _t=this[ft];if(!Xe)return _t;if(Xe===!0)return function(Ct){const Pt=Object.create(null),ci=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let hi;for(;hi=ci.exec(Ct);)Pt[hi[1]]=hi[2];return Pt}(_t);if(_e.isFunction(Xe))return Xe.call(this,_t,ft);if(_e.isRegExp(Xe))return Xe.exec(_t);throw new TypeError("parser must be boolean|regexp|function")}}}has(Le,Xe){if(Le=Be(Le)){const ft=_e.findKey(this,Le);return!(!ft||this[ft]===void 0||Xe&&!Ne(0,this[ft],ft,Xe))}return!1}delete(Le,Xe){const ft=this;let _t=!1;function Ct(Pt){if(Pt=Be(Pt)){const ci=_e.findKey(ft,Pt);!ci||Xe&&!Ne(0,ft[ci],ci,Xe)||(delete ft[ci],_t=!0)}}return _e.isArray(Le)?Le.forEach(Ct):Ct(Le),_t}clear(Le){const Xe=Object.keys(this);let ft=Xe.length,_t=!1;for(;ft--;){const Ct=Xe[ft];Le&&!Ne(0,this[Ct],Ct,Le,!0)||(delete this[Ct],_t=!0)}return _t}normalize(Le){const Xe=this,ft={};return _e.forEach(this,(_t,Ct)=>{const Pt=_e.findKey(ft,Ct);if(Pt)return Xe[Pt]=it(_t),void delete Xe[Ct];const ci=Le?function(hi){return hi.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(Xt,_i,Ui)=>_i.toUpperCase()+Ui)}(Ct):String(Ct).trim();ci!==Ct&&delete Xe[Ct],Xe[ci]=it(_t),ft[ci]=!0}),this}concat(...Le){return this.constructor.concat(this,...Le)}toJSON(Le){const Xe=Object.create(null);return _e.forEach(this,(ft,_t)=>{ft!=null&&ft!==!1&&(Xe[_t]=Le&&_e.isArray(ft)?ft.join(", "):ft)}),Xe}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([Le,Xe])=>Le+": "+Xe).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(Le){return Le instanceof this?Le:new this(Le)}static concat(Le,...Xe){const ft=new this(Le);return Xe.forEach(_t=>ft.set(_t)),ft}static accessor(Le){const Xe=(this[$e]=this[$e]={accessors:{}}).accessors,ft=this.prototype;function _t(Ct){const Pt=Be(Ct);Xe[Pt]||(function(ci,hi){const Xt=_e.toCamelCase(" "+hi);["get","set","has"].forEach(_i=>{Object.defineProperty(ci,_i+Xt,{value:function(Ui,bi,pi){return this[_i].call(this,hi,Ui,bi,pi)},configurable:!0})})}(ft,Ct),Xe[Pt]=!0)}return _e.isArray(Le)?Le.forEach(_t):_t(Le),this}}Qe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),_e.reduceDescriptors(Qe.prototype,({value:ge},Le)=>{let Xe=Le[0].toUpperCase()+Le.slice(1);return{get:()=>ge,set(ft){this[Xe]=ft}}}),_e.freezeMethods(Qe);const Me=Qe;function Se(ge,Le){const Xe=this||At,ft=Le||Xe,_t=Me.from(ft.headers);let Ct=ft.data;return _e.forEach(ge,function(Pt){Ct=Pt.call(Xe,Ct,_t.normalize(),Le?Le.status:void 0)}),_t.normalize(),Ct}function K(ge){return!(!ge||!ge.__CANCEL__)}function xe(ge,Le,Xe){tt.call(this,ge??"canceled",tt.ERR_CANCELED,Le,Xe),this.name="CanceledError"}_e.inherits(xe,tt,{__CANCEL__:!0});const be=xe,Te=gt.isStandardBrowserEnv?{write:function(ge,Le,Xe,ft,_t,Ct){const Pt=[];Pt.push(ge+"="+encodeURIComponent(Le)),_e.isNumber(Xe)&&Pt.push("expires="+new Date(Xe).toGMTString()),_e.isString(ft)&&Pt.push("path="+ft),_e.isString(_t)&&Pt.push("domain="+_t),Ct===!0&&Pt.push("secure"),document.cookie=Pt.join("; ")},read:function(ge){const Le=document.cookie.match(new RegExp("(^|;\\s*)("+ge+")=([^;]*)"));return Le?decodeURIComponent(Le[3]):null},remove:function(ge){this.write(ge,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function V(ge,Le){return ge&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(Le)?function(Xe,ft){return ft?Xe.replace(/\/+$/,"")+"/"+ft.replace(/^\/+/,""):Xe}(ge,Le):Le}const N=gt.isStandardBrowserEnv?function(){const ge=/(msie|trident)/i.test(navigator.userAgent),Le=document.createElement("a");let Xe;function ft(_t){let Ct=_t;return ge&&(Le.setAttribute("href",Ct),Ct=Le.href),Le.setAttribute("href",Ct),{href:Le.href,protocol:Le.protocol?Le.protocol.replace(/:$/,""):"",host:Le.host,search:Le.search?Le.search.replace(/^\?/,""):"",hash:Le.hash?Le.hash.replace(/^#/,""):"",hostname:Le.hostname,port:Le.port,pathname:Le.pathname.charAt(0)==="/"?Le.pathname:"/"+Le.pathname}}return Xe=ft(window.location.href),function(_t){const Ct=_e.isString(_t)?ft(_t):_t;return Ct.protocol===Xe.protocol&&Ct.host===Xe.host}}():function(){return!0},S=function(ge,Le){ge=ge||10;const Xe=new Array(ge),ft=new Array(ge);let _t,Ct=0,Pt=0;return Le=Le!==void 0?Le:1e3,function(ci){const hi=Date.now(),Xt=ft[Pt];_t||(_t=hi),Xe[Ct]=ci,ft[Ct]=hi;let _i=Pt,Ui=0;for(;_i!==Ct;)Ui+=Xe[_i++],_i%=ge;if(Ct=(Ct+1)%ge,Ct===Pt&&(Pt=(Pt+1)%ge),hi-_t{const Ct=_t.loaded,Pt=_t.lengthComputable?_t.total:void 0,ci=Ct-Xe,hi=ft(ci);Xe=Ct;const Xt={loaded:Ct,total:Pt,progress:Pt?Ct/Pt:void 0,bytes:ci,rate:hi||void 0,estimated:hi&&Pt&&Ct<=Pt?(Pt-Ct)/hi:void 0,event:_t};Xt[Le?"download":"upload"]=!0,ge(Xt)}}const re={http:null,xhr:typeof XMLHttpRequest<"u"&&function(ge){return new Promise(function(Le,Xe){let ft=ge.data;const _t=Me.from(ge.headers).normalize(),Ct=ge.responseType;let Pt,ci;function hi(){ge.cancelToken&&ge.cancelToken.unsubscribe(Pt),ge.signal&&ge.signal.removeEventListener("abort",Pt)}_e.isFormData(ft)&&(gt.isStandardBrowserEnv||gt.isStandardBrowserWebWorkerEnv?_t.setContentType(!1):_t.getContentType(/^\s*multipart\/form-data/)?_e.isString(ci=_t.getContentType())&&_t.setContentType(ci.replace(/^\s*(multipart\/form-data);+/,"$1")):_t.setContentType("multipart/form-data"));let Xt=new XMLHttpRequest;if(ge.auth){const pi=ge.auth.username||"",Di=ge.auth.password?unescape(encodeURIComponent(ge.auth.password)):"";_t.set("Authorization","Basic "+btoa(pi+":"+Di))}const _i=V(ge.baseURL,ge.url);function Ui(){if(!Xt)return;const pi=Me.from("getAllResponseHeaders"in Xt&&Xt.getAllResponseHeaders());(function(Di,On,Ji){const tn=Ji.config.validateStatus;Ji.status&&tn&&!tn(Ji.status)?On(new tt("Request failed with status code "+Ji.status,[tt.ERR_BAD_REQUEST,tt.ERR_BAD_RESPONSE][Math.floor(Ji.status/100)-4],Ji.config,Ji.request,Ji)):Di(Ji)})(function(Di){Le(Di),hi()},function(Di){Xe(Di),hi()},{data:Ct&&Ct!=="text"&&Ct!=="json"?Xt.response:Xt.responseText,status:Xt.status,statusText:Xt.statusText,headers:pi,config:ge,request:Xt}),Xt=null}if(Xt.open(ge.method.toUpperCase(),De(_i,ge.params,ge.paramsSerializer),!0),Xt.timeout=ge.timeout,"onloadend"in Xt?Xt.onloadend=Ui:Xt.onreadystatechange=function(){Xt&&Xt.readyState===4&&(Xt.status!==0||Xt.responseURL&&Xt.responseURL.indexOf("file:")===0)&&setTimeout(Ui)},Xt.onabort=function(){Xt&&(Xe(new tt("Request aborted",tt.ECONNABORTED,ge,Xt)),Xt=null)},Xt.onerror=function(){Xe(new tt("Network Error",tt.ERR_NETWORK,ge,Xt)),Xt=null},Xt.ontimeout=function(){let pi=ge.timeout?"timeout of "+ge.timeout+"ms exceeded":"timeout exceeded";const Di=ge.transitional||ut;ge.timeoutErrorMessage&&(pi=ge.timeoutErrorMessage),Xe(new tt(pi,Di.clarifyTimeoutError?tt.ETIMEDOUT:tt.ECONNABORTED,ge,Xt)),Xt=null},gt.isStandardBrowserEnv){const pi=N(_i)&&ge.xsrfCookieName&&Te.read(ge.xsrfCookieName);pi&&_t.set(ge.xsrfHeaderName,pi)}ft===void 0&&_t.setContentType(null),"setRequestHeader"in Xt&&_e.forEach(_t.toJSON(),function(pi,Di){Xt.setRequestHeader(Di,pi)}),_e.isUndefined(ge.withCredentials)||(Xt.withCredentials=!!ge.withCredentials),Ct&&Ct!=="json"&&(Xt.responseType=ge.responseType),typeof ge.onDownloadProgress=="function"&&Xt.addEventListener("progress",F(ge.onDownloadProgress,!0)),typeof ge.onUploadProgress=="function"&&Xt.upload&&Xt.upload.addEventListener("progress",F(ge.onUploadProgress)),(ge.cancelToken||ge.signal)&&(Pt=pi=>{Xt&&(Xe(!pi||pi.type?new be(null,ge,Xt):pi),Xt.abort(),Xt=null)},ge.cancelToken&&ge.cancelToken.subscribe(Pt),ge.signal&&(ge.signal.aborted?Pt():ge.signal.addEventListener("abort",Pt)));const bi=function(pi){const Di=/^([-+\w]{1,25})(:?\/\/|:)/.exec(pi);return Di&&Di[1]||""}(_i);bi&>.protocols.indexOf(bi)===-1?Xe(new tt("Unsupported protocol "+bi+":",tt.ERR_BAD_REQUEST,ge)):Xt.send(ft||null)})}};_e.forEach(re,(ge,Le)=>{if(ge){try{Object.defineProperty(ge,"name",{value:Le})}catch{}Object.defineProperty(ge,"adapterName",{value:Le})}});const ce=ge=>`- ${ge}`,me=ge=>_e.isFunction(ge)||ge===null||ge===!1,ye=ge=>{ge=_e.isArray(ge)?ge:[ge];const{length:Le}=ge;let Xe,ft;const _t={};for(let Ct=0;Ct`adapter ${ci} `+(hi===!1?"is not supported by the environment":"is not available in the build"));let Pt=Le?Ct.length>1?`since : `+Ct.map(ce).join(` -`):" "+ce(Ct[0]):"as no adapter specified";throw new tt("There is no suitable adapter to dispatch the request "+Pt,"ERR_NOT_SUPPORT")}return ft};function Pe(ge){if(ge.cancelToken&&ge.cancelToken.throwIfRequested(),ge.signal&&ge.signal.aborted)throw new be(null,ge)}function We(ge){return Pe(ge),ge.headers=Me.from(ge.headers),ge.data=Se.call(ge,ge.transformRequest),["post","put","patch"].indexOf(ge.method)!==-1&&ge.headers.setContentType("application/x-www-form-urlencoded",!1),ye(ge.adapter||At.adapter)(ge).then(function(Le){return Pe(ge),Le.data=Se.call(ge,ge.transformResponse,Le),Le.headers=Me.from(Le.headers),Le},function(Le){return K(Le)||(Pe(ge),Le&&Le.response&&(Le.response.data=Se.call(ge,ge.transformResponse,Le.response),Le.response.headers=Me.from(Le.response.headers))),Promise.reject(Le)})}const nt=ge=>ge instanceof Me?ge.toJSON():ge;function et(ge,Le){Le=Le||{};const Xe={};function ft(Xt,_i,Ui){return _e.isPlainObject(Xt)&&_e.isPlainObject(_i)?_e.merge.call({caseless:Ui},Xt,_i):_e.isPlainObject(_i)?_e.merge({},_i):_e.isArray(_i)?_i.slice():_i}function _t(Xt,_i,Ui){return _e.isUndefined(_i)?_e.isUndefined(Xt)?void 0:ft(void 0,Xt,Ui):ft(Xt,_i,Ui)}function Ct(Xt,_i){if(!_e.isUndefined(_i))return ft(void 0,_i)}function Pt(Xt,_i){return _e.isUndefined(_i)?_e.isUndefined(Xt)?void 0:ft(void 0,Xt):ft(void 0,_i)}function ci(Xt,_i,Ui){return Ui in Le?ft(Xt,_i):Ui in ge?ft(void 0,Xt):void 0}const hi={url:Ct,method:Ct,data:Ct,baseURL:Pt,transformRequest:Pt,transformResponse:Pt,paramsSerializer:Pt,timeout:Pt,timeoutMessage:Pt,withCredentials:Pt,adapter:Pt,responseType:Pt,xsrfCookieName:Pt,xsrfHeaderName:Pt,onUploadProgress:Pt,onDownloadProgress:Pt,decompress:Pt,maxContentLength:Pt,maxBodyLength:Pt,beforeRedirect:Pt,transport:Pt,httpAgent:Pt,httpsAgent:Pt,cancelToken:Pt,socketPath:Pt,responseEncoding:Pt,validateStatus:ci,headers:(Xt,_i)=>_t(nt(Xt),nt(_i),!0)};return _e.forEach(Object.keys(Object.assign({},ge,Le)),function(Xt){const _i=hi[Xt]||_t,Ui=_i(ge[Xt],Le[Xt],Xt);_e.isUndefined(Ui)&&_i!==ci||(Xe[Xt]=Ui)}),Xe}const ot="1.6.0",dt={};["object","boolean","number","function","string","symbol"].forEach((ge,Le)=>{dt[ge]=function(Xe){return typeof Xe===ge||"a"+(Le<1?"n ":" ")+ge}});const yt={};dt.transitional=function(ge,Le,Xe){function ft(_t,Ct){return"[Axios v1.6.0] Transitional option '"+_t+"'"+Ct+(Xe?". "+Xe:"")}return(_t,Ct,Pt)=>{if(ge===!1)throw new tt(ft(Ct," has been removed"+(Le?" in "+Le:"")),tt.ERR_DEPRECATED);return Le&&!yt[Ct]&&(yt[Ct]=!0,console.warn(ft(Ct," has been deprecated since v"+Le+" and will be removed in the near future"))),!ge||ge(_t,Ct,Pt)}};const wt={assertOptions:function(ge,Le,Xe){if(typeof ge!="object")throw new tt("options must be an object",tt.ERR_BAD_OPTION_VALUE);const ft=Object.keys(ge);let _t=ft.length;for(;_t-- >0;){const Ct=ft[_t],Pt=Le[Ct];if(Pt){const ci=ge[Ct],hi=ci===void 0||Pt(ci,Ct,ge);if(hi!==!0)throw new tt("option "+Ct+" must be "+hi,tt.ERR_BAD_OPTION_VALUE)}else if(Xe!==!0)throw new tt("Unknown option "+Ct,tt.ERR_BAD_OPTION)}},validators:dt},bt=wt.validators;class Rt{constructor(Le){this.defaults=Le,this.interceptors={request:new Re,response:new Re}}request(Le,Xe){typeof Le=="string"?(Xe=Xe||{}).url=Le:Xe=Le||{},Xe=et(this.defaults,Xe);const{transitional:ft,paramsSerializer:_t,headers:Ct}=Xe;ft!==void 0&&wt.assertOptions(ft,{silentJSONParsing:bt.transitional(bt.boolean),forcedJSONParsing:bt.transitional(bt.boolean),clarifyTimeoutError:bt.transitional(bt.boolean)},!1),_t!=null&&(_e.isFunction(_t)?Xe.paramsSerializer={serialize:_t}:wt.assertOptions(_t,{encode:bt.function,serialize:bt.function},!0)),Xe.method=(Xe.method||this.defaults.method||"get").toLowerCase();let Pt=Ct&&_e.merge(Ct.common,Ct[Xe.method]);Ct&&_e.forEach(["delete","get","head","post","put","patch","common"],Di=>{delete Ct[Di]}),Xe.headers=Me.concat(Pt,Ct);const ci=[];let hi=!0;this.interceptors.request.forEach(function(Di){typeof Di.runWhen=="function"&&Di.runWhen(Xe)===!1||(hi=hi&&Di.synchronous,ci.unshift(Di.fulfilled,Di.rejected))});const Xt=[];let _i;this.interceptors.response.forEach(function(Di){Xt.push(Di.fulfilled,Di.rejected)});let Ui,bi=0;if(!hi){const Di=[We.bind(this),void 0];for(Di.unshift.apply(Di,ci),Di.push.apply(Di,Xt),Ui=Di.length,_i=Promise.resolve(Xe);bi{if(!ft._listeners)return;let Ct=ft._listeners.length;for(;Ct-- >0;)ft._listeners[Ct](_t);ft._listeners=null}),this.promise.then=_t=>{let Ct;const Pt=new Promise(ci=>{ft.subscribe(ci),Ct=ci}).then(_t);return Pt.cancel=function(){ft.unsubscribe(Ct)},Pt},Le(function(_t,Ct,Pt){ft.reason||(ft.reason=new be(_t,Ct,Pt),Xe(ft.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(Le){this.reason?Le(this.reason):this._listeners?this._listeners.push(Le):this._listeners=[Le]}unsubscribe(Le){if(!this._listeners)return;const Xe=this._listeners.indexOf(Le);Xe!==-1&&this._listeners.splice(Xe,1)}static source(){let Le;return{token:new Tt(function(Xe){Le=Xe}),cancel:Le}}}const xt=Tt,Ut={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ut).forEach(([ge,Le])=>{Ut[Le]=ge});const Vt=Ut,Bt=function ge(Le){const Xe=new Lt(Le),ft=w(Lt.prototype.request,Xe);return _e.extend(ft,Lt.prototype,Xe,{allOwnKeys:!0}),_e.extend(ft,Xe,null,{allOwnKeys:!0}),ft.create=function(_t){return ge(et(Le,_t))},ft}(At);Bt.Axios=Lt,Bt.CanceledError=be,Bt.CancelToken=xt,Bt.isCancel=K,Bt.VERSION=ot,Bt.toFormData=Ae,Bt.AxiosError=tt,Bt.Cancel=Bt.CanceledError,Bt.all=function(ge){return Promise.all(ge)},Bt.spread=function(ge){return function(Le){return ge.apply(null,Le)}},Bt.isAxiosError=function(ge){return _e.isObject(ge)&&ge.isAxiosError===!0},Bt.mergeConfig=et,Bt.AxiosHeaders=Me,Bt.formToJSON=ge=>Ce(_e.isHTMLForm(ge)?new FormData(ge):ge),Bt.getAdapter=ye,Bt.HttpStatusCode=Vt,Bt.default=Bt;const jt=Bt;var Mt=y(662);const Ot=/iPhone|iPad|iPod|Windows|Macintosh|Android|Mobile/i.test(navigator.userAgent)&&"ontouchend"in document,Jt={secondToTime:ge=>{if((ge=ge||0)===0||ge===1/0||ge.toString()==="NaN")return"00:00";const Le=Math.floor(ge/3600),Xe=Math.floor((ge-3600*Le)/60),ft=Math.floor(ge-3600*Le-60*Xe);return(Le>0?[Le,Xe,ft]:[Xe,ft]).map(_t=>_t<10?"0"+_t:""+_t).join(":")},getVideoDuration:(ge,Le)=>{let Xe=ge.duration;return Xe===1/0&&(ge.seekable.length>0?(Le.dtime.textContent=Jt.secondToTime(ge.seekable.end(0)),Xe=ge.seekable.end(0)):ge.buffered.length>0&&(Le.dtime.textContent=Jt.secondToTime(ge.buffered.end(0)),Xe=ge.buffered.end(0))),Xe},getElementViewLeft:ge=>{let Le=ge.offsetLeft,Xe=ge.offsetParent;const ft=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.webkitFullscreenElement)for(;Xe!==null&&Xe!==ge;)Le+=Xe.offsetLeft,Xe=Xe.offsetParent;else for(;Xe!==null;)Le+=Xe.offsetLeft,Xe=Xe.offsetParent;return Le-ft},getBoundingClientRectViewLeft(ge){const Le=window.scrollY||window.pageYOffset||document.body.scrollTop+(document.documentElement&&document.documentElement.scrollTop||0);if(ge.getBoundingClientRect){if(typeof this.getBoundingClientRectViewLeft.offset!="number"){let _t=document.createElement("div");_t.style.cssText="position:absolute;top:0;left:0;",document.body.appendChild(_t),this.getBoundingClientRectViewLeft.offset=-_t.getBoundingClientRect().top-Le,document.body.removeChild(_t),_t=null}const Xe=ge.getBoundingClientRect(),ft=this.getBoundingClientRectViewLeft.offset;return Xe.left+ft}return this.getElementViewLeft(ge)},getScrollPosition:()=>({left:window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0,top:window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}),setScrollPosition({left:ge=0,top:Le=0}){this.isFirefox?(document.documentElement.scrollLeft=ge,document.documentElement.scrollTop=Le):window.scrollTo(ge,Le)},isMobile:Ot,isFirefox:/firefox/i.test(window.navigator.userAgent),isChrome:/chrome/i.test(window.navigator.userAgent),storage:{set:(ge,Le)=>{localStorage.setItem(ge,Le)},get:ge=>localStorage.getItem(ge)},nameMap:{dragStart:Ot?"touchstart":"mousedown",dragMove:Ot?"touchmove":"mousemove",dragEnd:Ot?"touchend":"mouseup"},color2Number:ge=>(ge[0]==="#"&&(ge=ge.substr(1)),ge.length===3&&(ge=`${ge[0]}${ge[0]}${ge[1]}${ge[1]}${ge[2]}${ge[2]}`),parseInt(ge,16)+0&16777215),number2Color:ge=>"#"+("00000"+ge.toString(16)).slice(-6),number2Type:ge=>{switch(ge){case 0:default:return"right";case 1:return"top";case 2:return"bottom"}}},Wt=Jt,di={send:ge=>{ge.url!==void 0?jt.post(ge.url,ge.data).then(Le=>{const Xe=Le.data;Xe&&Xe.code===0?ge.success&&ge.success():ge.error&&ge.error(Xe&&Xe.msg)}).catch(Le=>{console.error(Le),ge.error&&ge.error()}):ge.error&&ge.error()},read:ge=>{ge.url!==void 0?jt.get(ge.url).then(Le=>{const Xe=Le.data;Xe&&Xe.code===0?Xe.data?ge.success&&ge.success(Xe.data.map(ft=>({author:ft[3],time:ft[0],text:ft[4],color:ft[2],type:ft[1],size:ft[5]&&(ft[5]==="big"||ft[5]==="small")?ft[5]:"medium"}))):ge.success&&ge.success([{author:"",time:0,text:"",color:"#ffeaea",type:"right",size:"medium"}]):ge.error&&ge.error(Xe&&Xe.msg)}).catch(Le=>{console.error(Le),ge.error&&ge.error()}):ge.error&&ge.error()}},oi=di,$t={"zh-cn":{"Danmaku is loading":"弹幕加载中",Top:"顶部",Bottom:"底部",Rolling:"滚动",Big:"大的",Medium:"中等的",Small:"小的","Input danmaku, hit Enter":"输入弹幕,回车发送","About author":"关于作者","DPlayer feedback":"播放器意见反馈","About DPlayer":"关于 DPlayer 播放器",Loop:"洗脑循环",Speed:"速度",Audio:"音频","Primary audio":"主要音频","Secondary audio":"辅助音频","Opacity for danmaku":"弹幕透明度",Normal:"正常","Please input danmaku content!":"要输入弹幕内容啊喂!","Set danmaku color":"设置弹幕颜色","Set danmaku type":"设置弹幕类型","Set danmaku size":"设置弹幕大小","Show danmaku":"显示弹幕","Video load failed":"视频加载失败","Danmaku load failed":"弹幕加载失败","Danmaku send failed":"弹幕发送失败","Switching to":"正在切换至","Switched to":"已经切换至",Synchronize:"同步",Synchronized:"同步的",Quality:"画质",quality:"画质",FF:"快进",REW:"快退","Unlimited danmaku":"海量弹幕","Send danmaku":"发送弹幕",Setting:"设置","Full screen":"全屏","Web full screen":"页面全屏","Picture-in-Picture":"子母画面",Send:"发送",Screenshot:"截图",AirPlay:"无线投屏",s:"秒","Show comment":"显示弹幕","Hide comment":"隐藏弹幕","Show subtitle":"显示字幕","Hide subtitle":"隐藏字幕",Volume:"音量",Live:"直播","Video info":"视频统计信息"},"zh-tw":{"Danmaku is loading":"彈幕載入中",Top:"頂部",Bottom:"底部",Rolling:"滾動",Big:"大的",Medium:"中等的",Small:"小的","Input danmaku, hit Enter":"輸入彈幕,Enter 發送","About author":"關於作者","DPlayer feedback":"播放器意見回饋","About DPlayer":"關於 DPlayer 播放器",Loop:"循環播放",Speed:"速度",Audio:"音頻","Primary audio":"主要音頻","Secondary audio":"輔助音頻","Opacity for danmaku":"彈幕透明度",Normal:"正常","Please input danmaku content!":"請輸入彈幕內容啊!","Set danmaku color":"設定彈幕顏色","Set danmaku type":"設定彈幕類型","Set danmaku size":"设置弹幕大小","Show danmaku":"顯示彈幕","Video load failed":"影片載入失敗","Danmaku load failed":"彈幕載入失敗","Danmaku send failed":"彈幕發送失敗","Switching to":"正在切換至","Switched to":"已經切換至",Synchronize:"同步",Synchronized:"同步的",Quality:"畫質",quality:"畫質",FF:"快進",REW:"快退","Unlimited danmaku":"巨量彈幕","Send danmaku":"發送彈幕",Setting:"設定","Full screen":"全螢幕","Web full screen":"頁面全螢幕","Picture-in-Picture":"子母畫面",Send:"發送",Screenshot:"截圖",AirPlay:"無線投屏",s:"秒","Show comment":"顯示彈幕","Hide comment":"隱藏彈幕","Show subtitle":"顯示字幕","Hide subtitle":"隱藏字幕",Volume:"音量",Live:"直播","Video info":"影片統計訊息"},"ja-jp":{"Danmaku is loading":"コメントを読み込み中…",Top:"上固定",Bottom:"下固定",Rolling:"スクロール",Big:"大きめ",Medium:"標準",Small:"小さめ","Input danmaku, hit Enter":"右のボタンを押すとコメントできます","About author":"作者について","DPlayer feedback":"フィードバック","About DPlayer":"DPlayer について",Loop:"リピート再生",Speed:"再生速度",Audio:"音声","Primary audio":"主音声","Secondary audio":"副音声","Opacity for danmaku":"コメントの透明度",Normal:"標準","Please input danmaku content!":"コメント内容を入力して下さい!","Set danmaku color":"コメントの色","Set danmaku type":"コメントの位置","Set danmaku size":"コメントのサイズ","Show danmaku":"コメントを表示","Video load failed":"動画の読み込みに失敗しました…","Danmaku load failed":"コメントの読み込みに失敗しました…","Danmaku send failed":"コメントの送信に失敗しました…","Switching to":"画質を切り替えています…","Switched to":"画質を切り替えました",Synchronize:"同期する",Synchronized:"同期しました",Quality:"画質",quality:"画質",FF:"早送り",REW:"巻き戻し","Unlimited danmaku":"コメントを無制限に表示","Send danmaku":"コメントする",Setting:"設定","Full screen":"フルスクリーン","Web full screen":"ブラウザフルスクリーン","Picture-in-Picture":"Picture-in-Picture",Send:"コメントする",Screenshot:"スクリーンショット",s:"秒","Show comment":"コメントを表示する","Hide comment":"コメントを表示しない","Show subtitle":"字幕を表示する","Hide subtitle":"字幕を表示しない",Volume:"音量",Live:"Live","Video info":"動画の統計情報"}},ui=function(ge){this.lang=ge,this.lang==="ja"&&(this.lang="ja-jp"),this.tran=Le=>$t[this.lang]&&$t[this.lang][Le]?$t[this.lang][Le]:Le};var ti=y(7),li=y.n(ti),wi=y(723),Pi=y.n(wi),mi=y(704),gi=y.n(mi),Kt=y(189),Ii=y.n(Kt),ei=y(848),ji=y.n(ei),Li=y(813),Ti=y.n(Li),Bi=y(480),dn=y.n(Bi),rn=y(241),Un=y.n(rn),on=y(783),gn=y.n(on),An=y(355),tr=y.n(An),Kn=y(531),ir=y.n(Kn),yn=y(863),nr=y.n(yn),rr=y(381),Or=y.n(rr),br=y(243),cr=y.n(br),_r=y(885),Mr=y.n(_r),cs=y(478),sr=y.n(cs),kt=y(916),Gt=y.n(kt),ii=y(310),yi=y.n(ii),Ei=y(409),Mi=y.n(Ei),xi=y(597),Vi=y.n(xi),$i=y(223),pn=y.n($i),ar=y(112),Hn=y.n(ar);const En={play:li(),pause:Pi(),backward:gi(),forward:Ii(),volumeUp:ji(),volumeDown:Ti(),volumeOff:dn(),full:Un(),fullWeb:gn(),pip:tr(),setting:ir(),left:nr(),right:Or(),check:cr(),comment:Mr(),commentOff:sr(),send:Gt(),pallette:yi(),camera:Mi(),subtitle:pn(),loading:Hn(),airplay:Vi()};var Pa=y(368),ds=y.n(Pa);const ha=class{constructor(ge){we(this,"container");we(this,"options");we(this,"index");we(this,"tran");we(this,"volumeBar");we(this,"volumeBarWrap");we(this,"volumeBarWrapWrap");we(this,"volumeButton");we(this,"volumeButtonIcon");we(this,"volumeIcon");we(this,"playedBar");we(this,"loadedBar");we(this,"playedBarWrap");we(this,"playedBarTime");we(this,"danmaku");we(this,"danmakuLoading");we(this,"video");we(this,"bezel");we(this,"playButton");we(this,"mobileBackwardButton");we(this,"mobilePlayButton");we(this,"mobileForwardButton");we(this,"videoWrap");we(this,"videoWrapAspect");we(this,"controllerMask");we(this,"ptime");we(this,"settingButton");we(this,"settingBox");we(this,"settingOriginPanel");we(this,"mask");we(this,"syncButton");we(this,"loop");we(this,"loopToggle");we(this,"showDanmaku");we(this,"showDanmakuToggle");we(this,"unlimitDanmaku");we(this,"unlimitDanmakuToggle");we(this,"quality");we(this,"qualityValue");we(this,"qualityHeader");we(this,"qualityItem");we(this,"speed");we(this,"speedValue");we(this,"speedHeader");we(this,"speedItem");we(this,"audio");we(this,"audioValue");we(this,"audioHeader");we(this,"audioItem");we(this,"danmakuOpacityBar");we(this,"danmakuOpacityBarWrap");we(this,"danmakuOpacityBarWrapWrap");we(this,"danmakuOpacityBox");we(this,"danmakuOpacityValue");we(this,"dtime");we(this,"controller");we(this,"commentInput");we(this,"commentButton");we(this,"commentSettingBox");we(this,"commentSettingButton");we(this,"commentSettingFill");we(this,"commentSendButton");we(this,"commentSendFill");we(this,"commentColorSettingBox");we(this,"browserFullButton");we(this,"webFullButton");we(this,"pipButton");we(this,"menu");we(this,"menuItem");we(this,"cameraButton");we(this,"airplayButton");we(this,"subtitleButton");we(this,"subtitleButtonInner");we(this,"subtitle");we(this,"barPreview");we(this,"barWrap");we(this,"notice");we(this,"infoPanel");we(this,"infoPanelClose");we(this,"infoMimeType");we(this,"infoVersion");we(this,"infoVideoFPS");we(this,"infoPageFPS");we(this,"infoDroppedFrames");we(this,"infoType");we(this,"infoUrl");we(this,"infoResolution");we(this,"infoDuration");we(this,"infoBufferRemain");we(this,"infoDownloadSpeed");this.container=ge.container,this.options=ge.options,this.index=ge.index,this.tran=ge.tran,this.init()}init(){this.container.innerHTML=ds()({options:this.options,index:this.index,tran:this.tran,icons:En,mobile:Wt.isMobile,video:{current:!0,pic:this.options.video.pic,screenshot:this.options.screenshot,airplay:this.options.airplay,preload:this.options.preload,url:this.options.video.type==="live-llhls-for-KonomiTV"?"":this.options.video.url,subtitle:this.options.subtitle,crossOrigin:this.options.crossOrigin}}),this.volumeBar=this.container.querySelector(".dplayer-volume-bar-inner"),this.volumeBarWrap=this.container.querySelector(".dplayer-volume-bar"),this.volumeBarWrapWrap=this.container.querySelector(".dplayer-volume-bar-wrap"),this.volumeButton=this.container.querySelector(".dplayer-volume"),this.volumeButtonIcon=this.container.querySelector(".dplayer-volume-icon"),this.volumeIcon=this.container.querySelector(".dplayer-volume-icon .dplayer-icon-content"),this.playedBar=this.container.querySelector(".dplayer-played"),this.loadedBar=this.container.querySelector(".dplayer-loaded"),this.playedBarWrap=this.container.querySelector(".dplayer-bar-wrap"),this.playedBarTime=this.container.querySelector(".dplayer-bar-time"),this.danmaku=this.container.querySelector(".dplayer-danmaku"),this.danmakuLoading=this.container.querySelector(".dplayer-danloading"),this.video=this.container.querySelector(".dplayer-video-current"),this.bezel=this.container.querySelector(".dplayer-bezel-icon"),this.playButton=this.container.querySelector(".dplayer-play-icon"),this.mobileBackwardButton=this.container.querySelector(".dplayer-mobile-icon-backward"),this.mobilePlayButton=this.container.querySelector(".dplayer-mobile-icon-play"),this.mobileForwardButton=this.container.querySelector(".dplayer-mobile-icon-forward"),this.videoWrap=this.container.querySelector(".dplayer-video-wrap"),this.videoWrapAspect=this.container.querySelector(".dplayer-video-wrap-aspect"),this.controllerMask=this.container.querySelector(".dplayer-controller-mask"),this.ptime=this.container.querySelector(".dplayer-ptime"),this.settingButton=this.container.querySelector(".dplayer-setting-icon"),this.settingBox=this.container.querySelector(".dplayer-setting-box"),this.settingOriginPanel=this.container.querySelector(".dplayer-setting-origin-panel"),this.mask=this.container.querySelector(".dplayer-mask"),this.syncButton=this.container.querySelector(".dplayer-live-badge"),this.loop=this.container.querySelector(".dplayer-setting-loop"),this.loopToggle=this.container.querySelector(".dplayer-setting-loop .dplayer-toggle-setting-input"),this.showDanmaku=this.container.querySelector(".dplayer-setting-showdan"),this.showDanmakuToggle=this.container.querySelector(".dplayer-showdan-setting-input"),this.unlimitDanmaku=this.container.querySelector(".dplayer-setting-danunlimit"),this.unlimitDanmakuToggle=this.container.querySelector(".dplayer-danunlimit-setting-input"),this.quality=this.container.querySelector(".dplayer-setting-quality"),this.qualityValue=this.container.querySelector(".dplayer-setting-quality .dplayer-label-value"),this.qualityHeader=this.container.querySelector(".dplayer-setting-quality-header"),this.qualityItem=this.container.querySelectorAll(".dplayer-setting-quality-item"),this.speed=this.container.querySelector(".dplayer-setting-speed"),this.speedValue=this.container.querySelector(".dplayer-setting-speed .dplayer-label-value"),this.speedHeader=this.container.querySelector(".dplayer-setting-speed-header"),this.speedItem=this.container.querySelectorAll(".dplayer-setting-speed-item"),this.audio=this.container.querySelector(".dplayer-setting-audio"),this.audioValue=this.container.querySelector(".dplayer-setting-audio .dplayer-label-value"),this.audioHeader=this.container.querySelector(".dplayer-setting-audio-header"),this.audioItem=this.container.querySelectorAll(".dplayer-setting-audio-item"),this.danmakuOpacityBar=this.container.querySelector(".dplayer-danmaku-bar-inner"),this.danmakuOpacityBarWrap=this.container.querySelector(".dplayer-danmaku-bar"),this.danmakuOpacityBarWrapWrap=this.container.querySelector(".dplayer-danmaku-bar-wrap"),this.danmakuOpacityBox=this.container.querySelector(".dplayer-setting-danmaku"),this.danmakuOpacityValue=this.container.querySelector(".dplayer-setting-danmaku .dplayer-label-value"),this.dtime=this.container.querySelector(".dplayer-dtime"),this.controller=this.container.querySelector(".dplayer-controller"),this.commentInput=this.container.querySelector(".dplayer-comment-input"),this.commentButton=this.container.querySelector(".dplayer-comment-icon"),this.commentSettingBox=this.container.querySelector(".dplayer-comment-setting-box"),this.commentSettingButton=this.container.querySelector(".dplayer-comment-setting-icon"),this.commentSettingFill=this.container.querySelector(".dplayer-comment-setting-icon path"),this.commentSendButton=this.container.querySelector(".dplayer-send-icon"),this.commentSendFill=this.container.querySelector(".dplayer-send-icon path"),this.commentColorSettingBox=this.container.querySelector(".dplayer-comment-setting-color"),this.browserFullButton=this.container.querySelector(".dplayer-full-icon"),this.webFullButton=this.container.querySelector(".dplayer-full-in-icon"),this.pipButton=this.container.querySelector(".dplayer-pip-icon"),this.menu=this.container.querySelector(".dplayer-menu"),this.menuItem=this.container.querySelectorAll(".dplayer-menu-item"),this.cameraButton=this.container.querySelector(".dplayer-camera-icon"),this.airplayButton=this.container.querySelector(".dplayer-airplay-icon"),this.subtitleButton=this.container.querySelector(".dplayer-subtitle-icon"),this.subtitleButtonInner=this.container.querySelector(".dplayer-subtitle-icon .dplayer-icon-content"),this.subtitle=this.container.querySelector(".dplayer-subtitle"),this.barPreview=this.container.querySelector(".dplayer-bar-preview"),this.barWrap=this.container.querySelector(".dplayer-bar-wrap"),this.notice=this.container.querySelector(".dplayer-notice"),this.infoPanel=this.container.querySelector(".dplayer-info-panel"),this.infoPanelClose=this.container.querySelector(".dplayer-info-panel-close"),this.infoMimeType=this.container.querySelector(".dplayer-info-panel-item-mimetype .dplayer-info-panel-item-data"),this.infoVersion=this.container.querySelector(".dplayer-info-panel-item-version .dplayer-info-panel-item-data"),this.infoVideoFPS=this.container.querySelector(".dplayer-info-panel-item-video-fps .dplayer-info-panel-item-data"),this.infoPageFPS=this.container.querySelector(".dplayer-info-panel-item-page-fps .dplayer-info-panel-item-data"),this.infoDroppedFrames=this.container.querySelector(".dplayer-info-panel-item-dropped-frames .dplayer-info-panel-item-data"),this.infoType=this.container.querySelector(".dplayer-info-panel-item-type .dplayer-info-panel-item-data"),this.infoUrl=this.container.querySelector(".dplayer-info-panel-item-url .dplayer-info-panel-item-data"),this.infoResolution=this.container.querySelector(".dplayer-info-panel-item-resolution .dplayer-info-panel-item-data"),this.infoDuration=this.container.querySelector(".dplayer-info-panel-item-duration .dplayer-info-panel-item-data"),this.infoBufferRemain=this.container.querySelector(".dplayer-info-panel-item-buffer-remain .dplayer-info-panel-item-data"),this.infoDownloadSpeed=this.container.querySelector(".dplayer-info-panel-item-download-speed .dplayer-info-panel-item-data")}},el=class{constructor(ge){we(this,"options");we(this,"player");we(this,"container");we(this,"danTunnel");we(this,"danIndex");we(this,"danFontSize");we(this,"dan");we(this,"_opacity");we(this,"events");we(this,"unlimited");we(this,"context",null);we(this,"showing");we(this,"paused",!1);this.options=ge,this.player=this.options.player,this.container=this.options.container,this.danTunnel={right:{},top:{},bottom:{}},this.danIndex=0,this.danFontSize=24,this.dan=[],this.showing=!0,this._opacity=this.options.opacity,this.events=this.options.events,this.unlimited=this.options.unlimited===1,this._measure("",0),this.load()}load(){let ge;ge=this.options.api.maximum?`${this.options.api.address}?id=${this.options.api.id}&max=${this.options.api.maximum}`:`${this.options.api.address}?id=${this.options.api.id}`;const Le=(this.options.api.addition||[]).slice(0);Le.push(ge),this.events&&this.events.trigger("danmaku_load_start",Le),this._readAllEndpoints(Le,Xe=>{this.dan=[].concat(...Xe).sort((ft,_t)=>ft.time-_t.time),window.requestAnimationFrame(()=>{this.frame()}),this.options.callback(),this.events&&this.events.trigger("danmaku_load_end")})}reload(ge){this.options.api=ge,this.dan=[],this.clear(),this.load()}_readAllEndpoints(ge,Le){const Xe=[];let ft=0;for(let _t=0;_t{Xe[_t]=Ct,++ft,ft===ge.length&&Le(Xe)},error:Ct=>{this.options.error(Ct||this.options.tran("Danmaku load failed")),Xe[_t]=[],++ft,ft===ge.length&&Le(Xe)}})}send(ge,Le,Xe=!1){const ft={token:this.options.api.token,id:this.options.api.id,author:this.options.api.user,time:this.options.time(),text:ge.text,color:ge.color,type:ge.type,size:ge.size};this.options.apiBackend.send({url:this.options.api.address,data:ft,success:()=>{this.dan.splice(this.danIndex,0,ft),this.danIndex++,this.draw({text:this.htmlEncode(ft.text),color:ft.color,type:ft.type,size:ft.size,border:!0}),this.events&&this.events.trigger("danmaku_send",ft),Le()},error:_t=>{this.options.error(_t||this.options.tran("Danmaku send failed")),Xe===!0&&Le()}})}frame(){if(this.dan.length&&!this.paused&&this.showing){let ge=this.dan[this.danIndex];const Le=[];for(;ge&&this.options.time()>(typeof ge.time=="number"?ge.time:parseFloat(ge.time));)Le.push(ge),ge=this.dan[++this.danIndex];this.draw(Le)}window.requestAnimationFrame(()=>{this.frame()})}opacity(ge){return ge!==void 0&&(this.container.style.setProperty("--dplayer-danmaku-opacity",`${ge}`),this._opacity=ge,this.events&&this.events.trigger("danmaku_opacity",this._opacity)),this._opacity}draw(ge){if(this.showing){let Le;Le=Object.prototype.toString.call(ge)!=="[object Array]"?[ge]:ge;let ft=this.container.offsetWidth/1024*1.25;ft>=1&&(ft=1);let _t=this.options.fontSize*ft;const Ct=_t+6*ft,Pt=this.container.offsetWidth,ci=this.container.offsetHeight/Ct,hi=bi=>{const pi=bi.offsetWidth||parseInt(bi.style.width),Di=bi.getBoundingClientRect().right||this.container.getBoundingClientRect().right+pi;return this.container.getBoundingClientRect().right-Di},Xt=bi=>(Pt+bi)/5,_i=(bi,pi,Di)=>{const On=Pt/Xt(Di);for(let Ji=0;this.unlimited||Ji{this.danTunnel[pi][Ji+""].splice(0,1)}),Ji%ci;if(pi==="right")for(let Cn=0;Cn{this.danTunnel[pi][Ji+""].splice(0,1)}),Ji%ci}}return-1},Ui=document.createDocumentFragment();for(let bi=0;bi{let Ji=0;for(const tn of pi.text.split(` +`):" "+ce(Ct[0]):"as no adapter specified";throw new tt("There is no suitable adapter to dispatch the request "+Pt,"ERR_NOT_SUPPORT")}return ft};function Pe(ge){if(ge.cancelToken&&ge.cancelToken.throwIfRequested(),ge.signal&&ge.signal.aborted)throw new be(null,ge)}function We(ge){return Pe(ge),ge.headers=Me.from(ge.headers),ge.data=Se.call(ge,ge.transformRequest),["post","put","patch"].indexOf(ge.method)!==-1&&ge.headers.setContentType("application/x-www-form-urlencoded",!1),ye(ge.adapter||At.adapter)(ge).then(function(Le){return Pe(ge),Le.data=Se.call(ge,ge.transformResponse,Le),Le.headers=Me.from(Le.headers),Le},function(Le){return K(Le)||(Pe(ge),Le&&Le.response&&(Le.response.data=Se.call(ge,ge.transformResponse,Le.response),Le.response.headers=Me.from(Le.response.headers))),Promise.reject(Le)})}const nt=ge=>ge instanceof Me?ge.toJSON():ge;function et(ge,Le){Le=Le||{};const Xe={};function ft(Xt,_i,Ui){return _e.isPlainObject(Xt)&&_e.isPlainObject(_i)?_e.merge.call({caseless:Ui},Xt,_i):_e.isPlainObject(_i)?_e.merge({},_i):_e.isArray(_i)?_i.slice():_i}function _t(Xt,_i,Ui){return _e.isUndefined(_i)?_e.isUndefined(Xt)?void 0:ft(void 0,Xt,Ui):ft(Xt,_i,Ui)}function Ct(Xt,_i){if(!_e.isUndefined(_i))return ft(void 0,_i)}function Pt(Xt,_i){return _e.isUndefined(_i)?_e.isUndefined(Xt)?void 0:ft(void 0,Xt):ft(void 0,_i)}function ci(Xt,_i,Ui){return Ui in Le?ft(Xt,_i):Ui in ge?ft(void 0,Xt):void 0}const hi={url:Ct,method:Ct,data:Ct,baseURL:Pt,transformRequest:Pt,transformResponse:Pt,paramsSerializer:Pt,timeout:Pt,timeoutMessage:Pt,withCredentials:Pt,adapter:Pt,responseType:Pt,xsrfCookieName:Pt,xsrfHeaderName:Pt,onUploadProgress:Pt,onDownloadProgress:Pt,decompress:Pt,maxContentLength:Pt,maxBodyLength:Pt,beforeRedirect:Pt,transport:Pt,httpAgent:Pt,httpsAgent:Pt,cancelToken:Pt,socketPath:Pt,responseEncoding:Pt,validateStatus:ci,headers:(Xt,_i)=>_t(nt(Xt),nt(_i),!0)};return _e.forEach(Object.keys(Object.assign({},ge,Le)),function(Xt){const _i=hi[Xt]||_t,Ui=_i(ge[Xt],Le[Xt],Xt);_e.isUndefined(Ui)&&_i!==ci||(Xe[Xt]=Ui)}),Xe}const ot="1.6.0",dt={};["object","boolean","number","function","string","symbol"].forEach((ge,Le)=>{dt[ge]=function(Xe){return typeof Xe===ge||"a"+(Le<1?"n ":" ")+ge}});const yt={};dt.transitional=function(ge,Le,Xe){function ft(_t,Ct){return"[Axios v1.6.0] Transitional option '"+_t+"'"+Ct+(Xe?". "+Xe:"")}return(_t,Ct,Pt)=>{if(ge===!1)throw new tt(ft(Ct," has been removed"+(Le?" in "+Le:"")),tt.ERR_DEPRECATED);return Le&&!yt[Ct]&&(yt[Ct]=!0,console.warn(ft(Ct," has been deprecated since v"+Le+" and will be removed in the near future"))),!ge||ge(_t,Ct,Pt)}};const wt={assertOptions:function(ge,Le,Xe){if(typeof ge!="object")throw new tt("options must be an object",tt.ERR_BAD_OPTION_VALUE);const ft=Object.keys(ge);let _t=ft.length;for(;_t-- >0;){const Ct=ft[_t],Pt=Le[Ct];if(Pt){const ci=ge[Ct],hi=ci===void 0||Pt(ci,Ct,ge);if(hi!==!0)throw new tt("option "+Ct+" must be "+hi,tt.ERR_BAD_OPTION_VALUE)}else if(Xe!==!0)throw new tt("Unknown option "+Ct,tt.ERR_BAD_OPTION)}},validators:dt},bt=wt.validators;class Rt{constructor(Le){this.defaults=Le,this.interceptors={request:new Re,response:new Re}}request(Le,Xe){typeof Le=="string"?(Xe=Xe||{}).url=Le:Xe=Le||{},Xe=et(this.defaults,Xe);const{transitional:ft,paramsSerializer:_t,headers:Ct}=Xe;ft!==void 0&&wt.assertOptions(ft,{silentJSONParsing:bt.transitional(bt.boolean),forcedJSONParsing:bt.transitional(bt.boolean),clarifyTimeoutError:bt.transitional(bt.boolean)},!1),_t!=null&&(_e.isFunction(_t)?Xe.paramsSerializer={serialize:_t}:wt.assertOptions(_t,{encode:bt.function,serialize:bt.function},!0)),Xe.method=(Xe.method||this.defaults.method||"get").toLowerCase();let Pt=Ct&&_e.merge(Ct.common,Ct[Xe.method]);Ct&&_e.forEach(["delete","get","head","post","put","patch","common"],Di=>{delete Ct[Di]}),Xe.headers=Me.concat(Pt,Ct);const ci=[];let hi=!0;this.interceptors.request.forEach(function(Di){typeof Di.runWhen=="function"&&Di.runWhen(Xe)===!1||(hi=hi&&Di.synchronous,ci.unshift(Di.fulfilled,Di.rejected))});const Xt=[];let _i;this.interceptors.response.forEach(function(Di){Xt.push(Di.fulfilled,Di.rejected)});let Ui,bi=0;if(!hi){const Di=[We.bind(this),void 0];for(Di.unshift.apply(Di,ci),Di.push.apply(Di,Xt),Ui=Di.length,_i=Promise.resolve(Xe);bi{if(!ft._listeners)return;let Ct=ft._listeners.length;for(;Ct-- >0;)ft._listeners[Ct](_t);ft._listeners=null}),this.promise.then=_t=>{let Ct;const Pt=new Promise(ci=>{ft.subscribe(ci),Ct=ci}).then(_t);return Pt.cancel=function(){ft.unsubscribe(Ct)},Pt},Le(function(_t,Ct,Pt){ft.reason||(ft.reason=new be(_t,Ct,Pt),Xe(ft.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(Le){this.reason?Le(this.reason):this._listeners?this._listeners.push(Le):this._listeners=[Le]}unsubscribe(Le){if(!this._listeners)return;const Xe=this._listeners.indexOf(Le);Xe!==-1&&this._listeners.splice(Xe,1)}static source(){let Le;return{token:new Tt(function(Xe){Le=Xe}),cancel:Le}}}const xt=Tt,Ut={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ut).forEach(([ge,Le])=>{Ut[Le]=ge});const Vt=Ut,Bt=function ge(Le){const Xe=new Lt(Le),ft=w(Lt.prototype.request,Xe);return _e.extend(ft,Lt.prototype,Xe,{allOwnKeys:!0}),_e.extend(ft,Xe,null,{allOwnKeys:!0}),ft.create=function(_t){return ge(et(Le,_t))},ft}(At);Bt.Axios=Lt,Bt.CanceledError=be,Bt.CancelToken=xt,Bt.isCancel=K,Bt.VERSION=ot,Bt.toFormData=Ae,Bt.AxiosError=tt,Bt.Cancel=Bt.CanceledError,Bt.all=function(ge){return Promise.all(ge)},Bt.spread=function(ge){return function(Le){return ge.apply(null,Le)}},Bt.isAxiosError=function(ge){return _e.isObject(ge)&&ge.isAxiosError===!0},Bt.mergeConfig=et,Bt.AxiosHeaders=Me,Bt.formToJSON=ge=>Ce(_e.isHTMLForm(ge)?new FormData(ge):ge),Bt.getAdapter=ye,Bt.HttpStatusCode=Vt,Bt.default=Bt;const jt=Bt;var Mt=A(662);const Ot=/iPhone|iPad|iPod|Windows|Macintosh|Android|Mobile/i.test(navigator.userAgent)&&"ontouchend"in document,Jt={secondToTime:ge=>{if((ge=ge||0)===0||ge===1/0||ge.toString()==="NaN")return"00:00";const Le=Math.floor(ge/3600),Xe=Math.floor((ge-3600*Le)/60),ft=Math.floor(ge-3600*Le-60*Xe);return(Le>0?[Le,Xe,ft]:[Xe,ft]).map(_t=>_t<10?"0"+_t:""+_t).join(":")},getVideoDuration:(ge,Le)=>{let Xe=ge.duration;return Xe===1/0&&(ge.seekable.length>0?(Le.dtime.textContent=Jt.secondToTime(ge.seekable.end(0)),Xe=ge.seekable.end(0)):ge.buffered.length>0&&(Le.dtime.textContent=Jt.secondToTime(ge.buffered.end(0)),Xe=ge.buffered.end(0))),Xe},getElementViewLeft:ge=>{let Le=ge.offsetLeft,Xe=ge.offsetParent;const ft=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.webkitFullscreenElement)for(;Xe!==null&&Xe!==ge;)Le+=Xe.offsetLeft,Xe=Xe.offsetParent;else for(;Xe!==null;)Le+=Xe.offsetLeft,Xe=Xe.offsetParent;return Le-ft},getBoundingClientRectViewLeft(ge){const Le=window.scrollY||window.pageYOffset||document.body.scrollTop+(document.documentElement&&document.documentElement.scrollTop||0);if(ge.getBoundingClientRect){if(typeof this.getBoundingClientRectViewLeft.offset!="number"){let _t=document.createElement("div");_t.style.cssText="position:absolute;top:0;left:0;",document.body.appendChild(_t),this.getBoundingClientRectViewLeft.offset=-_t.getBoundingClientRect().top-Le,document.body.removeChild(_t),_t=null}const Xe=ge.getBoundingClientRect(),ft=this.getBoundingClientRectViewLeft.offset;return Xe.left+ft}return this.getElementViewLeft(ge)},getScrollPosition:()=>({left:window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0,top:window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}),setScrollPosition({left:ge=0,top:Le=0}){this.isFirefox?(document.documentElement.scrollLeft=ge,document.documentElement.scrollTop=Le):window.scrollTo(ge,Le)},isMobile:Ot,isFirefox:/firefox/i.test(window.navigator.userAgent),isChrome:/chrome/i.test(window.navigator.userAgent),storage:{set:(ge,Le)=>{localStorage.setItem(ge,Le)},get:ge=>localStorage.getItem(ge)},nameMap:{dragStart:Ot?"touchstart":"mousedown",dragMove:Ot?"touchmove":"mousemove",dragEnd:Ot?"touchend":"mouseup"},color2Number:ge=>(ge[0]==="#"&&(ge=ge.substr(1)),ge.length===3&&(ge=`${ge[0]}${ge[0]}${ge[1]}${ge[1]}${ge[2]}${ge[2]}`),parseInt(ge,16)+0&16777215),number2Color:ge=>"#"+("00000"+ge.toString(16)).slice(-6),number2Type:ge=>{switch(ge){case 0:default:return"right";case 1:return"top";case 2:return"bottom"}}},Wt=Jt,di={send:ge=>{ge.url!==void 0?jt.post(ge.url,ge.data).then(Le=>{const Xe=Le.data;Xe&&Xe.code===0?ge.success&&ge.success():ge.error&&ge.error(Xe&&Xe.msg)}).catch(Le=>{console.error(Le),ge.error&&ge.error()}):ge.error&&ge.error()},read:ge=>{ge.url!==void 0?jt.get(ge.url).then(Le=>{const Xe=Le.data;Xe&&Xe.code===0?Xe.data?ge.success&&ge.success(Xe.data.map(ft=>({author:ft[3],time:ft[0],text:ft[4],color:ft[2],type:ft[1],size:ft[5]&&(ft[5]==="big"||ft[5]==="small")?ft[5]:"medium"}))):ge.success&&ge.success([{author:"",time:0,text:"",color:"#ffeaea",type:"right",size:"medium"}]):ge.error&&ge.error(Xe&&Xe.msg)}).catch(Le=>{console.error(Le),ge.error&&ge.error()}):ge.error&&ge.error()}},oi=di,$t={"zh-cn":{"Danmaku is loading":"弹幕加载中",Top:"顶部",Bottom:"底部",Rolling:"滚动",Big:"大的",Medium:"中等的",Small:"小的","Input danmaku, hit Enter":"输入弹幕,回车发送","About author":"关于作者","DPlayer feedback":"播放器意见反馈","About DPlayer":"关于 DPlayer 播放器",Loop:"洗脑循环",Speed:"速度",Audio:"音频","Primary audio":"主要音频","Secondary audio":"辅助音频","Opacity for danmaku":"弹幕透明度",Normal:"正常","Please input danmaku content!":"要输入弹幕内容啊喂!","Set danmaku color":"设置弹幕颜色","Set danmaku type":"设置弹幕类型","Set danmaku size":"设置弹幕大小","Show danmaku":"显示弹幕","Video load failed":"视频加载失败","Danmaku load failed":"弹幕加载失败","Danmaku send failed":"弹幕发送失败","Switching to":"正在切换至","Switched to":"已经切换至",Synchronize:"同步",Synchronized:"同步的",Quality:"画质",quality:"画质",FF:"快进",REW:"快退","Unlimited danmaku":"海量弹幕","Send danmaku":"发送弹幕",Setting:"设置","Full screen":"全屏","Web full screen":"页面全屏","Picture-in-Picture":"子母画面",Send:"发送",Screenshot:"截图",AirPlay:"无线投屏",s:"秒","Show comment":"显示弹幕","Hide comment":"隐藏弹幕","Show subtitle":"显示字幕","Hide subtitle":"隐藏字幕",Volume:"音量",Live:"直播","Video info":"视频统计信息"},"zh-tw":{"Danmaku is loading":"彈幕載入中",Top:"頂部",Bottom:"底部",Rolling:"滾動",Big:"大的",Medium:"中等的",Small:"小的","Input danmaku, hit Enter":"輸入彈幕,Enter 發送","About author":"關於作者","DPlayer feedback":"播放器意見回饋","About DPlayer":"關於 DPlayer 播放器",Loop:"循環播放",Speed:"速度",Audio:"音頻","Primary audio":"主要音頻","Secondary audio":"輔助音頻","Opacity for danmaku":"彈幕透明度",Normal:"正常","Please input danmaku content!":"請輸入彈幕內容啊!","Set danmaku color":"設定彈幕顏色","Set danmaku type":"設定彈幕類型","Set danmaku size":"设置弹幕大小","Show danmaku":"顯示彈幕","Video load failed":"影片載入失敗","Danmaku load failed":"彈幕載入失敗","Danmaku send failed":"彈幕發送失敗","Switching to":"正在切換至","Switched to":"已經切換至",Synchronize:"同步",Synchronized:"同步的",Quality:"畫質",quality:"畫質",FF:"快進",REW:"快退","Unlimited danmaku":"巨量彈幕","Send danmaku":"發送彈幕",Setting:"設定","Full screen":"全螢幕","Web full screen":"頁面全螢幕","Picture-in-Picture":"子母畫面",Send:"發送",Screenshot:"截圖",AirPlay:"無線投屏",s:"秒","Show comment":"顯示彈幕","Hide comment":"隱藏彈幕","Show subtitle":"顯示字幕","Hide subtitle":"隱藏字幕",Volume:"音量",Live:"直播","Video info":"影片統計訊息"},"ja-jp":{"Danmaku is loading":"コメントを読み込み中…",Top:"上固定",Bottom:"下固定",Rolling:"スクロール",Big:"大きめ",Medium:"標準",Small:"小さめ","Input danmaku, hit Enter":"右のボタンを押すとコメントできます","About author":"作者について","DPlayer feedback":"フィードバック","About DPlayer":"DPlayer について",Loop:"リピート再生",Speed:"再生速度",Audio:"音声","Primary audio":"主音声","Secondary audio":"副音声","Opacity for danmaku":"コメントの透明度",Normal:"標準","Please input danmaku content!":"コメント内容を入力して下さい!","Set danmaku color":"コメントの色","Set danmaku type":"コメントの位置","Set danmaku size":"コメントのサイズ","Show danmaku":"コメントを表示","Video load failed":"動画の読み込みに失敗しました…","Danmaku load failed":"コメントの読み込みに失敗しました…","Danmaku send failed":"コメントの送信に失敗しました…","Switching to":"画質を切り替えています…","Switched to":"画質を切り替えました",Synchronize:"同期する",Synchronized:"同期しました",Quality:"画質",quality:"画質",FF:"早送り",REW:"巻き戻し","Unlimited danmaku":"コメントを無制限に表示","Send danmaku":"コメントする",Setting:"設定","Full screen":"フルスクリーン","Web full screen":"ブラウザフルスクリーン","Picture-in-Picture":"Picture-in-Picture",Send:"コメントする",Screenshot:"スクリーンショット",s:"秒","Show comment":"コメントを表示する","Hide comment":"コメントを表示しない","Show subtitle":"字幕を表示する","Hide subtitle":"字幕を表示しない",Volume:"音量",Live:"Live","Video info":"動画の統計情報"}},ui=function(ge){this.lang=ge,this.lang==="ja"&&(this.lang="ja-jp"),this.tran=Le=>$t[this.lang]&&$t[this.lang][Le]?$t[this.lang][Le]:Le};var ti=A(7),li=A.n(ti),wi=A(723),Pi=A.n(wi),mi=A(704),gi=A.n(mi),Kt=A(189),Ii=A.n(Kt),ei=A(848),ji=A.n(ei),Li=A(813),Ti=A.n(Li),Bi=A(480),dn=A.n(Bi),rn=A(241),Un=A.n(rn),on=A(783),gn=A.n(on),An=A(355),tr=A.n(An),Kn=A(531),ir=A.n(Kn),yn=A(863),nr=A.n(yn),rr=A(381),Or=A.n(rr),br=A(243),cr=A.n(br),_r=A(885),Mr=A.n(_r),cs=A(478),sr=A.n(cs),kt=A(916),Gt=A.n(kt),ii=A(310),yi=A.n(ii),Ei=A(409),Mi=A.n(Ei),xi=A(597),Vi=A.n(xi),$i=A(223),pn=A.n($i),ar=A(112),Hn=A.n(ar);const En={play:li(),pause:Pi(),backward:gi(),forward:Ii(),volumeUp:ji(),volumeDown:Ti(),volumeOff:dn(),full:Un(),fullWeb:gn(),pip:tr(),setting:ir(),left:nr(),right:Or(),check:cr(),comment:Mr(),commentOff:sr(),send:Gt(),pallette:yi(),camera:Mi(),subtitle:pn(),loading:Hn(),airplay:Vi()};var Pa=A(368),ds=A.n(Pa);const ha=class{constructor(ge){we(this,"container");we(this,"options");we(this,"index");we(this,"tran");we(this,"volumeBar");we(this,"volumeBarWrap");we(this,"volumeBarWrapWrap");we(this,"volumeButton");we(this,"volumeButtonIcon");we(this,"volumeIcon");we(this,"playedBar");we(this,"loadedBar");we(this,"playedBarWrap");we(this,"playedBarTime");we(this,"danmaku");we(this,"danmakuLoading");we(this,"video");we(this,"bezel");we(this,"playButton");we(this,"mobileBackwardButton");we(this,"mobilePlayButton");we(this,"mobileForwardButton");we(this,"videoWrap");we(this,"videoWrapAspect");we(this,"controllerMask");we(this,"ptime");we(this,"settingButton");we(this,"settingBox");we(this,"settingOriginPanel");we(this,"mask");we(this,"syncButton");we(this,"loop");we(this,"loopToggle");we(this,"showDanmaku");we(this,"showDanmakuToggle");we(this,"unlimitDanmaku");we(this,"unlimitDanmakuToggle");we(this,"quality");we(this,"qualityValue");we(this,"qualityHeader");we(this,"qualityItem");we(this,"speed");we(this,"speedValue");we(this,"speedHeader");we(this,"speedItem");we(this,"audio");we(this,"audioValue");we(this,"audioHeader");we(this,"audioItem");we(this,"danmakuOpacityBar");we(this,"danmakuOpacityBarWrap");we(this,"danmakuOpacityBarWrapWrap");we(this,"danmakuOpacityBox");we(this,"danmakuOpacityValue");we(this,"dtime");we(this,"controller");we(this,"commentInput");we(this,"commentButton");we(this,"commentSettingBox");we(this,"commentSettingButton");we(this,"commentSettingFill");we(this,"commentSendButton");we(this,"commentSendFill");we(this,"commentColorSettingBox");we(this,"browserFullButton");we(this,"webFullButton");we(this,"pipButton");we(this,"menu");we(this,"menuItem");we(this,"cameraButton");we(this,"airplayButton");we(this,"subtitleButton");we(this,"subtitleButtonInner");we(this,"subtitle");we(this,"barPreview");we(this,"barWrap");we(this,"notice");we(this,"infoPanel");we(this,"infoPanelClose");we(this,"infoMimeType");we(this,"infoVersion");we(this,"infoVideoFPS");we(this,"infoPageFPS");we(this,"infoDroppedFrames");we(this,"infoType");we(this,"infoUrl");we(this,"infoResolution");we(this,"infoDuration");we(this,"infoBufferRemain");we(this,"infoDownloadSpeed");this.container=ge.container,this.options=ge.options,this.index=ge.index,this.tran=ge.tran,this.init()}init(){this.container.innerHTML=ds()({options:this.options,index:this.index,tran:this.tran,icons:En,mobile:Wt.isMobile,video:{current:!0,pic:this.options.video.pic,screenshot:this.options.screenshot,airplay:this.options.airplay,preload:this.options.preload,url:this.options.video.type==="live-llhls-for-KonomiTV"?"":this.options.video.url,subtitle:this.options.subtitle,crossOrigin:this.options.crossOrigin}}),this.volumeBar=this.container.querySelector(".dplayer-volume-bar-inner"),this.volumeBarWrap=this.container.querySelector(".dplayer-volume-bar"),this.volumeBarWrapWrap=this.container.querySelector(".dplayer-volume-bar-wrap"),this.volumeButton=this.container.querySelector(".dplayer-volume"),this.volumeButtonIcon=this.container.querySelector(".dplayer-volume-icon"),this.volumeIcon=this.container.querySelector(".dplayer-volume-icon .dplayer-icon-content"),this.playedBar=this.container.querySelector(".dplayer-played"),this.loadedBar=this.container.querySelector(".dplayer-loaded"),this.playedBarWrap=this.container.querySelector(".dplayer-bar-wrap"),this.playedBarTime=this.container.querySelector(".dplayer-bar-time"),this.danmaku=this.container.querySelector(".dplayer-danmaku"),this.danmakuLoading=this.container.querySelector(".dplayer-danloading"),this.video=this.container.querySelector(".dplayer-video-current"),this.bezel=this.container.querySelector(".dplayer-bezel-icon"),this.playButton=this.container.querySelector(".dplayer-play-icon"),this.mobileBackwardButton=this.container.querySelector(".dplayer-mobile-icon-backward"),this.mobilePlayButton=this.container.querySelector(".dplayer-mobile-icon-play"),this.mobileForwardButton=this.container.querySelector(".dplayer-mobile-icon-forward"),this.videoWrap=this.container.querySelector(".dplayer-video-wrap"),this.videoWrapAspect=this.container.querySelector(".dplayer-video-wrap-aspect"),this.controllerMask=this.container.querySelector(".dplayer-controller-mask"),this.ptime=this.container.querySelector(".dplayer-ptime"),this.settingButton=this.container.querySelector(".dplayer-setting-icon"),this.settingBox=this.container.querySelector(".dplayer-setting-box"),this.settingOriginPanel=this.container.querySelector(".dplayer-setting-origin-panel"),this.mask=this.container.querySelector(".dplayer-mask"),this.syncButton=this.container.querySelector(".dplayer-live-badge"),this.loop=this.container.querySelector(".dplayer-setting-loop"),this.loopToggle=this.container.querySelector(".dplayer-setting-loop .dplayer-toggle-setting-input"),this.showDanmaku=this.container.querySelector(".dplayer-setting-showdan"),this.showDanmakuToggle=this.container.querySelector(".dplayer-showdan-setting-input"),this.unlimitDanmaku=this.container.querySelector(".dplayer-setting-danunlimit"),this.unlimitDanmakuToggle=this.container.querySelector(".dplayer-danunlimit-setting-input"),this.quality=this.container.querySelector(".dplayer-setting-quality"),this.qualityValue=this.container.querySelector(".dplayer-setting-quality .dplayer-label-value"),this.qualityHeader=this.container.querySelector(".dplayer-setting-quality-header"),this.qualityItem=this.container.querySelectorAll(".dplayer-setting-quality-item"),this.speed=this.container.querySelector(".dplayer-setting-speed"),this.speedValue=this.container.querySelector(".dplayer-setting-speed .dplayer-label-value"),this.speedHeader=this.container.querySelector(".dplayer-setting-speed-header"),this.speedItem=this.container.querySelectorAll(".dplayer-setting-speed-item"),this.audio=this.container.querySelector(".dplayer-setting-audio"),this.audioValue=this.container.querySelector(".dplayer-setting-audio .dplayer-label-value"),this.audioHeader=this.container.querySelector(".dplayer-setting-audio-header"),this.audioItem=this.container.querySelectorAll(".dplayer-setting-audio-item"),this.danmakuOpacityBar=this.container.querySelector(".dplayer-danmaku-bar-inner"),this.danmakuOpacityBarWrap=this.container.querySelector(".dplayer-danmaku-bar"),this.danmakuOpacityBarWrapWrap=this.container.querySelector(".dplayer-danmaku-bar-wrap"),this.danmakuOpacityBox=this.container.querySelector(".dplayer-setting-danmaku"),this.danmakuOpacityValue=this.container.querySelector(".dplayer-setting-danmaku .dplayer-label-value"),this.dtime=this.container.querySelector(".dplayer-dtime"),this.controller=this.container.querySelector(".dplayer-controller"),this.commentInput=this.container.querySelector(".dplayer-comment-input"),this.commentButton=this.container.querySelector(".dplayer-comment-icon"),this.commentSettingBox=this.container.querySelector(".dplayer-comment-setting-box"),this.commentSettingButton=this.container.querySelector(".dplayer-comment-setting-icon"),this.commentSettingFill=this.container.querySelector(".dplayer-comment-setting-icon path"),this.commentSendButton=this.container.querySelector(".dplayer-send-icon"),this.commentSendFill=this.container.querySelector(".dplayer-send-icon path"),this.commentColorSettingBox=this.container.querySelector(".dplayer-comment-setting-color"),this.browserFullButton=this.container.querySelector(".dplayer-full-icon"),this.webFullButton=this.container.querySelector(".dplayer-full-in-icon"),this.pipButton=this.container.querySelector(".dplayer-pip-icon"),this.menu=this.container.querySelector(".dplayer-menu"),this.menuItem=this.container.querySelectorAll(".dplayer-menu-item"),this.cameraButton=this.container.querySelector(".dplayer-camera-icon"),this.airplayButton=this.container.querySelector(".dplayer-airplay-icon"),this.subtitleButton=this.container.querySelector(".dplayer-subtitle-icon"),this.subtitleButtonInner=this.container.querySelector(".dplayer-subtitle-icon .dplayer-icon-content"),this.subtitle=this.container.querySelector(".dplayer-subtitle"),this.barPreview=this.container.querySelector(".dplayer-bar-preview"),this.barWrap=this.container.querySelector(".dplayer-bar-wrap"),this.notice=this.container.querySelector(".dplayer-notice"),this.infoPanel=this.container.querySelector(".dplayer-info-panel"),this.infoPanelClose=this.container.querySelector(".dplayer-info-panel-close"),this.infoMimeType=this.container.querySelector(".dplayer-info-panel-item-mimetype .dplayer-info-panel-item-data"),this.infoVersion=this.container.querySelector(".dplayer-info-panel-item-version .dplayer-info-panel-item-data"),this.infoVideoFPS=this.container.querySelector(".dplayer-info-panel-item-video-fps .dplayer-info-panel-item-data"),this.infoPageFPS=this.container.querySelector(".dplayer-info-panel-item-page-fps .dplayer-info-panel-item-data"),this.infoDroppedFrames=this.container.querySelector(".dplayer-info-panel-item-dropped-frames .dplayer-info-panel-item-data"),this.infoType=this.container.querySelector(".dplayer-info-panel-item-type .dplayer-info-panel-item-data"),this.infoUrl=this.container.querySelector(".dplayer-info-panel-item-url .dplayer-info-panel-item-data"),this.infoResolution=this.container.querySelector(".dplayer-info-panel-item-resolution .dplayer-info-panel-item-data"),this.infoDuration=this.container.querySelector(".dplayer-info-panel-item-duration .dplayer-info-panel-item-data"),this.infoBufferRemain=this.container.querySelector(".dplayer-info-panel-item-buffer-remain .dplayer-info-panel-item-data"),this.infoDownloadSpeed=this.container.querySelector(".dplayer-info-panel-item-download-speed .dplayer-info-panel-item-data")}},el=class{constructor(ge){we(this,"options");we(this,"player");we(this,"container");we(this,"danTunnel");we(this,"danIndex");we(this,"danFontSize");we(this,"dan");we(this,"_opacity");we(this,"events");we(this,"unlimited");we(this,"context",null);we(this,"showing");we(this,"paused",!1);this.options=ge,this.player=this.options.player,this.container=this.options.container,this.danTunnel={right:{},top:{},bottom:{}},this.danIndex=0,this.danFontSize=24,this.dan=[],this.showing=!0,this._opacity=this.options.opacity,this.events=this.options.events,this.unlimited=this.options.unlimited===1,this._measure("",0),this.load()}load(){let ge;ge=this.options.api.maximum?`${this.options.api.address}?id=${this.options.api.id}&max=${this.options.api.maximum}`:`${this.options.api.address}?id=${this.options.api.id}`;const Le=(this.options.api.addition||[]).slice(0);Le.push(ge),this.events&&this.events.trigger("danmaku_load_start",Le),this._readAllEndpoints(Le,Xe=>{this.dan=[].concat(...Xe).sort((ft,_t)=>ft.time-_t.time),window.requestAnimationFrame(()=>{this.frame()}),this.options.callback(),this.events&&this.events.trigger("danmaku_load_end")})}reload(ge){this.options.api=ge,this.dan=[],this.clear(),this.load()}_readAllEndpoints(ge,Le){const Xe=[];let ft=0;for(let _t=0;_t{Xe[_t]=Ct,++ft,ft===ge.length&&Le(Xe)},error:Ct=>{this.options.error(Ct||this.options.tran("Danmaku load failed")),Xe[_t]=[],++ft,ft===ge.length&&Le(Xe)}})}send(ge,Le,Xe=!1){const ft={token:this.options.api.token,id:this.options.api.id,author:this.options.api.user,time:this.options.time(),text:ge.text,color:ge.color,type:ge.type,size:ge.size};this.options.apiBackend.send({url:this.options.api.address,data:ft,success:()=>{this.dan.splice(this.danIndex,0,ft),this.danIndex++,this.draw({text:this.htmlEncode(ft.text),color:ft.color,type:ft.type,size:ft.size,border:!0}),this.events&&this.events.trigger("danmaku_send",ft),Le()},error:_t=>{this.options.error(_t||this.options.tran("Danmaku send failed")),Xe===!0&&Le()}})}frame(){if(this.dan.length&&!this.paused&&this.showing){let ge=this.dan[this.danIndex];const Le=[];for(;ge&&this.options.time()>(typeof ge.time=="number"?ge.time:parseFloat(ge.time));)Le.push(ge),ge=this.dan[++this.danIndex];this.draw(Le)}window.requestAnimationFrame(()=>{this.frame()})}opacity(ge){return ge!==void 0&&(this.container.style.setProperty("--dplayer-danmaku-opacity",`${ge}`),this._opacity=ge,this.events&&this.events.trigger("danmaku_opacity",this._opacity)),this._opacity}draw(ge){if(this.showing){let Le;Le=Object.prototype.toString.call(ge)!=="[object Array]"?[ge]:ge;let ft=this.container.offsetWidth/1024*1.25;ft>=1&&(ft=1);let _t=this.options.fontSize*ft;const Ct=_t+6*ft,Pt=this.container.offsetWidth,ci=this.container.offsetHeight/Ct,hi=bi=>{const pi=bi.offsetWidth||parseInt(bi.style.width),Di=bi.getBoundingClientRect().right||this.container.getBoundingClientRect().right+pi;return this.container.getBoundingClientRect().right-Di},Xt=bi=>(Pt+bi)/5,_i=(bi,pi,Di)=>{const On=Pt/Xt(Di);for(let Ji=0;this.unlimited||Ji{this.danTunnel[pi][Ji+""].splice(0,1)}),Ji%ci;if(pi==="right")for(let Cn=0;Cn{this.danTunnel[pi][Ji+""].splice(0,1)}),Ji%ci}}return-1},Ui=document.createDocumentFragment();for(let bi=0;bi{let Ji=0;for(const tn of pi.text.split(` `)){const Cn=this._measure(tn,_t);Cn>Ji&&(Ji=Cn)}return Ji})(),On=pi.text.split(` `);for(const Ji of pi.type==="bottom"?On.reverse():On){const tn=document.createElement("div");if(tn.classList.add("dplayer-danmaku-item"),tn.classList.add(`dplayer-danmaku-${pi.type}`),tn.classList.add(`dplayer-danmaku-size-${pi.size}`),tn.style.color=pi.color,"border"in pi&&pi.border){const ns=document.createElement("span");ns.style.border=`2px solid ${this.options.borderColor}`,ns.textContent=Ji,tn.appendChild(ns)}else tn.textContent=Ji;tn.addEventListener("animationend",()=>{this.container.removeChild(tn)});const Cn=_i(tn,pi.type,Di);switch(pi.type){case"right":Cn>=0&&(tn.style.width=Di+1+"px",tn.style.top=Ct*Cn+8+"px",tn.style.transform=`translateX(-${Pt}px)`,tn.style.willChange="transform");break;case"top":Cn>=0&&(tn.style.width=Di+1+"px",tn.style.top=Ct*Cn+8+"px",tn.style.willChange="visibility");break;case"bottom":Cn>=0&&(tn.style.width=Di+1+"px",tn.style.bottom=Ct*Cn+8+"px",tn.style.willChange="visibility");break;default:console.error(`Can't handled danmaku type: ${pi.type}`)}Cn>=0&&(tn.classList.add("dplayer-danmaku-move"),tn.style.animationDuration=this._danAnimation(pi.type),Ui.appendChild(tn))}}return this.container.style.setProperty("--dplayer-danmaku-font-size",`${_t}px`),this.container.appendChild(Ui),Ui}return null}play(){this.paused=!1}pause(){this.paused=!0}_measure(ge,Le){this.context&&this.danFontSize===Le||(this.danFontSize=Le,this.context=document.createElement("canvas").getContext("2d"),this.context.font=`bold ${this.danFontSize}px "Segoe UI", Arial`);const Xe=ge.split(` -`);let ft=0;for(let _t=0;_t=this.options.time()){this.danIndex=ge;break}this.danIndex=this.dan.length}}clear(){this.danTunnel={right:{},top:{},bottom:{}},this.danIndex=0,this.options.container.innerHTML="",this.events&&this.events.trigger("danmaku_clear")}htmlEncode(ge){return ge.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}resize(){const ge=this.container.offsetWidth,Le=this.container.querySelectorAll(".dplayer-danmaku-item");for(let Xe=0;Xe{this.player.resize()}),this.player.events.on("webfullscreen_cancel",()=>{this.player.resize(),Wt.setScrollPosition(this.lastScrollPosition)}),this.fullscreenchange=()=>{this.player.resize(),this.isFullScreen("browser")?this.player.events.trigger("fullscreen"):(Wt.setScrollPosition(this.lastScrollPosition),this.player.container.classList.remove("dplayer-fulled-browser"),this.player.events.trigger("fullscreen_cancel"))},this.player.container.onfullscreenchange!==void 0?this.player.container.addEventListener("fullscreenchange",this.fullscreenchange):this.player.container.addEventListener("webkitfullscreenchange",this.fullscreenchange)}isFullScreen(ge="browser"){switch(ge){case"browser":{const Le=document.fullscreenElement||document.webkitFullscreenElement;return!(!Le||Le!==this.player.container)}case"web":return this.player.container.classList.contains("dplayer-fulled")}}request(ge="browser"){const Le=ge==="browser"?"web":"browser",Xe=this.isFullScreen(Le);switch(Xe||(this.lastScrollPosition=Wt.getScrollPosition()),ge){case"browser":if(this.player.container.requestFullscreen=this.player.container.requestFullscreen||this.player.container.webkitRequestFullscreen,this.player.container.requestFullscreen!==void 0?this.player.container.requestFullscreen():this.player.video.webkitEnterFullscreen&&this.player.video.webkitEnterFullscreen(),screen.orientation)try{screen.orientation.lock("landscape").catch(()=>{})}catch{}this.player.container.requestFullscreen!==void 0&&this.player.container.classList.add("dplayer-fulled-browser");break;case"web":this.player.container.classList.add("dplayer-fulled"),document.body.classList.add("dplayer-web-fullscreen-fix"),this.player.events.trigger("webfullscreen")}Xe&&this.cancel(Le)}cancel(ge="browser"){switch(ge){case"browser":if(document.exitFullscreen=document.exitFullscreen||document.webkitExitFullscreen,document.exitFullscreen&&document.exitFullscreen(),screen.orientation)try{screen.orientation.unlock()}catch{}this.player.container.classList.remove("dplayer-fulled-browser");break;case"web":this.player.container.classList.remove("dplayer-fulled"),document.body.classList.remove("dplayer-web-fullscreen-fix"),this.player.events.trigger("webfullscreen_cancel")}}toggle(ge="browser"){this.isFullScreen(ge)?this.cancel(ge):this.request(ge)}destroy(){this.player.container.removeEventListener("fullscreenchange",this.fullscreenchange),this.player.container.removeEventListener("webkitfullscreenchange",this.fullscreenchange)}},Er=class{constructor(ge){we(this,"storageName");we(this,"default");we(this,"data");this.storageName={opacity:"dplayer-danmaku-opacity",volume:"dplayer-volume",unlimited:"dplayer-danmaku-unlimited",danmaku:"dplayer-danmaku-show",subtitle:"dplayer-subtitle-show"},this.default={opacity:1,volume:Object.prototype.hasOwnProperty.call(ge.options,"volume")?ge.options.volume:1,unlimited:(ge.options.danmaku&&ge.options.danmaku.unlimited?1:0)||0,danmaku:1,subtitle:1},this.data={},this.init()}init(){for(const ge in this.storageName){const Le=this.storageName[ge];this.data[ge]=parseFloat(Wt.storage.get(Le)||this.default[ge].toString())}}get(ge){return this.data[ge]}set(ge,Le){this.data[ge]=Le,Wt.storage.set(this.storageName[ge],Le)}},ks=class{constructor(ge,Le,Xe,ft,_t){we(this,"container");we(this,"video");we(this,"plugins");we(this,"options");we(this,"events");this.container=ge,this.video=Le,this.plugins=Xe,this.options=ft,this.events=_t,this.init()}init(){if(this.container.style.fontSize=this.options.fontSize,this.container.style.bottom=this.options.bottom,this.container.style.color=this.options.color,this.options.type==="webvtt"&&this.video.textTracks&&this.video.textTracks[0]){const ge=this.video.textTracks[0];ge.oncuechange=()=>{if(!ge.activeCues)return;const Le=ge.activeCues[0];if(this.container.innerHTML="",Le){const Xe=document.createElement("div");Xe.appendChild(Le.getCueAsHTML());const ft=Xe.innerHTML.split(/\r?\n/).map(_t=>`

${_t}

`).join("");this.container.innerHTML=ft}this.events.trigger("subtitle_change")}}}show(){this.container.classList.remove("dplayer-subtitle-hide"),this.options.type==="aribb24"&&this.plugins.aribb24Caption&&this.plugins.aribb24Caption.show(),this.events.trigger("subtitle_show")}hide(){this.container.classList.add("dplayer-subtitle-hide"),this.options.type==="aribb24"&&this.plugins.aribb24Caption&&this.plugins.aribb24Caption.hide(),this.events.trigger("subtitle_hide")}toggle(){this.container.classList.contains("dplayer-subtitle-hide")?this.show():this.hide()}},Xr=class{constructor(ge){we(this,"elements");this.elements={},this.elements.volume=ge.volumeBar,this.elements.played=ge.playedBar,this.elements.loaded=ge.loadedBar,this.elements.danmaku=ge.danmakuOpacityBar}set(ge,Le,Xe){Le=Math.max(Le,0),Le=Math.min(Le,1),this.elements[ge].style[Xe]=100*Le+"%"}get(ge){return parseFloat(this.elements[ge].style.width)/100}},Rs=class{constructor(ge){we(this,"player");we(this,"types");we(this,"enablefpsChecker");we(this,"enableinfoChecker");we(this,"enableloadingChecker");we(this,"fpsIndex");we(this,"fpsStart");we(this,"fpsChecker");we(this,"infoChecker");we(this,"loadingChecker");this.player=ge,window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(Le){window.setTimeout(Le,1e3/60)},this.types=["loading","info","fps"],this.init()}init(){this.types.map(ge=>(ge!=="fps"&&this[`init${ge}Checker`](),ge))}initloadingChecker(){let ge=0,Le=0,Xe=!1;this.loadingChecker=window.setInterval(()=>{this.enableloadingChecker&&(Le=this.player.video.currentTime,Xe||Le!==ge||this.player.video.paused||(this.player.container.classList.add("dplayer-loading"),Xe=!0),Xe&&Le>ge&&!this.player.video.paused&&(this.player.container.classList.remove("dplayer-loading"),Xe=!1),ge=Le)},100)}initfpsChecker(){window.requestAnimationFrame(()=>{if(this.enablefpsChecker)if(this.initfpsChecker(),this.fpsStart){this.fpsIndex++;const ge=new Date;ge-this.fpsStart>1e3&&(this.player.infoPanel.fps(this.fpsIndex/(ge-this.fpsStart)*1e3),this.fpsStart=new Date,this.fpsIndex=0)}else this.fpsStart=new Date,this.fpsIndex=0;else this.fpsStart=0,this.fpsIndex=0})}initinfoChecker(){this.infoChecker=window.setInterval(()=>{this.enableinfoChecker&&this.player.infoPanel.update()},1e3)}enable(ge){this[`enable${ge}Checker`]=!0,ge==="fps"&&this.initfpsChecker()}disable(ge){this[`enable${ge}Checker`]=!1}destroy(){this.types.map(ge=>(this[`enable${ge}Checker`]=!1,this[`${ge}Checker`]&&window.clearInterval(this[`${ge}Checker`]),ge))}},Ba=class{constructor(ge){we(this,"container");this.container=ge,this.container.addEventListener("animationend",()=>{this.container.classList.remove("dplayer-bezel-transition")})}switch(ge){this.container.innerHTML=ge,this.container.classList.add("dplayer-bezel-transition")}},il=class{constructor(ge){we(this,"container");we(this,"barWidth");we(this,"events");this.container=ge.container,this.barWidth=ge.barWidth,this.container.style.backgroundImage=`url('${ge.url}')`,this.events=ge.events}resize(ge,Le,Xe){this.container.style.width=`${ge}px`,this.container.style.height=`${Le}px`,this.container.style.top=2-Le+"px",this.barWidth=Xe}show(){this.container.style.display="block",this.events&&this.events.trigger("thumbnails_show")}move(ge){this.container.style.backgroundPosition=`-${160*(Math.ceil(ge/this.barWidth*100)-1)}px 0`,this.container.style.left=`${Math.min(Math.max(ge-this.container.offsetWidth/2,-10),this.barWidth-150)}px`}hide(){this.container.style.display="none",this.events&&this.events.trigger("thumbnails_hide")}},pa=class{constructor(ge){we(this,"player");we(this,"disableAutoHide",!1);we(this,"autoHideTimer");we(this,"mobileSkipTimer");we(this,"mobileBackwardTime");we(this,"mobileForwardTime");we(this,"setAutoHideHandler");we(this,"thumbnails",null);this.player=ge,this.autoHideTimer=0,this.mobileSkipTimer=0,this.mobileBackwardTime=0,this.mobileForwardTime=0,this.setAutoHideHandler=()=>this.setAutoHide(),Wt.isMobile?this.player.container.addEventListener("touchmove",this.setAutoHideHandler):(this.player.container.addEventListener("mousemove",this.setAutoHideHandler),this.player.container.addEventListener("click",this.setAutoHideHandler)),this.player.on("play",this.setAutoHideHandler),this.player.on("pause",this.setAutoHideHandler),this.initPlayButton(),this.initThumbnails(),this.initPlayedBar(),this.initFullButton(),this.initPipButton(),this.initSyncButton(),this.initScreenshotButton(),this.initSubtitleButton(),this.initHighlights(),this.initAirplayButton(),Wt.isMobile||this.initVolumeButton()}initPlayButton(){this.player.template.playButton.addEventListener("click",()=>{this.player.toggle()}),this.player.template.mobilePlayButton.addEventListener("click",()=>{this.player.toggle()}),Wt.isMobile?(this.player.template.videoWrap.addEventListener("click",()=>{this.toggle(),this.isShow()&&this.setAutoHide()}),this.player.template.controllerMask.addEventListener("click",()=>{this.toggle(),this.isShow()&&this.setAutoHide()})):(this.player.template.videoWrap.addEventListener("click",()=>{this.player.toggle()}),this.player.template.controllerMask.addEventListener("click",()=>{this.player.toggle()})),this.player.template.mobileBackwardButton.addEventListener("click",()=>{this.mobileBackwardTime+=10,this.player.seek(this.player.video.currentTime-10),this.player.notice(`${this.player.tran("REW")} ${this.mobileBackwardTime.toFixed(0)} ${this.player.tran("s")}`),window.clearTimeout(this.mobileSkipTimer),this.mobileSkipTimer=window.setTimeout(()=>{this.mobileBackwardTime=0},1e3),this.setAutoHide()}),this.player.template.mobileForwardButton.addEventListener("click",()=>{this.mobileForwardTime+=10,this.player.seek(this.player.video.currentTime+10),this.player.notice(`${this.player.tran("FF")} ${this.mobileForwardTime.toFixed(0)} ${this.player.tran("s")}`),window.clearTimeout(this.mobileSkipTimer),this.mobileSkipTimer=window.setTimeout(()=>{this.mobileForwardTime=0},1e3),this.setAutoHide()})}initHighlights(){this.player.on("durationchange",()=>{if(this.player.video.duration!==1&&this.player.video.duration!==1/0&&this.player.options.highlight){const ge=this.player.template.playedBarWrap.querySelectorAll(".dplayer-highlight");[].slice.call(ge,0).forEach(Le=>{this.player.template.playedBarWrap.removeChild(Le)});for(let Le=0;Le{this.thumbnails.resize(160,this.player.video.videoHeight/this.player.video.videoWidth*160,this.player.template.barWrap.offsetWidth)}))}initPlayedBar(){let ge;const Le=ft=>{let _t=((ft.clientX||ft.changedTouches&&ft.changedTouches[0].clientX)-Wt.getBoundingClientRectViewLeft(this.player.template.playedBarWrap))/this.player.template.playedBarWrap.clientWidth;_t=Math.max(_t,0),_t=Math.min(_t,1),this.player.bar.set("played",_t,"width");const Ct=Wt.getVideoDuration(this.player.video,this.player.template);this.player.template.ptime.textContent=Wt.secondToTime(_t*Ct),this.player.container.classList.add("dplayer-seeking"),this.player.video.paused||this.player.video.pause()},Xe=ft=>{document.removeEventListener(Wt.nameMap.dragEnd,Xe),document.removeEventListener(Wt.nameMap.dragMove,Le);let _t=((ft.clientX||ft.changedTouches&&ft.changedTouches[0].clientX)-Wt.getBoundingClientRectViewLeft(this.player.template.playedBarWrap))/this.player.template.playedBarWrap.clientWidth;_t=Math.max(_t,0),_t=Math.min(_t,1),this.player.bar.set("played",_t,"width");const Ct=Wt.getVideoDuration(this.player.video,this.player.template);this.player.seek(this.player.bar.get("played")*Ct),ge||this.player.video.play(),this.player.container.classList.remove("dplayer-seeking")};this.player.template.playedBarWrap.addEventListener(Wt.nameMap.dragStart,()=>{ge=this.player.video.paused,document.addEventListener(Wt.nameMap.dragMove,Le),document.addEventListener(Wt.nameMap.dragEnd,Xe)}),this.player.template.playedBarWrap.addEventListener(Wt.nameMap.dragMove,ft=>{const _t=Wt.getVideoDuration(this.player.video,this.player.template);if(_t){const Ct=this.player.template.playedBarWrap.getBoundingClientRect().left,Pt=(ft.clientX||ft.changedTouches[0].clientX)-Ct;if(Pt<0||Pt>this.player.template.playedBarWrap.offsetWidth)return;const ci=_t*(Pt/this.player.template.playedBarWrap.offsetWidth);Wt.isMobile&&this.thumbnails&&this.thumbnails.show(),this.thumbnails&&this.thumbnails.move(Pt),this.player.template.playedBarTime.style.left=Pt-(ci>=3600?25:20)+"px",this.player.template.playedBarTime.textContent=Wt.secondToTime(ci),this.player.template.playedBarTime.classList.remove("hidden")}}),this.player.template.playedBarWrap.addEventListener(Wt.nameMap.dragEnd,()=>{Wt.isMobile&&this.thumbnails&&this.thumbnails.hide()}),Wt.isMobile||(this.player.template.playedBarWrap.addEventListener("mouseenter",()=>{this.player.video.duration&&(this.thumbnails&&this.thumbnails.show(),this.player.template.playedBarTime.classList.remove("hidden"))}),this.player.template.playedBarWrap.addEventListener("mouseleave",()=>{this.player.video.duration&&(this.thumbnails&&this.thumbnails.hide(),this.player.template.playedBarTime.classList.add("hidden"))}))}initFullButton(){this.player.template.browserFullButton.addEventListener("click",()=>{this.player.fullScreen.toggle("browser")}),this.player.template.webFullButton.addEventListener("click",()=>{this.player.fullScreen.toggle("web")})}initPipButton(){document.pictureInPictureEnabled?this.player.template.pipButton.addEventListener("click",()=>{document.pictureInPictureElement?document.exitPictureInPicture():this.player.video.requestPictureInPicture().catch(ge=>{console.error(ge),this.player.options.lang==="ja"||this.player.options.lang==="ja-jp"?this.player.notice("Picture-in-Picture を開始できませんでした。",void 0,void 0,"#FF6F6A"):this.player.notice("Picture-in-Picture could not be started.",void 0,void 0,"#FF6F6A")})}):this.player.template.pipButton.style.display="none"}initVolumeButton(){const ge=Xe=>{const ft=Xe||window.event,_t=((ft.clientX||ft.changedTouches[0].clientX)-Wt.getBoundingClientRectViewLeft(this.player.template.volumeBarWrap)-5.5)/35;this.player.volume(_t)},Le=()=>{document.removeEventListener(Wt.nameMap.dragEnd,Le),document.removeEventListener(Wt.nameMap.dragMove,ge),this.player.template.volumeButton.classList.remove("dplayer-volume-active")};this.player.template.volumeBarWrapWrap.addEventListener("click",Xe=>{const ft=Xe||window.event,_t=((ft.clientX||ft.changedTouches[0].clientX)-Wt.getBoundingClientRectViewLeft(this.player.template.volumeBarWrap)-5.5)/35;this.player.volume(_t)}),this.player.template.volumeBarWrapWrap.addEventListener(Wt.nameMap.dragStart,()=>{document.addEventListener(Wt.nameMap.dragMove,ge),document.addEventListener(Wt.nameMap.dragEnd,Le),this.player.template.volumeButton.classList.add("dplayer-volume-active")}),this.player.template.volumeButtonIcon.addEventListener("click",()=>{this.player.video.muted?(this.player.video.muted=!1,this.player.switchVolumeIcon(),this.player.bar.set("volume",this.player.volume(),"width")):(this.player.video.muted=!0,this.player.template.volumeIcon.innerHTML=En.volumeOff,this.player.bar.set("volume",0,"width"))})}initSyncButton(){this.player.options.live&&this.player.template.syncButton.addEventListener("click",()=>{this.player.sync()})}initScreenshotButton(){this.player.options.screenshot&&this.player.template.cameraButton.addEventListener("click",()=>{const ge=document.createElement("canvas");ge.width=this.player.video.videoWidth,ge.height=this.player.video.videoHeight,ge.getContext("2d").drawImage(this.player.video,0,0,ge.width,ge.height),ge.toBlob(Le=>{if(Le===null)return;const Xe=new Date,ft=`Capture_${Xe.getFullYear()}${("0"+(Xe.getMonth()+1)).slice(-2)}${("0"+Xe.getDate()).slice(-2)}-${("0"+Xe.getHours()).slice(-2)}${("0"+Xe.getMinutes()).slice(-2)}${("0"+Xe.getSeconds()).slice(-2)}.jpg`,_t=URL.createObjectURL(Le),Ct=document.createElement("a");Ct.download!==void 0?(Ct.download=ft,Ct.href=_t,Ct.click(),URL.revokeObjectURL(_t),this.player.events.trigger("screenshot",Le)):this.player.notice("Error: Screenshot download is not supported.",void 0,void 0,"#FF6F6A")},"image/jpeg",1)})}initAirplayButton(){this.player.options.airplay&&(window.WebKitPlaybackTargetAvailabilityEvent?this.player.video.addEventListener("webkitplaybacktargetavailabilitychanged",(function(ge){ge.availability==="available"?this.template.airplayButton.disable=!1:this.template.airplayButton.disable=!0,this.template.airplayButton.addEventListener("click",(function(){this.video.webkitShowPlaybackTargetPicker()}).bind(this))}).bind(this.player)):this.player.template.airplayButton.style.display="none")}initSubtitleButton(){this.player.options.subtitle&&(this.player.events.on("subtitle_show",()=>{this.player.template.subtitleButton.ariaLabel=this.player.tran("Hide subtitle"),this.player.template.subtitleButtonInner.style.opacity="",this.player.user.set("subtitle",1)}),this.player.events.on("subtitle_hide",()=>{this.player.template.subtitleButton.ariaLabel=this.player.tran("Show subtitle"),this.player.template.subtitleButtonInner.style.opacity="0.4",this.player.user.set("subtitle",0)}),this.player.template.subtitleButton.addEventListener("click",()=>{this.player.subtitle!==null&&this.player.subtitle.toggle()}))}setAutoHide(ge=3e3){this.show(),window.clearTimeout(this.autoHideTimer),this.autoHideTimer=window.setTimeout(()=>{!this.player.video.played.length||this.player.paused||this.disableAutoHide||this.hide()},ge)}show(){this.player.container.classList.remove("dplayer-hide-controller")}hide(){this.player.container.classList.add("dplayer-hide-controller"),this.player.setting.hide(),this.player.comment&&this.player.comment.hide()}isShow(){return!this.player.container.classList.contains("dplayer-hide-controller")}toggle(){this.isShow()?this.hide():this.show()}destroy(){Wt.isMobile?this.player.container.removeEventListener("touchmove",this.setAutoHideHandler):(this.player.container.removeEventListener("mousemove",this.setAutoHideHandler),this.player.container.removeEventListener("click",this.setAutoHideHandler)),window.clearTimeout(this.autoHideTimer)}},ma=class{constructor(ge){we(this,"player");we(this,"loop");we(this,"showDanmaku");we(this,"unlimitDanmaku");we(this,"currentAudio","primary");we(this,"resizeObserver");this.player=ge,this.player.template.mask.addEventListener("click",()=>{this.hide()}),this.player.template.settingButton.addEventListener("click",()=>{this.show()});const Le=()=>{const Xe=this.player.template.settingOriginPanel.scrollHeight;this.player.template.settingBox.style.clipPath=`inset(calc(100% - ${Xe}px) 0 0 round 7px)`};if(Le(),this.resizeObserver=new ResizeObserver(Le),this.resizeObserver.observe(this.player.template.settingOriginPanel),this.player.options.video.quality){this.player.template.quality.addEventListener("click",()=>{this.player.template.settingBox.classList.add("dplayer-setting-box-quality")}),this.player.template.qualityHeader.addEventListener("click",()=>{this.player.template.settingBox.classList.remove("dplayer-setting-box-quality")});for(let Xe=0;Xe{this.player.switchingQuality||this.player.switchQuality(parseInt(this.player.template.qualityItem[Xe].dataset.index))})}this.player.template.speed.addEventListener("click",()=>{this.player.template.settingBox.classList.add("dplayer-setting-box-speed")}),this.player.template.speedHeader.addEventListener("click",()=>{this.player.template.settingBox.classList.remove("dplayer-setting-box-speed")});for(let Xe=0;Xe{this.player.speed(parseFloat(ft.target.dataset.speed))});this.player.template.audio.addEventListener("click",()=>{this.player.template.settingBox.classList.add("dplayer-setting-box-audio")}),this.player.template.audioHeader.addEventListener("click",()=>{this.player.template.settingBox.classList.remove("dplayer-setting-box-audio")});for(let Xe=0;Xe{if(this.player.plugins.mpegts||this.player.plugins.liveLLHLSForKonomiTV){if(this.player.template.audioItem[Xe].dataset.audio===this.currentAudio)return;this.player.template.audioItem[Xe].dataset.audio==="primary"?(this.currentAudio="primary",this.player.template.audioItem[0].classList.add("dplayer-setting-audio-current"),this.player.template.audioItem[1].classList.remove("dplayer-setting-audio-current"),this.player.template.audioValue.textContent=this.player.tran("Primary audio"),window.mpegts&&this.player.plugins.mpegts&&this.player.plugins.mpegts instanceof window.mpegts.MSEPlayer?this.player.plugins.mpegts.switchPrimaryAudio():this.player.plugins.liveLLHLSForKonomiTV&&this.player.plugins.liveLLHLSForKonomiTV.switchPrimaryAudio()):this.player.template.audioItem[Xe].dataset.audio==="secondary"&&(this.currentAudio="secondary",this.player.template.audioItem[0].classList.remove("dplayer-setting-audio-current"),this.player.template.audioItem[1].classList.add("dplayer-setting-audio-current"),this.player.template.audioValue.textContent=this.player.tran("Secondary audio"),window.mpegts&&this.player.plugins.mpegts&&this.player.plugins.mpegts instanceof window.mpegts.MSEPlayer?this.player.plugins.mpegts.switchSecondaryAudio():this.player.plugins.liveLLHLSForKonomiTV&&this.player.plugins.liveLLHLSForKonomiTV.switchSecondaryAudio()),this.player.template.settingBox.classList.remove("dplayer-setting-box-audio")}});if(this.loop=this.player.options.loop,this.player.template.loopToggle.checked=this.loop,this.player.template.loop.addEventListener("click",()=>{this.player.template.loopToggle.checked=!this.player.template.loopToggle.checked,this.player.template.loopToggle.checked?this.loop=!0:this.loop=!1}),this.showDanmaku=this.player.user.get("danmaku")===1,this.showDanmaku||this.player.danmaku&&this.player.danmaku.hide(),this.player.template.showDanmakuToggle.checked=this.showDanmaku,this.player.template.showDanmaku.addEventListener("click",()=>{this.player.template.showDanmakuToggle.checked=!this.player.template.showDanmakuToggle.checked,this.player.template.showDanmakuToggle.checked?(this.showDanmaku=!0,this.player.danmaku!==null&&this.player.danmaku.show()):(this.showDanmaku=!1,this.player.danmaku!==null&&this.player.danmaku.hide()),this.player.user.set("danmaku",this.showDanmaku?1:0)}),this.unlimitDanmaku=this.player.user.get("unlimited")===1,this.player.template.unlimitDanmakuToggle.checked=this.unlimitDanmaku,this.player.template.unlimitDanmaku.addEventListener("click",()=>{this.player.template.unlimitDanmakuToggle.checked=!this.player.template.unlimitDanmakuToggle.checked,this.player.template.unlimitDanmakuToggle.checked?(this.unlimitDanmaku=!0,this.player.danmaku!==null&&this.player.danmaku.unlimit(!0)):(this.unlimitDanmaku=!1,this.player.danmaku!==null&&this.player.danmaku.unlimit(!1)),this.player.user.set("unlimited",this.unlimitDanmaku?1:0)}),this.player.danmaku){this.player.on("danmaku_opacity",Ct=>{this.player.bar.set("danmaku",Ct,"width"),this.player.user.set("opacity",Ct),this.player.template.danmakuOpacityValue.textContent=Ct.toFixed(1)}),this.player.danmaku.opacity(this.player.user.get("opacity")),this.player.template.danmakuOpacityValue.textContent=this.player.user.get("opacity").toFixed(1);const ft=Ct=>{const Pt=Ct||window.event;let ci=((Pt.clientX||Pt.changedTouches[0].clientX)-Wt.getBoundingClientRectViewLeft(this.player.template.danmakuOpacityBarWrap))/190;ci=Math.max(ci,0),ci=Math.min(ci,1),this.player.danmaku!==null&&this.player.danmaku.opacity(ci)},_t=()=>{document.removeEventListener(Wt.nameMap.dragEnd,_t),document.removeEventListener(Wt.nameMap.dragMove,ft),this.player.template.danmakuOpacityBox.classList.remove("dplayer-setting-danmaku-active")};this.player.template.danmakuOpacityBarWrapWrap.addEventListener("click",Ct=>{const Pt=Ct||window.event;let ci=((Pt.clientX||Pt.changedTouches[0].clientX)-Wt.getBoundingClientRectViewLeft(this.player.template.danmakuOpacityBarWrap))/190;ci=Math.max(ci,0),ci=Math.min(ci,1),this.player.danmaku!==null&&this.player.danmaku.opacity(ci)}),this.player.template.danmakuOpacityBarWrapWrap.addEventListener(Wt.nameMap.dragStart,()=>{document.addEventListener(Wt.nameMap.dragMove,ft),document.addEventListener(Wt.nameMap.dragEnd,_t),this.player.template.danmakuOpacityBox.classList.add("dplayer-setting-danmaku-active")})}}hide(){this.player.template.container.classList.remove("dplayer-show-controller"),this.player.template.settingBox.classList.remove("dplayer-setting-box-open"),this.player.template.mask.classList.remove("dplayer-mask-show"),window.setTimeout(()=>{this.player.template.settingBox.classList.remove("dplayer-setting-box-speed"),this.player.template.settingBox.classList.remove("dplayer-setting-box-audio")},300),this.player.controller.disableAutoHide=!1}show(){this.player.template.container.classList.add("dplayer-show-controller"),this.player.template.settingBox.classList.add("dplayer-setting-box-open"),this.player.template.mask.classList.add("dplayer-mask-show"),this.player.controller.disableAutoHide=!0}destroy(){this.resizeObserver.disconnect()}},nl=class{constructor(ge){we(this,"player");this.player=ge,this.player.template.mask.addEventListener("click",()=>{this.hide()}),this.player.template.commentButton.addEventListener("click",()=>{this.show()}),this.player.template.commentSettingButton.addEventListener("click",()=>{this.toggleSetting()}),this.player.template.commentColorSettingBox.addEventListener("click",()=>{if(this.player.template.commentColorSettingBox.querySelector("input:checked+span")){const Le=this.player.template.commentColorSettingBox.querySelector("input:checked").value;this.player.template.commentSettingFill.style.fill=Le,this.player.template.commentInput.style.color=Le,this.player.template.commentSendFill.style.fill=Le}}),this.player.template.commentInput.addEventListener("click",()=>{this.hideSetting()}),this.player.template.commentInput.addEventListener("keydown",Le=>{(Le||window.event).keyCode===13&&this.send()}),this.player.template.commentSendButton.addEventListener("click",()=>{this.send()})}show(){this.player.controller.disableAutoHide=!0,this.player.template.controller.classList.add("dplayer-controller-comment"),this.player.template.mask.classList.add("dplayer-mask-show"),this.player.container.classList.add("dplayer-show-controller"),this.player.template.commentInput.focus()}hide(){this.player.template.controller.classList.remove("dplayer-controller-comment"),this.player.template.mask.classList.remove("dplayer-mask-show"),this.player.container.classList.remove("dplayer-show-controller"),this.player.controller.disableAutoHide=!1,this.hideSetting()}showSetting(){this.player.template.commentSettingBox.classList.add("dplayer-comment-setting-open")}hideSetting(){this.player.template.commentSettingBox.classList.remove("dplayer-comment-setting-open")}toggleSetting(){this.player.template.commentSettingBox.classList.contains("dplayer-comment-setting-open")?this.hideSetting():this.showSetting()}send(){var ge;((ge=this.player.options.danmaku)==null?void 0:ge.closeCommentFormAfterSend)===!0&&this.player.template.commentInput.blur(),this.player.template.commentInput.value.replace(/^\s+|\s+$/g,"")?(this.player.danmaku!==null&&this.player.danmaku.send({text:this.player.template.commentInput.value,color:this.player.container.querySelector(".dplayer-comment-setting-color input:checked").value,type:this.player.container.querySelector(".dplayer-comment-setting-type input:checked").value,size:this.player.container.querySelector(".dplayer-comment-setting-size input:checked").value},()=>{var Le;((Le=this.player.options.danmaku)==null?void 0:Le.closeCommentFormAfterSend)===!0&&(this.hide(),this.player.controller.setAutoHide(750))},!0),this.player.template.commentInput.value=""):this.player.notice(this.player.tran("Please input danmaku content!"),void 0,void 0,"#FF6F6A")}},Is=class{constructor(ge){we(this,"player");we(this,"doHotKeyHandler");we(this,"cancelFullScreenHandler");this.player=ge,this.doHotKeyHandler=this.doHotKey.bind(this),this.cancelFullScreenHandler=this.cancelFullScreen.bind(this),this.player.options.hotkey&&document.addEventListener("keydown",this.doHotKeyHandler),document.addEventListener("keydown",this.cancelFullScreenHandler)}doHotKey(ge){var ft,_t;const Le=(ft=document.activeElement)==null?void 0:ft.tagName.toUpperCase(),Xe=(_t=document.activeElement)==null?void 0:_t.getAttribute("contenteditable");if(Le!=="INPUT"&&Le!=="TEXTAREA"&&Xe!==""&&Xe!=="true"){const Ct=ge||window.event;let Pt;switch(Ct.keyCode){case 32:(this.player.focus||this.player.options.hotkey)&&(Ct.preventDefault(),this.player.toggle());break;case 37:(this.player.focus||this.player.options.hotkey)&&(Ct.preventDefault(),Ct.altKey?this.player.seek(this.player.video.currentTime-60):Ct.shiftKey?this.player.seek(this.player.video.currentTime-30):Ct.ctrlKey||Ct.metaKey?this.player.seek(this.player.video.currentTime-15):this.player.seek(this.player.video.currentTime-5),this.player.controller.setAutoHide());break;case 39:(this.player.focus||this.player.options.hotkey)&&(Ct.preventDefault(),Ct.altKey?this.player.seek(this.player.video.currentTime+60):Ct.shiftKey?this.player.seek(this.player.video.currentTime+30):Ct.ctrlKey||Ct.metaKey?this.player.seek(this.player.video.currentTime+15):this.player.seek(this.player.video.currentTime+5),this.player.controller.setAutoHide());break;case 38:this.player.focus&&(Ct.preventDefault(),Pt=this.player.volume()+.1,this.player.volume(Pt));break;case 40:this.player.focus&&(Ct.preventDefault(),Pt=this.player.volume()-.1,this.player.volume(Pt));break;case 70:Ct.ctrlKey||Ct.metaKey||(Ct.preventDefault(),this.player.fullScreen.toggle("browser"));break;case 87:Ct.ctrlKey||Ct.metaKey||(Ct.preventDefault(),this.player.fullScreen.toggle("web"));break;case 76:this.player.options.live&&(Ct.preventDefault(),this.player.sync());break;case 80:this.player.options.pictureInPicture&&document.pictureInPictureEnabled&&(Ct.preventDefault(),this.player.template.pipButton.click());break;case 67:typeof this.player.options.danmaku=="object"&&this.player.options.danmaku&&(Ct.ctrlKey||Ct.metaKey||(Ct.preventDefault(),this.player.controller.show(),this.player.comment!=null&&this.player.comment.show()));break;case 68:typeof this.player.options.danmaku=="object"&&this.player.options.danmaku&&(Ct.ctrlKey||Ct.metaKey||(Ct.preventDefault(),this.player.template.showDanmaku.click(),this.player.template.showDanmakuToggle.checked?this.player.notice(`${this.player.tran("Show comment")}`):this.player.notice(`${this.player.tran("Hide comment")}`)));break;case 83:this.player.options.subtitle&&(Ct.ctrlKey||Ct.metaKey||(Ct.preventDefault(),this.player.subtitle!==null&&(this.player.subtitle.container.classList.contains("dplayer-subtitle-hide")?this.player.notice(`${this.player.tran("Show subtitle")}`):this.player.notice(`${this.player.tran("Hide subtitle")}`),this.player.subtitle.toggle())))}}}cancelFullScreen(ge){(ge||window.event).keyCode===27&&this.player.fullScreen.isFullScreen("web")&&this.player.fullScreen.cancel("web")}destroy(){this.player.options.hotkey&&document.removeEventListener("keydown",this.doHotKeyHandler),document.removeEventListener("keydown",this.cancelFullScreenHandler)}},Na=class{constructor(ge){we(this,"contextmenuHandler");we(this,"player");we(this,"shown");this.player=ge,this.shown=!1,Array.prototype.slice.call(this.player.template.menuItem).forEach((Le,Xe)=>{this.player.options.contextmenu[Xe].click&&Le.addEventListener("click",()=>{const ft=this.player.options.contextmenu[Xe];ft.click&&ft.click(this.player),this.hide()})}),this.contextmenuHandler=Le=>{const Xe=Le||window.event;if(Xe.preventDefault(),this.shown)return void this.hide();const ft=this.player.container.getBoundingClientRect();this.show(Xe.clientX-ft.left,Xe.clientY-ft.top),this.player.template.mask.addEventListener("click",()=>{this.hide()})},this.player.container.addEventListener("contextmenu",this.contextmenuHandler)}show(ge,Le){this.player.template.menu.classList.add("dplayer-menu-show");const Xe=this.player.container.getBoundingClientRect();ge+this.player.template.menu.offsetWidth>=Xe.width?(this.player.template.menu.style.right=Xe.width-ge+"px",this.player.template.menu.style.left="initial"):(this.player.template.menu.style.left=ge+"px",this.player.template.menu.style.right="initial"),Le+this.player.template.menu.offsetHeight>=Xe.height?(this.player.template.menu.style.bottom=Xe.height-Le+"px",this.player.template.menu.style.top="initial"):(this.player.template.menu.style.top=Le+"px",this.player.template.menu.style.bottom="initial"),this.player.template.mask.classList.add("dplayer-mask-show"),this.shown=!0,this.player.events.trigger("contextmenu_show")}hide(){this.player.template.mask.classList.remove("dplayer-mask-show"),this.player.template.menu.classList.remove("dplayer-menu-show"),this.shown=!1,this.player.events.trigger("contextmenu_hide")}destroy(){this.player.container.removeEventListener("contextmenu",this.contextmenuHandler)}},us=class{constructor(ge){we(this,"player");we(this,"container");we(this,"template");we(this,"video");we(this,"beginTime",0);this.player=ge,this.container=ge.template.infoPanel,this.template=ge.template,this.video=ge.video,this.template.infoPanelClose.addEventListener("click",()=>{this.hide()})}show(){this.beginTime=Date.now(),this.update(),this.player.timer.enable("info"),this.player.timer.enable("fps"),this.container.classList.remove("dplayer-info-panel-hide")}hide(){this.player.timer.disable("info"),this.player.timer.disable("fps"),this.container.classList.add("dplayer-info-panel-hide")}toggle(){this.container.classList.contains("dplayer-info-panel-hide")?this.show():this.hide()}update(){var ge;if(this.template.infoVersion.textContent="v1.31.2 7131b6b",this.template.infoType.textContent=this.player.type,this.template.infoUrl.textContent=this.player.options.video.url??"N/A",this.template.infoResolution.textContent=`${this.player.video.videoWidth} x ${this.player.video.videoHeight}`,this.template.infoDuration.textContent=`${this.player.video.duration}`,this.player.video.getVideoPlaybackQuality!=null){const Le=this.player.video.getVideoPlaybackQuality();this.template.infoDroppedFrames.textContent=`${Le.droppedVideoFrames} / ${Le.totalVideoFrames}`}else if(this.player.video.webkitDecodedFrameCount!=null){const Le=this.player.video.webkitDecodedFrameCount,Xe=this.player.video.webkitDroppedFrameCount;this.template.infoDroppedFrames.textContent=`${Xe} / ${Le}`}else this.template.infoDroppedFrames.textContent="N/A";if(this.player.video.buffered.length>0){const Le=this.player.video.buffered.length,Xe=this.player.video.buffered.end(Le-1)-this.player.video.currentTime;this.template.infoBufferRemain.textContent=`${Xe.toFixed(3)} s`}else this.template.infoBufferRemain.textContent="N/A";if(this.player.type==="mpegts"||this.player.type==="flv"){const Le=this.player.plugins.mpegts||this.player.plugins.flvjs;if(Le){const Xe=Le.mediaInfo,ft=Le.statisticsInfo;this.template.infoMimeType.textContent=Xe.mimeType??"N/A",this.template.infoVideoFPS.textContent=`${((ge=Xe.fps)==null?void 0:ge.toFixed(3))??"N/A"}`,ft.speed!=null?this.template.infoDownloadSpeed.textContent=`${ft.speed.toFixed(3)} KB/s`:this.template.infoDownloadSpeed.textContent="N/A"}}else this.template.infoMimeType.textContent="N/A",this.template.infoVideoFPS.textContent="N/A",this.template.infoDownloadSpeed.textContent="N/A"}fps(ge){this.template.infoPageFPS.textContent=`${ge.toFixed(1)}`}};var Fa=y(953),$r=y.n(Fa);let es=0;const ts=[],Ls=class{constructor(ge){we(this,"bar");we(this,"bezel");we(this,"comment",null);we(this,"contextmenu");we(this,"controller");we(this,"danmaku",null);we(this,"events");we(this,"fullScreen");we(this,"hotkey");we(this,"infoPanel");we(this,"setting");we(this,"subtitle",null);we(this,"template");we(this,"timer");we(this,"user");we(this,"container");we(this,"containerClickFun");we(this,"docClickFun");we(this,"focus",!1);we(this,"narrow",!1);we(this,"noticeTime",null);we(this,"options");we(this,"paused",!1);we(this,"plugins");we(this,"prevVideoCurrentTime",0);we(this,"prevVideo",null);we(this,"quality",null);we(this,"qualityIndex",null);we(this,"switchingQuality",!1);we(this,"resizeObserver");we(this,"tran");we(this,"type","auto");we(this,"video");this.options=(Le=>{const Xe={container:Le.container||document.querySelector(".dplayer")||void 0,live:!1,liveSyncMinBufferSize:.8,syncWhenPlayingLive:!0,autoplay:!1,theme:"#b7daff",loop:!1,lang:navigator.language.toLowerCase(),screenshot:!1,pictureInPicture:!0,airplay:!0,hotkey:!0,preload:"metadata",crossOrigin:null,volume:1,playbackSpeed:[.25,.5,.75,1,1.25,1.5,1.75,2],apiBackend:oi,video:{},contextmenu:[],mutex:!0,pluginOptions:{}};for(const ft in Xe)Object.prototype.hasOwnProperty.call(Xe,ft)&&!Object.prototype.hasOwnProperty.call(Le,ft)&&(Le[ft]=Xe[ft]);return Le.video&&!Le.video.type&&(Le.video.type="auto"),typeof Le.danmaku=="object"&&Le.danmaku&&(!Le.danmaku.user&&(Le.danmaku.user="DPlayer"),!Le.danmaku.speedRate&&(Le.danmaku.speedRate=1),!Le.danmaku.fontSize&&(Le.danmaku.fontSize=35),Le.danmaku.closeCommentFormAfterSend!==!1&&(Le.danmaku.closeCommentFormAfterSend=!0)),Le.subtitle&&(!Le.subtitle.type&&(Le.subtitle.type="webvtt"),!Le.subtitle.fontSize&&(Le.subtitle.fontSize="20px"),!Le.subtitle.bottom&&(Le.subtitle.bottom="40px"),!Le.subtitle.color&&(Le.subtitle.color="#fff")),Le.video.quality&&(typeof Le.video.defaultQuality=="string"&&(Le.video.quality.forEach((ft,_t)=>{Le.video.defaultQuality===ft.name&&(Le.video.defaultQuality=_t)}),typeof Le.video.defaultQuality=="string"&&(Le.video.defaultQuality=0)),Le.video.defaultQuality===void 0&&(Le.video.defaultQuality=0),Le.video.type=Le.video.quality[Le.video.defaultQuality].type,Le.video.url=Le.video.quality[Le.video.defaultQuality].url),Le.lang&&(Le.lang=Le.lang.toLowerCase()),Le.contextmenu=Le.contextmenu.concat([{text:"Video info",click:ft=>{ft.infoPanel.toggle()}},{text:"DPlayer v1.31.2",link:"https://github.com/tsukumijima/DPlayer"}]),{container:Le.container,live:Le.live,liveSyncMinBufferSize:Le.liveSyncMinBufferSize,syncWhenPlayingLive:Le.syncWhenPlayingLive,autoplay:Le.autoplay,theme:Le.theme,loop:Le.loop,lang:Le.lang,screenshot:Le.screenshot,pictureInPicture:Le.pictureInPicture,airplay:Le.airplay,hotkey:Le.hotkey,preload:Le.preload,crossOrigin:Le.crossOrigin,volume:Le.volume,playbackSpeed:Le.playbackSpeed,logo:Le.logo,apiBackend:Le.apiBackend,video:Le.video,subtitle:Le.subtitle,danmaku:Le.danmaku,contextmenu:Le.contextmenu,highlight:Le.highlight,mutex:Le.mutex,pluginOptions:Le.pluginOptions}})({preload:ge.video.type==="webtorrent"?"none":"metadata",...ge}),this.options.video.quality&&(this.qualityIndex=this.options.video.defaultQuality,this.quality=this.options.video.quality[this.options.video.defaultQuality]),this.tran=new ui(this.options.lang).tran,this.events=new tl,this.user=new Er(this),this.container=this.options.container,this.container.classList.add("dplayer"),this.options.danmaku||this.container.classList.add("dplayer-no-danmaku"),this.options.live?this.container.classList.add("dplayer-live"):this.container.classList.remove("dplayer-live"),Wt.isMobile&&this.container.classList.add("dplayer-mobile"),this.narrow=this.container.offsetWidth<=500,this.narrow&&this.container.classList.add("dplayer-narrow"),this.resizeObserver=new ResizeObserver(Le=>{for(const Xe of Le)Xe.target===this.container&&(this.narrow=this.container.offsetWidth<=500,this.narrow?this.container.classList.add("dplayer-narrow"):this.container.classList.remove("dplayer-narrow"))}),this.resizeObserver.observe(this.container),this.template=new ha({container:this.container,options:this.options,index:es,tran:this.tran}),this.video=this.template.video,this.bar=new Xr(this.template),this.bezel=new Ba(this.template.bezel),this.fullScreen=new fa(this),this.controller=new pa(this),this.options.danmaku&&(this.danmaku=new el({player:this,container:this.template.danmaku,opacity:this.user.get("opacity"),callback:()=>{setTimeout(()=>{this.template.danmakuLoading.style.display="none",this.options.autoplay&&this.play()},0)},error:Le=>{this.notice(Le,void 0,void 0,"#FF6F6A")},apiBackend:this.options.apiBackend,borderColor:this.options.theme,fontSize:this.options.danmaku.fontSize,time:()=>this.video.currentTime,unlimited:this.user.get("unlimited"),speedRate:this.options.danmaku.speedRate,api:{id:this.options.danmaku.id,address:this.options.danmaku.api,token:this.options.danmaku.token,maximum:this.options.danmaku.maximum,addition:this.options.danmaku.addition,user:this.options.danmaku.user},events:this.events,tran:Le=>this.tran(Le)}),this.comment=new nl(this)),this.plugins={},this.docClickFun=()=>{this.focus=!1},this.containerClickFun=()=>{this.focus=!0},document.addEventListener("click",this.docClickFun,!0),this.container.addEventListener("click",this.containerClickFun,!0),this.paused=!0,this.timer=new Rs(this),this.hotkey=new Is(this),this.contextmenu=new Na(this),this.initVideo(this.video,this.quality&&this.quality.type||this.options.video.type),this.setting=new ma(this),this.infoPanel=new us(this),!this.danmaku&&this.options.autoplay&&this.play(),es++,ts.push(this)}seek(ge){ge=Math.max(ge,0);const Le=Wt.getVideoDuration(this.video,this.template);Le&&(ge=Math.min(ge,Le)),this.video.currentTimege&&this.notice(`${this.tran("REW")} ${(this.video.currentTime-ge).toFixed(0)} ${this.tran("s")}`),isFinite(ge)&&(this.video.currentTime=ge),this.danmaku&&this.danmaku.seek(),this.bar.set("played",ge/Le,"width"),this.template.ptime.textContent=Wt.secondToTime(ge)}sync(ge=!1){if(this.options.live){const Le=Wt.getVideoDuration(this.video,this.template)-this.options.liveSyncMinBufferSize;try{this.video.currentTime=Le}catch{return}this.danmaku&&this.danmaku.seek(),this.template.ptime.textContent=Wt.secondToTime(Le),ge||this.notice(this.tran("Synchronized"))}}play(ge=!1){if(this.paused=!1,this.video.paused&&!Wt.isMobile&&this.bezel.switch(En.play),this.template.playButton.innerHTML=En.pause,this.template.mobilePlayButton.innerHTML=En.pause,this.options.live&&this.options.syncWhenPlayingLive&&this.sync(!0),!ge){const Le=this.type==="mpegts"&&this.plugins.mpegts&&this.plugins.mpegts.play.bind(this.plugins.mpegts)||this.video.play.bind(this.video);Promise.resolve(Le()).catch(()=>{this.pause()}).then(()=>{})}if(this.timer.enable("loading"),this.container.classList.remove("dplayer-paused"),this.container.classList.add("dplayer-playing"),this.danmaku&&this.danmaku.play(),this.options.mutex)for(let Le=0;Le=.95?this.template.volumeIcon.innerHTML=En.volumeUp:this.volume()>0?this.template.volumeIcon.innerHTML=En.volumeDown:this.template.volumeIcon.innerHTML=En.volumeOff}volume(ge=NaN,Le=!1,Xe=!1){if(typeof ge=="string"&&(ge=parseFloat(ge)),!isNaN(ge)){ge=Math.max(ge,0),ge=Math.min(ge,1),this.bar.set("volume",ge,"width");const ft=`${(100*ge).toFixed(0)}%`;this.template.volumeBarWrapWrap.ariaLabel=ft,Le||this.user.set("volume",ge),Xe||this.notice(`${this.tran("Volume")} ${(100*ge).toFixed(0)}%`),this.video.volume=ge,this.video.muted&&(this.video.muted=!1),this.switchVolumeIcon()}return this.video.volume}toggle(){this.video.paused?this.play():this.pause()}on(ge,Le,Xe=!1){this.events.on(ge,Le,Xe)}off(ge,Le){this.events.off(ge,Le)}switchVideo(ge,Le){this.pause(),this.video.poster=ge.pic?ge.pic:"",this.video.src=ge.url,this.initMSE(this.video,ge.type||"auto"),Le&&(this.template.danmakuLoading.style.display="block",this.bar.set("played",0,"width"),this.bar.set("loaded",0,"width"),this.template.ptime.textContent="00:00",this.template.danmaku.innerHTML="",this.danmaku&&this.danmaku.reload({id:Le.id,address:Le.api,token:Le.token,maximum:Le.maximum,addition:Le.addition,user:Le.user}))}initMSE(ge,Le){if(this.type=Le,this.options.video.customType&&this.options.video.customType[Le])Object.prototype.toString.call(this.options.video.customType[Le])==="[object Function]"?this.options.video.customType[Le](this.video,this):console.error(`Illegal customType: ${Le}`);else switch(this.type==="auto"&&(/m3u8(#|\?|$)/i.exec(ge.src)?this.type="hls":/.ts(#|\?|$)/i.exec(ge.src)?this.type="mpegts":/.flv(#|\?|$)/i.exec(ge.src)?this.type="flv":/.mpd(#|\?|$)/i.exec(ge.src)?this.type="dash":this.type="normal"),this.type!=="mpegts"&&this.type!=="live-llhls-for-KonomiTV"&&this.container.classList.add("dplayer-no-audio-switching"),this.type){case"hls":if(window.Hls){const Xe=/Safari/i.test(navigator.userAgent)&&/iPad|Macintosh/i.test(navigator.userAgent)&&"ontouchend"in document&&(ge.canPlayType("application/x-mpegURL")||ge.canPlayType("application/vnd.apple.mpegURL"));if(window.Hls.isSupported()&&!Xe){this.plugins.hls&&(this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose),this.plugins.hls.destroy(),delete this.plugins.hls);const ft=this.options.pluginOptions.hls,_t=new window.Hls(ft);if(this.plugins.hls=_t,_t.loadSource(ge.src),_t.attachMedia(ge),this.events.on("destroy",()=>{this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose),_t.destroy(),delete this.plugins.hls}),this.options.subtitle&&this.options.subtitle.type==="aribb24"){this.options.pluginOptions.aribb24===void 0&&(this.options.pluginOptions.aribb24={}),this.options.pluginOptions.aribb24.enableAutoInBandMetadataTextTrackDetection=!1;const Ct=this.options.pluginOptions.aribb24,Pt=this.plugins.aribb24Caption=new Mt.CanvasRenderer({...Ct,data_identifier:128});if(Pt.attachMedia(ge),Pt.show(),this.options.pluginOptions.aribb24.disableSuperimposeRenderer!==!0){const ci=this.plugins.aribb24Superimpose=new Mt.CanvasRenderer({...Ct,data_identifier:129});ci.attachMedia(ge),ci.show()}_t.on(window.Hls.Events.FRAG_PARSING_METADATA,(ci,hi)=>{for(const Xt of hi.samples)this.plugins.aribb24Caption&&this.plugins.aribb24Caption.pushID3v2Data(Xt.pts,Xt.data),this.plugins.aribb24Superimpose&&this.plugins.aribb24Superimpose.pushID3v2Data(Xt.pts,Xt.data)})}}else if(ge.canPlayType("application/x-mpegURL")||ge.canPlayType("application/vnd.apple.mpegURL")){if(this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose),this.events.on("destroy",()=>{this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose)}),this.options.subtitle&&this.options.subtitle.type==="aribb24"){this.options.pluginOptions.aribb24===void 0&&(this.options.pluginOptions.aribb24={}),this.options.pluginOptions.aribb24.enableAutoInBandMetadataTextTrackDetection=!0;const ft=this.options.pluginOptions.aribb24,_t=this.plugins.aribb24Caption=new Mt.CanvasRenderer({...ft,data_identifier:128});if(_t.attachMedia(ge),_t.show(),this.options.pluginOptions.aribb24.disableSuperimposeRenderer!==!0){const Ct=this.plugins.aribb24Superimpose=new Mt.CanvasRenderer({...ft,data_identifier:129});Ct.attachMedia(ge),Ct.show()}}}else this.notice("Error: HLS is not supported.",void 0,void 0,"#FF6F6A")}else this.notice("Error: Can't find hls.js.",void 0,void 0,"#FF6F6A");break;case"live-llhls-for-KonomiTV":this.plugins.liveLLHLSForKonomiTV&&(this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose),jt.delete(`${this.plugins.liveLLHLSForKonomiTV.baseUrl}/${this.plugins.liveLLHLSForKonomiTV.clientId}`),delete this.plugins.liveLLHLSForKonomiTV),(async()=>{const Xe=this.quality!==null?this.quality.url:this.options.video.url,ft=(await jt.post(Xe)).data.client_id,_t=(Pt=!1)=>{let ci=Xe.replace("/ll-hls",`/ll-hls/${ft}/primary-audio/playlist.m3u8`);if(Pt===!0&&(ci=Xe.replace("/ll-hls",`/ll-hls/${ft}/secondary-audio/playlist.m3u8`)),ge.src===ci)return;const hi=ge.paused;if(ge.src=ci,ge.load(),this.plugins.aribb24Caption&&this.plugins.aribb24Caption.dispose(),this.plugins.aribb24Superimpose&&this.plugins.aribb24Superimpose.dispose(),this.options.subtitle&&this.options.subtitle.type==="aribb24"){this.options.pluginOptions.aribb24===void 0&&(this.options.pluginOptions.aribb24={}),this.options.pluginOptions.aribb24.enableAutoInBandMetadataTextTrackDetection=!0;const Xt=this.options.pluginOptions.aribb24,_i=this.plugins.aribb24Caption=new Mt.CanvasRenderer({...Xt,data_identifier:128});if(_i.attachMedia(ge),_i.show(),this.options.pluginOptions.aribb24.disableSuperimposeRenderer!==!0){const Ui=this.plugins.aribb24Superimpose=new Mt.CanvasRenderer({...Xt,data_identifier:129});Ui.attachMedia(ge),Ui.show()}}hi||ge.play()},Ct={baseUrl:Xe,clientId:ft,switchPrimaryAudio(){_t(!1)},switchSecondaryAudio(){_t(!0)}};this.plugins.liveLLHLSForKonomiTV=Ct,_t(!1),this.events.on("destroy",()=>{this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose),jt.delete(`${Ct.baseUrl}/${Ct.clientId}`),delete this.plugins.liveLLHLSForKonomiTV})})();break;case"mpegts":if(window.mpegts)if(window.mpegts.isSupported()){this.plugins.mpegts&&(this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose),this.plugins.mpegts.unload(),this.plugins.mpegts.detachMediaElement(),this.plugins.mpegts.destroy(),delete this.plugins.mpegts),this.options.pluginOptions.mpegts===void 0&&(this.options.pluginOptions.mpegts={});const Xe=window.mpegts.createPlayer(Object.assign(this.options.pluginOptions.mpegts.mediaDataSource||{},{type:"mpegts",isLive:this.options.live,url:ge.src}),this.options.pluginOptions.mpegts.config);if(this.plugins.mpegts=Xe,Xe.attachMediaElement(ge),Xe.load(),this.events.on("destroy",()=>{this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose),Xe.unload(),Xe.detachMediaElement(),Xe.destroy(),delete this.plugins.mpegts}),this.options.subtitle&&this.options.subtitle.type==="aribb24"){this.options.pluginOptions.aribb24===void 0&&(this.options.pluginOptions.aribb24={}),this.options.pluginOptions.aribb24.enableAutoInBandMetadataTextTrackDetection=!1;const ft=this.options.pluginOptions.aribb24,_t=this.plugins.aribb24Caption=new Mt.CanvasRenderer({...ft,data_identifier:128});if(_t.attachMedia(ge),_t.show(),this.options.pluginOptions.aribb24.disableSuperimposeRenderer!==!0){const Ct=this.plugins.aribb24Superimpose=new Mt.CanvasRenderer({...ft,data_identifier:129});Ct.attachMedia(ge),Ct.show()}Xe.on(window.mpegts.Events.TIMED_ID3_METADATA_ARRIVED,Ct=>{this.plugins.aribb24Caption&&this.plugins.aribb24Caption.pushID3v2Data(Ct.pts/1e3,Ct.data),this.plugins.aribb24Superimpose&&this.plugins.aribb24Superimpose.pushID3v2Data(Ct.pts/1e3,Ct.data)})}}else this.notice("Error: mpegts.js is not supported.",void 0,void 0,"#FF6F6A");else this.notice("Error: Can't find mpegts.js.",void 0,void 0,"#FF6F6A");break;case"flv":if(window.flvjs)if(window.flvjs.isSupported()){this.options.pluginOptions.flv===void 0&&(this.options.pluginOptions.flv={});const Xe=window.flvjs.createPlayer(Object.assign(this.options.pluginOptions.flv.mediaDataSource||{},{type:"flv",url:ge.src}),this.options.pluginOptions.flv.config);this.plugins.flvjs=Xe,Xe.attachMediaElement(ge),Xe.load(),this.events.on("destroy",()=>{Xe.unload(),Xe.detachMediaElement(),Xe.destroy(),delete this.plugins.flvjs})}else this.notice("Error: flv.js is not supported.",void 0,void 0,"#FF6F6A");else this.notice("Error: Can't find flv.js.",void 0,void 0,"#FF6F6A");break;case"dash":if(window.dashjs){const Xe=window.dashjs.MediaPlayer().create();Xe.initialize(ge,ge.src,!1);const ft=this.options.pluginOptions.dash;Xe.updateSettings(ft??{}),this.plugins.dash=Xe,this.events.on("destroy",()=>{Xe.reset(),delete this.plugins.dash})}else this.notice("Error: Can't find dash.js.",void 0,void 0,"#FF6F6A");break;case"webtorrent":if(window.WebTorrent)if(window.WebTorrent.WEBRTC_SUPPORT){this.container.classList.add("dplayer-loading");const Xe=this.options.pluginOptions.webtorrent,ft=new window.WebTorrent(Xe);this.plugins.webtorrent=ft;const _t=ge.src;ge.src="",ge.preload="metadata",ge.addEventListener("durationchange",()=>this.container.classList.remove("dplayer-loading"),{once:!0}),ft.add(_t,Ct=>{const Pt=Ct.files.find(ci=>ci.name.endsWith(".mp4"));Pt&&Pt.renderTo(this.video,{autoplay:this.options.autoplay,controls:!1})}),this.events.on("destroy",()=>{ft.remove(_t),ft.destroy(),delete this.plugins.webtorrent})}else this.notice("Error: Webtorrent is not supported.",void 0,void 0,"#FF6F6A");else this.notice("Error: Can't find Webtorrent.",void 0,void 0,"#FF6F6A")}}initVideo(ge,Le){this.initMSE(ge,Le),this.on("durationchange",()=>{ge.duration!==1&&ge.duration!==1/0&&(this.template.dtime.textContent=Wt.secondToTime(ge.duration))}),this.on("progress",()=>{const Xe=Wt.getVideoDuration(this.video,this.template),ft=ge.buffered.length?ge.buffered.end(ge.buffered.length-1)/Xe:0;this.bar.set("loaded",ft,"width")}),this.on("error",()=>{this.video.error&&(this.switchingQuality&&(this.prevVideo!==null&&this.template.videoWrapAspect.removeChild(this.prevVideo),this.video.classList.add("dplayer-video-current"),this.prevVideo=null,this.switchingQuality=!1,this.events.trigger("quality_end")),this.tran&&this.notice&&this.type!=="webtorrent"&&this.type!=="live-llhls-for-KonomiTV"&&this.notice(this.tran("Video load failed"),-1,void 0,"#FF6F6A"),this.container.classList.remove("dplayer-loading"))}),this.on("ended",()=>{this.bar.set("played",1,"width"),this.setting.loop?(this.seek(0),this.play()):this.pause(),this.danmaku&&(this.danmaku.danIndex=0)}),this.on("play",()=>{this.paused&&this.play(!0)}),this.on("pause",()=>{this.paused||this.pause(!0)}),this.on("timeupdate",()=>{const Xe=Wt.getVideoDuration(this.video,this.template);this.bar.set("played",this.video.currentTime/Xe,"width");const ft=Wt.secondToTime(this.video.currentTime);this.template.ptime.textContent!==ft&&(this.template.ptime.textContent=ft)});for(let Xe=0;Xe{this.events.trigger(this.events.videoEvents[Xe],ft)});this.volume(this.user.get("volume"),!0,!0),this.options.subtitle&&(this.subtitle=new ks(this.template.subtitle,this.video,this.plugins,this.options.subtitle,this.events),this.user.get("subtitle")||this.subtitle.hide())}switchQuality(ge){if(ge=typeof ge=="string"?parseInt(ge):ge,this.options.video.quality===void 0||this.qualityIndex===ge||this.switchingQuality)return;this.qualityIndex=ge,this.switchingQuality=!0,this.quality=this.options.video.quality[ge];const Le=this.video.paused;this.video.pause();const Xe=$r()({current:!1,pic:null,screenshot:this.options.screenshot,preload:"auto",url:this.quality.type==="live-llhls-for-KonomiTV"?"":this.quality.url,subtitle:this.options.subtitle,crossOrigin:this.options.crossOrigin}),ft=new DOMParser().parseFromString(Xe,"text/html").body.firstChild;this.template.videoWrapAspect.insertBefore(ft,this.template.videoWrapAspect.getElementsByTagName("div")[0]),this.prevVideoCurrentTime=this.video.currentTime,this.prevVideo=this.video,this.video=ft,this.initVideo(this.video,this.quality.type||this.options.video.type),this.options.live||this.seek(this.prevVideoCurrentTime),Le||this.video.play(),this.options.lang==="ja"||this.options.lang==="ja-jp"?this.notice(`画質を ${this.quality.name} に切り替えています…`,-1):this.notice(`${this.tran("Switching to")} ${this.quality.name} ${this.tran("quality")}`,-1),this.container.classList.add("dplayer-loading"),this.events.trigger("quality_start",this.quality),this.template.qualityItem.forEach(_t=>{_t.classList.remove("dplayer-setting-quality-current"),parseInt(_t.dataset.index)===ge&&(_t.classList.add("dplayer-setting-quality-current"),this.template.qualityValue.textContent=this.quality.name,this.template.settingBox.classList.remove("dplayer-setting-box-quality"))}),this.on("canplay",()=>{if(this.prevVideo!==null){if(!this.options.live&&this.video.currentTime!==this.prevVideoCurrentTime)return void this.seek(this.prevVideoCurrentTime);this.template.videoWrapAspect.removeChild(this.prevVideo),this.video.classList.add("dplayer-video-current"),Le||this.video.play(),this.prevVideo=null,this.options.lang==="ja"||this.options.lang==="ja-jp"?this.notice(`画質を ${this.quality.name} に切り替えました。`,1e3):this.notice(`${this.tran("Switched to")} ${this.quality.name} ${this.tran("quality")}`),this.switchingQuality=!1;const _t=parseFloat(this.template.settingBox.querySelector(".dplayer-setting-speed-current").dataset.speed);this.speed(_t),this.template.settingBox.querySelector(".dplayer-setting-audio-current").dataset.audio==="secondary"&&(window.mpegts&&this.plugins.mpegts&&this.plugins.mpegts instanceof window.mpegts.MSEPlayer?this.plugins.mpegts.switchSecondaryAudio():this.plugins.liveLLHLSForKonomiTV&&this.plugins.liveLLHLSForKonomiTV.switchSecondaryAudio()),this.container.classList.remove("dplayer-loading"),this.events.trigger("quality_end")}})}notice(ge,Le=2e3,Xe=.8,ft){this.template.notice.textContent=ge,this.template.notice.style.opacity=`${Xe}`,this.template.notice.style.color=ft&&ft!==""?ft:"",this.noticeTime&&window.clearTimeout(this.noticeTime),this.events.trigger("notice_show",ge),Le>0&&(this.noticeTime=window.setTimeout(()=>{this.hideNotice()},Le))}hideNotice(){this.template.notice.style.opacity="0",this.events.trigger("notice_hide")}resize(){this.danmaku&&this.danmaku.resize(),this.plugins.aribb24Caption&&this.plugins.aribb24Caption.refresh(),this.plugins.aribb24Superimpose&&this.plugins.aribb24Superimpose.refresh(),this.controller.thumbnails&&this.controller.thumbnails.resize(160,this.video.videoHeight/this.video.videoWidth*160,this.template.barWrap.offsetWidth),this.events.trigger("resize")}speed(ge){this.video.playbackRate=ge,this.template.speedItem.forEach(Le=>{Le.classList.remove("dplayer-setting-speed-current"),parseFloat(Le.dataset.speed)===ge&&(Le.classList.add("dplayer-setting-speed-current"),parseFloat(Le.dataset.speed)===1?this.template.speedValue.textContent=this.tran("Normal"):this.template.speedValue.textContent=`${ge}`,this.template.settingBox.classList.remove("dplayer-setting-box-speed"))})}destroy(ge=!1){ts.splice(ts.indexOf(this),1),this.pause(),document.removeEventListener("click",this.docClickFun,!0),this.container.removeEventListener("click",this.containerClickFun,!0),this.fullScreen.destroy(),this.hotkey.destroy(),this.contextmenu.destroy(),this.controller.destroy(),this.timer.destroy(),this.setting.destroy(),this.resizeObserver.disconnect(),this.video.src="",ge||(this.container.innerHTML=""),this.events.trigger("destroy")}static get version(){return"1.31.2"}};console.log(` +`);let ft=0;for(let _t=0;_t=this.options.time()){this.danIndex=ge;break}this.danIndex=this.dan.length}}clear(){this.danTunnel={right:{},top:{},bottom:{}},this.danIndex=0,this.options.container.innerHTML="",this.events&&this.events.trigger("danmaku_clear")}htmlEncode(ge){return ge.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}resize(){const ge=this.container.offsetWidth,Le=this.container.querySelectorAll(".dplayer-danmaku-item");for(let Xe=0;Xe{this.player.resize()}),this.player.events.on("webfullscreen_cancel",()=>{this.player.resize(),Wt.setScrollPosition(this.lastScrollPosition)}),this.fullscreenchange=()=>{this.player.resize(),this.isFullScreen("browser")?this.player.events.trigger("fullscreen"):(Wt.setScrollPosition(this.lastScrollPosition),this.player.container.classList.remove("dplayer-fulled-browser"),this.player.events.trigger("fullscreen_cancel"))},this.player.container.onfullscreenchange!==void 0?this.player.container.addEventListener("fullscreenchange",this.fullscreenchange):this.player.container.addEventListener("webkitfullscreenchange",this.fullscreenchange)}isFullScreen(ge="browser"){switch(ge){case"browser":{const Le=document.fullscreenElement||document.webkitFullscreenElement;return!(!Le||Le!==this.player.container)}case"web":return this.player.container.classList.contains("dplayer-fulled")}}request(ge="browser"){const Le=ge==="browser"?"web":"browser",Xe=this.isFullScreen(Le);switch(Xe||(this.lastScrollPosition=Wt.getScrollPosition()),ge){case"browser":if(this.player.container.requestFullscreen=this.player.container.requestFullscreen||this.player.container.webkitRequestFullscreen,this.player.container.requestFullscreen!==void 0?this.player.container.requestFullscreen():this.player.video.webkitEnterFullscreen&&this.player.video.webkitEnterFullscreen(),screen.orientation)try{screen.orientation.lock("landscape").catch(()=>{})}catch{}this.player.container.requestFullscreen!==void 0&&this.player.container.classList.add("dplayer-fulled-browser");break;case"web":this.player.container.classList.add("dplayer-fulled"),document.body.classList.add("dplayer-web-fullscreen-fix"),this.player.events.trigger("webfullscreen")}Xe&&this.cancel(Le)}cancel(ge="browser"){switch(ge){case"browser":if(document.exitFullscreen=document.exitFullscreen||document.webkitExitFullscreen,document.exitFullscreen&&document.exitFullscreen(),screen.orientation)try{screen.orientation.unlock()}catch{}this.player.container.classList.remove("dplayer-fulled-browser");break;case"web":this.player.container.classList.remove("dplayer-fulled"),document.body.classList.remove("dplayer-web-fullscreen-fix"),this.player.events.trigger("webfullscreen_cancel")}}toggle(ge="browser"){this.isFullScreen(ge)?this.cancel(ge):this.request(ge)}destroy(){this.player.container.removeEventListener("fullscreenchange",this.fullscreenchange),this.player.container.removeEventListener("webkitfullscreenchange",this.fullscreenchange)}},Er=class{constructor(ge){we(this,"storageName");we(this,"default");we(this,"data");this.storageName={opacity:"dplayer-danmaku-opacity",volume:"dplayer-volume",unlimited:"dplayer-danmaku-unlimited",danmaku:"dplayer-danmaku-show",subtitle:"dplayer-subtitle-show"},this.default={opacity:1,volume:Object.prototype.hasOwnProperty.call(ge.options,"volume")?ge.options.volume:1,unlimited:(ge.options.danmaku&&ge.options.danmaku.unlimited?1:0)||0,danmaku:1,subtitle:1},this.data={},this.init()}init(){for(const ge in this.storageName){const Le=this.storageName[ge];this.data[ge]=parseFloat(Wt.storage.get(Le)||this.default[ge].toString())}}get(ge){return this.data[ge]}set(ge,Le){this.data[ge]=Le,Wt.storage.set(this.storageName[ge],Le)}},ks=class{constructor(ge,Le,Xe,ft,_t){we(this,"container");we(this,"video");we(this,"plugins");we(this,"options");we(this,"events");this.container=ge,this.video=Le,this.plugins=Xe,this.options=ft,this.events=_t,this.init()}init(){if(this.container.style.fontSize=this.options.fontSize,this.container.style.bottom=this.options.bottom,this.container.style.color=this.options.color,this.options.type==="webvtt"&&this.video.textTracks&&this.video.textTracks[0]){const ge=this.video.textTracks[0];ge.oncuechange=()=>{if(!ge.activeCues)return;const Le=ge.activeCues[0];if(this.container.innerHTML="",Le){const Xe=document.createElement("div");Xe.appendChild(Le.getCueAsHTML());const ft=Xe.innerHTML.split(/\r?\n/).map(_t=>`

${_t}

`).join("");this.container.innerHTML=ft}this.events.trigger("subtitle_change")}}}show(){this.container.classList.remove("dplayer-subtitle-hide"),this.options.type==="aribb24"&&this.plugins.aribb24Caption&&this.plugins.aribb24Caption.show(),this.events.trigger("subtitle_show")}hide(){this.container.classList.add("dplayer-subtitle-hide"),this.options.type==="aribb24"&&this.plugins.aribb24Caption&&this.plugins.aribb24Caption.hide(),this.events.trigger("subtitle_hide")}toggle(){this.container.classList.contains("dplayer-subtitle-hide")?this.show():this.hide()}},Xr=class{constructor(ge){we(this,"elements");this.elements={},this.elements.volume=ge.volumeBar,this.elements.played=ge.playedBar,this.elements.loaded=ge.loadedBar,this.elements.danmaku=ge.danmakuOpacityBar}set(ge,Le,Xe){Le=Math.max(Le,0),Le=Math.min(Le,1),this.elements[ge].style[Xe]=100*Le+"%"}get(ge){return parseFloat(this.elements[ge].style.width)/100}},Rs=class{constructor(ge){we(this,"player");we(this,"types");we(this,"enablefpsChecker");we(this,"enableinfoChecker");we(this,"enableloadingChecker");we(this,"fpsIndex");we(this,"fpsStart");we(this,"fpsChecker");we(this,"infoChecker");we(this,"loadingChecker");this.player=ge,window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(Le){window.setTimeout(Le,1e3/60)},this.types=["loading","info","fps"],this.init()}init(){this.types.map(ge=>(ge!=="fps"&&this[`init${ge}Checker`](),ge))}initloadingChecker(){let ge=0,Le=0,Xe=!1;this.loadingChecker=window.setInterval(()=>{this.enableloadingChecker&&(Le=this.player.video.currentTime,Xe||Le!==ge||this.player.video.paused||(this.player.container.classList.add("dplayer-loading"),Xe=!0),Xe&&Le>ge&&!this.player.video.paused&&(this.player.container.classList.remove("dplayer-loading"),Xe=!1),ge=Le)},100)}initfpsChecker(){window.requestAnimationFrame(()=>{if(this.enablefpsChecker)if(this.initfpsChecker(),this.fpsStart){this.fpsIndex++;const ge=new Date;ge-this.fpsStart>1e3&&(this.player.infoPanel.fps(this.fpsIndex/(ge-this.fpsStart)*1e3),this.fpsStart=new Date,this.fpsIndex=0)}else this.fpsStart=new Date,this.fpsIndex=0;else this.fpsStart=0,this.fpsIndex=0})}initinfoChecker(){this.infoChecker=window.setInterval(()=>{this.enableinfoChecker&&this.player.infoPanel.update()},1e3)}enable(ge){this[`enable${ge}Checker`]=!0,ge==="fps"&&this.initfpsChecker()}disable(ge){this[`enable${ge}Checker`]=!1}destroy(){this.types.map(ge=>(this[`enable${ge}Checker`]=!1,this[`${ge}Checker`]&&window.clearInterval(this[`${ge}Checker`]),ge))}},Ba=class{constructor(ge){we(this,"container");this.container=ge,this.container.addEventListener("animationend",()=>{this.container.classList.remove("dplayer-bezel-transition")})}switch(ge){this.container.innerHTML=ge,this.container.classList.add("dplayer-bezel-transition")}},il=class{constructor(ge){we(this,"container");we(this,"barWidth");we(this,"events");this.container=ge.container,this.barWidth=ge.barWidth,this.container.style.backgroundImage=`url('${ge.url}')`,this.events=ge.events}resize(ge,Le,Xe){this.container.style.width=`${ge}px`,this.container.style.height=`${Le}px`,this.container.style.top=2-Le+"px",this.barWidth=Xe}show(){this.container.style.display="block",this.events&&this.events.trigger("thumbnails_show")}move(ge){this.container.style.backgroundPosition=`-${160*(Math.ceil(ge/this.barWidth*100)-1)}px 0`,this.container.style.left=`${Math.min(Math.max(ge-this.container.offsetWidth/2,-10),this.barWidth-150)}px`}hide(){this.container.style.display="none",this.events&&this.events.trigger("thumbnails_hide")}},pa=class{constructor(ge){we(this,"player");we(this,"disableAutoHide",!1);we(this,"autoHideTimer");we(this,"mobileSkipTimer");we(this,"mobileBackwardTime");we(this,"mobileForwardTime");we(this,"setAutoHideHandler");we(this,"thumbnails",null);this.player=ge,this.autoHideTimer=0,this.mobileSkipTimer=0,this.mobileBackwardTime=0,this.mobileForwardTime=0,this.setAutoHideHandler=()=>this.setAutoHide(),Wt.isMobile?this.player.container.addEventListener("touchmove",this.setAutoHideHandler):(this.player.container.addEventListener("mousemove",this.setAutoHideHandler),this.player.container.addEventListener("click",this.setAutoHideHandler)),this.player.on("play",this.setAutoHideHandler),this.player.on("pause",this.setAutoHideHandler),this.initPlayButton(),this.initThumbnails(),this.initPlayedBar(),this.initFullButton(),this.initPipButton(),this.initSyncButton(),this.initScreenshotButton(),this.initSubtitleButton(),this.initHighlights(),this.initAirplayButton(),Wt.isMobile||this.initVolumeButton()}initPlayButton(){this.player.template.playButton.addEventListener("click",()=>{this.player.toggle()}),this.player.template.mobilePlayButton.addEventListener("click",()=>{this.player.toggle()}),Wt.isMobile?(this.player.template.videoWrap.addEventListener("click",()=>{this.toggle(),this.isShow()&&this.setAutoHide()}),this.player.template.controllerMask.addEventListener("click",()=>{this.toggle(),this.isShow()&&this.setAutoHide()})):(this.player.template.videoWrap.addEventListener("click",()=>{this.player.toggle()}),this.player.template.controllerMask.addEventListener("click",()=>{this.player.toggle()})),this.player.template.mobileBackwardButton.addEventListener("click",()=>{this.mobileBackwardTime+=10,this.player.seek(this.player.video.currentTime-10),this.player.notice(`${this.player.tran("REW")} ${this.mobileBackwardTime.toFixed(0)} ${this.player.tran("s")}`),window.clearTimeout(this.mobileSkipTimer),this.mobileSkipTimer=window.setTimeout(()=>{this.mobileBackwardTime=0},1e3),this.setAutoHide()}),this.player.template.mobileForwardButton.addEventListener("click",()=>{this.mobileForwardTime+=10,this.player.seek(this.player.video.currentTime+10),this.player.notice(`${this.player.tran("FF")} ${this.mobileForwardTime.toFixed(0)} ${this.player.tran("s")}`),window.clearTimeout(this.mobileSkipTimer),this.mobileSkipTimer=window.setTimeout(()=>{this.mobileForwardTime=0},1e3),this.setAutoHide()})}initHighlights(){this.player.on("durationchange",()=>{if(this.player.video.duration!==1&&this.player.video.duration!==1/0&&this.player.options.highlight){const ge=this.player.template.playedBarWrap.querySelectorAll(".dplayer-highlight");[].slice.call(ge,0).forEach(Le=>{this.player.template.playedBarWrap.removeChild(Le)});for(let Le=0;Le{this.thumbnails.resize(160,this.player.video.videoHeight/this.player.video.videoWidth*160,this.player.template.barWrap.offsetWidth)}))}initPlayedBar(){let ge;const Le=ft=>{let _t=((ft.clientX||ft.changedTouches&&ft.changedTouches[0].clientX)-Wt.getBoundingClientRectViewLeft(this.player.template.playedBarWrap))/this.player.template.playedBarWrap.clientWidth;_t=Math.max(_t,0),_t=Math.min(_t,1),this.player.bar.set("played",_t,"width");const Ct=Wt.getVideoDuration(this.player.video,this.player.template);this.player.template.ptime.textContent=Wt.secondToTime(_t*Ct),this.player.container.classList.add("dplayer-seeking"),this.player.video.paused||this.player.video.pause()},Xe=ft=>{document.removeEventListener(Wt.nameMap.dragEnd,Xe),document.removeEventListener(Wt.nameMap.dragMove,Le);let _t=((ft.clientX||ft.changedTouches&&ft.changedTouches[0].clientX)-Wt.getBoundingClientRectViewLeft(this.player.template.playedBarWrap))/this.player.template.playedBarWrap.clientWidth;_t=Math.max(_t,0),_t=Math.min(_t,1),this.player.bar.set("played",_t,"width");const Ct=Wt.getVideoDuration(this.player.video,this.player.template);this.player.seek(this.player.bar.get("played")*Ct),ge||this.player.video.play(),this.player.container.classList.remove("dplayer-seeking")};this.player.template.playedBarWrap.addEventListener(Wt.nameMap.dragStart,()=>{ge=this.player.video.paused,document.addEventListener(Wt.nameMap.dragMove,Le),document.addEventListener(Wt.nameMap.dragEnd,Xe)}),this.player.template.playedBarWrap.addEventListener(Wt.nameMap.dragMove,ft=>{const _t=Wt.getVideoDuration(this.player.video,this.player.template);if(_t){const Ct=this.player.template.playedBarWrap.getBoundingClientRect().left,Pt=(ft.clientX||ft.changedTouches[0].clientX)-Ct;if(Pt<0||Pt>this.player.template.playedBarWrap.offsetWidth)return;const ci=_t*(Pt/this.player.template.playedBarWrap.offsetWidth);Wt.isMobile&&this.thumbnails&&this.thumbnails.show(),this.thumbnails&&this.thumbnails.move(Pt),this.player.template.playedBarTime.style.left=Pt-(ci>=3600?25:20)+"px",this.player.template.playedBarTime.textContent=Wt.secondToTime(ci),this.player.template.playedBarTime.classList.remove("hidden")}}),this.player.template.playedBarWrap.addEventListener(Wt.nameMap.dragEnd,()=>{Wt.isMobile&&this.thumbnails&&this.thumbnails.hide()}),Wt.isMobile||(this.player.template.playedBarWrap.addEventListener("mouseenter",()=>{this.player.video.duration&&(this.thumbnails&&this.thumbnails.show(),this.player.template.playedBarTime.classList.remove("hidden"))}),this.player.template.playedBarWrap.addEventListener("mouseleave",()=>{this.player.video.duration&&(this.thumbnails&&this.thumbnails.hide(),this.player.template.playedBarTime.classList.add("hidden"))}))}initFullButton(){this.player.template.browserFullButton.addEventListener("click",()=>{this.player.fullScreen.toggle("browser")}),this.player.template.webFullButton.addEventListener("click",()=>{this.player.fullScreen.toggle("web")})}initPipButton(){document.pictureInPictureEnabled?this.player.template.pipButton.addEventListener("click",()=>{document.pictureInPictureElement?document.exitPictureInPicture():this.player.video.requestPictureInPicture().catch(ge=>{console.error(ge),this.player.options.lang==="ja"||this.player.options.lang==="ja-jp"?this.player.notice("Picture-in-Picture を開始できませんでした。",void 0,void 0,"#FF6F6A"):this.player.notice("Picture-in-Picture could not be started.",void 0,void 0,"#FF6F6A")})}):this.player.template.pipButton.style.display="none"}initVolumeButton(){const ge=Xe=>{const ft=Xe||window.event,_t=((ft.clientX||ft.changedTouches[0].clientX)-Wt.getBoundingClientRectViewLeft(this.player.template.volumeBarWrap)-5.5)/35;this.player.volume(_t)},Le=()=>{document.removeEventListener(Wt.nameMap.dragEnd,Le),document.removeEventListener(Wt.nameMap.dragMove,ge),this.player.template.volumeButton.classList.remove("dplayer-volume-active")};this.player.template.volumeBarWrapWrap.addEventListener("click",Xe=>{const ft=Xe||window.event,_t=((ft.clientX||ft.changedTouches[0].clientX)-Wt.getBoundingClientRectViewLeft(this.player.template.volumeBarWrap)-5.5)/35;this.player.volume(_t)}),this.player.template.volumeBarWrapWrap.addEventListener(Wt.nameMap.dragStart,()=>{document.addEventListener(Wt.nameMap.dragMove,ge),document.addEventListener(Wt.nameMap.dragEnd,Le),this.player.template.volumeButton.classList.add("dplayer-volume-active")}),this.player.template.volumeButtonIcon.addEventListener("click",()=>{this.player.video.muted?(this.player.video.muted=!1,this.player.switchVolumeIcon(),this.player.bar.set("volume",this.player.volume(),"width")):(this.player.video.muted=!0,this.player.template.volumeIcon.innerHTML=En.volumeOff,this.player.bar.set("volume",0,"width"))})}initSyncButton(){this.player.options.live&&this.player.template.syncButton.addEventListener("click",()=>{this.player.sync()})}initScreenshotButton(){this.player.options.screenshot&&this.player.template.cameraButton.addEventListener("click",()=>{const ge=document.createElement("canvas");ge.width=this.player.video.videoWidth,ge.height=this.player.video.videoHeight,ge.getContext("2d").drawImage(this.player.video,0,0,ge.width,ge.height),ge.toBlob(Le=>{if(Le===null)return;const Xe=new Date,ft=`Capture_${Xe.getFullYear()}${("0"+(Xe.getMonth()+1)).slice(-2)}${("0"+Xe.getDate()).slice(-2)}-${("0"+Xe.getHours()).slice(-2)}${("0"+Xe.getMinutes()).slice(-2)}${("0"+Xe.getSeconds()).slice(-2)}.jpg`,_t=URL.createObjectURL(Le),Ct=document.createElement("a");Ct.download!==void 0?(Ct.download=ft,Ct.href=_t,Ct.click(),URL.revokeObjectURL(_t),this.player.events.trigger("screenshot",Le)):this.player.notice("Error: Screenshot download is not supported.",void 0,void 0,"#FF6F6A")},"image/jpeg",1)})}initAirplayButton(){this.player.options.airplay&&(window.WebKitPlaybackTargetAvailabilityEvent?this.player.video.addEventListener("webkitplaybacktargetavailabilitychanged",(function(ge){ge.availability==="available"?this.template.airplayButton.disable=!1:this.template.airplayButton.disable=!0,this.template.airplayButton.addEventListener("click",(function(){this.video.webkitShowPlaybackTargetPicker()}).bind(this))}).bind(this.player)):this.player.template.airplayButton.style.display="none")}initSubtitleButton(){this.player.options.subtitle&&(this.player.events.on("subtitle_show",()=>{this.player.template.subtitleButton.ariaLabel=this.player.tran("Hide subtitle"),this.player.template.subtitleButtonInner.style.opacity="",this.player.user.set("subtitle",1)}),this.player.events.on("subtitle_hide",()=>{this.player.template.subtitleButton.ariaLabel=this.player.tran("Show subtitle"),this.player.template.subtitleButtonInner.style.opacity="0.4",this.player.user.set("subtitle",0)}),this.player.template.subtitleButton.addEventListener("click",()=>{this.player.subtitle!==null&&this.player.subtitle.toggle()}))}setAutoHide(ge=3e3){this.show(),window.clearTimeout(this.autoHideTimer),this.autoHideTimer=window.setTimeout(()=>{!this.player.video.played.length||this.player.paused||this.disableAutoHide||this.hide()},ge)}show(){this.player.container.classList.remove("dplayer-hide-controller")}hide(){this.player.container.classList.add("dplayer-hide-controller"),this.player.setting.hide(),this.player.comment&&this.player.comment.hide()}isShow(){return!this.player.container.classList.contains("dplayer-hide-controller")}toggle(){this.isShow()?this.hide():this.show()}destroy(){Wt.isMobile?this.player.container.removeEventListener("touchmove",this.setAutoHideHandler):(this.player.container.removeEventListener("mousemove",this.setAutoHideHandler),this.player.container.removeEventListener("click",this.setAutoHideHandler)),window.clearTimeout(this.autoHideTimer)}},ma=class{constructor(ge){we(this,"player");we(this,"loop");we(this,"showDanmaku");we(this,"unlimitDanmaku");we(this,"currentAudio","primary");we(this,"resizeObserver");this.player=ge,this.player.template.mask.addEventListener("click",()=>{this.hide()}),this.player.template.settingButton.addEventListener("click",()=>{this.show()});const Le=()=>{const Xe=this.player.template.settingOriginPanel.scrollHeight;this.player.template.settingBox.style.clipPath=`inset(calc(100% - ${Xe}px) 0 0 round 7px)`};if(Le(),this.resizeObserver=new ResizeObserver(Le),this.resizeObserver.observe(this.player.template.settingOriginPanel),this.player.options.video.quality){this.player.template.quality.addEventListener("click",()=>{this.player.template.settingBox.classList.add("dplayer-setting-box-quality")}),this.player.template.qualityHeader.addEventListener("click",()=>{this.player.template.settingBox.classList.remove("dplayer-setting-box-quality")});for(let Xe=0;Xe{this.player.switchingQuality||this.player.switchQuality(parseInt(this.player.template.qualityItem[Xe].dataset.index))})}this.player.template.speed.addEventListener("click",()=>{this.player.template.settingBox.classList.add("dplayer-setting-box-speed")}),this.player.template.speedHeader.addEventListener("click",()=>{this.player.template.settingBox.classList.remove("dplayer-setting-box-speed")});for(let Xe=0;Xe{this.player.speed(parseFloat(ft.target.dataset.speed))});this.player.template.audio.addEventListener("click",()=>{this.player.template.settingBox.classList.add("dplayer-setting-box-audio")}),this.player.template.audioHeader.addEventListener("click",()=>{this.player.template.settingBox.classList.remove("dplayer-setting-box-audio")});for(let Xe=0;Xe{if(this.player.plugins.mpegts||this.player.plugins.liveLLHLSForKonomiTV){if(this.player.template.audioItem[Xe].dataset.audio===this.currentAudio)return;this.player.template.audioItem[Xe].dataset.audio==="primary"?(this.currentAudio="primary",this.player.template.audioItem[0].classList.add("dplayer-setting-audio-current"),this.player.template.audioItem[1].classList.remove("dplayer-setting-audio-current"),this.player.template.audioValue.textContent=this.player.tran("Primary audio"),window.mpegts&&this.player.plugins.mpegts&&this.player.plugins.mpegts instanceof window.mpegts.MSEPlayer?this.player.plugins.mpegts.switchPrimaryAudio():this.player.plugins.liveLLHLSForKonomiTV&&this.player.plugins.liveLLHLSForKonomiTV.switchPrimaryAudio()):this.player.template.audioItem[Xe].dataset.audio==="secondary"&&(this.currentAudio="secondary",this.player.template.audioItem[0].classList.remove("dplayer-setting-audio-current"),this.player.template.audioItem[1].classList.add("dplayer-setting-audio-current"),this.player.template.audioValue.textContent=this.player.tran("Secondary audio"),window.mpegts&&this.player.plugins.mpegts&&this.player.plugins.mpegts instanceof window.mpegts.MSEPlayer?this.player.plugins.mpegts.switchSecondaryAudio():this.player.plugins.liveLLHLSForKonomiTV&&this.player.plugins.liveLLHLSForKonomiTV.switchSecondaryAudio()),this.player.template.settingBox.classList.remove("dplayer-setting-box-audio")}});if(this.loop=this.player.options.loop,this.player.template.loopToggle.checked=this.loop,this.player.template.loop.addEventListener("click",()=>{this.player.template.loopToggle.checked=!this.player.template.loopToggle.checked,this.player.template.loopToggle.checked?this.loop=!0:this.loop=!1}),this.showDanmaku=this.player.user.get("danmaku")===1,this.showDanmaku||this.player.danmaku&&this.player.danmaku.hide(),this.player.template.showDanmakuToggle.checked=this.showDanmaku,this.player.template.showDanmaku.addEventListener("click",()=>{this.player.template.showDanmakuToggle.checked=!this.player.template.showDanmakuToggle.checked,this.player.template.showDanmakuToggle.checked?(this.showDanmaku=!0,this.player.danmaku!==null&&this.player.danmaku.show()):(this.showDanmaku=!1,this.player.danmaku!==null&&this.player.danmaku.hide()),this.player.user.set("danmaku",this.showDanmaku?1:0)}),this.unlimitDanmaku=this.player.user.get("unlimited")===1,this.player.template.unlimitDanmakuToggle.checked=this.unlimitDanmaku,this.player.template.unlimitDanmaku.addEventListener("click",()=>{this.player.template.unlimitDanmakuToggle.checked=!this.player.template.unlimitDanmakuToggle.checked,this.player.template.unlimitDanmakuToggle.checked?(this.unlimitDanmaku=!0,this.player.danmaku!==null&&this.player.danmaku.unlimit(!0)):(this.unlimitDanmaku=!1,this.player.danmaku!==null&&this.player.danmaku.unlimit(!1)),this.player.user.set("unlimited",this.unlimitDanmaku?1:0)}),this.player.danmaku){this.player.on("danmaku_opacity",Ct=>{this.player.bar.set("danmaku",Ct,"width"),this.player.user.set("opacity",Ct),this.player.template.danmakuOpacityValue.textContent=Ct.toFixed(1)}),this.player.danmaku.opacity(this.player.user.get("opacity")),this.player.template.danmakuOpacityValue.textContent=this.player.user.get("opacity").toFixed(1);const ft=Ct=>{const Pt=Ct||window.event;let ci=((Pt.clientX||Pt.changedTouches[0].clientX)-Wt.getBoundingClientRectViewLeft(this.player.template.danmakuOpacityBarWrap))/190;ci=Math.max(ci,0),ci=Math.min(ci,1),this.player.danmaku!==null&&this.player.danmaku.opacity(ci)},_t=()=>{document.removeEventListener(Wt.nameMap.dragEnd,_t),document.removeEventListener(Wt.nameMap.dragMove,ft),this.player.template.danmakuOpacityBox.classList.remove("dplayer-setting-danmaku-active")};this.player.template.danmakuOpacityBarWrapWrap.addEventListener("click",Ct=>{const Pt=Ct||window.event;let ci=((Pt.clientX||Pt.changedTouches[0].clientX)-Wt.getBoundingClientRectViewLeft(this.player.template.danmakuOpacityBarWrap))/190;ci=Math.max(ci,0),ci=Math.min(ci,1),this.player.danmaku!==null&&this.player.danmaku.opacity(ci)}),this.player.template.danmakuOpacityBarWrapWrap.addEventListener(Wt.nameMap.dragStart,()=>{document.addEventListener(Wt.nameMap.dragMove,ft),document.addEventListener(Wt.nameMap.dragEnd,_t),this.player.template.danmakuOpacityBox.classList.add("dplayer-setting-danmaku-active")})}}hide(){this.player.template.container.classList.remove("dplayer-show-controller"),this.player.template.settingBox.classList.remove("dplayer-setting-box-open"),this.player.template.mask.classList.remove("dplayer-mask-show"),window.setTimeout(()=>{this.player.template.settingBox.classList.remove("dplayer-setting-box-speed"),this.player.template.settingBox.classList.remove("dplayer-setting-box-audio")},300),this.player.controller.disableAutoHide=!1}show(){this.player.template.container.classList.add("dplayer-show-controller"),this.player.template.settingBox.classList.add("dplayer-setting-box-open"),this.player.template.mask.classList.add("dplayer-mask-show"),this.player.controller.disableAutoHide=!0}destroy(){this.resizeObserver.disconnect()}},nl=class{constructor(ge){we(this,"player");this.player=ge,this.player.template.mask.addEventListener("click",()=>{this.hide()}),this.player.template.commentButton.addEventListener("click",()=>{this.show()}),this.player.template.commentSettingButton.addEventListener("click",()=>{this.toggleSetting()}),this.player.template.commentColorSettingBox.addEventListener("click",()=>{if(this.player.template.commentColorSettingBox.querySelector("input:checked+span")){const Le=this.player.template.commentColorSettingBox.querySelector("input:checked").value;this.player.template.commentSettingFill.style.fill=Le,this.player.template.commentInput.style.color=Le,this.player.template.commentSendFill.style.fill=Le}}),this.player.template.commentInput.addEventListener("click",()=>{this.hideSetting()}),this.player.template.commentInput.addEventListener("keydown",Le=>{(Le||window.event).keyCode===13&&this.send()}),this.player.template.commentSendButton.addEventListener("click",()=>{this.send()})}show(){this.player.controller.disableAutoHide=!0,this.player.template.controller.classList.add("dplayer-controller-comment"),this.player.template.mask.classList.add("dplayer-mask-show"),this.player.container.classList.add("dplayer-show-controller"),this.player.template.commentInput.focus()}hide(){this.player.template.controller.classList.remove("dplayer-controller-comment"),this.player.template.mask.classList.remove("dplayer-mask-show"),this.player.container.classList.remove("dplayer-show-controller"),this.player.controller.disableAutoHide=!1,this.hideSetting()}showSetting(){this.player.template.commentSettingBox.classList.add("dplayer-comment-setting-open")}hideSetting(){this.player.template.commentSettingBox.classList.remove("dplayer-comment-setting-open")}toggleSetting(){this.player.template.commentSettingBox.classList.contains("dplayer-comment-setting-open")?this.hideSetting():this.showSetting()}send(){var ge;((ge=this.player.options.danmaku)==null?void 0:ge.closeCommentFormAfterSend)===!0&&this.player.template.commentInput.blur(),this.player.template.commentInput.value.replace(/^\s+|\s+$/g,"")?(this.player.danmaku!==null&&this.player.danmaku.send({text:this.player.template.commentInput.value,color:this.player.container.querySelector(".dplayer-comment-setting-color input:checked").value,type:this.player.container.querySelector(".dplayer-comment-setting-type input:checked").value,size:this.player.container.querySelector(".dplayer-comment-setting-size input:checked").value},()=>{var Le;((Le=this.player.options.danmaku)==null?void 0:Le.closeCommentFormAfterSend)===!0&&(this.hide(),this.player.controller.setAutoHide(750))},!0),this.player.template.commentInput.value=""):this.player.notice(this.player.tran("Please input danmaku content!"),void 0,void 0,"#FF6F6A")}},Is=class{constructor(ge){we(this,"player");we(this,"doHotKeyHandler");we(this,"cancelFullScreenHandler");this.player=ge,this.doHotKeyHandler=this.doHotKey.bind(this),this.cancelFullScreenHandler=this.cancelFullScreen.bind(this),this.player.options.hotkey&&document.addEventListener("keydown",this.doHotKeyHandler),document.addEventListener("keydown",this.cancelFullScreenHandler)}doHotKey(ge){var ft,_t;const Le=(ft=document.activeElement)==null?void 0:ft.tagName.toUpperCase(),Xe=(_t=document.activeElement)==null?void 0:_t.getAttribute("contenteditable");if(Le!=="INPUT"&&Le!=="TEXTAREA"&&Xe!==""&&Xe!=="true"){const Ct=ge||window.event;let Pt;switch(Ct.keyCode){case 32:(this.player.focus||this.player.options.hotkey)&&(Ct.preventDefault(),this.player.toggle());break;case 37:(this.player.focus||this.player.options.hotkey)&&(Ct.preventDefault(),Ct.altKey?this.player.seek(this.player.video.currentTime-60):Ct.shiftKey?this.player.seek(this.player.video.currentTime-30):Ct.ctrlKey||Ct.metaKey?this.player.seek(this.player.video.currentTime-15):this.player.seek(this.player.video.currentTime-5),this.player.controller.setAutoHide());break;case 39:(this.player.focus||this.player.options.hotkey)&&(Ct.preventDefault(),Ct.altKey?this.player.seek(this.player.video.currentTime+60):Ct.shiftKey?this.player.seek(this.player.video.currentTime+30):Ct.ctrlKey||Ct.metaKey?this.player.seek(this.player.video.currentTime+15):this.player.seek(this.player.video.currentTime+5),this.player.controller.setAutoHide());break;case 38:this.player.focus&&(Ct.preventDefault(),Pt=this.player.volume()+.1,this.player.volume(Pt));break;case 40:this.player.focus&&(Ct.preventDefault(),Pt=this.player.volume()-.1,this.player.volume(Pt));break;case 70:Ct.ctrlKey||Ct.metaKey||(Ct.preventDefault(),this.player.fullScreen.toggle("browser"));break;case 87:Ct.ctrlKey||Ct.metaKey||(Ct.preventDefault(),this.player.fullScreen.toggle("web"));break;case 76:this.player.options.live&&(Ct.preventDefault(),this.player.sync());break;case 80:this.player.options.pictureInPicture&&document.pictureInPictureEnabled&&(Ct.preventDefault(),this.player.template.pipButton.click());break;case 67:typeof this.player.options.danmaku=="object"&&this.player.options.danmaku&&(Ct.ctrlKey||Ct.metaKey||(Ct.preventDefault(),this.player.controller.show(),this.player.comment!=null&&this.player.comment.show()));break;case 68:typeof this.player.options.danmaku=="object"&&this.player.options.danmaku&&(Ct.ctrlKey||Ct.metaKey||(Ct.preventDefault(),this.player.template.showDanmaku.click(),this.player.template.showDanmakuToggle.checked?this.player.notice(`${this.player.tran("Show comment")}`):this.player.notice(`${this.player.tran("Hide comment")}`)));break;case 83:this.player.options.subtitle&&(Ct.ctrlKey||Ct.metaKey||(Ct.preventDefault(),this.player.subtitle!==null&&(this.player.subtitle.container.classList.contains("dplayer-subtitle-hide")?this.player.notice(`${this.player.tran("Show subtitle")}`):this.player.notice(`${this.player.tran("Hide subtitle")}`),this.player.subtitle.toggle())))}}}cancelFullScreen(ge){(ge||window.event).keyCode===27&&this.player.fullScreen.isFullScreen("web")&&this.player.fullScreen.cancel("web")}destroy(){this.player.options.hotkey&&document.removeEventListener("keydown",this.doHotKeyHandler),document.removeEventListener("keydown",this.cancelFullScreenHandler)}},Na=class{constructor(ge){we(this,"contextmenuHandler");we(this,"player");we(this,"shown");this.player=ge,this.shown=!1,Array.prototype.slice.call(this.player.template.menuItem).forEach((Le,Xe)=>{this.player.options.contextmenu[Xe].click&&Le.addEventListener("click",()=>{const ft=this.player.options.contextmenu[Xe];ft.click&&ft.click(this.player),this.hide()})}),this.contextmenuHandler=Le=>{const Xe=Le||window.event;if(Xe.preventDefault(),this.shown)return void this.hide();const ft=this.player.container.getBoundingClientRect();this.show(Xe.clientX-ft.left,Xe.clientY-ft.top),this.player.template.mask.addEventListener("click",()=>{this.hide()})},this.player.container.addEventListener("contextmenu",this.contextmenuHandler)}show(ge,Le){this.player.template.menu.classList.add("dplayer-menu-show");const Xe=this.player.container.getBoundingClientRect();ge+this.player.template.menu.offsetWidth>=Xe.width?(this.player.template.menu.style.right=Xe.width-ge+"px",this.player.template.menu.style.left="initial"):(this.player.template.menu.style.left=ge+"px",this.player.template.menu.style.right="initial"),Le+this.player.template.menu.offsetHeight>=Xe.height?(this.player.template.menu.style.bottom=Xe.height-Le+"px",this.player.template.menu.style.top="initial"):(this.player.template.menu.style.top=Le+"px",this.player.template.menu.style.bottom="initial"),this.player.template.mask.classList.add("dplayer-mask-show"),this.shown=!0,this.player.events.trigger("contextmenu_show")}hide(){this.player.template.mask.classList.remove("dplayer-mask-show"),this.player.template.menu.classList.remove("dplayer-menu-show"),this.shown=!1,this.player.events.trigger("contextmenu_hide")}destroy(){this.player.container.removeEventListener("contextmenu",this.contextmenuHandler)}},us=class{constructor(ge){we(this,"player");we(this,"container");we(this,"template");we(this,"video");we(this,"beginTime",0);this.player=ge,this.container=ge.template.infoPanel,this.template=ge.template,this.video=ge.video,this.template.infoPanelClose.addEventListener("click",()=>{this.hide()})}show(){this.beginTime=Date.now(),this.update(),this.player.timer.enable("info"),this.player.timer.enable("fps"),this.container.classList.remove("dplayer-info-panel-hide")}hide(){this.player.timer.disable("info"),this.player.timer.disable("fps"),this.container.classList.add("dplayer-info-panel-hide")}toggle(){this.container.classList.contains("dplayer-info-panel-hide")?this.show():this.hide()}update(){var ge;if(this.template.infoVersion.textContent="v1.31.2 7131b6b",this.template.infoType.textContent=this.player.type,this.template.infoUrl.textContent=this.player.options.video.url??"N/A",this.template.infoResolution.textContent=`${this.player.video.videoWidth} x ${this.player.video.videoHeight}`,this.template.infoDuration.textContent=`${this.player.video.duration}`,this.player.video.getVideoPlaybackQuality!=null){const Le=this.player.video.getVideoPlaybackQuality();this.template.infoDroppedFrames.textContent=`${Le.droppedVideoFrames} / ${Le.totalVideoFrames}`}else if(this.player.video.webkitDecodedFrameCount!=null){const Le=this.player.video.webkitDecodedFrameCount,Xe=this.player.video.webkitDroppedFrameCount;this.template.infoDroppedFrames.textContent=`${Xe} / ${Le}`}else this.template.infoDroppedFrames.textContent="N/A";if(this.player.video.buffered.length>0){const Le=this.player.video.buffered.length,Xe=this.player.video.buffered.end(Le-1)-this.player.video.currentTime;this.template.infoBufferRemain.textContent=`${Xe.toFixed(3)} s`}else this.template.infoBufferRemain.textContent="N/A";if(this.player.type==="mpegts"||this.player.type==="flv"){const Le=this.player.plugins.mpegts||this.player.plugins.flvjs;if(Le){const Xe=Le.mediaInfo,ft=Le.statisticsInfo;this.template.infoMimeType.textContent=Xe.mimeType??"N/A",this.template.infoVideoFPS.textContent=`${((ge=Xe.fps)==null?void 0:ge.toFixed(3))??"N/A"}`,ft.speed!=null?this.template.infoDownloadSpeed.textContent=`${ft.speed.toFixed(3)} KB/s`:this.template.infoDownloadSpeed.textContent="N/A"}}else this.template.infoMimeType.textContent="N/A",this.template.infoVideoFPS.textContent="N/A",this.template.infoDownloadSpeed.textContent="N/A"}fps(ge){this.template.infoPageFPS.textContent=`${ge.toFixed(1)}`}};var Fa=A(953),$r=A.n(Fa);let es=0;const ts=[],Ls=class{constructor(ge){we(this,"bar");we(this,"bezel");we(this,"comment",null);we(this,"contextmenu");we(this,"controller");we(this,"danmaku",null);we(this,"events");we(this,"fullScreen");we(this,"hotkey");we(this,"infoPanel");we(this,"setting");we(this,"subtitle",null);we(this,"template");we(this,"timer");we(this,"user");we(this,"container");we(this,"containerClickFun");we(this,"docClickFun");we(this,"focus",!1);we(this,"narrow",!1);we(this,"noticeTime",null);we(this,"options");we(this,"paused",!1);we(this,"plugins");we(this,"prevVideoCurrentTime",0);we(this,"prevVideo",null);we(this,"quality",null);we(this,"qualityIndex",null);we(this,"switchingQuality",!1);we(this,"resizeObserver");we(this,"tran");we(this,"type","auto");we(this,"video");this.options=(Le=>{const Xe={container:Le.container||document.querySelector(".dplayer")||void 0,live:!1,liveSyncMinBufferSize:.8,syncWhenPlayingLive:!0,autoplay:!1,theme:"#b7daff",loop:!1,lang:navigator.language.toLowerCase(),screenshot:!1,pictureInPicture:!0,airplay:!0,hotkey:!0,preload:"metadata",crossOrigin:null,volume:1,playbackSpeed:[.25,.5,.75,1,1.25,1.5,1.75,2],apiBackend:oi,video:{},contextmenu:[],mutex:!0,pluginOptions:{}};for(const ft in Xe)Object.prototype.hasOwnProperty.call(Xe,ft)&&!Object.prototype.hasOwnProperty.call(Le,ft)&&(Le[ft]=Xe[ft]);return Le.video&&!Le.video.type&&(Le.video.type="auto"),typeof Le.danmaku=="object"&&Le.danmaku&&(!Le.danmaku.user&&(Le.danmaku.user="DPlayer"),!Le.danmaku.speedRate&&(Le.danmaku.speedRate=1),!Le.danmaku.fontSize&&(Le.danmaku.fontSize=35),Le.danmaku.closeCommentFormAfterSend!==!1&&(Le.danmaku.closeCommentFormAfterSend=!0)),Le.subtitle&&(!Le.subtitle.type&&(Le.subtitle.type="webvtt"),!Le.subtitle.fontSize&&(Le.subtitle.fontSize="20px"),!Le.subtitle.bottom&&(Le.subtitle.bottom="40px"),!Le.subtitle.color&&(Le.subtitle.color="#fff")),Le.video.quality&&(typeof Le.video.defaultQuality=="string"&&(Le.video.quality.forEach((ft,_t)=>{Le.video.defaultQuality===ft.name&&(Le.video.defaultQuality=_t)}),typeof Le.video.defaultQuality=="string"&&(Le.video.defaultQuality=0)),Le.video.defaultQuality===void 0&&(Le.video.defaultQuality=0),Le.video.type=Le.video.quality[Le.video.defaultQuality].type,Le.video.url=Le.video.quality[Le.video.defaultQuality].url),Le.lang&&(Le.lang=Le.lang.toLowerCase()),Le.contextmenu=Le.contextmenu.concat([{text:"Video info",click:ft=>{ft.infoPanel.toggle()}},{text:"DPlayer v1.31.2",link:"https://github.com/tsukumijima/DPlayer"}]),{container:Le.container,live:Le.live,liveSyncMinBufferSize:Le.liveSyncMinBufferSize,syncWhenPlayingLive:Le.syncWhenPlayingLive,autoplay:Le.autoplay,theme:Le.theme,loop:Le.loop,lang:Le.lang,screenshot:Le.screenshot,pictureInPicture:Le.pictureInPicture,airplay:Le.airplay,hotkey:Le.hotkey,preload:Le.preload,crossOrigin:Le.crossOrigin,volume:Le.volume,playbackSpeed:Le.playbackSpeed,logo:Le.logo,apiBackend:Le.apiBackend,video:Le.video,subtitle:Le.subtitle,danmaku:Le.danmaku,contextmenu:Le.contextmenu,highlight:Le.highlight,mutex:Le.mutex,pluginOptions:Le.pluginOptions}})({preload:ge.video.type==="webtorrent"?"none":"metadata",...ge}),this.options.video.quality&&(this.qualityIndex=this.options.video.defaultQuality,this.quality=this.options.video.quality[this.options.video.defaultQuality]),this.tran=new ui(this.options.lang).tran,this.events=new tl,this.user=new Er(this),this.container=this.options.container,this.container.classList.add("dplayer"),this.options.danmaku||this.container.classList.add("dplayer-no-danmaku"),this.options.live?this.container.classList.add("dplayer-live"):this.container.classList.remove("dplayer-live"),Wt.isMobile&&this.container.classList.add("dplayer-mobile"),this.narrow=this.container.offsetWidth<=500,this.narrow&&this.container.classList.add("dplayer-narrow"),this.resizeObserver=new ResizeObserver(Le=>{for(const Xe of Le)Xe.target===this.container&&(this.narrow=this.container.offsetWidth<=500,this.narrow?this.container.classList.add("dplayer-narrow"):this.container.classList.remove("dplayer-narrow"))}),this.resizeObserver.observe(this.container),this.template=new ha({container:this.container,options:this.options,index:es,tran:this.tran}),this.video=this.template.video,this.bar=new Xr(this.template),this.bezel=new Ba(this.template.bezel),this.fullScreen=new fa(this),this.controller=new pa(this),this.options.danmaku&&(this.danmaku=new el({player:this,container:this.template.danmaku,opacity:this.user.get("opacity"),callback:()=>{setTimeout(()=>{this.template.danmakuLoading.style.display="none",this.options.autoplay&&this.play()},0)},error:Le=>{this.notice(Le,void 0,void 0,"#FF6F6A")},apiBackend:this.options.apiBackend,borderColor:this.options.theme,fontSize:this.options.danmaku.fontSize,time:()=>this.video.currentTime,unlimited:this.user.get("unlimited"),speedRate:this.options.danmaku.speedRate,api:{id:this.options.danmaku.id,address:this.options.danmaku.api,token:this.options.danmaku.token,maximum:this.options.danmaku.maximum,addition:this.options.danmaku.addition,user:this.options.danmaku.user},events:this.events,tran:Le=>this.tran(Le)}),this.comment=new nl(this)),this.plugins={},this.docClickFun=()=>{this.focus=!1},this.containerClickFun=()=>{this.focus=!0},document.addEventListener("click",this.docClickFun,!0),this.container.addEventListener("click",this.containerClickFun,!0),this.paused=!0,this.timer=new Rs(this),this.hotkey=new Is(this),this.contextmenu=new Na(this),this.initVideo(this.video,this.quality&&this.quality.type||this.options.video.type),this.setting=new ma(this),this.infoPanel=new us(this),!this.danmaku&&this.options.autoplay&&this.play(),es++,ts.push(this)}seek(ge){ge=Math.max(ge,0);const Le=Wt.getVideoDuration(this.video,this.template);Le&&(ge=Math.min(ge,Le)),this.video.currentTimege&&this.notice(`${this.tran("REW")} ${(this.video.currentTime-ge).toFixed(0)} ${this.tran("s")}`),isFinite(ge)&&(this.video.currentTime=ge),this.danmaku&&this.danmaku.seek(),this.bar.set("played",ge/Le,"width"),this.template.ptime.textContent=Wt.secondToTime(ge)}sync(ge=!1){if(this.options.live){const Le=Wt.getVideoDuration(this.video,this.template)-this.options.liveSyncMinBufferSize;try{this.video.currentTime=Le}catch{return}this.danmaku&&this.danmaku.seek(),this.template.ptime.textContent=Wt.secondToTime(Le),ge||this.notice(this.tran("Synchronized"))}}play(ge=!1){if(this.paused=!1,this.video.paused&&!Wt.isMobile&&this.bezel.switch(En.play),this.template.playButton.innerHTML=En.pause,this.template.mobilePlayButton.innerHTML=En.pause,this.options.live&&this.options.syncWhenPlayingLive&&this.sync(!0),!ge){const Le=this.type==="mpegts"&&this.plugins.mpegts&&this.plugins.mpegts.play.bind(this.plugins.mpegts)||this.video.play.bind(this.video);Promise.resolve(Le()).catch(()=>{this.pause()}).then(()=>{})}if(this.timer.enable("loading"),this.container.classList.remove("dplayer-paused"),this.container.classList.add("dplayer-playing"),this.danmaku&&this.danmaku.play(),this.options.mutex)for(let Le=0;Le=.95?this.template.volumeIcon.innerHTML=En.volumeUp:this.volume()>0?this.template.volumeIcon.innerHTML=En.volumeDown:this.template.volumeIcon.innerHTML=En.volumeOff}volume(ge=NaN,Le=!1,Xe=!1){if(typeof ge=="string"&&(ge=parseFloat(ge)),!isNaN(ge)){ge=Math.max(ge,0),ge=Math.min(ge,1),this.bar.set("volume",ge,"width");const ft=`${(100*ge).toFixed(0)}%`;this.template.volumeBarWrapWrap.ariaLabel=ft,Le||this.user.set("volume",ge),Xe||this.notice(`${this.tran("Volume")} ${(100*ge).toFixed(0)}%`),this.video.volume=ge,this.video.muted&&(this.video.muted=!1),this.switchVolumeIcon()}return this.video.volume}toggle(){this.video.paused?this.play():this.pause()}on(ge,Le,Xe=!1){this.events.on(ge,Le,Xe)}off(ge,Le){this.events.off(ge,Le)}switchVideo(ge,Le){this.pause(),this.video.poster=ge.pic?ge.pic:"",this.video.src=ge.url,this.initMSE(this.video,ge.type||"auto"),Le&&(this.template.danmakuLoading.style.display="block",this.bar.set("played",0,"width"),this.bar.set("loaded",0,"width"),this.template.ptime.textContent="00:00",this.template.danmaku.innerHTML="",this.danmaku&&this.danmaku.reload({id:Le.id,address:Le.api,token:Le.token,maximum:Le.maximum,addition:Le.addition,user:Le.user}))}initMSE(ge,Le){if(this.type=Le,this.options.video.customType&&this.options.video.customType[Le])Object.prototype.toString.call(this.options.video.customType[Le])==="[object Function]"?this.options.video.customType[Le](this.video,this):console.error(`Illegal customType: ${Le}`);else switch(this.type==="auto"&&(/m3u8(#|\?|$)/i.exec(ge.src)?this.type="hls":/.ts(#|\?|$)/i.exec(ge.src)?this.type="mpegts":/.flv(#|\?|$)/i.exec(ge.src)?this.type="flv":/.mpd(#|\?|$)/i.exec(ge.src)?this.type="dash":this.type="normal"),this.type!=="mpegts"&&this.type!=="live-llhls-for-KonomiTV"&&this.container.classList.add("dplayer-no-audio-switching"),this.type){case"hls":if(window.Hls){const Xe=/Safari/i.test(navigator.userAgent)&&/iPad|Macintosh/i.test(navigator.userAgent)&&"ontouchend"in document&&(ge.canPlayType("application/x-mpegURL")||ge.canPlayType("application/vnd.apple.mpegURL"));if(window.Hls.isSupported()&&!Xe){this.plugins.hls&&(this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose),this.plugins.hls.destroy(),delete this.plugins.hls);const ft=this.options.pluginOptions.hls,_t=new window.Hls(ft);if(this.plugins.hls=_t,_t.loadSource(ge.src),_t.attachMedia(ge),this.events.on("destroy",()=>{this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose),_t.destroy(),delete this.plugins.hls}),this.options.subtitle&&this.options.subtitle.type==="aribb24"){this.options.pluginOptions.aribb24===void 0&&(this.options.pluginOptions.aribb24={}),this.options.pluginOptions.aribb24.enableAutoInBandMetadataTextTrackDetection=!1;const Ct=this.options.pluginOptions.aribb24,Pt=this.plugins.aribb24Caption=new Mt.CanvasRenderer({...Ct,data_identifier:128});if(Pt.attachMedia(ge),Pt.show(),this.options.pluginOptions.aribb24.disableSuperimposeRenderer!==!0){const ci=this.plugins.aribb24Superimpose=new Mt.CanvasRenderer({...Ct,data_identifier:129});ci.attachMedia(ge),ci.show()}_t.on(window.Hls.Events.FRAG_PARSING_METADATA,(ci,hi)=>{for(const Xt of hi.samples)this.plugins.aribb24Caption&&this.plugins.aribb24Caption.pushID3v2Data(Xt.pts,Xt.data),this.plugins.aribb24Superimpose&&this.plugins.aribb24Superimpose.pushID3v2Data(Xt.pts,Xt.data)})}}else if(ge.canPlayType("application/x-mpegURL")||ge.canPlayType("application/vnd.apple.mpegURL")){if(this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose),this.events.on("destroy",()=>{this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose)}),this.options.subtitle&&this.options.subtitle.type==="aribb24"){this.options.pluginOptions.aribb24===void 0&&(this.options.pluginOptions.aribb24={}),this.options.pluginOptions.aribb24.enableAutoInBandMetadataTextTrackDetection=!0;const ft=this.options.pluginOptions.aribb24,_t=this.plugins.aribb24Caption=new Mt.CanvasRenderer({...ft,data_identifier:128});if(_t.attachMedia(ge),_t.show(),this.options.pluginOptions.aribb24.disableSuperimposeRenderer!==!0){const Ct=this.plugins.aribb24Superimpose=new Mt.CanvasRenderer({...ft,data_identifier:129});Ct.attachMedia(ge),Ct.show()}}}else this.notice("Error: HLS is not supported.",void 0,void 0,"#FF6F6A")}else this.notice("Error: Can't find hls.js.",void 0,void 0,"#FF6F6A");break;case"live-llhls-for-KonomiTV":this.plugins.liveLLHLSForKonomiTV&&(this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose),jt.delete(`${this.plugins.liveLLHLSForKonomiTV.baseUrl}/${this.plugins.liveLLHLSForKonomiTV.clientId}`),delete this.plugins.liveLLHLSForKonomiTV),(async()=>{const Xe=this.quality!==null?this.quality.url:this.options.video.url,ft=(await jt.post(Xe)).data.client_id,_t=(Pt=!1)=>{let ci=Xe.replace("/ll-hls",`/ll-hls/${ft}/primary-audio/playlist.m3u8`);if(Pt===!0&&(ci=Xe.replace("/ll-hls",`/ll-hls/${ft}/secondary-audio/playlist.m3u8`)),ge.src===ci)return;const hi=ge.paused;if(ge.src=ci,ge.load(),this.plugins.aribb24Caption&&this.plugins.aribb24Caption.dispose(),this.plugins.aribb24Superimpose&&this.plugins.aribb24Superimpose.dispose(),this.options.subtitle&&this.options.subtitle.type==="aribb24"){this.options.pluginOptions.aribb24===void 0&&(this.options.pluginOptions.aribb24={}),this.options.pluginOptions.aribb24.enableAutoInBandMetadataTextTrackDetection=!0;const Xt=this.options.pluginOptions.aribb24,_i=this.plugins.aribb24Caption=new Mt.CanvasRenderer({...Xt,data_identifier:128});if(_i.attachMedia(ge),_i.show(),this.options.pluginOptions.aribb24.disableSuperimposeRenderer!==!0){const Ui=this.plugins.aribb24Superimpose=new Mt.CanvasRenderer({...Xt,data_identifier:129});Ui.attachMedia(ge),Ui.show()}}hi||ge.play()},Ct={baseUrl:Xe,clientId:ft,switchPrimaryAudio(){_t(!1)},switchSecondaryAudio(){_t(!0)}};this.plugins.liveLLHLSForKonomiTV=Ct,_t(!1),this.events.on("destroy",()=>{this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose),jt.delete(`${Ct.baseUrl}/${Ct.clientId}`),delete this.plugins.liveLLHLSForKonomiTV})})();break;case"mpegts":if(window.mpegts)if(window.mpegts.isSupported()){this.plugins.mpegts&&(this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose),this.plugins.mpegts.unload(),this.plugins.mpegts.detachMediaElement(),this.plugins.mpegts.destroy(),delete this.plugins.mpegts),this.options.pluginOptions.mpegts===void 0&&(this.options.pluginOptions.mpegts={});const Xe=window.mpegts.createPlayer(Object.assign(this.options.pluginOptions.mpegts.mediaDataSource||{},{type:"mpegts",isLive:this.options.live,url:ge.src}),this.options.pluginOptions.mpegts.config);if(this.plugins.mpegts=Xe,Xe.attachMediaElement(ge),Xe.load(),this.events.on("destroy",()=>{this.plugins.aribb24Caption&&(this.plugins.aribb24Caption.dispose(),delete this.plugins.aribb24Caption),this.plugins.aribb24Superimpose&&(this.plugins.aribb24Superimpose.dispose(),delete this.plugins.aribb24Superimpose),Xe.unload(),Xe.detachMediaElement(),Xe.destroy(),delete this.plugins.mpegts}),this.options.subtitle&&this.options.subtitle.type==="aribb24"){this.options.pluginOptions.aribb24===void 0&&(this.options.pluginOptions.aribb24={}),this.options.pluginOptions.aribb24.enableAutoInBandMetadataTextTrackDetection=!1;const ft=this.options.pluginOptions.aribb24,_t=this.plugins.aribb24Caption=new Mt.CanvasRenderer({...ft,data_identifier:128});if(_t.attachMedia(ge),_t.show(),this.options.pluginOptions.aribb24.disableSuperimposeRenderer!==!0){const Ct=this.plugins.aribb24Superimpose=new Mt.CanvasRenderer({...ft,data_identifier:129});Ct.attachMedia(ge),Ct.show()}Xe.on(window.mpegts.Events.TIMED_ID3_METADATA_ARRIVED,Ct=>{this.plugins.aribb24Caption&&this.plugins.aribb24Caption.pushID3v2Data(Ct.pts/1e3,Ct.data),this.plugins.aribb24Superimpose&&this.plugins.aribb24Superimpose.pushID3v2Data(Ct.pts/1e3,Ct.data)})}}else this.notice("Error: mpegts.js is not supported.",void 0,void 0,"#FF6F6A");else this.notice("Error: Can't find mpegts.js.",void 0,void 0,"#FF6F6A");break;case"flv":if(window.flvjs)if(window.flvjs.isSupported()){this.options.pluginOptions.flv===void 0&&(this.options.pluginOptions.flv={});const Xe=window.flvjs.createPlayer(Object.assign(this.options.pluginOptions.flv.mediaDataSource||{},{type:"flv",url:ge.src}),this.options.pluginOptions.flv.config);this.plugins.flvjs=Xe,Xe.attachMediaElement(ge),Xe.load(),this.events.on("destroy",()=>{Xe.unload(),Xe.detachMediaElement(),Xe.destroy(),delete this.plugins.flvjs})}else this.notice("Error: flv.js is not supported.",void 0,void 0,"#FF6F6A");else this.notice("Error: Can't find flv.js.",void 0,void 0,"#FF6F6A");break;case"dash":if(window.dashjs){const Xe=window.dashjs.MediaPlayer().create();Xe.initialize(ge,ge.src,!1);const ft=this.options.pluginOptions.dash;Xe.updateSettings(ft??{}),this.plugins.dash=Xe,this.events.on("destroy",()=>{Xe.reset(),delete this.plugins.dash})}else this.notice("Error: Can't find dash.js.",void 0,void 0,"#FF6F6A");break;case"webtorrent":if(window.WebTorrent)if(window.WebTorrent.WEBRTC_SUPPORT){this.container.classList.add("dplayer-loading");const Xe=this.options.pluginOptions.webtorrent,ft=new window.WebTorrent(Xe);this.plugins.webtorrent=ft;const _t=ge.src;ge.src="",ge.preload="metadata",ge.addEventListener("durationchange",()=>this.container.classList.remove("dplayer-loading"),{once:!0}),ft.add(_t,Ct=>{const Pt=Ct.files.find(ci=>ci.name.endsWith(".mp4"));Pt&&Pt.renderTo(this.video,{autoplay:this.options.autoplay,controls:!1})}),this.events.on("destroy",()=>{ft.remove(_t),ft.destroy(),delete this.plugins.webtorrent})}else this.notice("Error: Webtorrent is not supported.",void 0,void 0,"#FF6F6A");else this.notice("Error: Can't find Webtorrent.",void 0,void 0,"#FF6F6A")}}initVideo(ge,Le){this.initMSE(ge,Le),this.on("durationchange",()=>{ge.duration!==1&&ge.duration!==1/0&&(this.template.dtime.textContent=Wt.secondToTime(ge.duration))}),this.on("progress",()=>{const Xe=Wt.getVideoDuration(this.video,this.template),ft=ge.buffered.length?ge.buffered.end(ge.buffered.length-1)/Xe:0;this.bar.set("loaded",ft,"width")}),this.on("error",()=>{this.video.error&&(this.switchingQuality&&(this.prevVideo!==null&&this.template.videoWrapAspect.removeChild(this.prevVideo),this.video.classList.add("dplayer-video-current"),this.prevVideo=null,this.switchingQuality=!1,this.events.trigger("quality_end")),this.tran&&this.notice&&this.type!=="webtorrent"&&this.type!=="live-llhls-for-KonomiTV"&&this.notice(this.tran("Video load failed"),-1,void 0,"#FF6F6A"),this.container.classList.remove("dplayer-loading"))}),this.on("ended",()=>{this.bar.set("played",1,"width"),this.setting.loop?(this.seek(0),this.play()):this.pause(),this.danmaku&&(this.danmaku.danIndex=0)}),this.on("play",()=>{this.paused&&this.play(!0)}),this.on("pause",()=>{this.paused||this.pause(!0)}),this.on("timeupdate",()=>{const Xe=Wt.getVideoDuration(this.video,this.template);this.bar.set("played",this.video.currentTime/Xe,"width");const ft=Wt.secondToTime(this.video.currentTime);this.template.ptime.textContent!==ft&&(this.template.ptime.textContent=ft)});for(let Xe=0;Xe{this.events.trigger(this.events.videoEvents[Xe],ft)});this.volume(this.user.get("volume"),!0,!0),this.options.subtitle&&(this.subtitle=new ks(this.template.subtitle,this.video,this.plugins,this.options.subtitle,this.events),this.user.get("subtitle")||this.subtitle.hide())}switchQuality(ge){if(ge=typeof ge=="string"?parseInt(ge):ge,this.options.video.quality===void 0||this.qualityIndex===ge||this.switchingQuality)return;this.qualityIndex=ge,this.switchingQuality=!0,this.quality=this.options.video.quality[ge];const Le=this.video.paused;this.video.pause();const Xe=$r()({current:!1,pic:null,screenshot:this.options.screenshot,preload:"auto",url:this.quality.type==="live-llhls-for-KonomiTV"?"":this.quality.url,subtitle:this.options.subtitle,crossOrigin:this.options.crossOrigin}),ft=new DOMParser().parseFromString(Xe,"text/html").body.firstChild;this.template.videoWrapAspect.insertBefore(ft,this.template.videoWrapAspect.getElementsByTagName("div")[0]),this.prevVideoCurrentTime=this.video.currentTime,this.prevVideo=this.video,this.video=ft,this.initVideo(this.video,this.quality.type||this.options.video.type),this.options.live||this.seek(this.prevVideoCurrentTime),Le||this.video.play(),this.options.lang==="ja"||this.options.lang==="ja-jp"?this.notice(`画質を ${this.quality.name} に切り替えています…`,-1):this.notice(`${this.tran("Switching to")} ${this.quality.name} ${this.tran("quality")}`,-1),this.container.classList.add("dplayer-loading"),this.events.trigger("quality_start",this.quality),this.template.qualityItem.forEach(_t=>{_t.classList.remove("dplayer-setting-quality-current"),parseInt(_t.dataset.index)===ge&&(_t.classList.add("dplayer-setting-quality-current"),this.template.qualityValue.textContent=this.quality.name,this.template.settingBox.classList.remove("dplayer-setting-box-quality"))}),this.on("canplay",()=>{if(this.prevVideo!==null){if(!this.options.live&&this.video.currentTime!==this.prevVideoCurrentTime)return void this.seek(this.prevVideoCurrentTime);this.template.videoWrapAspect.removeChild(this.prevVideo),this.video.classList.add("dplayer-video-current"),Le||this.video.play(),this.prevVideo=null,this.options.lang==="ja"||this.options.lang==="ja-jp"?this.notice(`画質を ${this.quality.name} に切り替えました。`,1e3):this.notice(`${this.tran("Switched to")} ${this.quality.name} ${this.tran("quality")}`),this.switchingQuality=!1;const _t=parseFloat(this.template.settingBox.querySelector(".dplayer-setting-speed-current").dataset.speed);this.speed(_t),this.template.settingBox.querySelector(".dplayer-setting-audio-current").dataset.audio==="secondary"&&(window.mpegts&&this.plugins.mpegts&&this.plugins.mpegts instanceof window.mpegts.MSEPlayer?this.plugins.mpegts.switchSecondaryAudio():this.plugins.liveLLHLSForKonomiTV&&this.plugins.liveLLHLSForKonomiTV.switchSecondaryAudio()),this.container.classList.remove("dplayer-loading"),this.events.trigger("quality_end")}})}notice(ge,Le=2e3,Xe=.8,ft){this.template.notice.textContent=ge,this.template.notice.style.opacity=`${Xe}`,this.template.notice.style.color=ft&&ft!==""?ft:"",this.noticeTime&&window.clearTimeout(this.noticeTime),this.events.trigger("notice_show",ge),Le>0&&(this.noticeTime=window.setTimeout(()=>{this.hideNotice()},Le))}hideNotice(){this.template.notice.style.opacity="0",this.events.trigger("notice_hide")}resize(){this.danmaku&&this.danmaku.resize(),this.plugins.aribb24Caption&&this.plugins.aribb24Caption.refresh(),this.plugins.aribb24Superimpose&&this.plugins.aribb24Superimpose.refresh(),this.controller.thumbnails&&this.controller.thumbnails.resize(160,this.video.videoHeight/this.video.videoWidth*160,this.template.barWrap.offsetWidth),this.events.trigger("resize")}speed(ge){this.video.playbackRate=ge,this.template.speedItem.forEach(Le=>{Le.classList.remove("dplayer-setting-speed-current"),parseFloat(Le.dataset.speed)===ge&&(Le.classList.add("dplayer-setting-speed-current"),parseFloat(Le.dataset.speed)===1?this.template.speedValue.textContent=this.tran("Normal"):this.template.speedValue.textContent=`${ge}`,this.template.settingBox.classList.remove("dplayer-setting-box-speed"))})}destroy(ge=!1){ts.splice(ts.indexOf(this),1),this.pause(),document.removeEventListener("click",this.docClickFun,!0),this.container.removeEventListener("click",this.containerClickFun,!0),this.fullScreen.destroy(),this.hotkey.destroy(),this.contextmenu.destroy(),this.controller.destroy(),this.timer.destroy(),this.setting.destroy(),this.resizeObserver.disconnect(),this.video.src="",ge||(this.container.innerHTML=""),this.events.trigger("destroy")}static get version(){return"1.31.2"}};console.log(` %c DPlayer v1.31.2 7131b6b %c http://dplayer.js.org -`,"color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;");const is=Ls})(),A=A.default})())})(vp);var Bb=vp.exports;const Nb=sd(Bb);function Fb(_){return _&&_.__esModule&&Object.prototype.hasOwnProperty.call(_,"default")?_.default:_}var bp={exports:{}};(function(_,e){(function(s){var u=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,y=/^(?=([^\/?#]*))\1([^]*)$/,A=/(?:\/|^)\.(?=\/)/g,l=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,c={buildAbsoluteURL:function(p,r,i){if(i=i||{},p=p.trim(),r=r.trim(),!r){if(!i.alwaysNormalize)return p;var t=c.parseURL(p);if(!t)throw new Error("Error trying to parse base URL.");return t.path=c.normalizePath(t.path),c.buildURLFromParts(t)}var n=c.parseURL(r);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return i.alwaysNormalize?(n.path=c.normalizePath(n.path),c.buildURLFromParts(n)):r;var a=c.parseURL(p);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var o=y.exec(a.path);a.netLoc=o[1],a.path=o[2]}a.netLoc&&!a.path&&(a.path="/");var d={scheme:a.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(d.netLoc=a.netLoc,n.path[0]!=="/"))if(!n.path)d.path=a.path,n.params||(d.params=a.params,n.query||(d.query=a.query));else{var g=a.path,m=g.substring(0,g.lastIndexOf("/")+1)+n.path;d.path=c.normalizePath(m)}return d.path===null&&(d.path=i.alwaysNormalize?c.normalizePath(n.path):n.path),c.buildURLFromParts(d)},parseURL:function(p){var r=u.exec(p);return r?{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}:null},normalizePath:function(p){for(p=p.split("").reverse().join("").replace(A,"");p.length!==(p=p.replace(l,"")).length;);return p.split("").reverse().join("")},buildURLFromParts:function(p){return p.scheme+p.netLoc+p.path+p.params+p.query+p.fragment}};_.exports=c})()})(bp);var yd=bp.exports;function gh(_,e){var s=Object.keys(_);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(_);e&&(u=u.filter(function(y){return Object.getOwnPropertyDescriptor(_,y).enumerable})),s.push.apply(s,u)}return s}function Dn(_){for(var e=1;e`):vs}function Wb(_,...e){e.forEach(function(s){Ta[s]=_[s]?_[s].bind(_):zb(s)})}function Kb(_,e){if(typeof console=="object"&&_===!0||typeof _=="object"){Wb(_,"debug","log","info","warn","error");try{Ta.log(`Debug logs enabled for "${e}" in hls.js version 1.5.1-patch.1`)}catch{Ta=Uc}}else Ta=Uc}const Ft=Ta,qb=/^(\d+)x(\d+)$/,Ah=/(.+?)=(".*?"|.*?)(?:,|$)/g;class bn{constructor(e){typeof e=="string"&&(e=bn.parseAttrList(e)),xn(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const s=parseInt(this[e],10);return s>Number.MAX_SAFE_INTEGER?1/0:s}hexadecimalInteger(e){if(this[e]){let s=(this[e]||"0x").slice(2);s=(s.length&1?"0":"")+s;const u=new Uint8Array(s.length/2);for(let y=0;yNumber.MAX_SAFE_INTEGER?1/0:s}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,s){const u=this[e];return u?parseFloat(u):s}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const s=qb.exec(this[e]);if(s!==null)return{width:parseInt(s[1],10),height:parseInt(s[2],10)}}static parseAttrList(e){let s;const u={},y='"';for(Ah.lastIndex=0;(s=Ah.exec(e))!==null;){let A=s[2];A.indexOf(y)===0&&A.lastIndexOf(y)===A.length-1&&(A=A.slice(1,-1));const l=s[1].trim();u[l]=A}return u}}function Yb(_){return _!=="ID"&&_!=="CLASS"&&_!=="START-DATE"&&_!=="DURATION"&&_!=="END-DATE"&&_!=="END-ON-NEXT"}function Jb(_){return _==="SCTE35-OUT"||_==="SCTE35-IN"}class _p{constructor(e,s){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,s){const u=s.attr;for(const y in u)if(Object.prototype.hasOwnProperty.call(e,y)&&e[y]!==u[y]){Ft.warn(`DATERANGE tag attribute: "${y}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=y;break}e=xn(new bn({}),u,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const u=new Date(this.attr["END-DATE"]);Ci(u.getTime())&&(this._endDate=u)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(Ci(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&Ci(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class Zo{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var fn={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Ep{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[fn.AUDIO]:null,[fn.VIDEO]:null,[fn.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,s){const u=e.split("@",2);let y;u.length===1?y=(s==null?void 0:s.byteRangeEndOffset)||0:y=parseInt(u[1]),this._byteRange=[y,parseInt(u[0])+y]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=yd.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class ac extends Ep{constructor(e,s){super(s),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new Zo,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const s=this.levelkeys.identity;if(s)this._decryptdata=s.getDecryptData(this.sn);else{const u=Object.keys(this.levelkeys);if(u.length===1)return this._decryptdata=this.levelkeys[u[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!Ci(this.programDateTime))return null;const e=Ci(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const s=Object.keys(this.levelkeys),u=s.length;if(u>1||u===1&&this.levelkeys[s[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const s=this.levelkeys[e];s&&!this._decryptdata&&(this._decryptdata=s.getDecryptData(this.sn))}}abortRequests(){var e,s;(e=this.loader)==null||e.abort(),(s=this.keyLoader)==null||s.abort()}setElementaryStreamInfo(e,s,u,y,A,l=!1){const{elementaryStreams:c}=this,p=c[e];if(!p){c[e]={startPTS:s,endPTS:u,startDTS:y,endDTS:A,partial:l};return}p.startPTS=Math.min(p.startPTS,s),p.endPTS=Math.max(p.endPTS,u),p.startDTS=Math.min(p.startDTS,y),p.endDTS=Math.max(p.endDTS,A)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[fn.AUDIO]=null,e[fn.VIDEO]=null,e[fn.AUDIOVIDEO]=null}}class Qb extends Ep{constructor(e,s,u,y,A){super(u),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new Zo,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=s,this.index=y;const l=e.enumeratedString("BYTERANGE");l&&this.setByteRange(l,A),A&&(this.fragOffset=A.fragOffset+A.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const Zb=10;class Xb{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const s=this.lastPartSn-e.lastPartSn,u=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!u||!!s||!this.live,this.advanced=this.endSN>e.endSN||s>0||s===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?Ci(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Zb}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function vd(_){return Uint8Array.from(atob(_),e=>e.charCodeAt(0))}function $b(_){const e=Gc(_).subarray(0,16),s=new Uint8Array(16);return s.set(e,16-e.length),s}function e_(_){const e=function(u,y,A){const l=u[y];u[y]=u[A],u[A]=l};e(_,0,3),e(_,1,2),e(_,4,5),e(_,6,7)}function t_(_){const e=_.split(":");let s=null;if(e[0]==="data"&&e.length===2){const u=e[1].split(";"),y=u[u.length-1].split(",");if(y.length===2){const A=y[0]==="base64",l=y[1];A?(u.splice(-1,1),s=vd(l)):s=$b(l)}}return s}function Gc(_){return Uint8Array.from(unescape(encodeURIComponent(_)),e=>e.charCodeAt(0))}const oa=typeof self<"u"?self:void 0;var vn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Zn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function yh(_){switch(_){case Zn.FAIRPLAY:return vn.FAIRPLAY;case Zn.PLAYREADY:return vn.PLAYREADY;case Zn.WIDEVINE:return vn.WIDEVINE;case Zn.CLEARKEY:return vn.CLEARKEY}}var wp={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function i_(_){if(_===wp.WIDEVINE)return vn.WIDEVINE}function vh(_){switch(_){case vn.FAIRPLAY:return Zn.FAIRPLAY;case vn.PLAYREADY:return Zn.PLAYREADY;case vn.WIDEVINE:return Zn.WIDEVINE;case vn.CLEARKEY:return Zn.CLEARKEY}}function oc(_){const{drmSystems:e,widevineLicenseUrl:s}=_,u=e?[vn.FAIRPLAY,vn.WIDEVINE,vn.PLAYREADY,vn.CLEARKEY].filter(y=>!!e[y]):[];return!u[vn.WIDEVINE]&&s&&u.push(vn.WIDEVINE),u}const Sp=function(_){return oa!=null&&(_=oa.navigator)!=null&&_.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function n_(_,e,s,u){let y;switch(_){case vn.FAIRPLAY:y=["cenc","sinf"];break;case vn.WIDEVINE:case vn.PLAYREADY:y=["cenc"];break;case vn.CLEARKEY:y=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${_}`)}return r_(y,e,s,u)}function r_(_,e,s,u){return[{initDataTypes:_,persistentState:u.persistentState||"optional",distinctiveIdentifier:u.distinctiveIdentifier||"optional",sessionTypes:u.sessionTypes||[u.sessionType||"temporary"],audioCapabilities:e.map(A=>({contentType:`audio/mp4; codecs="${A}"`,robustness:u.audioRobustness||"",encryptionScheme:u.audioEncryptionScheme||null})),videoCapabilities:s.map(A=>({contentType:`video/mp4; codecs="${A}"`,robustness:u.videoRobustness||"",encryptionScheme:u.videoEncryptionScheme||null}))}]}function Ts(_,e,s){return Uint8Array.prototype.slice?_.slice(e,s):new Uint8Array(Array.prototype.slice.call(_,e,s))}const bd=(_,e)=>e+10<=_.length&&_[e]===73&&_[e+1]===68&&_[e+2]===51&&_[e+3]<255&&_[e+4]<255&&_[e+6]<128&&_[e+7]<128&&_[e+8]<128&&_[e+9]<128,Tp=(_,e)=>e+10<=_.length&&_[e]===51&&_[e+1]===68&&_[e+2]===73&&_[e+3]<255&&_[e+4]<255&&_[e+6]<128&&_[e+7]<128&&_[e+8]<128&&_[e+9]<128,Ra=(_,e)=>{const s=e;let u=0;for(;bd(_,e);){u+=10;const y=Xo(_,e+6);u+=y,Tp(_,e+10)&&(u+=10),e+=u}if(u>0)return _.subarray(s,s+u)},Xo=(_,e)=>{let s=0;return s=(_[e]&127)<<21,s|=(_[e+1]&127)<<14,s|=(_[e+2]&127)<<7,s|=_[e+3]&127,s},s_=(_,e)=>bd(_,e)&&Xo(_,e+6)+10<=_.length-e,_d=_=>{const e=xp(_);for(let s=0;s_&&_.key==="PRIV"&&_.info==="com.apple.streaming.transportStreamTimestamp",a_=_=>{const e=String.fromCharCode(_[0],_[1],_[2],_[3]),s=Xo(_,4),u=10;return{type:e,size:s,data:_.subarray(u,u+s)}},xp=_=>{let e=0;const s=[];for(;bd(_,e);){const u=Xo(_,e+6);e+=10;const y=e+u;for(;e+8_.type==="PRIV"?l_(_):_.type[0]==="W"?d_(_):c_(_),l_=_=>{if(_.size<2)return;const e=Vr(_.data,!0),s=new Uint8Array(_.data.subarray(e.length+1));return{key:_.type,info:e,data:s.buffer}},c_=_=>{if(_.size<2)return;if(_.type==="TXXX"){let s=1;const u=Vr(_.data.subarray(s),!0);s+=u.length+1;const y=Vr(_.data.subarray(s));return{key:_.type,info:u,data:y}}const e=Vr(_.data.subarray(1));return{key:_.type,data:e}},d_=_=>{if(_.type==="WXXX"){if(_.size<2)return;let s=1;const u=Vr(_.data.subarray(s),!0);s+=u.length+1;const y=Vr(_.data.subarray(s));return{key:_.type,info:u,data:y}}const e=Vr(_.data);return{key:_.type,data:e}},u_=_=>{if(_.data.byteLength===8){const e=new Uint8Array(_.data),s=e[3]&1;let u=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return u/=45,s&&(u+=4772185884e-2),Math.round(u)}},Vr=(_,e=!1)=>{const s=h_();if(s){const r=s.decode(_);if(e){const i=r.indexOf("\0");return i!==-1?r.substring(0,i):r}return r.replace(/\0/g,"")}const u=_.length;let y,A,l,c="",p=0;for(;p>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(y);break;case 12:case 13:A=_[p++],c+=String.fromCharCode((y&31)<<6|A&63);break;case 14:A=_[p++],l=_[p++],c+=String.fromCharCode((y&15)<<12|(A&63)<<6|(l&63)<<0);break}}return c};let lc;function h_(){if(!navigator.userAgent.includes("PlayStation 4"))return!lc&&typeof self.TextDecoder<"u"&&(lc=new self.TextDecoder("utf-8")),lc}const Fr={hexDump:function(_){let e="";for(let s=0;s<_.length;s++){let u=_[s].toString(16);u.length<2&&(u="0"+u),e+=u}return e}},ko=Math.pow(2,32)-1,f_=[].push,kp={video:1,audio:2,id3:3,text:4};function In(_){return String.fromCharCode.apply(null,_)}function Rp(_,e){const s=_[e]<<8|_[e+1];return s<0?65536+s:s}function Ki(_,e){const s=Ip(_,e);return s<0?4294967296+s:s}function Ip(_,e){return _[e]<<24|_[e+1]<<16|_[e+2]<<8|_[e+3]}function cc(_,e,s){_[e]=s>>24,_[e+1]=s>>16&255,_[e+2]=s>>8&255,_[e+3]=s&255}function p_(_){const e=_.byteLength;for(let s=0;s8&&_[s+4]===109&&_[s+5]===111&&_[s+6]===111&&_[s+7]===102)return!0;s=u>1?s+u:e}return!1}function Zi(_,e){const s=[];if(!e.length)return s;const u=_.byteLength;for(let y=0;y1?y+A:u;if(l===e[0])if(e.length===1)s.push(_.subarray(y+8,c));else{const p=Zi(_.subarray(y+8,c),e.slice(1));p.length&&f_.apply(s,p)}y=c}return s}function m_(_){const e=[],s=_[0];let u=8;const y=Ki(_,u);u+=4;const A=0,l=0;s===0?u+=8:u+=16,u+=2;let c=_.length+l;const p=Rp(_,u);u+=2;for(let r=0;r>>31===1)return Ft.warn("SIDX has hierarchical references (not supported)"),null;const o=Ki(_,i);i+=4,e.push({referenceSize:n,subsegmentDuration:o,info:{duration:o/y,start:c,end:c+n-1}}),c+=n,i+=4,u=i}return{earliestPresentationTime:A,timescale:y,version:s,referencesCount:p,references:e}}function Lp(_){const e=[],s=Zi(_,["moov","trak"]);for(let y=0;y{const A=Ki(y,4),l=e[A];l&&(l.default={duration:Ki(y,12),flags:Ki(y,20)})}),e}function g_(_){const e=_.subarray(8),s=e.subarray(86),u=In(e.subarray(4,8));let y=u;const A=u==="enca"||u==="encv";if(A){const c=Zi(e,[u])[0].subarray(u==="enca"?28:78);Zi(c,["sinf"]).forEach(r=>{const i=Zi(r,["schm"])[0];if(i){const t=In(i.subarray(4,8));if(t==="cbcs"||t==="cenc"){const n=Zi(r,["frma"])[0];n&&(y=In(n))}}})}switch(y){case"avc1":case"avc2":case"avc3":case"avc4":{const l=Zi(s,["avcC"])[0];y+="."+Za(l[1])+Za(l[2])+Za(l[3]);break}case"mp4a":{const l=Zi(e,[u])[0],c=Zi(l.subarray(28),["esds"])[0];if(c&&c.length>12){let p=4;if(c[p++]!==3)break;p=dc(c,p),p+=2;const r=c[p++];if(r&128&&(p+=2),r&64&&(p+=c[p++]),c[p++]!==4)break;p=dc(c,p);const i=c[p++];if(i===64)y+="."+Za(i);else break;if(p+=12,c[p++]!==5)break;p=dc(c,p);const t=c[p++];let n=(t&248)>>3;n===31&&(n+=1+((t&7)<<3)+((c[p]&224)>>5)),y+="."+n}break}case"hvc1":case"hev1":{const l=Zi(s,["hvcC"])[0],c=l[1],p=["","A","B","C"][c>>6],r=c&31,i=Ki(l,2),t=(c&32)>>5?"H":"L",n=l[12],a=l.subarray(6,12);y+="."+p+r,y+="."+i.toString(16).toUpperCase(),y+="."+t+n;let o="";for(let d=a.length;d--;){const g=a[d];(g||o)&&(o="."+g.toString(16).toUpperCase()+o)}y+=o;break}case"dvh1":case"dvhe":{const l=Zi(s,["dvcC"])[0],c=l[2]>>1&127,p=l[2]<<5&32|l[3]>>3&31;y+="."+Nr(c)+"."+Nr(p);break}case"vp09":{const l=Zi(s,["vpcC"])[0],c=l[4],p=l[5],r=l[6]>>4&15;y+="."+Nr(c)+"."+Nr(p)+"."+Nr(r);break}case"av01":{const l=Zi(s,["av1C"])[0],c=l[1]>>>5,p=l[1]&31,r=l[2]>>>7?"H":"M",i=(l[2]&64)>>6,t=(l[2]&32)>>5,n=c===2&&i?t?12:10:i?10:8,a=(l[2]&16)>>4,o=(l[2]&8)>>3,d=(l[2]&4)>>2,g=l[2]&3;y+="."+c+"."+Nr(p)+r+"."+Nr(n)+"."+a+"."+o+d+g+"."+Nr(1)+"."+Nr(1)+"."+Nr(1)+"."+0;break}}return{codec:y,encrypted:A}}function dc(_,e){const s=e+5;for(;_[e++]&128&&e{const l=Zi(y,["mdia","minf","stbl","stsd"])[0].subarray(8);let c=Zi(l,["enca"]);const p=c.length>0;p||(c=Zi(l,["encv"])),c.forEach(r=>{const i=p?r.subarray(28):r.subarray(78);Zi(i,["sinf"]).forEach(n=>{const a=Dp(n);if(a){const o=a.subarray(8,24);o.some(d=>d!==0)||(Ft.log(`[eme] Patching keyId in 'enc${p?"a":"v"}>sinf>>tenc' box: ${Fr.hexDump(o)} -> ${Fr.hexDump(s)}`),a.set(s,8))}})})}),_}function Dp(_){const e=Zi(_,["schm"])[0];if(e){const s=In(e.subarray(4,8));if(s==="cbcs"||s==="cenc")return Zi(_,["schi","tenc"])[0]}return Ft.error("[eme] missing 'schm' box"),null}function y_(_,e){return Zi(e,["moof","traf"]).reduce((s,u)=>{const y=Zi(u,["tfdt"])[0],A=y[0],l=Zi(u,["tfhd"]).reduce((c,p)=>{const r=Ki(p,4),i=_[r];if(i){let t=Ki(y,4);if(A===1){if(t===ko)return Ft.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),c;t*=ko+1,t+=Ki(y,8)}const n=i.timescale||9e4,a=t/n;if(Ci(a)&&(c===null||ai+t.info.duration||0,0))}return l}return u||y}function b_(_){const e=Ki(_,0);let s=8;e&1&&(s+=4),e&4&&(s+=4);let u=0;const y=Ki(_,4);for(let A=0;A{Zi(u,["tfhd"]).forEach(y=>{const A=Ki(y,4),l=_[A];if(!l)return;const c=l.timescale||9e4;Zi(u,["tfdt"]).forEach(p=>{const r=p[0],i=s*c;if(i){let t=Ki(p,4);if(r===0)t-=i,t=Math.max(t,0),cc(p,4,t);else{t*=Math.pow(2,32),t+=Ki(p,8),t-=i,t=Math.max(t,0);const n=Math.floor(t/(ko+1)),a=Math.floor(t%(ko+1));cc(p,4,n),cc(p,8,a)}}})})})}function E_(_){const e={valid:null,remainder:null},s=Zi(_,["moof"]);if(s.length<2)return e.remainder=_,e;const u=s[s.length-1];return e.valid=Ts(_,0,u.byteOffset-8),e.remainder=Ts(_,u.byteOffset-8),e}function Ar(_,e){const s=new Uint8Array(_.length+e.length);return s.set(_),s.set(e,_.length),s}function bh(_,e){const s=[],u=e.samples,y=e.timescale,A=e.id;let l=!1;return Zi(u,["moof"]).map(p=>{const r=p.byteOffset-8;Zi(p,["traf"]).map(t=>{const n=Zi(t,["tfdt"]).map(a=>{const o=a[0];let d=Ki(a,4);return o===1&&(d*=Math.pow(2,32),d+=Ki(a,8)),d/y})[0];return n!==void 0&&(_=n),Zi(t,["tfhd"]).map(a=>{const o=Ki(a,4),d=Ki(a,0)&16777215,g=(d&1)!==0,m=(d&2)!==0,v=(d&8)!==0;let b=0;const w=(d&16)!==0;let C=0;const D=(d&32)!==0;let R=8;o===A&&(g&&(R+=8),m&&(R+=4),v&&(b=Ki(a,R),R+=4),w&&(C=Ki(a,R),R+=4),D&&(R+=4),e.type==="video"&&(l=w_(e.codec)),Zi(t,["trun"]).map(T=>{const P=T[0],L=Ki(T,0)&16777215,I=(L&1)!==0;let x=0;const O=(L&4)!==0,G=(L&256)!==0;let J=0;const te=(L&512)!==0;let le=0;const ne=(L&1024)!==0,ee=(L&2048)!==0;let M=0;const Y=Ki(T,4);let j=8;I&&(x=Ki(T,j),j+=4),O&&(j+=4);let z=x+r;for(let q=0;q>1&63;return s===39||s===40}else return(e&31)===6}function Ed(_,e,s,u){const y=Op(_);let A=0;A+=e;let l=0,c=0,p=0;for(;A=y.length)break;p=y[A++],l+=p}while(p===255);c=0;do{if(A>=y.length)break;p=y[A++],c+=p}while(p===255);const r=y.length-A;let i=A;if(cr){Ft.error(`Malformed SEI payload. ${c} is too small, only ${r} bytes left to parse.`);break}if(l===4){if(y[i++]===181){const n=Rp(y,i);if(i+=2,n===49){const a=Ki(y,i);if(i+=4,a===1195456820){const o=y[i++];if(o===3){const d=y[i++],g=31&d,m=64&d,v=m?2+g*3:0,b=new Uint8Array(v);if(m){b[0]=d;for(let w=1;w16){const t=[];for(let o=0;o<16;o++){const d=y[i++].toString(16);t.push(d.length==1?"0"+d:d),(o===3||o===5||o===7||o===9)&&t.push("-")}const n=c-16,a=new Uint8Array(n);for(let o=0;o>24&255,A[1]=u>>16&255,A[2]=u>>8&255,A[3]=u&255,A.set(_,4),y=0,u=8;y0?(A=new Uint8Array(4),e.length>0&&new DataView(A.buffer).setUint32(0,e.length,!1)):A=new Uint8Array;const l=new Uint8Array(4);return s&&s.byteLength>0&&new DataView(l.buffer).setUint32(0,s.byteLength,!1),C_([112,115,115,104],new Uint8Array([u,0,0,0]),_,A,y,l,s||new Uint8Array)}function k_(_){if(!(_ instanceof ArrayBuffer)||_.byteLength<32)return null;const e={version:0,systemId:"",kids:null,data:null},s=new DataView(_),u=s.getUint32(0);if(_.byteLength!==u&&u>44||s.getUint32(4)!==1886614376||(e.version=s.getUint32(8)>>>24,e.version>1))return null;e.systemId=Fr.hexDump(new Uint8Array(_,12,16));const A=s.getUint32(28);if(e.version===0){if(u-32=22&&(this.keyId=s.subarray(s.length-22,s.length-6));break;case Zn.PLAYREADY:{const u=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=x_(u,null,s);const y=new Uint16Array(s.buffer,s.byteOffset,s.byteLength/2),A=String.fromCharCode.apply(null,Array.from(y)),l=A.substring(A.indexOf("<"),A.length),r=new DOMParser().parseFromString(l,"text/xml").getElementsByTagName("KID")[0];if(r){const i=r.childNodes[0]?r.childNodes[0].nodeValue:r.getAttribute("VALUE");if(i){const t=vd(i).subarray(0,16);e_(t),this.keyId=t}}break}default:{let u=s.subarray(0,16);if(u.length!==16){const y=new Uint8Array(16);y.set(u,16-u.length),u=y}this.keyId=u;break}}if(!this.keyId||this.keyId.byteLength!==16){let u=Xa[this.uri];if(!u){const y=Object.keys(Xa).length%Number.MAX_SAFE_INTEGER;u=new Uint8Array(16),new DataView(u.buffer,12,4).setUint32(0,y),Xa[this.uri]=u}this.keyId=u}return this}}function R_(_){const e=new Uint8Array(16);for(let s=12;s<16;s++)e[s]=_>>8*(15-s)&255;return e}const Mp=/\{\$([a-zA-Z0-9-_]+)\}/g;function _h(_){return Mp.test(_)}function Qn(_,e,s){if(_.variableList!==null||_.hasVariableRefs)for(let u=s.length;u--;){const y=s[u],A=e[y];A&&(e[y]=jc(_,A))}}function jc(_,e){if(_.variableList!==null||_.hasVariableRefs){const s=_.variableList;return e.replace(Mp,u=>{const y=u.substring(2,u.length-1),A=s==null?void 0:s[y];return A===void 0?(_.playlistParsingError||(_.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${y}"`)),u):A})}return e}function Eh(_,e,s){let u=_.variableList;u||(_.variableList=u={});let y,A;if("QUERYPARAM"in e){y=e.QUERYPARAM;try{const l=new self.URL(s).searchParams;if(l.has(y))A=l.get(y);else throw new Error(`"${y}" does not match any query parameter in URI: "${s}"`)}catch(l){_.playlistParsingError||(_.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${l.message}`))}}else y=e.NAME,A=e.VALUE;y in u?_.playlistParsingError||(_.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${y}"`)):u[y]=A||""}function I_(_,e,s){const u=e.IMPORT;if(s&&u in s){let y=_.variableList;y||(_.variableList=y={}),y[u]=s[u]}else _.playlistParsingError||(_.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${u}"`))}function ua(_=!0){return typeof self>"u"?void 0:(_||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}const Ro={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function L_(_,e){const s=Ro[e];return!!s&&!!s[_.slice(0,4)]}function uc(_,e,s=!0){return!_.split(",").some(u=>!Pp(u,e,s))}function Pp(_,e,s=!0){var u;const y=ua(s);return(u=y==null?void 0:y.isTypeSupported(La(_,e)))!=null?u:!1}function La(_,e){return`${e}/mp4;codecs="${_}"`}function wh(_){if(_){const e=_.substring(0,4);return Ro.video[e]}return 2}function Io(_){return _.split(",").reduce((e,s)=>{const u=Ro.video[s];return u?(u*2+e)/(e?3:2):(Ro.audio[s]+e)/(e?2:1)},0)}const hc={};function D_(_,e=!0){if(hc[_])return hc[_];const s={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[_];for(let u=0;uD_(s.toLowerCase(),e))}function Sh(_,e){return _&&_!=="mp4a"?_:e}function M_(_){const e=_.split(".");if(e.length>2){let s=e.shift()+".";return s+=parseInt(e.shift()).toString(16),s+=("000"+parseInt(e.shift()).toString(16)).slice(-4),s}return _}const Th=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Ch=/#EXT-X-MEDIA:(.*)/g,P_=/^#EXT(?:INF|-X-TARGETDURATION):/m,xh=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),B_=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Gr{static findGroup(e,s){for(let u=0;u0&&A.length({id:r.attrs.AUDIO,audioCodec:r.audioCodec})),SUBTITLES:l.map(r=>({id:r.attrs.SUBTITLES,textCodec:r.textCodec})),"CLOSED-CAPTIONS":[]};let p=0;for(Ch.lastIndex=0;(y=Ch.exec(e))!==null;){const r=new bn(y[1]),i=r.TYPE;if(i){const t=c[i],n=A[i]||[];A[i]=n,Qn(u,r,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const a=r.LANGUAGE,o=r["ASSOC-LANGUAGE"],d=r.CHANNELS,g=r.CHARACTERISTICS,m=r["INSTREAM-ID"],v={attrs:r,bitrate:0,id:p++,groupId:r["GROUP-ID"]||"",name:r.NAME||a||"",type:i,default:r.bool("DEFAULT"),autoselect:r.bool("AUTOSELECT"),forced:r.bool("FORCED"),lang:a,url:r.URI?Gr.resolve(r.URI,s):""};if(o&&(v.assocLang=o),d&&(v.channels=d),g&&(v.characteristics=g),m&&(v.instreamId=m),t!=null&&t.length){const b=Gr.findGroup(t,v.groupId)||t[0];Ih(v,b,"audioCodec"),Ih(v,b,"textCodec")}n.push(v)}}return A}static parseLevelPlaylist(e,s,u,y,A,l){const c=new Xb(s),p=c.fragments;let r=null,i=0,t=0,n=0,a=0,o=null,d=new ac(y,s),g,m,v,b=-1,w=!1,C=null;for(xh.lastIndex=0,c.m3u8=e,c.hasVariableRefs=_h(e);(g=xh.exec(e))!==null;){w&&(w=!1,d=new ac(y,s),d.start=n,d.sn=i,d.cc=a,d.level=u,r&&(d.initSegment=r,d.rawProgramDateTime=r.rawProgramDateTime,r.rawProgramDateTime=null,C&&(d.setByteRange(C),C=null)));const P=g[1];if(P){d.duration=parseFloat(P);const L=(" "+g[2]).slice(1);d.title=L||null,d.tagList.push(L?["INF",P,L]:["INF",P])}else if(g[3]){if(Ci(d.duration)){d.start=n,v&&Oh(d,v,c),d.sn=i,d.level=u,d.cc=a,p.push(d);const L=(" "+g[3]).slice(1);d.relurl=jc(c,L),Lh(d,o),o=d,n+=d.duration,i++,t=0,w=!0}}else if(g[4]){const L=(" "+g[4]).slice(1);o?d.setByteRange(L,o):d.setByteRange(L)}else if(g[5])d.rawProgramDateTime=(" "+g[5]).slice(1),d.tagList.push(["PROGRAM-DATE-TIME",d.rawProgramDateTime]),b===-1&&(b=p.length);else{if(g=g[0].match(B_),!g){Ft.warn("No matches on slow regex match for level playlist!");continue}for(m=1;m0&&O.bool("CAN-SKIP-DATERANGES"),c.partHoldBack=O.optionalFloat("PART-HOLD-BACK",0),c.holdBack=O.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const O=new bn(I);c.partTarget=O.decimalFloatingPoint("PART-TARGET");break}case"PART":{let O=c.partList;O||(O=c.partList=[]);const G=t>0?O[O.length-1]:void 0,J=t++,te=new bn(I);Qn(c,te,["BYTERANGE","URI"]);const le=new Qb(te,d,s,J,G);O.push(le),d.duration+=le.duration;break}case"PRELOAD-HINT":{const O=new bn(I);Qn(c,O,["URI"]),c.preloadHint=O;break}case"RENDITION-REPORT":{const O=new bn(I);Qn(c,O,["URI"]),c.renditionReports=c.renditionReports||[],c.renditionReports.push(O);break}default:Ft.warn(`line parsed but not handled: ${g}`);break}}}o&&!o.relurl?(p.pop(),n-=o.duration,c.partList&&(c.fragmentHint=o)):c.partList&&(Lh(d,o),d.cc=a,c.fragmentHint=d,v&&Oh(d,v,c));const D=p.length,R=p[0],T=p[D-1];if(n+=c.skippedSegments*c.targetduration,n>0&&D&&T){c.averagetargetduration=n/D;const P=T.sn;c.endSN=P!=="initSegment"?P:0,c.live||(T.endList=!0),R&&(c.startCC=R.cc)}else c.endSN=0,c.startCC=0;return c.fragmentHint&&(n+=c.fragmentHint.duration),c.totalduration=n,c.endCC=a,b>0&&F_(p,b),c}}function kh(_,e,s){var u,y;const A=new bn(_);Qn(s,A,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const l=(u=A.METHOD)!=null?u:"",c=A.URI,p=A.hexadecimalInteger("IV"),r=A.KEYFORMATVERSIONS,i=(y=A.KEYFORMAT)!=null?y:"identity";c&&A.IV&&!p&&Ft.error(`Invalid IV: ${A.IV}`);const t=c?Gr.resolve(c,e):"",n=(r||"1").split("/").map(Number).filter(Number.isFinite);return new Ia(l,t,i,n,p)}function Rh(_){const s=new bn(_).decimalFloatingPoint("TIME-OFFSET");return Ci(s)?s:null}function N_(_,e){let s=(_||"").split(/[ ,]+/).filter(u=>u);["video","audio","text"].forEach(u=>{const y=s.filter(A=>L_(A,u));y.length&&(e[`${u}Codec`]=y.join(","),s=s.filter(A=>y.indexOf(A)===-1))}),e.unknownCodecs=s}function Ih(_,e,s){const u=e[s];u&&(_[s]=u)}function F_(_,e){let s=_[e];for(let u=e;u--;){const y=_[u];if(!y)return;y.programDateTime=s.programDateTime-y.duration*1e3,s=y}}function Lh(_,e){_.rawProgramDateTime?_.programDateTime=Date.parse(_.rawProgramDateTime):e!=null&&e.programDateTime&&(_.programDateTime=e.endProgramDateTime),Ci(_.programDateTime)||(_.programDateTime=null,_.rawProgramDateTime=null)}function Dh(_,e,s,u){_.relurl=e.URI,e.BYTERANGE&&_.setByteRange(e.BYTERANGE),_.level=s,_.sn="initSegment",u&&(_.levelkeys=u),_.initSegment=null}function Oh(_,e,s){_.levelkeys=e;const{encryptedFragments:u}=s;(!u.length||u[u.length-1].levelkeys!==e)&&Object.keys(e).some(y=>e[y].isCommonEncryption)&&u.push(_)}var ln={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},Hi={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Mh(_){const{type:e}=_;switch(e){case ln.AUDIO_TRACK:return Hi.AUDIO;case ln.SUBTITLE_TRACK:return Hi.SUBTITLE;default:return Hi.MAIN}}function fc(_,e){let s=_.url;return(s===void 0||s.indexOf("data:")===0)&&(s=e.url),s}class U_{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.LEVEL_LOADING,this.onLevelLoading,this),e.on(rt.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(rt.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.LEVEL_LOADING,this.onLevelLoading,this),e.off(rt.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(rt.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const s=this.hls.config,u=s.pLoader,y=s.loader,A=u||y,l=new A(s);return this.loaders[e.type]=l,l}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const s=this.loaders[e];s&&s.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,s){const{url:u}=s;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:ln.MANIFEST,url:u,deliveryDirectives:null})}onLevelLoading(e,s){const{id:u,level:y,pathwayId:A,url:l,deliveryDirectives:c}=s;this.load({id:u,level:y,pathwayId:A,responseType:"text",type:ln.LEVEL,url:l,deliveryDirectives:c})}onAudioTrackLoading(e,s){const{id:u,groupId:y,url:A,deliveryDirectives:l}=s;this.load({id:u,groupId:y,level:null,responseType:"text",type:ln.AUDIO_TRACK,url:A,deliveryDirectives:l})}onSubtitleTrackLoading(e,s){const{id:u,groupId:y,url:A,deliveryDirectives:l}=s;this.load({id:u,groupId:y,level:null,responseType:"text",type:ln.SUBTITLE_TRACK,url:A,deliveryDirectives:l})}load(e){var s;const u=this.hls.config;let y=this.getInternalLoader(e);if(y){const r=y.context;if(r&&r.url===e.url&&r.level===e.level){Ft.trace("[playlist-loader]: playlist request ongoing");return}Ft.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),y.abort()}let A;if(e.type===ln.MANIFEST?A=u.manifestLoadPolicy.default:A=xn({},u.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),y=this.createInternalLoader(e),Ci((s=e.deliveryDirectives)==null?void 0:s.part)){let r;if(e.type===ln.LEVEL&&e.level!==null?r=this.hls.levels[e.level].details:e.type===ln.AUDIO_TRACK&&e.id!==null?r=this.hls.audioTracks[e.id].details:e.type===ln.SUBTITLE_TRACK&&e.id!==null&&(r=this.hls.subtitleTracks[e.id].details),r){const i=r.partTarget,t=r.targetduration;if(i&&t){const n=Math.max(i*3,t*.8)*1e3;A=xn({},A,{maxTimeToFirstByteMs:Math.min(n,A.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(n,A.maxTimeToFirstByteMs)})}}}const l=A.errorRetry||A.timeoutRetry||{},c={loadPolicy:A,timeout:A.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},p={onSuccess:(r,i,t,n)=>{const a=this.getInternalLoader(t);this.resetInternalLoader(t.type);const o=r.data;if(o.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,t,new Error("no EXTM3U delimiter"),n||null,i);return}i.parsing.start=performance.now(),Gr.isMediaPlaylist(o)?this.handleTrackOrLevelPlaylist(r,i,t,n||null,a):this.handleMasterPlaylist(r,i,t,n)},onError:(r,i,t,n)=>{this.handleNetworkError(i,t,!1,r,n)},onTimeout:(r,i,t)=>{this.handleNetworkError(i,t,!0,void 0,r)}};y.load(e,c,p)}handleMasterPlaylist(e,s,u,y){const A=this.hls,l=e.data,c=fc(e,u),p=Gr.parseMasterPlaylist(l,c);if(p.playlistParsingError){this.handleManifestParsingError(e,u,p.playlistParsingError,y,s);return}const{contentSteering:r,levels:i,sessionData:t,sessionKeys:n,startTimeOffset:a,variableList:o}=p;this.variableList=o;const{AUDIO:d=[],SUBTITLES:g,"CLOSED-CAPTIONS":m}=Gr.parseMasterPlaylistMedia(l,c,p);d.length&&!d.some(b=>!b.url)&&i[0].audioCodec&&!i[0].attrs.AUDIO&&(Ft.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),d.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new bn({}),bitrate:0,url:""})),A.trigger(rt.MANIFEST_LOADED,{levels:i,audioTracks:d,subtitles:g,captions:m,contentSteering:r,url:c,stats:s,networkDetails:y,sessionData:t,sessionKeys:n,startTimeOffset:a,variableList:o})}handleTrackOrLevelPlaylist(e,s,u,y,A){const l=this.hls,{id:c,level:p,type:r}=u,i=fc(e,u),t=0,n=Ci(p)?p:Ci(c)?c:0,a=Mh(u),o=Gr.parseLevelPlaylist(e.data,i,n,a,t,this.variableList);if(r===ln.MANIFEST){const d={attrs:new bn({}),bitrate:0,details:o,name:"",url:i};l.trigger(rt.MANIFEST_LOADED,{levels:[d],audioTracks:[],url:i,stats:s,networkDetails:y,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}s.parsing.end=performance.now(),u.levelDetails=o,this.handlePlaylistLoaded(o,e,s,u,y,A)}handleManifestParsingError(e,s,u,y,A){this.hls.trigger(rt.ERROR,{type:Wi.NETWORK_ERROR,details:qt.MANIFEST_PARSING_ERROR,fatal:s.type===ln.MANIFEST,url:e.url,err:u,error:u,reason:u.message,response:e,context:s,networkDetails:y,stats:A})}handleNetworkError(e,s,u=!1,y,A){let l=`A network ${u?"timeout":"error"+(y?" (status "+y.code+")":"")} occurred while loading ${e.type}`;e.type===ln.LEVEL?l+=`: ${e.level} id: ${e.id}`:(e.type===ln.AUDIO_TRACK||e.type===ln.SUBTITLE_TRACK)&&(l+=` id: ${e.id} group-id: "${e.groupId}"`);const c=new Error(l);Ft.warn(`[playlist-loader]: ${l}`);let p=qt.UNKNOWN,r=!1;const i=this.getInternalLoader(e);switch(e.type){case ln.MANIFEST:p=u?qt.MANIFEST_LOAD_TIMEOUT:qt.MANIFEST_LOAD_ERROR,r=!0;break;case ln.LEVEL:p=u?qt.LEVEL_LOAD_TIMEOUT:qt.LEVEL_LOAD_ERROR,r=!1;break;case ln.AUDIO_TRACK:p=u?qt.AUDIO_TRACK_LOAD_TIMEOUT:qt.AUDIO_TRACK_LOAD_ERROR,r=!1;break;case ln.SUBTITLE_TRACK:p=u?qt.SUBTITLE_TRACK_LOAD_TIMEOUT:qt.SUBTITLE_LOAD_ERROR,r=!1;break}i&&this.resetInternalLoader(e.type);const t={type:Wi.NETWORK_ERROR,details:p,fatal:r,url:e.url,loader:i,context:e,error:c,networkDetails:s,stats:A};if(y){const n=(s==null?void 0:s.url)||e.url;t.response=Dn({url:n,data:void 0},y)}this.hls.trigger(rt.ERROR,t)}handlePlaylistLoaded(e,s,u,y,A,l){const c=this.hls,{type:p,level:r,id:i,groupId:t,deliveryDirectives:n}=y,a=fc(s,y),o=Mh(y),d=typeof y.level=="number"&&o===Hi.MAIN?r:void 0;if(!e.fragments.length){const m=new Error("No Segments found in Playlist");c.trigger(rt.ERROR,{type:Wi.NETWORK_ERROR,details:qt.LEVEL_EMPTY_ERROR,fatal:!1,url:a,error:m,reason:m.message,response:s,context:y,level:d,parent:o,networkDetails:A,stats:u});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const g=e.playlistParsingError;if(g){c.trigger(rt.ERROR,{type:Wi.NETWORK_ERROR,details:qt.LEVEL_PARSING_ERROR,fatal:!1,url:a,error:g,reason:g.message,response:s,context:y,level:d,parent:o,networkDetails:A,stats:u});return}switch(e.live&&l&&(l.getCacheAge&&(e.ageHeader=l.getCacheAge()||0),(!l.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),p){case ln.MANIFEST:case ln.LEVEL:c.trigger(rt.LEVEL_LOADED,{details:e,level:d||0,id:i||0,stats:u,networkDetails:A,deliveryDirectives:n});break;case ln.AUDIO_TRACK:c.trigger(rt.AUDIO_TRACK_LOADED,{details:e,id:i||0,groupId:t||"",stats:u,networkDetails:A,deliveryDirectives:n});break;case ln.SUBTITLE_TRACK:c.trigger(rt.SUBTITLE_TRACK_LOADED,{details:e,id:i||0,groupId:t||"",stats:u,networkDetails:A,deliveryDirectives:n});break}}}function Bp(_,e){let s;try{s=new Event("addtrack")}catch{s=document.createEvent("Event"),s.initEvent("addtrack",!1,!1)}s.track=_,e.dispatchEvent(s)}function Np(_,e){const s=_.mode;if(s==="disabled"&&(_.mode="hidden"),_.cues&&!_.cues.getCueById(e.id))try{if(_.addCue(e),!_.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(u){Ft.debug(`[texttrack-utils]: ${u}`);try{const y=new self.TextTrackCue(e.startTime,e.endTime,e.text);y.id=e.id,_.addCue(y)}catch(y){Ft.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${y}`)}}s==="disabled"&&(_.mode=s)}function Zs(_){const e=_.mode;if(e==="disabled"&&(_.mode="hidden"),_.cues)for(let s=_.cues.length;s--;)_.removeCue(_.cues[s]);e==="disabled"&&(_.mode=e)}function Vc(_,e,s,u){const y=_.mode;if(y==="disabled"&&(_.mode="hidden"),_.cues&&_.cues.length>0){const A=j_(_.cues,e,s);for(let l=0;l_[s].endTime)return-1;let u=0,y=s;for(;u<=y;){const A=Math.floor((y+u)/2);if(e<_[A].startTime)y=A-1;else if(e>_[A].startTime&&u-1)for(let A=y,l=_.length;A=e&&c.endTime<=s)u.push(c);else if(c.startTime>s)return u}return u}function po(_){const e=[];for(let s=0;s<_.length;s++){const u=_[s];(u.kind==="subtitles"||u.kind==="captions")&&u.label&&e.push(_[s])}return e}var xr={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const V_=.25;function Hc(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function Ph(_,e,s,u,y){let A=new _(e,s,"");try{A.value=u,y&&(A.type=y)}catch{A=new _(e,s,JSON.stringify(y?Dn({type:y},u):u))}return A}const $a=(()=>{const _=Hc();try{_&&new _(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function pc(_,e){return _.getTime()/1e3-e}function H_(_){return Uint8Array.from(_.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class z_{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(rt.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(rt.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(rt.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(rt.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,s){this.media=s.media}onMediaDetaching(){this.id3Track&&(Zs(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const s=this.getID3Track(e.textTracks);return s.mode="hidden",s}getID3Track(e){if(this.media){for(let s=0;s$a&&(t=$a),t-i<=0&&(t=i+V_);for(let a=0;ai.type===xr.audioId3&&p:y==="video"?r=i=>i.type===xr.emsg&&c:r=i=>i.type===xr.audioId3&&p||i.type===xr.emsg&&c,Vc(A,s,u,r)}}onLevelUpdated(e,{details:s}){if(!this.media||!s.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:u,id3Track:y}=this,{dateRanges:A}=s,l=Object.keys(A);if(y){const i=Object.keys(u).filter(t=>!l.includes(t));for(let t=i.length;t--;){const n=i[t];Object.keys(u[n].cues).forEach(a=>{y.removeCue(u[n].cues[a])}),delete u[n]}}const c=s.fragments[s.fragments.length-1];if(l.length===0||!Ci(c==null?void 0:c.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const p=c.programDateTime/1e3-c.start,r=Hc();for(let i=0;i{if(D!==n.id){const R=A[D];if(R.class===n.class&&R.startDate>n.startDate&&(!C||n.startDatethis.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:s}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:s?e.liveMaxLatencyDurationCount*s.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:s,partHoldBack:u,targetduration:y}=e,{liveSyncDuration:A,liveSyncDurationCount:l,lowLatencyMode:c}=this.config,p=this.hls.userConfig;let r=c&&u||s;(p.liveSyncDuration||p.liveSyncDurationCount||r===0)&&(r=A!==void 0?A:l*y);const i=y;return r+Math.min(this.stallCount*1,i)}get liveSyncPosition(){const e=this.estimateLiveEdge(),s=this.targetLatency,u=this.levelDetails;if(e===null||s===null||u===null)return null;const y=u.edge,A=e-s-this.edgeStalled,l=y-u.totalduration,c=y-(this.config.lowLatencyMode&&u.partTarget||u.targetduration);return Math.min(Math.max(l,A),c)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const s=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-s,0)}get forwardBufferLength(){const{media:e,levelDetails:s}=this;if(!e||!s)return 0;const u=e.buffered.length;return(u?e.buffered.end(u-1):s.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(rt.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(rt.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(rt.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(rt.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(rt.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(rt.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(rt.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(rt.ERROR,this.onError,this)}onMediaAttached(e,s){this.media=s.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:s}){this.levelDetails=s,s.advanced&&this.timeupdate(),!s.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,s){var u;s.details===qt.BUFFER_STALLED_ERROR&&(this.stallCount++,(u=this.levelDetails)!=null&&u.live&&Ft.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:s}=this;if(!e||!s)return;this.currentTime=e.currentTime;const u=this.computeLatency();if(u===null)return;this._latency=u;const{lowLatencyMode:y,maxLiveSyncPlaybackRate:A}=this.config;if(!y||A===1||!s.live)return;const l=this.targetLatency;if(l===null)return;const c=u-l,p=Math.min(this.maxLatency,l+s.targetduration);if(c.05&&this.forwardBufferLength>1){const i=Math.min(2,Math.max(1,A)),t=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20;e.playbackRate=Math.min(i,Math.max(1,t))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const zc=["NONE","TYPE-0","TYPE-1",null];function K_(_){return zc.indexOf(_)>-1}const Do=["SDR","PQ","HLG"];function q_(_){return!!_&&Do.indexOf(_)>-1}var Ca={No:"",Yes:"YES",v2:"v2"};function Y_(_,e){const{canSkipUntil:s,canSkipDateRanges:u,endSN:y}=_,A=e!==void 0?e-y:0;return s&&A!!s).map(s=>s.substring(0,4)).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return Nh(this._audioGroups,e)}hasSubtitleGroup(e){return Nh(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,s){if(s){if(e==="audio"){let u=this._audioGroups;u||(u=this._audioGroups=[]),u.indexOf(s)===-1&&u.push(s)}else if(e==="text"){let u=this._subtitleGroups;u||(u=this._subtitleGroups=[]),u.indexOf(s)===-1&&u.push(s)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function Nh(_,e){return!e||!_?!1:_.indexOf(e)!==-1}function mc(_,e){const s=e.startPTS;if(Ci(s)){let u=0,y;e.sn>_.sn?(u=s-_.start,y=_):(u=_.start-s,y=e),y.duration!==u&&(y.duration=u)}else e.sn>_.sn?_.cc===e.cc&&_.minEndPTS?e.start=_.start+(_.minEndPTS-_.start):e.start=_.start+_.duration:e.start=Math.max(_.start-e.duration,0)}function Fp(_,e,s,u,y,A){u-s<=0&&(Ft.warn("Fragment should have a positive duration",e),u=s+e.duration,A=y+e.duration);let c=s,p=u;const r=e.startPTS,i=e.endPTS;if(Ci(r)){const g=Math.abs(r-s);Ci(e.deltaPTS)?e.deltaPTS=Math.max(g,e.deltaPTS):e.deltaPTS=g,c=Math.max(s,r),s=Math.min(s,r),y=Math.min(y,e.startDTS),p=Math.min(u,i),u=Math.max(u,i),A=Math.max(A,e.endDTS)}const t=s-e.start;e.start!==0&&(e.start=s),e.duration=u-e.start,e.startPTS=s,e.maxStartPTS=c,e.startDTS=y,e.endPTS=u,e.minEndPTS=p,e.endDTS=A;const n=e.sn;if(!_||n<_.startSN||n>_.endSN)return 0;let a;const o=n-_.startSN,d=_.fragments;for(d[o]=e,a=o;a>0;a--)mc(d[a],d[a-1]);for(a=o;a=0;p--){const r=u[p].initSegment;if(r){s=r;break}}_.fragmentHint&&delete _.fragmentHint.endPTS;let y=0,A;if(X_(_,e,(p,r)=>{p.relurl&&(y=p.cc-r.cc),Ci(p.startPTS)&&Ci(p.endPTS)&&(r.start=r.startPTS=p.startPTS,r.startDTS=p.startDTS,r.maxStartPTS=p.maxStartPTS,r.endPTS=p.endPTS,r.endDTS=p.endDTS,r.minEndPTS=p.minEndPTS,r.duration=p.endPTS-p.startPTS,r.duration&&(A=r),e.PTSKnown=e.alignedSliding=!0),r.elementaryStreams=p.elementaryStreams,r.loader=p.loader,r.stats=p.stats,p.initSegment&&(r.initSegment=p.initSegment,s=p.initSegment)}),s&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(r=>{var i;r&&(!r.initSegment||r.initSegment.relurl===((i=s)==null?void 0:i.relurl))&&(r.initSegment=s)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(p=>!p),e.deltaUpdateFailed){Ft.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let p=e.skippedSegments;p--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=Q_(_.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const l=e.fragments;if(y){Ft.warn("discontinuity sliding from playlist, take drift into account");for(let p=0;p{r.elementaryStreams=p.elementaryStreams,r.stats=p.stats}),A?Fp(e,A,A.startPTS,A.endPTS,A.startDTS,A.endDTS):Up(_,e),l.length&&(e.totalduration=e.edge-l[0].start),e.driftStartTime=_.driftStartTime,e.driftStart=_.driftStart;const c=e.advancedDateTime;if(e.advanced&&c){const p=e.edge;e.driftStart||(e.driftStartTime=c,e.driftStart=p),e.driftEndTime=c,e.driftEnd=p}else e.driftEndTime=_.driftEndTime,e.driftEnd=_.driftEnd,e.advancedDateTime=_.advancedDateTime}function Q_(_,e,s){const u=xn({},_);return s&&s.forEach(y=>{delete u[y]}),Object.keys(e).forEach(y=>{const A=new _p(e[y].attr,u[y]);A.isValid?u[y]=A:Ft.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[y].attr)}"`)}),u}function Z_(_,e,s){if(_&&e){let u=0;for(let y=0,A=_.length;y<=A;y++){const l=_[y],c=e[y+u];l&&c&&l.index===c.index&&l.fragment.sn===c.fragment.sn?s(l,c):u--}}}function X_(_,e,s){const u=e.skippedSegments,y=Math.max(_.startSN,e.startSN)-e.startSN,A=(_.fragmentHint?1:0)+(u?e.endSN:Math.min(_.endSN,e.endSN))-e.startSN,l=e.startSN-_.startSN,c=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,p=_.fragmentHint?_.fragments.concat(_.fragmentHint):_.fragments;for(let r=y;r<=A;r++){const i=p[l+r];let t=c[r];u&&!t&&r=u.length||Wc(e,u[s].start)}function Wc(_,e){if(e){const s=_.fragments;for(let u=_.skippedSegments;ue){const A=u[u.length-1].duration*1e3;A{const{details:u}=e;u!=null&&u.fragments&&u.fragments.forEach(y=>{y.level=s})})}function Oo(_){switch(_.details){case qt.FRAG_LOAD_TIMEOUT:case qt.KEY_LOAD_TIMEOUT:case qt.LEVEL_LOAD_TIMEOUT:case qt.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Uh(_,e){const s=Oo(e);return _.default[`${s?"timeout":"error"}Retry`]}function wd(_,e){const s=_.backoff==="linear"?1:Math.pow(2,e);return Math.min(s*_.retryDelayMs,_.maxRetryDelayMs)}function Gh(_){return Dn(Dn({},_),{errorRetry:null,timeoutRetry:null})}function Mo(_,e,s,u){if(!_)return!1;const y=u==null?void 0:u.code,A=e<_.maxNumRetry&&(t5(y)||!!s);return _.shouldRetry?_.shouldRetry(_,e,s,u,A):A}function t5(_){return _===0&&navigator.onLine===!1||!!_&&(_<400||_>499)}const Vp={search:function(_,e){let s=0,u=_.length-1,y=null,A=null;for(;s<=u;){y=(s+u)/2|0,A=_[y];const l=e(A);if(l>0)s=y+1;else if(l<0)u=y-1;else return A}return null}};function i5(_,e,s){if(e===null||!Array.isArray(_)||!_.length||!Ci(e))return null;const u=_[0].programDateTime;if(e<(u||0))return null;const y=_[_.length-1].endProgramDateTime;if(e>=(y||0))return null;s=s||0;for(let A=0;A<_.length;++A){const l=_[A];if(n5(e,s,l))return l}return null}function Po(_,e,s=0,u=0){let y=null;if(_){y=e[_.sn-e[0].sn+1]||null;const l=_.endDTS-s;l>0&&l<15e-7&&(s+=15e-7)}else s===0&&e[0].start===0&&(y=e[0]);if(y&&(!_||_.level===y.level)&&Kc(s,u,y)===0)return y;const A=Vp.search(e,Kc.bind(null,s,u));return A&&(A!==_||!y)?A:y}function Kc(_=0,e=0,s){if(s.start<=_&&s.start+s.duration>_)return 0;const u=Math.min(e,s.duration+(s.deltaPTS?s.deltaPTS:0));return s.start+s.duration-u<=_?1:s.start-u>_&&s.start?-1:0}function n5(_,e,s){const u=Math.min(e,s.duration+(s.deltaPTS?s.deltaPTS:0))*1e3;return(s.endProgramDateTime||0)-u>_}function r5(_,e){return Vp.search(_,s=>s.cce?-1:0)}var Vn={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Tr={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class s5{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=Ft.log.bind(Ft,"[info]:"),this.warn=Ft.warn.bind(Ft,"[warning]:"),this.error=Ft.error.bind(Ft,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(rt.ERROR,this.onError,this),e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(rt.ERROR,this.onError,this),e.off(rt.ERROR,this.onErrorOut,this),e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===Hi.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,s){var u,y;if(s.fatal)return;const A=this.hls,l=s.context;switch(s.details){case qt.FRAG_LOAD_ERROR:case qt.FRAG_LOAD_TIMEOUT:case qt.KEY_LOAD_ERROR:case qt.KEY_LOAD_TIMEOUT:s.errorAction=this.getFragRetryOrSwitchAction(s);return;case qt.FRAG_PARSING_ERROR:if((u=s.frag)!=null&&u.gap){s.errorAction={action:Vn.DoNothing,flags:Tr.None};return}case qt.FRAG_GAP:case qt.FRAG_DECRYPT_ERROR:{s.errorAction=this.getFragRetryOrSwitchAction(s),s.errorAction.action=Vn.SendAlternateToPenaltyBox;return}case qt.LEVEL_EMPTY_ERROR:case qt.LEVEL_PARSING_ERROR:{var c,p;const r=s.parent===Hi.MAIN?s.level:A.loadLevel;s.details===qt.LEVEL_EMPTY_ERROR&&((c=s.context)!=null&&(p=c.levelDetails)!=null&&p.live)?s.errorAction=this.getPlaylistRetryOrSwitchAction(s,r):(s.levelRetry=!1,s.errorAction=this.getLevelSwitchAction(s,r))}return;case qt.LEVEL_LOAD_ERROR:case qt.LEVEL_LOAD_TIMEOUT:typeof(l==null?void 0:l.level)=="number"&&(s.errorAction=this.getPlaylistRetryOrSwitchAction(s,l.level));return;case qt.AUDIO_TRACK_LOAD_ERROR:case qt.AUDIO_TRACK_LOAD_TIMEOUT:case qt.SUBTITLE_LOAD_ERROR:case qt.SUBTITLE_TRACK_LOAD_TIMEOUT:if(l){const r=A.levels[A.loadLevel];if(r&&(l.type===ln.AUDIO_TRACK&&r.hasAudioGroup(l.groupId)||l.type===ln.SUBTITLE_TRACK&&r.hasSubtitleGroup(l.groupId))){s.errorAction=this.getPlaylistRetryOrSwitchAction(s,A.loadLevel),s.errorAction.action=Vn.SendAlternateToPenaltyBox,s.errorAction.flags=Tr.MoveAllAlternatesMatchingHost;return}}return;case qt.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const r=A.levels[A.loadLevel],i=r==null?void 0:r.attrs["HDCP-LEVEL"];i?s.errorAction={action:Vn.SendAlternateToPenaltyBox,flags:Tr.MoveAllAlternatesMatchingHDCP,hdcpLevel:i}:this.keySystemError(s)}return;case qt.BUFFER_ADD_CODEC_ERROR:case qt.REMUX_ALLOC_ERROR:case qt.BUFFER_APPEND_ERROR:s.errorAction=this.getLevelSwitchAction(s,(y=s.level)!=null?y:A.loadLevel);return;case qt.INTERNAL_EXCEPTION:case qt.BUFFER_APPENDING_ERROR:case qt.BUFFER_FULL_ERROR:case qt.LEVEL_SWITCH_ERROR:case qt.BUFFER_STALLED_ERROR:case qt.BUFFER_SEEK_OVER_HOLE:case qt.BUFFER_NUDGE_ON_STALL:s.errorAction={action:Vn.DoNothing,flags:Tr.None};return}s.type===Wi.KEY_SYSTEM_ERROR&&this.keySystemError(s)}keySystemError(e){const s=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,s)}getPlaylistRetryOrSwitchAction(e,s){const u=this.hls,y=Uh(u.config.playlistLoadPolicy,e),A=this.playlistError++;if(Mo(y,A,Oo(e),e.response))return{action:Vn.RetryRequest,flags:Tr.None,retryConfig:y,retryCount:A};const c=this.getLevelSwitchAction(e,s);return y&&(c.retryConfig=y,c.retryCount=A),c}getFragRetryOrSwitchAction(e){const s=this.hls,u=this.getVariantLevelIndex(e.frag),y=s.levels[u],{fragLoadPolicy:A,keyLoadPolicy:l}=s.config,c=Uh(e.details.startsWith("key")?l:A,e),p=s.levels.reduce((i,t)=>i+t.fragmentError,0);if(y&&(e.details!==qt.FRAG_GAP&&y.fragmentError++,Mo(c,p,Oo(e),e.response)))return{action:Vn.RetryRequest,flags:Tr.None,retryConfig:c,retryCount:p};const r=this.getLevelSwitchAction(e,u);return c&&(r.retryConfig=c,r.retryCount=p),r}getLevelSwitchAction(e,s){const u=this.hls;s==null&&(s=u.loadLevel);const y=this.hls.levels[s];if(y){var A,l;const r=e.details;y.loadError++,r===qt.BUFFER_APPEND_ERROR&&y.fragmentError++;let i=-1;const{levels:t,loadLevel:n,minAutoLevel:a,maxAutoLevel:o}=u;u.autoLevelEnabled||(u.loadLevel=-1);const d=(A=e.frag)==null?void 0:A.type,m=(d===Hi.AUDIO&&r===qt.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(r===qt.BUFFER_ADD_CODEC_ERROR||r===qt.BUFFER_APPEND_ERROR))&&t.some(({audioCodec:D})=>y.audioCodec!==D),b=e.sourceBufferName==="video"&&(r===qt.BUFFER_ADD_CODEC_ERROR||r===qt.BUFFER_APPEND_ERROR)&&t.some(({codecSet:D,audioCodec:R})=>y.codecSet!==D&&y.audioCodec===R),{type:w,groupId:C}=(l=e.context)!=null?l:{};for(let D=t.length;D--;){const R=(D+n)%t.length;if(R!==n&&R>=a&&R<=o&&t[R].loadError===0){var c,p;const T=t[R];if(r===qt.FRAG_GAP&&e.frag){const P=t[R].details;if(P){const L=Po(e.frag,P.fragments,e.frag.start);if(L!=null&&L.gap)continue}}else{if(w===ln.AUDIO_TRACK&&T.hasAudioGroup(C)||w===ln.SUBTITLE_TRACK&&T.hasSubtitleGroup(C))continue;if(d===Hi.AUDIO&&(c=y.audioGroups)!=null&&c.some(P=>T.hasAudioGroup(P))||d===Hi.SUBTITLE&&(p=y.subtitleGroups)!=null&&p.some(P=>T.hasSubtitleGroup(P))||m&&y.audioCodec===T.audioCodec||!m&&y.audioCodec!==T.audioCodec||b&&y.codecSet===T.codecSet)continue}i=R;break}}if(i>-1&&u.loadLevel!==i)return e.levelRetry=!0,this.playlistError=0,{action:Vn.SendAlternateToPenaltyBox,flags:Tr.None,nextAutoLevel:i}}return{action:Vn.SendAlternateToPenaltyBox,flags:Tr.MoveAllAlternatesMatchingHost}}onErrorOut(e,s){var u;switch((u=s.errorAction)==null?void 0:u.action){case Vn.DoNothing:break;case Vn.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(s),!s.errorAction.resolved&&s.details!==qt.FRAG_GAP?s.fatal=!0:/MediaSource readyState: ended/.test(s.error.message)&&(this.warn(`MediaSource ended after "${s.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(s.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const s=this.hls,u=e.errorAction;if(!u)return;const{flags:y,hdcpLevel:A,nextAutoLevel:l}=u;switch(y){case Tr.None:this.switchLevel(e,l);break;case Tr.MoveAllAlternatesMatchingHDCP:A&&(s.maxHdcpLevel=zc[zc.indexOf(A)-1],u.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${s.maxHdcpLevel}" or lower`);break}u.resolved||this.switchLevel(e,l)}switchLevel(e,s){s!==void 0&&e.errorAction&&(this.warn(`switching to level ${s} after ${e.details}`),this.hls.nextAutoLevel=s,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}class Sd{constructor(e,s){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=Ft.log.bind(Ft,`${s}:`),this.warn=Ft.warn.bind(Ft,`${s}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,s){const u=s==null?void 0:s.renditionReports;if(u){let y=-1;for(let A=0;A=0&&p>s.partTarget&&(c+=1)}return new Bh(l,c>=0?c:void 0,Ca.No)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,s,u){const{details:y,stats:A}=s,l=self.performance.now(),c=A.loading.first?Math.max(0,l-A.loading.first):0;if(y.advancedDateTime=Date.now()-c,y.live||u!=null&&u.live){if(y.reloaded(u),u&&this.log(`live playlist ${e} ${y.advanced?"REFRESHED "+y.lastPartSn+"-"+y.lastPartIndex:y.updated?"UPDATED":"MISSED"}`),u&&y.fragments.length>0&&J_(u,y),!this.canLoad||!y.live)return;let p,r,i;if(y.canBlockReload&&y.endSN&&y.advanced){const g=this.hls.config.lowLatencyMode,m=y.lastPartSn,v=y.endSN,b=y.lastPartIndex,w=b!==-1,C=m===v,D=g?0:b;w?(r=C?v+1:m,i=C?D:b+1):r=v+1;const R=y.age,T=R+y.ageHeader;let P=Math.min(T-y.partTarget,y.targetduration*1.5);if(P>0){if(u&&P>u.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${u.tuneInGoal} to: ${P} with playlist age: ${y.age}`),P=0;else{const L=Math.floor(P/y.targetduration);if(r+=L,i!==void 0){const I=Math.round(P%y.targetduration/y.partTarget);i+=I}this.log(`CDN Tune-in age: ${y.ageHeader}s last advanced ${R.toFixed(2)}s goal: ${P} skip sn ${L} to part ${i}`)}y.tuneInGoal=P}if(p=this.getDeliveryDirectives(y,s.deliveryDirectives,r,i),g||!C){this.loadPlaylist(p);return}}else(y.canBlockReload||y.canSkipUntil)&&(p=this.getDeliveryDirectives(y,s.deliveryDirectives,r,i));const t=this.hls.mainForwardBufferInfo,n=t?t.end-t.len:0,a=(y.edge-n)*1e3,o=$_(y,a);y.updated&&l>this.requestScheduled+o&&(this.requestScheduled=A.loading.start),r!==void 0&&y.canBlockReload?this.requestScheduled=A.loading.first+o-(y.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+othis.loadPlaylist(p),d)}else this.clearTimer()}getDeliveryDirectives(e,s,u,y){let A=Y_(e,u);return s!=null&&s.skip&&e.deltaUpdateFailed&&(u=s.msn,y=s.part,A=Ca.No),new Bh(u,y,A)}checkRetry(e){const s=e.details,u=Oo(e),y=e.errorAction,{action:A,retryCount:l=0,retryConfig:c}=y||{},p=!!y&&!!c&&(A===Vn.RetryRequest||!y.resolved&&A===Vn.SendAlternateToPenaltyBox);if(p){var r;if(this.requestScheduled=-1,l>=c.maxNumRetry)return!1;if(u&&(r=e.context)!=null&&r.deliveryDirectives)this.warn(`Retrying playlist loading ${l+1}/${c.maxNumRetry} after "${s}" without delivery-directives`),this.loadPlaylist();else{const i=wd(c,l);this.timer=self.setTimeout(()=>this.loadPlaylist(),i),this.warn(`Retrying playlist loading ${l+1}/${c.maxNumRetry} after "${s}" in ${i}ms`)}e.levelRetry=!0,y.resolved=!0}return p}}class js{constructor(e,s=0,u=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=s,this.totalWeight_=u}sample(e,s){const u=Math.pow(this.alpha_,e);this.estimate_=s*(1-u)+u*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class a5{constructor(e,s,u,y=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=u,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new js(e),this.fast_=new js(s),this.defaultTTFB_=y,this.ttfb_=new js(e)}update(e,s){const{slow_:u,fast_:y,ttfb_:A}=this;u.halfLife!==e&&(this.slow_=new js(e,u.getEstimate(),u.getTotalWeight())),y.halfLife!==s&&(this.fast_=new js(s,y.getEstimate(),y.getTotalWeight())),A.halfLife!==e&&(this.ttfb_=new js(e,A.getEstimate(),A.getTotalWeight()))}sample(e,s){e=Math.max(e,this.minDelayMs_);const u=8*s,y=e/1e3,A=u/y;this.fast_.sample(y,A),this.slow_.sample(y,A)}sampleTTFB(e){const s=e/1e3,u=Math.sqrt(2)*Math.exp(-Math.pow(s,2)/2);this.ttfb_.sample(u,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const Hp={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},jh={};function o5(_,e,s,u,y,A){const l=_.audioCodec?_.audioGroups:null,c=A==null?void 0:A.audioCodec,p=A==null?void 0:A.channels,r=p?parseInt(p):c?1/0:2;let i=null;if(l!=null&&l.length)try{l.length===1&&l[0]?i=e.groups[l[0]].channels:i=l.reduce((t,n)=>{if(n){const a=e.groups[n];if(!a)throw new Error(`Audio track group ${n} not found`);Object.keys(a.channels).forEach(o=>{t[o]=(t[o]||0)+a.channels[o]})}return t},{2:0})}catch{return!0}return _.videoCodec!==void 0&&(_.width>1920&&_.height>1088||_.height>1920&&_.width>1088||_.frameRate>Math.max(u,30)||_.videoRange!=="SDR"&&_.videoRange!==s||_.bitrate>Math.max(y,8e6))||!!i&&Ci(r)&&Object.keys(i).some(t=>parseInt(t)>r)}function l5(_,e,s){const u=_.videoCodec,y=_.audioCodec;if(!u||!y||!s)return Promise.resolve(Hp);const A={width:_.width,height:_.height,bitrate:Math.ceil(Math.max(_.bitrate*.9,_.averageBitrate)),framerate:_.frameRate||30},l=_.videoRange;l!=="SDR"&&(A.transferFunction=l.toLowerCase());const c=u.split(",").map(p=>({type:"media-source",video:Dn(Dn({},A),{},{contentType:La(p,"video")})}));return y&&_.audioGroups&&_.audioGroups.forEach(p=>{var r;p&&((r=e.groups[p])==null||r.tracks.forEach(i=>{if(i.groupId===p){const t=i.channels||"",n=parseFloat(t);Ci(n)&&n>2&&c.push.apply(c,y.split(",").map(a=>({type:"media-source",audio:{contentType:La(a,"audio"),channels:""+n}})))}}))}),Promise.all(c.map(p=>{const r=c5(p);return jh[r]||(jh[r]=s.decodingInfo(p))})).then(p=>({supported:!p.some(r=>!r.supported),configurations:c,decodingInfoResults:p})).catch(p=>({supported:!1,configurations:c,decodingInfoResults:[],error:p}))}function c5(_){const{audio:e,video:s}=_,u=s||e;if(u){const y=u.contentType.split('"')[1];if(s)return`r${s.height}x${s.width}f${Math.ceil(s.framerate)}${s.transferFunction||"sd"}_${y}_${Math.ceil(s.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${y}`}return""}function d5(){if(typeof matchMedia=="function"){const _=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(_.media!==e.media)return _.matches===!0}return!1}function u5(_,e){let s=!1,u=[];return _&&(s=_!=="SDR",u=[_]),e&&(u=e.allowedVideoRanges||Do.slice(0),s=e.preferHDR!==void 0?e.preferHDR:d5(),s?u=u.filter(y=>y!=="SDR"):u=["SDR"]),{preferHDR:s,allowedVideoRanges:u}}function h5(_,e,s,u,y){const A=Object.keys(_),l=u==null?void 0:u.channels,c=u==null?void 0:u.audioCodec,p=l&&parseInt(l)===2;let r=!0,i=!1,t=1/0,n=1/0,a=1/0,o=0,d=[];const{preferHDR:g,allowedVideoRanges:m}=u5(e,y);for(let C=A.length;C--;){const D=_[A[C]];r=D.channels[2]>0,t=Math.min(t,D.minHeight),n=Math.min(n,D.minFramerate),a=Math.min(a,D.minBitrate);const R=m.filter(T=>D.videoRanges[T]>0);R.length>0&&(i=!0,d=R)}t=Ci(t)?t:0,n=Ci(n)?n:0;const v=Math.max(1080,t),b=Math.max(30,n);return a=Ci(a)?a:s,s=Math.max(a,s),i||(e=void 0,d=[]),{codecSet:A.reduce((C,D)=>{const R=_[D];if(D===C)return C;if(R.minBitrate>s)return Yr(D,`min bitrate of ${R.minBitrate} > current estimate of ${s}`),C;if(!R.hasDefaultAudio)return Yr(D,"no renditions with default or auto-select sound found"),C;if(c&&D.indexOf(c.substring(0,4))%5!==0)return Yr(D,`audio codec preference "${c}" not found`),C;if(l&&!p){if(!R.channels[l])return Yr(D,`no renditions with ${l} channel sound found (channels options: ${Object.keys(R.channels)})`),C}else if((!c||p)&&r&&R.channels[2]===0)return Yr(D,"no renditions with stereo sound found"),C;return R.minHeight>v?(Yr(D,`min resolution of ${R.minHeight} > maximum of ${v}`),C):R.minFramerate>b?(Yr(D,`min framerate of ${R.minFramerate} > maximum of ${b}`),C):d.some(T=>R.videoRanges[T]>0)?R.maxScore=Io(C)||R.fragmentError>_[C].fragmentError)?C:(o=R.maxScore,D):(Yr(D,`no variants with VIDEO-RANGE of ${JSON.stringify(d)} found`),C)},void 0),videoRanges:d,preferHDR:g,minFramerate:n,minBitrate:a}}function Yr(_,e){Ft.log(`[abr] start candidates with "${_}" ignored because ${e}`)}function f5(_){return _.reduce((e,s)=>{let u=e.groups[s.groupId];u||(u=e.groups[s.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),u.tracks.push(s);const y=s.channels||"2";return u.channels[y]=(u.channels[y]||0)+1,u.hasDefault=u.hasDefault||s.default,u.hasAutoSelect=u.hasAutoSelect||s.autoselect,u.hasDefault&&(e.hasDefaultAudio=!0),u.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function p5(_,e,s,u){return _.slice(s,u+1).reduce((y,A)=>{if(!A.codecSet)return y;const l=A.audioGroups;let c=y[A.codecSet];c||(y[A.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!l,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,A.bitrate);const p=Math.min(A.height,A.width);return c.minHeight=Math.min(c.minHeight,p),c.minFramerate=Math.min(c.minFramerate,A.frameRate),c.maxScore=Math.max(c.maxScore,A.score),c.fragmentError+=A.fragmentError,c.videoRanges[A.videoRange]=(c.videoRanges[A.videoRange]||0)+1,l&&l.forEach(r=>{if(!r)return;const i=e.groups[r];c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?i.hasDefault:i.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(i.channels).forEach(t=>{c.channels[t]=(c.channels[t]||0)+i.channels[t]})}),y},{})}function jr(_,e,s){if("attrs"in _){const u=e.indexOf(_);if(u!==-1)return u}for(let u=0;uu.indexOf(y)===-1)}function Vs(_,e){const{audioCodec:s,channels:u}=_;return(s===void 0||(e.audioCodec||"").substring(0,4)===s.substring(0,4))&&(u===void 0||u===(e.channels||"2"))}function g5(_,e,s,u,y){const A=e[u],c=e.reduce((n,a,o)=>{const d=a.uri;return(n[d]||(n[d]=[])).push(o),n},{})[A.uri];c.length>1&&(u=Math.max.apply(Math,c));const p=A.videoRange,r=A.frameRate,i=A.codecSet.substring(0,4),t=Vh(e,u,n=>{if(n.videoRange!==p||n.frameRate!==r||n.codecSet.substring(0,4)!==i)return!1;const a=n.audioGroups,o=s.filter(d=>!a||a.indexOf(d.groupId)!==-1);return jr(_,o,y)>-1});return t>-1?t:Vh(e,u,n=>{const a=n.audioGroups,o=s.filter(d=>!a||a.indexOf(d.groupId)!==-1);return jr(_,o,y)>-1})}function Vh(_,e,s){for(let u=e;u;u--)if(s(_[u]))return u;for(let u=e+1;u<_.length;u++)if(s(_[u]))return u;return-1}class A5{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this._abandonRulesCheck=()=>{const{fragCurrent:s,partCurrent:u,hls:y}=this,{autoLevelEnabled:A,media:l}=y;if(!s||!l)return;const c=performance.now(),p=u?u.stats:s.stats,r=u?u.duration:s.duration,i=c-p.loading.start,t=y.minAutoLevel;if(p.aborted||p.loaded&&p.loaded===p.total||s.level<=t){this.clearTimer(),this._nextAutoLevel=-1;return}if(!A||l.paused||!l.playbackRate||!l.readyState)return;const n=y.mainForwardBufferInfo;if(n===null)return;const a=this.bwEstimator.getEstimateTTFB(),o=Math.abs(l.playbackRate);if(i<=Math.max(a,1e3*(r/(o*2))))return;const d=n.len/o,g=p.loading.first?p.loading.first-p.loading.start:-1,m=p.loaded&&g>-1,v=this.getBwEstimate(),b=y.levels,w=b[s.level],C=p.total||Math.max(p.loaded,Math.round(r*w.maxBitrate/8));let D=m?i-g:i;D<1&&m&&(D=Math.min(i,p.loaded*8/v));const R=m?p.loaded*1e3/D:0,T=R?(C-p.loaded)/R:C*8/v+a/1e3;if(T<=d)return;const P=R?R*8:v;let L=Number.POSITIVE_INFINITY,I;for(I=s.level-1;I>t;I--){const O=b[I].maxBitrate;if(L=this.getTimeToLoadFrag(a/1e3,P,r*O,!b[I].details),L=T||L>r*10)return;y.nextLoadLevel=y.nextAutoLevel=I,m?this.bwEstimator.sample(i-Math.min(a,g),p.loaded):this.bwEstimator.sampleTTFB(i);const x=b[I].bitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>x&&this.resetEstimator(x),this.clearTimer(),Ft.warn(`[abr] Fragment ${s.sn}${u?" part "+u.index:""} of level ${s.level} is loading too slowly; +`,"color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;");const is=Ls})(),y=y.default})())})(vp);var Nb=vp.exports;const Fb=sd(Nb);function Ub(_){return _&&_.__esModule&&Object.prototype.hasOwnProperty.call(_,"default")?_.default:_}var bp={exports:{}};(function(_,e){(function(s){var u=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,A=/^(?=([^\/?#]*))\1([^]*)$/,y=/(?:\/|^)\.(?=\/)/g,l=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,c={buildAbsoluteURL:function(p,r,i){if(i=i||{},p=p.trim(),r=r.trim(),!r){if(!i.alwaysNormalize)return p;var t=c.parseURL(p);if(!t)throw new Error("Error trying to parse base URL.");return t.path=c.normalizePath(t.path),c.buildURLFromParts(t)}var n=c.parseURL(r);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return i.alwaysNormalize?(n.path=c.normalizePath(n.path),c.buildURLFromParts(n)):r;var a=c.parseURL(p);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var o=A.exec(a.path);a.netLoc=o[1],a.path=o[2]}a.netLoc&&!a.path&&(a.path="/");var d={scheme:a.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(d.netLoc=a.netLoc,n.path[0]!=="/"))if(!n.path)d.path=a.path,n.params||(d.params=a.params,n.query||(d.query=a.query));else{var g=a.path,m=g.substring(0,g.lastIndexOf("/")+1)+n.path;d.path=c.normalizePath(m)}return d.path===null&&(d.path=i.alwaysNormalize?c.normalizePath(n.path):n.path),c.buildURLFromParts(d)},parseURL:function(p){var r=u.exec(p);return r?{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}:null},normalizePath:function(p){for(p=p.split("").reverse().join("").replace(y,"");p.length!==(p=p.replace(l,"")).length;);return p.split("").reverse().join("")},buildURLFromParts:function(p){return p.scheme+p.netLoc+p.path+p.params+p.query+p.fragment}};_.exports=c})()})(bp);var yd=bp.exports;function gh(_,e){var s=Object.keys(_);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(_);e&&(u=u.filter(function(A){return Object.getOwnPropertyDescriptor(_,A).enumerable})),s.push.apply(s,u)}return s}function Dn(_){for(var e=1;e`):vs}function Kb(_,...e){e.forEach(function(s){Ta[s]=_[s]?_[s].bind(_):Wb(s)})}function qb(_,e){if(typeof console=="object"&&_===!0||typeof _=="object"){Kb(_,"debug","log","info","warn","error");try{Ta.log(`Debug logs enabled for "${e}" in hls.js version 1.5.1-patch.1`)}catch{Ta=Uc}}else Ta=Uc}const Ft=Ta,Yb=/^(\d+)x(\d+)$/,Ah=/(.+?)=(".*?"|.*?)(?:,|$)/g;class bn{constructor(e){typeof e=="string"&&(e=bn.parseAttrList(e)),xn(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const s=parseInt(this[e],10);return s>Number.MAX_SAFE_INTEGER?1/0:s}hexadecimalInteger(e){if(this[e]){let s=(this[e]||"0x").slice(2);s=(s.length&1?"0":"")+s;const u=new Uint8Array(s.length/2);for(let A=0;ANumber.MAX_SAFE_INTEGER?1/0:s}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,s){const u=this[e];return u?parseFloat(u):s}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const s=Yb.exec(this[e]);if(s!==null)return{width:parseInt(s[1],10),height:parseInt(s[2],10)}}static parseAttrList(e){let s;const u={},A='"';for(Ah.lastIndex=0;(s=Ah.exec(e))!==null;){let y=s[2];y.indexOf(A)===0&&y.lastIndexOf(A)===y.length-1&&(y=y.slice(1,-1));const l=s[1].trim();u[l]=y}return u}}function Jb(_){return _!=="ID"&&_!=="CLASS"&&_!=="START-DATE"&&_!=="DURATION"&&_!=="END-DATE"&&_!=="END-ON-NEXT"}function Qb(_){return _==="SCTE35-OUT"||_==="SCTE35-IN"}class _p{constructor(e,s){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,s){const u=s.attr;for(const A in u)if(Object.prototype.hasOwnProperty.call(e,A)&&e[A]!==u[A]){Ft.warn(`DATERANGE tag attribute: "${A}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=A;break}e=xn(new bn({}),u,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const u=new Date(this.attr["END-DATE"]);Ci(u.getTime())&&(this._endDate=u)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(Ci(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&Ci(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class Zo{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var fn={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Ep{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[fn.AUDIO]:null,[fn.VIDEO]:null,[fn.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,s){const u=e.split("@",2);let A;u.length===1?A=(s==null?void 0:s.byteRangeEndOffset)||0:A=parseInt(u[1]),this._byteRange=[A,parseInt(u[0])+A]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=yd.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class ac extends Ep{constructor(e,s){super(s),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new Zo,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const s=this.levelkeys.identity;if(s)this._decryptdata=s.getDecryptData(this.sn);else{const u=Object.keys(this.levelkeys);if(u.length===1)return this._decryptdata=this.levelkeys[u[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!Ci(this.programDateTime))return null;const e=Ci(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const s=Object.keys(this.levelkeys),u=s.length;if(u>1||u===1&&this.levelkeys[s[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const s=this.levelkeys[e];s&&!this._decryptdata&&(this._decryptdata=s.getDecryptData(this.sn))}}abortRequests(){var e,s;(e=this.loader)==null||e.abort(),(s=this.keyLoader)==null||s.abort()}setElementaryStreamInfo(e,s,u,A,y,l=!1){const{elementaryStreams:c}=this,p=c[e];if(!p){c[e]={startPTS:s,endPTS:u,startDTS:A,endDTS:y,partial:l};return}p.startPTS=Math.min(p.startPTS,s),p.endPTS=Math.max(p.endPTS,u),p.startDTS=Math.min(p.startDTS,A),p.endDTS=Math.max(p.endDTS,y)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[fn.AUDIO]=null,e[fn.VIDEO]=null,e[fn.AUDIOVIDEO]=null}}class Zb extends Ep{constructor(e,s,u,A,y){super(u),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new Zo,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=s,this.index=A;const l=e.enumeratedString("BYTERANGE");l&&this.setByteRange(l,y),y&&(this.fragOffset=y.fragOffset+y.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const Xb=10;class $b{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const s=this.lastPartSn-e.lastPartSn,u=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!u||!!s||!this.live,this.advanced=this.endSN>e.endSN||s>0||s===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?Ci(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Xb}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function vd(_){return Uint8Array.from(atob(_),e=>e.charCodeAt(0))}function e_(_){const e=Gc(_).subarray(0,16),s=new Uint8Array(16);return s.set(e,16-e.length),s}function t_(_){const e=function(u,A,y){const l=u[A];u[A]=u[y],u[y]=l};e(_,0,3),e(_,1,2),e(_,4,5),e(_,6,7)}function i_(_){const e=_.split(":");let s=null;if(e[0]==="data"&&e.length===2){const u=e[1].split(";"),A=u[u.length-1].split(",");if(A.length===2){const y=A[0]==="base64",l=A[1];y?(u.splice(-1,1),s=vd(l)):s=e_(l)}}return s}function Gc(_){return Uint8Array.from(unescape(encodeURIComponent(_)),e=>e.charCodeAt(0))}const oa=typeof self<"u"?self:void 0;var vn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Zn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function yh(_){switch(_){case Zn.FAIRPLAY:return vn.FAIRPLAY;case Zn.PLAYREADY:return vn.PLAYREADY;case Zn.WIDEVINE:return vn.WIDEVINE;case Zn.CLEARKEY:return vn.CLEARKEY}}var wp={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function n_(_){if(_===wp.WIDEVINE)return vn.WIDEVINE}function vh(_){switch(_){case vn.FAIRPLAY:return Zn.FAIRPLAY;case vn.PLAYREADY:return Zn.PLAYREADY;case vn.WIDEVINE:return Zn.WIDEVINE;case vn.CLEARKEY:return Zn.CLEARKEY}}function oc(_){const{drmSystems:e,widevineLicenseUrl:s}=_,u=e?[vn.FAIRPLAY,vn.WIDEVINE,vn.PLAYREADY,vn.CLEARKEY].filter(A=>!!e[A]):[];return!u[vn.WIDEVINE]&&s&&u.push(vn.WIDEVINE),u}const Sp=function(_){return oa!=null&&(_=oa.navigator)!=null&&_.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function r_(_,e,s,u){let A;switch(_){case vn.FAIRPLAY:A=["cenc","sinf"];break;case vn.WIDEVINE:case vn.PLAYREADY:A=["cenc"];break;case vn.CLEARKEY:A=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${_}`)}return s_(A,e,s,u)}function s_(_,e,s,u){return[{initDataTypes:_,persistentState:u.persistentState||"optional",distinctiveIdentifier:u.distinctiveIdentifier||"optional",sessionTypes:u.sessionTypes||[u.sessionType||"temporary"],audioCapabilities:e.map(y=>({contentType:`audio/mp4; codecs="${y}"`,robustness:u.audioRobustness||"",encryptionScheme:u.audioEncryptionScheme||null})),videoCapabilities:s.map(y=>({contentType:`video/mp4; codecs="${y}"`,robustness:u.videoRobustness||"",encryptionScheme:u.videoEncryptionScheme||null}))}]}function Ts(_,e,s){return Uint8Array.prototype.slice?_.slice(e,s):new Uint8Array(Array.prototype.slice.call(_,e,s))}const bd=(_,e)=>e+10<=_.length&&_[e]===73&&_[e+1]===68&&_[e+2]===51&&_[e+3]<255&&_[e+4]<255&&_[e+6]<128&&_[e+7]<128&&_[e+8]<128&&_[e+9]<128,Tp=(_,e)=>e+10<=_.length&&_[e]===51&&_[e+1]===68&&_[e+2]===73&&_[e+3]<255&&_[e+4]<255&&_[e+6]<128&&_[e+7]<128&&_[e+8]<128&&_[e+9]<128,Ra=(_,e)=>{const s=e;let u=0;for(;bd(_,e);){u+=10;const A=Xo(_,e+6);u+=A,Tp(_,e+10)&&(u+=10),e+=u}if(u>0)return _.subarray(s,s+u)},Xo=(_,e)=>{let s=0;return s=(_[e]&127)<<21,s|=(_[e+1]&127)<<14,s|=(_[e+2]&127)<<7,s|=_[e+3]&127,s},a_=(_,e)=>bd(_,e)&&Xo(_,e+6)+10<=_.length-e,_d=_=>{const e=xp(_);for(let s=0;s_&&_.key==="PRIV"&&_.info==="com.apple.streaming.transportStreamTimestamp",o_=_=>{const e=String.fromCharCode(_[0],_[1],_[2],_[3]),s=Xo(_,4),u=10;return{type:e,size:s,data:_.subarray(u,u+s)}},xp=_=>{let e=0;const s=[];for(;bd(_,e);){const u=Xo(_,e+6);e+=10;const A=e+u;for(;e+8_.type==="PRIV"?c_(_):_.type[0]==="W"?u_(_):d_(_),c_=_=>{if(_.size<2)return;const e=Vr(_.data,!0),s=new Uint8Array(_.data.subarray(e.length+1));return{key:_.type,info:e,data:s.buffer}},d_=_=>{if(_.size<2)return;if(_.type==="TXXX"){let s=1;const u=Vr(_.data.subarray(s),!0);s+=u.length+1;const A=Vr(_.data.subarray(s));return{key:_.type,info:u,data:A}}const e=Vr(_.data.subarray(1));return{key:_.type,data:e}},u_=_=>{if(_.type==="WXXX"){if(_.size<2)return;let s=1;const u=Vr(_.data.subarray(s),!0);s+=u.length+1;const A=Vr(_.data.subarray(s));return{key:_.type,info:u,data:A}}const e=Vr(_.data);return{key:_.type,data:e}},h_=_=>{if(_.data.byteLength===8){const e=new Uint8Array(_.data),s=e[3]&1;let u=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return u/=45,s&&(u+=4772185884e-2),Math.round(u)}},Vr=(_,e=!1)=>{const s=f_();if(s){const r=s.decode(_);if(e){const i=r.indexOf("\0");return i!==-1?r.substring(0,i):r}return r.replace(/\0/g,"")}const u=_.length;let A,y,l,c="",p=0;for(;p>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(A);break;case 12:case 13:y=_[p++],c+=String.fromCharCode((A&31)<<6|y&63);break;case 14:y=_[p++],l=_[p++],c+=String.fromCharCode((A&15)<<12|(y&63)<<6|(l&63)<<0);break}}return c};let lc;function f_(){if(!navigator.userAgent.includes("PlayStation 4"))return!lc&&typeof self.TextDecoder<"u"&&(lc=new self.TextDecoder("utf-8")),lc}const Fr={hexDump:function(_){let e="";for(let s=0;s<_.length;s++){let u=_[s].toString(16);u.length<2&&(u="0"+u),e+=u}return e}},ko=Math.pow(2,32)-1,p_=[].push,kp={video:1,audio:2,id3:3,text:4};function In(_){return String.fromCharCode.apply(null,_)}function Rp(_,e){const s=_[e]<<8|_[e+1];return s<0?65536+s:s}function Ki(_,e){const s=Ip(_,e);return s<0?4294967296+s:s}function Ip(_,e){return _[e]<<24|_[e+1]<<16|_[e+2]<<8|_[e+3]}function cc(_,e,s){_[e]=s>>24,_[e+1]=s>>16&255,_[e+2]=s>>8&255,_[e+3]=s&255}function m_(_){const e=_.byteLength;for(let s=0;s8&&_[s+4]===109&&_[s+5]===111&&_[s+6]===111&&_[s+7]===102)return!0;s=u>1?s+u:e}return!1}function Zi(_,e){const s=[];if(!e.length)return s;const u=_.byteLength;for(let A=0;A1?A+y:u;if(l===e[0])if(e.length===1)s.push(_.subarray(A+8,c));else{const p=Zi(_.subarray(A+8,c),e.slice(1));p.length&&p_.apply(s,p)}A=c}return s}function g_(_){const e=[],s=_[0];let u=8;const A=Ki(_,u);u+=4;const y=0,l=0;s===0?u+=8:u+=16,u+=2;let c=_.length+l;const p=Rp(_,u);u+=2;for(let r=0;r>>31===1)return Ft.warn("SIDX has hierarchical references (not supported)"),null;const o=Ki(_,i);i+=4,e.push({referenceSize:n,subsegmentDuration:o,info:{duration:o/A,start:c,end:c+n-1}}),c+=n,i+=4,u=i}return{earliestPresentationTime:y,timescale:A,version:s,referencesCount:p,references:e}}function Lp(_){const e=[],s=Zi(_,["moov","trak"]);for(let A=0;A{const y=Ki(A,4),l=e[y];l&&(l.default={duration:Ki(A,12),flags:Ki(A,20)})}),e}function A_(_){const e=_.subarray(8),s=e.subarray(86),u=In(e.subarray(4,8));let A=u;const y=u==="enca"||u==="encv";if(y){const c=Zi(e,[u])[0].subarray(u==="enca"?28:78);Zi(c,["sinf"]).forEach(r=>{const i=Zi(r,["schm"])[0];if(i){const t=In(i.subarray(4,8));if(t==="cbcs"||t==="cenc"){const n=Zi(r,["frma"])[0];n&&(A=In(n))}}})}switch(A){case"avc1":case"avc2":case"avc3":case"avc4":{const l=Zi(s,["avcC"])[0];A+="."+Za(l[1])+Za(l[2])+Za(l[3]);break}case"mp4a":{const l=Zi(e,[u])[0],c=Zi(l.subarray(28),["esds"])[0];if(c&&c.length>12){let p=4;if(c[p++]!==3)break;p=dc(c,p),p+=2;const r=c[p++];if(r&128&&(p+=2),r&64&&(p+=c[p++]),c[p++]!==4)break;p=dc(c,p);const i=c[p++];if(i===64)A+="."+Za(i);else break;if(p+=12,c[p++]!==5)break;p=dc(c,p);const t=c[p++];let n=(t&248)>>3;n===31&&(n+=1+((t&7)<<3)+((c[p]&224)>>5)),A+="."+n}break}case"hvc1":case"hev1":{const l=Zi(s,["hvcC"])[0],c=l[1],p=["","A","B","C"][c>>6],r=c&31,i=Ki(l,2),t=(c&32)>>5?"H":"L",n=l[12],a=l.subarray(6,12);A+="."+p+r,A+="."+i.toString(16).toUpperCase(),A+="."+t+n;let o="";for(let d=a.length;d--;){const g=a[d];(g||o)&&(o="."+g.toString(16).toUpperCase()+o)}A+=o;break}case"dvh1":case"dvhe":{const l=Zi(s,["dvcC"])[0],c=l[2]>>1&127,p=l[2]<<5&32|l[3]>>3&31;A+="."+Nr(c)+"."+Nr(p);break}case"vp09":{const l=Zi(s,["vpcC"])[0],c=l[4],p=l[5],r=l[6]>>4&15;A+="."+Nr(c)+"."+Nr(p)+"."+Nr(r);break}case"av01":{const l=Zi(s,["av1C"])[0],c=l[1]>>>5,p=l[1]&31,r=l[2]>>>7?"H":"M",i=(l[2]&64)>>6,t=(l[2]&32)>>5,n=c===2&&i?t?12:10:i?10:8,a=(l[2]&16)>>4,o=(l[2]&8)>>3,d=(l[2]&4)>>2,g=l[2]&3;A+="."+c+"."+Nr(p)+r+"."+Nr(n)+"."+a+"."+o+d+g+"."+Nr(1)+"."+Nr(1)+"."+Nr(1)+"."+0;break}}return{codec:A,encrypted:y}}function dc(_,e){const s=e+5;for(;_[e++]&128&&e{const l=Zi(A,["mdia","minf","stbl","stsd"])[0].subarray(8);let c=Zi(l,["enca"]);const p=c.length>0;p||(c=Zi(l,["encv"])),c.forEach(r=>{const i=p?r.subarray(28):r.subarray(78);Zi(i,["sinf"]).forEach(n=>{const a=Dp(n);if(a){const o=a.subarray(8,24);o.some(d=>d!==0)||(Ft.log(`[eme] Patching keyId in 'enc${p?"a":"v"}>sinf>>tenc' box: ${Fr.hexDump(o)} -> ${Fr.hexDump(s)}`),a.set(s,8))}})})}),_}function Dp(_){const e=Zi(_,["schm"])[0];if(e){const s=In(e.subarray(4,8));if(s==="cbcs"||s==="cenc")return Zi(_,["schi","tenc"])[0]}return Ft.error("[eme] missing 'schm' box"),null}function v_(_,e){return Zi(e,["moof","traf"]).reduce((s,u)=>{const A=Zi(u,["tfdt"])[0],y=A[0],l=Zi(u,["tfhd"]).reduce((c,p)=>{const r=Ki(p,4),i=_[r];if(i){let t=Ki(A,4);if(y===1){if(t===ko)return Ft.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),c;t*=ko+1,t+=Ki(A,8)}const n=i.timescale||9e4,a=t/n;if(Ci(a)&&(c===null||ai+t.info.duration||0,0))}return l}return u||A}function __(_){const e=Ki(_,0);let s=8;e&1&&(s+=4),e&4&&(s+=4);let u=0;const A=Ki(_,4);for(let y=0;y{Zi(u,["tfhd"]).forEach(A=>{const y=Ki(A,4),l=_[y];if(!l)return;const c=l.timescale||9e4;Zi(u,["tfdt"]).forEach(p=>{const r=p[0],i=s*c;if(i){let t=Ki(p,4);if(r===0)t-=i,t=Math.max(t,0),cc(p,4,t);else{t*=Math.pow(2,32),t+=Ki(p,8),t-=i,t=Math.max(t,0);const n=Math.floor(t/(ko+1)),a=Math.floor(t%(ko+1));cc(p,4,n),cc(p,8,a)}}})})})}function w_(_){const e={valid:null,remainder:null},s=Zi(_,["moof"]);if(s.length<2)return e.remainder=_,e;const u=s[s.length-1];return e.valid=Ts(_,0,u.byteOffset-8),e.remainder=Ts(_,u.byteOffset-8),e}function Ar(_,e){const s=new Uint8Array(_.length+e.length);return s.set(_),s.set(e,_.length),s}function bh(_,e){const s=[],u=e.samples,A=e.timescale,y=e.id;let l=!1;return Zi(u,["moof"]).map(p=>{const r=p.byteOffset-8;Zi(p,["traf"]).map(t=>{const n=Zi(t,["tfdt"]).map(a=>{const o=a[0];let d=Ki(a,4);return o===1&&(d*=Math.pow(2,32),d+=Ki(a,8)),d/A})[0];return n!==void 0&&(_=n),Zi(t,["tfhd"]).map(a=>{const o=Ki(a,4),d=Ki(a,0)&16777215,g=(d&1)!==0,m=(d&2)!==0,v=(d&8)!==0;let b=0;const w=(d&16)!==0;let C=0;const D=(d&32)!==0;let R=8;o===y&&(g&&(R+=8),m&&(R+=4),v&&(b=Ki(a,R),R+=4),w&&(C=Ki(a,R),R+=4),D&&(R+=4),e.type==="video"&&(l=S_(e.codec)),Zi(t,["trun"]).map(T=>{const P=T[0],L=Ki(T,0)&16777215,I=(L&1)!==0;let x=0;const O=(L&4)!==0,G=(L&256)!==0;let J=0;const te=(L&512)!==0;let le=0;const ne=(L&1024)!==0,ee=(L&2048)!==0;let M=0;const Y=Ki(T,4);let j=8;I&&(x=Ki(T,j),j+=4),O&&(j+=4);let z=x+r;for(let q=0;q>1&63;return s===39||s===40}else return(e&31)===6}function Ed(_,e,s,u){const A=Op(_);let y=0;y+=e;let l=0,c=0,p=0;for(;y=A.length)break;p=A[y++],l+=p}while(p===255);c=0;do{if(y>=A.length)break;p=A[y++],c+=p}while(p===255);const r=A.length-y;let i=y;if(cr){Ft.error(`Malformed SEI payload. ${c} is too small, only ${r} bytes left to parse.`);break}if(l===4){if(A[i++]===181){const n=Rp(A,i);if(i+=2,n===49){const a=Ki(A,i);if(i+=4,a===1195456820){const o=A[i++];if(o===3){const d=A[i++],g=31&d,m=64&d,v=m?2+g*3:0,b=new Uint8Array(v);if(m){b[0]=d;for(let w=1;w16){const t=[];for(let o=0;o<16;o++){const d=A[i++].toString(16);t.push(d.length==1?"0"+d:d),(o===3||o===5||o===7||o===9)&&t.push("-")}const n=c-16,a=new Uint8Array(n);for(let o=0;o>24&255,y[1]=u>>16&255,y[2]=u>>8&255,y[3]=u&255,y.set(_,4),A=0,u=8;A0?(y=new Uint8Array(4),e.length>0&&new DataView(y.buffer).setUint32(0,e.length,!1)):y=new Uint8Array;const l=new Uint8Array(4);return s&&s.byteLength>0&&new DataView(l.buffer).setUint32(0,s.byteLength,!1),x_([112,115,115,104],new Uint8Array([u,0,0,0]),_,y,A,l,s||new Uint8Array)}function R_(_){if(!(_ instanceof ArrayBuffer)||_.byteLength<32)return null;const e={version:0,systemId:"",kids:null,data:null},s=new DataView(_),u=s.getUint32(0);if(_.byteLength!==u&&u>44||s.getUint32(4)!==1886614376||(e.version=s.getUint32(8)>>>24,e.version>1))return null;e.systemId=Fr.hexDump(new Uint8Array(_,12,16));const y=s.getUint32(28);if(e.version===0){if(u-32=22&&(this.keyId=s.subarray(s.length-22,s.length-6));break;case Zn.PLAYREADY:{const u=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=k_(u,null,s);const A=new Uint16Array(s.buffer,s.byteOffset,s.byteLength/2),y=String.fromCharCode.apply(null,Array.from(A)),l=y.substring(y.indexOf("<"),y.length),r=new DOMParser().parseFromString(l,"text/xml").getElementsByTagName("KID")[0];if(r){const i=r.childNodes[0]?r.childNodes[0].nodeValue:r.getAttribute("VALUE");if(i){const t=vd(i).subarray(0,16);t_(t),this.keyId=t}}break}default:{let u=s.subarray(0,16);if(u.length!==16){const A=new Uint8Array(16);A.set(u,16-u.length),u=A}this.keyId=u;break}}if(!this.keyId||this.keyId.byteLength!==16){let u=Xa[this.uri];if(!u){const A=Object.keys(Xa).length%Number.MAX_SAFE_INTEGER;u=new Uint8Array(16),new DataView(u.buffer,12,4).setUint32(0,A),Xa[this.uri]=u}this.keyId=u}return this}}function I_(_){const e=new Uint8Array(16);for(let s=12;s<16;s++)e[s]=_>>8*(15-s)&255;return e}const Mp=/\{\$([a-zA-Z0-9-_]+)\}/g;function _h(_){return Mp.test(_)}function Qn(_,e,s){if(_.variableList!==null||_.hasVariableRefs)for(let u=s.length;u--;){const A=s[u],y=e[A];y&&(e[A]=jc(_,y))}}function jc(_,e){if(_.variableList!==null||_.hasVariableRefs){const s=_.variableList;return e.replace(Mp,u=>{const A=u.substring(2,u.length-1),y=s==null?void 0:s[A];return y===void 0?(_.playlistParsingError||(_.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${A}"`)),u):y})}return e}function Eh(_,e,s){let u=_.variableList;u||(_.variableList=u={});let A,y;if("QUERYPARAM"in e){A=e.QUERYPARAM;try{const l=new self.URL(s).searchParams;if(l.has(A))y=l.get(A);else throw new Error(`"${A}" does not match any query parameter in URI: "${s}"`)}catch(l){_.playlistParsingError||(_.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${l.message}`))}}else A=e.NAME,y=e.VALUE;A in u?_.playlistParsingError||(_.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${A}"`)):u[A]=y||""}function L_(_,e,s){const u=e.IMPORT;if(s&&u in s){let A=_.variableList;A||(_.variableList=A={}),A[u]=s[u]}else _.playlistParsingError||(_.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${u}"`))}function ua(_=!0){return typeof self>"u"?void 0:(_||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}const Ro={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function D_(_,e){const s=Ro[e];return!!s&&!!s[_.slice(0,4)]}function uc(_,e,s=!0){return!_.split(",").some(u=>!Pp(u,e,s))}function Pp(_,e,s=!0){var u;const A=ua(s);return(u=A==null?void 0:A.isTypeSupported(La(_,e)))!=null?u:!1}function La(_,e){return`${e}/mp4;codecs="${_}"`}function wh(_){if(_){const e=_.substring(0,4);return Ro.video[e]}return 2}function Io(_){return _.split(",").reduce((e,s)=>{const u=Ro.video[s];return u?(u*2+e)/(e?3:2):(Ro.audio[s]+e)/(e?2:1)},0)}const hc={};function O_(_,e=!0){if(hc[_])return hc[_];const s={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[_];for(let u=0;uO_(s.toLowerCase(),e))}function Sh(_,e){return _&&_!=="mp4a"?_:e}function P_(_){const e=_.split(".");if(e.length>2){let s=e.shift()+".";return s+=parseInt(e.shift()).toString(16),s+=("000"+parseInt(e.shift()).toString(16)).slice(-4),s}return _}const Th=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Ch=/#EXT-X-MEDIA:(.*)/g,B_=/^#EXT(?:INF|-X-TARGETDURATION):/m,xh=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),N_=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Gr{static findGroup(e,s){for(let u=0;u0&&y.length({id:r.attrs.AUDIO,audioCodec:r.audioCodec})),SUBTITLES:l.map(r=>({id:r.attrs.SUBTITLES,textCodec:r.textCodec})),"CLOSED-CAPTIONS":[]};let p=0;for(Ch.lastIndex=0;(A=Ch.exec(e))!==null;){const r=new bn(A[1]),i=r.TYPE;if(i){const t=c[i],n=y[i]||[];y[i]=n,Qn(u,r,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const a=r.LANGUAGE,o=r["ASSOC-LANGUAGE"],d=r.CHANNELS,g=r.CHARACTERISTICS,m=r["INSTREAM-ID"],v={attrs:r,bitrate:0,id:p++,groupId:r["GROUP-ID"]||"",name:r.NAME||a||"",type:i,default:r.bool("DEFAULT"),autoselect:r.bool("AUTOSELECT"),forced:r.bool("FORCED"),lang:a,url:r.URI?Gr.resolve(r.URI,s):""};if(o&&(v.assocLang=o),d&&(v.channels=d),g&&(v.characteristics=g),m&&(v.instreamId=m),t!=null&&t.length){const b=Gr.findGroup(t,v.groupId)||t[0];Ih(v,b,"audioCodec"),Ih(v,b,"textCodec")}n.push(v)}}return y}static parseLevelPlaylist(e,s,u,A,y,l){const c=new $b(s),p=c.fragments;let r=null,i=0,t=0,n=0,a=0,o=null,d=new ac(A,s),g,m,v,b=-1,w=!1,C=null;for(xh.lastIndex=0,c.m3u8=e,c.hasVariableRefs=_h(e);(g=xh.exec(e))!==null;){w&&(w=!1,d=new ac(A,s),d.start=n,d.sn=i,d.cc=a,d.level=u,r&&(d.initSegment=r,d.rawProgramDateTime=r.rawProgramDateTime,r.rawProgramDateTime=null,C&&(d.setByteRange(C),C=null)));const P=g[1];if(P){d.duration=parseFloat(P);const L=(" "+g[2]).slice(1);d.title=L||null,d.tagList.push(L?["INF",P,L]:["INF",P])}else if(g[3]){if(Ci(d.duration)){d.start=n,v&&Oh(d,v,c),d.sn=i,d.level=u,d.cc=a,p.push(d);const L=(" "+g[3]).slice(1);d.relurl=jc(c,L),Lh(d,o),o=d,n+=d.duration,i++,t=0,w=!0}}else if(g[4]){const L=(" "+g[4]).slice(1);o?d.setByteRange(L,o):d.setByteRange(L)}else if(g[5])d.rawProgramDateTime=(" "+g[5]).slice(1),d.tagList.push(["PROGRAM-DATE-TIME",d.rawProgramDateTime]),b===-1&&(b=p.length);else{if(g=g[0].match(N_),!g){Ft.warn("No matches on slow regex match for level playlist!");continue}for(m=1;m0&&O.bool("CAN-SKIP-DATERANGES"),c.partHoldBack=O.optionalFloat("PART-HOLD-BACK",0),c.holdBack=O.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const O=new bn(I);c.partTarget=O.decimalFloatingPoint("PART-TARGET");break}case"PART":{let O=c.partList;O||(O=c.partList=[]);const G=t>0?O[O.length-1]:void 0,J=t++,te=new bn(I);Qn(c,te,["BYTERANGE","URI"]);const le=new Zb(te,d,s,J,G);O.push(le),d.duration+=le.duration;break}case"PRELOAD-HINT":{const O=new bn(I);Qn(c,O,["URI"]),c.preloadHint=O;break}case"RENDITION-REPORT":{const O=new bn(I);Qn(c,O,["URI"]),c.renditionReports=c.renditionReports||[],c.renditionReports.push(O);break}default:Ft.warn(`line parsed but not handled: ${g}`);break}}}o&&!o.relurl?(p.pop(),n-=o.duration,c.partList&&(c.fragmentHint=o)):c.partList&&(Lh(d,o),d.cc=a,c.fragmentHint=d,v&&Oh(d,v,c));const D=p.length,R=p[0],T=p[D-1];if(n+=c.skippedSegments*c.targetduration,n>0&&D&&T){c.averagetargetduration=n/D;const P=T.sn;c.endSN=P!=="initSegment"?P:0,c.live||(T.endList=!0),R&&(c.startCC=R.cc)}else c.endSN=0,c.startCC=0;return c.fragmentHint&&(n+=c.fragmentHint.duration),c.totalduration=n,c.endCC=a,b>0&&U_(p,b),c}}function kh(_,e,s){var u,A;const y=new bn(_);Qn(s,y,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const l=(u=y.METHOD)!=null?u:"",c=y.URI,p=y.hexadecimalInteger("IV"),r=y.KEYFORMATVERSIONS,i=(A=y.KEYFORMAT)!=null?A:"identity";c&&y.IV&&!p&&Ft.error(`Invalid IV: ${y.IV}`);const t=c?Gr.resolve(c,e):"",n=(r||"1").split("/").map(Number).filter(Number.isFinite);return new Ia(l,t,i,n,p)}function Rh(_){const s=new bn(_).decimalFloatingPoint("TIME-OFFSET");return Ci(s)?s:null}function F_(_,e){let s=(_||"").split(/[ ,]+/).filter(u=>u);["video","audio","text"].forEach(u=>{const A=s.filter(y=>D_(y,u));A.length&&(e[`${u}Codec`]=A.join(","),s=s.filter(y=>A.indexOf(y)===-1))}),e.unknownCodecs=s}function Ih(_,e,s){const u=e[s];u&&(_[s]=u)}function U_(_,e){let s=_[e];for(let u=e;u--;){const A=_[u];if(!A)return;A.programDateTime=s.programDateTime-A.duration*1e3,s=A}}function Lh(_,e){_.rawProgramDateTime?_.programDateTime=Date.parse(_.rawProgramDateTime):e!=null&&e.programDateTime&&(_.programDateTime=e.endProgramDateTime),Ci(_.programDateTime)||(_.programDateTime=null,_.rawProgramDateTime=null)}function Dh(_,e,s,u){_.relurl=e.URI,e.BYTERANGE&&_.setByteRange(e.BYTERANGE),_.level=s,_.sn="initSegment",u&&(_.levelkeys=u),_.initSegment=null}function Oh(_,e,s){_.levelkeys=e;const{encryptedFragments:u}=s;(!u.length||u[u.length-1].levelkeys!==e)&&Object.keys(e).some(A=>e[A].isCommonEncryption)&&u.push(_)}var ln={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},Hi={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Mh(_){const{type:e}=_;switch(e){case ln.AUDIO_TRACK:return Hi.AUDIO;case ln.SUBTITLE_TRACK:return Hi.SUBTITLE;default:return Hi.MAIN}}function fc(_,e){let s=_.url;return(s===void 0||s.indexOf("data:")===0)&&(s=e.url),s}class G_{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.LEVEL_LOADING,this.onLevelLoading,this),e.on(rt.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(rt.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.LEVEL_LOADING,this.onLevelLoading,this),e.off(rt.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(rt.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const s=this.hls.config,u=s.pLoader,A=s.loader,y=u||A,l=new y(s);return this.loaders[e.type]=l,l}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const s=this.loaders[e];s&&s.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,s){const{url:u}=s;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:ln.MANIFEST,url:u,deliveryDirectives:null})}onLevelLoading(e,s){const{id:u,level:A,pathwayId:y,url:l,deliveryDirectives:c}=s;this.load({id:u,level:A,pathwayId:y,responseType:"text",type:ln.LEVEL,url:l,deliveryDirectives:c})}onAudioTrackLoading(e,s){const{id:u,groupId:A,url:y,deliveryDirectives:l}=s;this.load({id:u,groupId:A,level:null,responseType:"text",type:ln.AUDIO_TRACK,url:y,deliveryDirectives:l})}onSubtitleTrackLoading(e,s){const{id:u,groupId:A,url:y,deliveryDirectives:l}=s;this.load({id:u,groupId:A,level:null,responseType:"text",type:ln.SUBTITLE_TRACK,url:y,deliveryDirectives:l})}load(e){var s;const u=this.hls.config;let A=this.getInternalLoader(e);if(A){const r=A.context;if(r&&r.url===e.url&&r.level===e.level){Ft.trace("[playlist-loader]: playlist request ongoing");return}Ft.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),A.abort()}let y;if(e.type===ln.MANIFEST?y=u.manifestLoadPolicy.default:y=xn({},u.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),A=this.createInternalLoader(e),Ci((s=e.deliveryDirectives)==null?void 0:s.part)){let r;if(e.type===ln.LEVEL&&e.level!==null?r=this.hls.levels[e.level].details:e.type===ln.AUDIO_TRACK&&e.id!==null?r=this.hls.audioTracks[e.id].details:e.type===ln.SUBTITLE_TRACK&&e.id!==null&&(r=this.hls.subtitleTracks[e.id].details),r){const i=r.partTarget,t=r.targetduration;if(i&&t){const n=Math.max(i*3,t*.8)*1e3;y=xn({},y,{maxTimeToFirstByteMs:Math.min(n,y.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(n,y.maxTimeToFirstByteMs)})}}}const l=y.errorRetry||y.timeoutRetry||{},c={loadPolicy:y,timeout:y.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},p={onSuccess:(r,i,t,n)=>{const a=this.getInternalLoader(t);this.resetInternalLoader(t.type);const o=r.data;if(o.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,t,new Error("no EXTM3U delimiter"),n||null,i);return}i.parsing.start=performance.now(),Gr.isMediaPlaylist(o)?this.handleTrackOrLevelPlaylist(r,i,t,n||null,a):this.handleMasterPlaylist(r,i,t,n)},onError:(r,i,t,n)=>{this.handleNetworkError(i,t,!1,r,n)},onTimeout:(r,i,t)=>{this.handleNetworkError(i,t,!0,void 0,r)}};A.load(e,c,p)}handleMasterPlaylist(e,s,u,A){const y=this.hls,l=e.data,c=fc(e,u),p=Gr.parseMasterPlaylist(l,c);if(p.playlistParsingError){this.handleManifestParsingError(e,u,p.playlistParsingError,A,s);return}const{contentSteering:r,levels:i,sessionData:t,sessionKeys:n,startTimeOffset:a,variableList:o}=p;this.variableList=o;const{AUDIO:d=[],SUBTITLES:g,"CLOSED-CAPTIONS":m}=Gr.parseMasterPlaylistMedia(l,c,p);d.length&&!d.some(b=>!b.url)&&i[0].audioCodec&&!i[0].attrs.AUDIO&&(Ft.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),d.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new bn({}),bitrate:0,url:""})),y.trigger(rt.MANIFEST_LOADED,{levels:i,audioTracks:d,subtitles:g,captions:m,contentSteering:r,url:c,stats:s,networkDetails:A,sessionData:t,sessionKeys:n,startTimeOffset:a,variableList:o})}handleTrackOrLevelPlaylist(e,s,u,A,y){const l=this.hls,{id:c,level:p,type:r}=u,i=fc(e,u),t=0,n=Ci(p)?p:Ci(c)?c:0,a=Mh(u),o=Gr.parseLevelPlaylist(e.data,i,n,a,t,this.variableList);if(r===ln.MANIFEST){const d={attrs:new bn({}),bitrate:0,details:o,name:"",url:i};l.trigger(rt.MANIFEST_LOADED,{levels:[d],audioTracks:[],url:i,stats:s,networkDetails:A,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}s.parsing.end=performance.now(),u.levelDetails=o,this.handlePlaylistLoaded(o,e,s,u,A,y)}handleManifestParsingError(e,s,u,A,y){this.hls.trigger(rt.ERROR,{type:Wi.NETWORK_ERROR,details:qt.MANIFEST_PARSING_ERROR,fatal:s.type===ln.MANIFEST,url:e.url,err:u,error:u,reason:u.message,response:e,context:s,networkDetails:A,stats:y})}handleNetworkError(e,s,u=!1,A,y){let l=`A network ${u?"timeout":"error"+(A?" (status "+A.code+")":"")} occurred while loading ${e.type}`;e.type===ln.LEVEL?l+=`: ${e.level} id: ${e.id}`:(e.type===ln.AUDIO_TRACK||e.type===ln.SUBTITLE_TRACK)&&(l+=` id: ${e.id} group-id: "${e.groupId}"`);const c=new Error(l);Ft.warn(`[playlist-loader]: ${l}`);let p=qt.UNKNOWN,r=!1;const i=this.getInternalLoader(e);switch(e.type){case ln.MANIFEST:p=u?qt.MANIFEST_LOAD_TIMEOUT:qt.MANIFEST_LOAD_ERROR,r=!0;break;case ln.LEVEL:p=u?qt.LEVEL_LOAD_TIMEOUT:qt.LEVEL_LOAD_ERROR,r=!1;break;case ln.AUDIO_TRACK:p=u?qt.AUDIO_TRACK_LOAD_TIMEOUT:qt.AUDIO_TRACK_LOAD_ERROR,r=!1;break;case ln.SUBTITLE_TRACK:p=u?qt.SUBTITLE_TRACK_LOAD_TIMEOUT:qt.SUBTITLE_LOAD_ERROR,r=!1;break}i&&this.resetInternalLoader(e.type);const t={type:Wi.NETWORK_ERROR,details:p,fatal:r,url:e.url,loader:i,context:e,error:c,networkDetails:s,stats:y};if(A){const n=(s==null?void 0:s.url)||e.url;t.response=Dn({url:n,data:void 0},A)}this.hls.trigger(rt.ERROR,t)}handlePlaylistLoaded(e,s,u,A,y,l){const c=this.hls,{type:p,level:r,id:i,groupId:t,deliveryDirectives:n}=A,a=fc(s,A),o=Mh(A),d=typeof A.level=="number"&&o===Hi.MAIN?r:void 0;if(!e.fragments.length){const m=new Error("No Segments found in Playlist");c.trigger(rt.ERROR,{type:Wi.NETWORK_ERROR,details:qt.LEVEL_EMPTY_ERROR,fatal:!1,url:a,error:m,reason:m.message,response:s,context:A,level:d,parent:o,networkDetails:y,stats:u});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const g=e.playlistParsingError;if(g){c.trigger(rt.ERROR,{type:Wi.NETWORK_ERROR,details:qt.LEVEL_PARSING_ERROR,fatal:!1,url:a,error:g,reason:g.message,response:s,context:A,level:d,parent:o,networkDetails:y,stats:u});return}switch(e.live&&l&&(l.getCacheAge&&(e.ageHeader=l.getCacheAge()||0),(!l.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),p){case ln.MANIFEST:case ln.LEVEL:c.trigger(rt.LEVEL_LOADED,{details:e,level:d||0,id:i||0,stats:u,networkDetails:y,deliveryDirectives:n});break;case ln.AUDIO_TRACK:c.trigger(rt.AUDIO_TRACK_LOADED,{details:e,id:i||0,groupId:t||"",stats:u,networkDetails:y,deliveryDirectives:n});break;case ln.SUBTITLE_TRACK:c.trigger(rt.SUBTITLE_TRACK_LOADED,{details:e,id:i||0,groupId:t||"",stats:u,networkDetails:y,deliveryDirectives:n});break}}}function Bp(_,e){let s;try{s=new Event("addtrack")}catch{s=document.createEvent("Event"),s.initEvent("addtrack",!1,!1)}s.track=_,e.dispatchEvent(s)}function Np(_,e){const s=_.mode;if(s==="disabled"&&(_.mode="hidden"),_.cues&&!_.cues.getCueById(e.id))try{if(_.addCue(e),!_.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(u){Ft.debug(`[texttrack-utils]: ${u}`);try{const A=new self.TextTrackCue(e.startTime,e.endTime,e.text);A.id=e.id,_.addCue(A)}catch(A){Ft.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${A}`)}}s==="disabled"&&(_.mode=s)}function Zs(_){const e=_.mode;if(e==="disabled"&&(_.mode="hidden"),_.cues)for(let s=_.cues.length;s--;)_.removeCue(_.cues[s]);e==="disabled"&&(_.mode=e)}function Vc(_,e,s,u){const A=_.mode;if(A==="disabled"&&(_.mode="hidden"),_.cues&&_.cues.length>0){const y=V_(_.cues,e,s);for(let l=0;l_[s].endTime)return-1;let u=0,A=s;for(;u<=A;){const y=Math.floor((A+u)/2);if(e<_[y].startTime)A=y-1;else if(e>_[y].startTime&&u-1)for(let y=A,l=_.length;y=e&&c.endTime<=s)u.push(c);else if(c.startTime>s)return u}return u}function po(_){const e=[];for(let s=0;s<_.length;s++){const u=_[s];(u.kind==="subtitles"||u.kind==="captions")&&u.label&&e.push(_[s])}return e}var xr={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const H_=.25;function Hc(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function Ph(_,e,s,u,A){let y=new _(e,s,"");try{y.value=u,A&&(y.type=A)}catch{y=new _(e,s,JSON.stringify(A?Dn({type:A},u):u))}return y}const $a=(()=>{const _=Hc();try{_&&new _(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function pc(_,e){return _.getTime()/1e3-e}function z_(_){return Uint8Array.from(_.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class W_{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(rt.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(rt.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(rt.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(rt.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,s){this.media=s.media}onMediaDetaching(){this.id3Track&&(Zs(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const s=this.getID3Track(e.textTracks);return s.mode="hidden",s}getID3Track(e){if(this.media){for(let s=0;s$a&&(t=$a),t-i<=0&&(t=i+H_);for(let a=0;ai.type===xr.audioId3&&p:A==="video"?r=i=>i.type===xr.emsg&&c:r=i=>i.type===xr.audioId3&&p||i.type===xr.emsg&&c,Vc(y,s,u,r)}}onLevelUpdated(e,{details:s}){if(!this.media||!s.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:u,id3Track:A}=this,{dateRanges:y}=s,l=Object.keys(y);if(A){const i=Object.keys(u).filter(t=>!l.includes(t));for(let t=i.length;t--;){const n=i[t];Object.keys(u[n].cues).forEach(a=>{A.removeCue(u[n].cues[a])}),delete u[n]}}const c=s.fragments[s.fragments.length-1];if(l.length===0||!Ci(c==null?void 0:c.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const p=c.programDateTime/1e3-c.start,r=Hc();for(let i=0;i{if(D!==n.id){const R=y[D];if(R.class===n.class&&R.startDate>n.startDate&&(!C||n.startDatethis.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:s}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:s?e.liveMaxLatencyDurationCount*s.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:s,partHoldBack:u,targetduration:A}=e,{liveSyncDuration:y,liveSyncDurationCount:l,lowLatencyMode:c}=this.config,p=this.hls.userConfig;let r=c&&u||s;(p.liveSyncDuration||p.liveSyncDurationCount||r===0)&&(r=y!==void 0?y:l*A);const i=A;return r+Math.min(this.stallCount*1,i)}get liveSyncPosition(){const e=this.estimateLiveEdge(),s=this.targetLatency,u=this.levelDetails;if(e===null||s===null||u===null)return null;const A=u.edge,y=e-s-this.edgeStalled,l=A-u.totalduration,c=A-(this.config.lowLatencyMode&&u.partTarget||u.targetduration);return Math.min(Math.max(l,y),c)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const s=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-s,0)}get forwardBufferLength(){const{media:e,levelDetails:s}=this;if(!e||!s)return 0;const u=e.buffered.length;return(u?e.buffered.end(u-1):s.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(rt.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(rt.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(rt.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(rt.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(rt.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(rt.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(rt.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(rt.ERROR,this.onError,this)}onMediaAttached(e,s){this.media=s.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:s}){this.levelDetails=s,s.advanced&&this.timeupdate(),!s.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,s){var u;s.details===qt.BUFFER_STALLED_ERROR&&(this.stallCount++,(u=this.levelDetails)!=null&&u.live&&Ft.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:s}=this;if(!e||!s)return;this.currentTime=e.currentTime;const u=this.computeLatency();if(u===null)return;this._latency=u;const{lowLatencyMode:A,maxLiveSyncPlaybackRate:y}=this.config;if(!A||y===1||!s.live)return;const l=this.targetLatency;if(l===null)return;const c=u-l,p=Math.min(this.maxLatency,l+s.targetduration);if(c.05&&this.forwardBufferLength>1){const i=Math.min(2,Math.max(1,y)),t=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20;e.playbackRate=Math.min(i,Math.max(1,t))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const zc=["NONE","TYPE-0","TYPE-1",null];function q_(_){return zc.indexOf(_)>-1}const Do=["SDR","PQ","HLG"];function Y_(_){return!!_&&Do.indexOf(_)>-1}var Ca={No:"",Yes:"YES",v2:"v2"};function J_(_,e){const{canSkipUntil:s,canSkipDateRanges:u,endSN:A}=_,y=e!==void 0?e-A:0;return s&&y!!s).map(s=>s.substring(0,4)).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return Nh(this._audioGroups,e)}hasSubtitleGroup(e){return Nh(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,s){if(s){if(e==="audio"){let u=this._audioGroups;u||(u=this._audioGroups=[]),u.indexOf(s)===-1&&u.push(s)}else if(e==="text"){let u=this._subtitleGroups;u||(u=this._subtitleGroups=[]),u.indexOf(s)===-1&&u.push(s)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function Nh(_,e){return!e||!_?!1:_.indexOf(e)!==-1}function mc(_,e){const s=e.startPTS;if(Ci(s)){let u=0,A;e.sn>_.sn?(u=s-_.start,A=_):(u=_.start-s,A=e),A.duration!==u&&(A.duration=u)}else e.sn>_.sn?_.cc===e.cc&&_.minEndPTS?e.start=_.start+(_.minEndPTS-_.start):e.start=_.start+_.duration:e.start=Math.max(_.start-e.duration,0)}function Fp(_,e,s,u,A,y){u-s<=0&&(Ft.warn("Fragment should have a positive duration",e),u=s+e.duration,y=A+e.duration);let c=s,p=u;const r=e.startPTS,i=e.endPTS;if(Ci(r)){const g=Math.abs(r-s);Ci(e.deltaPTS)?e.deltaPTS=Math.max(g,e.deltaPTS):e.deltaPTS=g,c=Math.max(s,r),s=Math.min(s,r),A=Math.min(A,e.startDTS),p=Math.min(u,i),u=Math.max(u,i),y=Math.max(y,e.endDTS)}const t=s-e.start;e.start!==0&&(e.start=s),e.duration=u-e.start,e.startPTS=s,e.maxStartPTS=c,e.startDTS=A,e.endPTS=u,e.minEndPTS=p,e.endDTS=y;const n=e.sn;if(!_||n<_.startSN||n>_.endSN)return 0;let a;const o=n-_.startSN,d=_.fragments;for(d[o]=e,a=o;a>0;a--)mc(d[a],d[a-1]);for(a=o;a=0;p--){const r=u[p].initSegment;if(r){s=r;break}}_.fragmentHint&&delete _.fragmentHint.endPTS;let A=0,y;if($_(_,e,(p,r)=>{p.relurl&&(A=p.cc-r.cc),Ci(p.startPTS)&&Ci(p.endPTS)&&(r.start=r.startPTS=p.startPTS,r.startDTS=p.startDTS,r.maxStartPTS=p.maxStartPTS,r.endPTS=p.endPTS,r.endDTS=p.endDTS,r.minEndPTS=p.minEndPTS,r.duration=p.endPTS-p.startPTS,r.duration&&(y=r),e.PTSKnown=e.alignedSliding=!0),r.elementaryStreams=p.elementaryStreams,r.loader=p.loader,r.stats=p.stats,p.initSegment&&(r.initSegment=p.initSegment,s=p.initSegment)}),s&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(r=>{var i;r&&(!r.initSegment||r.initSegment.relurl===((i=s)==null?void 0:i.relurl))&&(r.initSegment=s)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(p=>!p),e.deltaUpdateFailed){Ft.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let p=e.skippedSegments;p--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=Z_(_.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const l=e.fragments;if(A){Ft.warn("discontinuity sliding from playlist, take drift into account");for(let p=0;p{r.elementaryStreams=p.elementaryStreams,r.stats=p.stats}),y?Fp(e,y,y.startPTS,y.endPTS,y.startDTS,y.endDTS):Up(_,e),l.length&&(e.totalduration=e.edge-l[0].start),e.driftStartTime=_.driftStartTime,e.driftStart=_.driftStart;const c=e.advancedDateTime;if(e.advanced&&c){const p=e.edge;e.driftStart||(e.driftStartTime=c,e.driftStart=p),e.driftEndTime=c,e.driftEnd=p}else e.driftEndTime=_.driftEndTime,e.driftEnd=_.driftEnd,e.advancedDateTime=_.advancedDateTime}function Z_(_,e,s){const u=xn({},_);return s&&s.forEach(A=>{delete u[A]}),Object.keys(e).forEach(A=>{const y=new _p(e[A].attr,u[A]);y.isValid?u[A]=y:Ft.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[A].attr)}"`)}),u}function X_(_,e,s){if(_&&e){let u=0;for(let A=0,y=_.length;A<=y;A++){const l=_[A],c=e[A+u];l&&c&&l.index===c.index&&l.fragment.sn===c.fragment.sn?s(l,c):u--}}}function $_(_,e,s){const u=e.skippedSegments,A=Math.max(_.startSN,e.startSN)-e.startSN,y=(_.fragmentHint?1:0)+(u?e.endSN:Math.min(_.endSN,e.endSN))-e.startSN,l=e.startSN-_.startSN,c=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,p=_.fragmentHint?_.fragments.concat(_.fragmentHint):_.fragments;for(let r=A;r<=y;r++){const i=p[l+r];let t=c[r];u&&!t&&r=u.length||Wc(e,u[s].start)}function Wc(_,e){if(e){const s=_.fragments;for(let u=_.skippedSegments;ue){const y=u[u.length-1].duration*1e3;y{const{details:u}=e;u!=null&&u.fragments&&u.fragments.forEach(A=>{A.level=s})})}function Oo(_){switch(_.details){case qt.FRAG_LOAD_TIMEOUT:case qt.KEY_LOAD_TIMEOUT:case qt.LEVEL_LOAD_TIMEOUT:case qt.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Uh(_,e){const s=Oo(e);return _.default[`${s?"timeout":"error"}Retry`]}function wd(_,e){const s=_.backoff==="linear"?1:Math.pow(2,e);return Math.min(s*_.retryDelayMs,_.maxRetryDelayMs)}function Gh(_){return Dn(Dn({},_),{errorRetry:null,timeoutRetry:null})}function Mo(_,e,s,u){if(!_)return!1;const A=u==null?void 0:u.code,y=e<_.maxNumRetry&&(i5(A)||!!s);return _.shouldRetry?_.shouldRetry(_,e,s,u,y):y}function i5(_){return _===0&&navigator.onLine===!1||!!_&&(_<400||_>499)}const Vp={search:function(_,e){let s=0,u=_.length-1,A=null,y=null;for(;s<=u;){A=(s+u)/2|0,y=_[A];const l=e(y);if(l>0)s=A+1;else if(l<0)u=A-1;else return y}return null}};function n5(_,e,s){if(e===null||!Array.isArray(_)||!_.length||!Ci(e))return null;const u=_[0].programDateTime;if(e<(u||0))return null;const A=_[_.length-1].endProgramDateTime;if(e>=(A||0))return null;s=s||0;for(let y=0;y<_.length;++y){const l=_[y];if(r5(e,s,l))return l}return null}function Po(_,e,s=0,u=0){let A=null;if(_){A=e[_.sn-e[0].sn+1]||null;const l=_.endDTS-s;l>0&&l<15e-7&&(s+=15e-7)}else s===0&&e[0].start===0&&(A=e[0]);if(A&&(!_||_.level===A.level)&&Kc(s,u,A)===0)return A;const y=Vp.search(e,Kc.bind(null,s,u));return y&&(y!==_||!A)?y:A}function Kc(_=0,e=0,s){if(s.start<=_&&s.start+s.duration>_)return 0;const u=Math.min(e,s.duration+(s.deltaPTS?s.deltaPTS:0));return s.start+s.duration-u<=_?1:s.start-u>_&&s.start?-1:0}function r5(_,e,s){const u=Math.min(e,s.duration+(s.deltaPTS?s.deltaPTS:0))*1e3;return(s.endProgramDateTime||0)-u>_}function s5(_,e){return Vp.search(_,s=>s.cce?-1:0)}var Vn={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Tr={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class a5{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=Ft.log.bind(Ft,"[info]:"),this.warn=Ft.warn.bind(Ft,"[warning]:"),this.error=Ft.error.bind(Ft,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(rt.ERROR,this.onError,this),e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(rt.ERROR,this.onError,this),e.off(rt.ERROR,this.onErrorOut,this),e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===Hi.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,s){var u,A;if(s.fatal)return;const y=this.hls,l=s.context;switch(s.details){case qt.FRAG_LOAD_ERROR:case qt.FRAG_LOAD_TIMEOUT:case qt.KEY_LOAD_ERROR:case qt.KEY_LOAD_TIMEOUT:s.errorAction=this.getFragRetryOrSwitchAction(s);return;case qt.FRAG_PARSING_ERROR:if((u=s.frag)!=null&&u.gap){s.errorAction={action:Vn.DoNothing,flags:Tr.None};return}case qt.FRAG_GAP:case qt.FRAG_DECRYPT_ERROR:{s.errorAction=this.getFragRetryOrSwitchAction(s),s.errorAction.action=Vn.SendAlternateToPenaltyBox;return}case qt.LEVEL_EMPTY_ERROR:case qt.LEVEL_PARSING_ERROR:{var c,p;const r=s.parent===Hi.MAIN?s.level:y.loadLevel;s.details===qt.LEVEL_EMPTY_ERROR&&((c=s.context)!=null&&(p=c.levelDetails)!=null&&p.live)?s.errorAction=this.getPlaylistRetryOrSwitchAction(s,r):(s.levelRetry=!1,s.errorAction=this.getLevelSwitchAction(s,r))}return;case qt.LEVEL_LOAD_ERROR:case qt.LEVEL_LOAD_TIMEOUT:typeof(l==null?void 0:l.level)=="number"&&(s.errorAction=this.getPlaylistRetryOrSwitchAction(s,l.level));return;case qt.AUDIO_TRACK_LOAD_ERROR:case qt.AUDIO_TRACK_LOAD_TIMEOUT:case qt.SUBTITLE_LOAD_ERROR:case qt.SUBTITLE_TRACK_LOAD_TIMEOUT:if(l){const r=y.levels[y.loadLevel];if(r&&(l.type===ln.AUDIO_TRACK&&r.hasAudioGroup(l.groupId)||l.type===ln.SUBTITLE_TRACK&&r.hasSubtitleGroup(l.groupId))){s.errorAction=this.getPlaylistRetryOrSwitchAction(s,y.loadLevel),s.errorAction.action=Vn.SendAlternateToPenaltyBox,s.errorAction.flags=Tr.MoveAllAlternatesMatchingHost;return}}return;case qt.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const r=y.levels[y.loadLevel],i=r==null?void 0:r.attrs["HDCP-LEVEL"];i?s.errorAction={action:Vn.SendAlternateToPenaltyBox,flags:Tr.MoveAllAlternatesMatchingHDCP,hdcpLevel:i}:this.keySystemError(s)}return;case qt.BUFFER_ADD_CODEC_ERROR:case qt.REMUX_ALLOC_ERROR:case qt.BUFFER_APPEND_ERROR:s.errorAction=this.getLevelSwitchAction(s,(A=s.level)!=null?A:y.loadLevel);return;case qt.INTERNAL_EXCEPTION:case qt.BUFFER_APPENDING_ERROR:case qt.BUFFER_FULL_ERROR:case qt.LEVEL_SWITCH_ERROR:case qt.BUFFER_STALLED_ERROR:case qt.BUFFER_SEEK_OVER_HOLE:case qt.BUFFER_NUDGE_ON_STALL:s.errorAction={action:Vn.DoNothing,flags:Tr.None};return}s.type===Wi.KEY_SYSTEM_ERROR&&this.keySystemError(s)}keySystemError(e){const s=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,s)}getPlaylistRetryOrSwitchAction(e,s){const u=this.hls,A=Uh(u.config.playlistLoadPolicy,e),y=this.playlistError++;if(Mo(A,y,Oo(e),e.response))return{action:Vn.RetryRequest,flags:Tr.None,retryConfig:A,retryCount:y};const c=this.getLevelSwitchAction(e,s);return A&&(c.retryConfig=A,c.retryCount=y),c}getFragRetryOrSwitchAction(e){const s=this.hls,u=this.getVariantLevelIndex(e.frag),A=s.levels[u],{fragLoadPolicy:y,keyLoadPolicy:l}=s.config,c=Uh(e.details.startsWith("key")?l:y,e),p=s.levels.reduce((i,t)=>i+t.fragmentError,0);if(A&&(e.details!==qt.FRAG_GAP&&A.fragmentError++,Mo(c,p,Oo(e),e.response)))return{action:Vn.RetryRequest,flags:Tr.None,retryConfig:c,retryCount:p};const r=this.getLevelSwitchAction(e,u);return c&&(r.retryConfig=c,r.retryCount=p),r}getLevelSwitchAction(e,s){const u=this.hls;s==null&&(s=u.loadLevel);const A=this.hls.levels[s];if(A){var y,l;const r=e.details;A.loadError++,r===qt.BUFFER_APPEND_ERROR&&A.fragmentError++;let i=-1;const{levels:t,loadLevel:n,minAutoLevel:a,maxAutoLevel:o}=u;u.autoLevelEnabled||(u.loadLevel=-1);const d=(y=e.frag)==null?void 0:y.type,m=(d===Hi.AUDIO&&r===qt.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(r===qt.BUFFER_ADD_CODEC_ERROR||r===qt.BUFFER_APPEND_ERROR))&&t.some(({audioCodec:D})=>A.audioCodec!==D),b=e.sourceBufferName==="video"&&(r===qt.BUFFER_ADD_CODEC_ERROR||r===qt.BUFFER_APPEND_ERROR)&&t.some(({codecSet:D,audioCodec:R})=>A.codecSet!==D&&A.audioCodec===R),{type:w,groupId:C}=(l=e.context)!=null?l:{};for(let D=t.length;D--;){const R=(D+n)%t.length;if(R!==n&&R>=a&&R<=o&&t[R].loadError===0){var c,p;const T=t[R];if(r===qt.FRAG_GAP&&e.frag){const P=t[R].details;if(P){const L=Po(e.frag,P.fragments,e.frag.start);if(L!=null&&L.gap)continue}}else{if(w===ln.AUDIO_TRACK&&T.hasAudioGroup(C)||w===ln.SUBTITLE_TRACK&&T.hasSubtitleGroup(C))continue;if(d===Hi.AUDIO&&(c=A.audioGroups)!=null&&c.some(P=>T.hasAudioGroup(P))||d===Hi.SUBTITLE&&(p=A.subtitleGroups)!=null&&p.some(P=>T.hasSubtitleGroup(P))||m&&A.audioCodec===T.audioCodec||!m&&A.audioCodec!==T.audioCodec||b&&A.codecSet===T.codecSet)continue}i=R;break}}if(i>-1&&u.loadLevel!==i)return e.levelRetry=!0,this.playlistError=0,{action:Vn.SendAlternateToPenaltyBox,flags:Tr.None,nextAutoLevel:i}}return{action:Vn.SendAlternateToPenaltyBox,flags:Tr.MoveAllAlternatesMatchingHost}}onErrorOut(e,s){var u;switch((u=s.errorAction)==null?void 0:u.action){case Vn.DoNothing:break;case Vn.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(s),!s.errorAction.resolved&&s.details!==qt.FRAG_GAP?s.fatal=!0:/MediaSource readyState: ended/.test(s.error.message)&&(this.warn(`MediaSource ended after "${s.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(s.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const s=this.hls,u=e.errorAction;if(!u)return;const{flags:A,hdcpLevel:y,nextAutoLevel:l}=u;switch(A){case Tr.None:this.switchLevel(e,l);break;case Tr.MoveAllAlternatesMatchingHDCP:y&&(s.maxHdcpLevel=zc[zc.indexOf(y)-1],u.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${s.maxHdcpLevel}" or lower`);break}u.resolved||this.switchLevel(e,l)}switchLevel(e,s){s!==void 0&&e.errorAction&&(this.warn(`switching to level ${s} after ${e.details}`),this.hls.nextAutoLevel=s,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}class Sd{constructor(e,s){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=Ft.log.bind(Ft,`${s}:`),this.warn=Ft.warn.bind(Ft,`${s}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,s){const u=s==null?void 0:s.renditionReports;if(u){let A=-1;for(let y=0;y=0&&p>s.partTarget&&(c+=1)}return new Bh(l,c>=0?c:void 0,Ca.No)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,s,u){const{details:A,stats:y}=s,l=self.performance.now(),c=y.loading.first?Math.max(0,l-y.loading.first):0;if(A.advancedDateTime=Date.now()-c,A.live||u!=null&&u.live){if(A.reloaded(u),u&&this.log(`live playlist ${e} ${A.advanced?"REFRESHED "+A.lastPartSn+"-"+A.lastPartIndex:A.updated?"UPDATED":"MISSED"}`),u&&A.fragments.length>0&&Q_(u,A),!this.canLoad||!A.live)return;let p,r,i;if(A.canBlockReload&&A.endSN&&A.advanced){const g=this.hls.config.lowLatencyMode,m=A.lastPartSn,v=A.endSN,b=A.lastPartIndex,w=b!==-1,C=m===v,D=g?0:b;w?(r=C?v+1:m,i=C?D:b+1):r=v+1;const R=A.age,T=R+A.ageHeader;let P=Math.min(T-A.partTarget,A.targetduration*1.5);if(P>0){if(u&&P>u.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${u.tuneInGoal} to: ${P} with playlist age: ${A.age}`),P=0;else{const L=Math.floor(P/A.targetduration);if(r+=L,i!==void 0){const I=Math.round(P%A.targetduration/A.partTarget);i+=I}this.log(`CDN Tune-in age: ${A.ageHeader}s last advanced ${R.toFixed(2)}s goal: ${P} skip sn ${L} to part ${i}`)}A.tuneInGoal=P}if(p=this.getDeliveryDirectives(A,s.deliveryDirectives,r,i),g||!C){this.loadPlaylist(p);return}}else(A.canBlockReload||A.canSkipUntil)&&(p=this.getDeliveryDirectives(A,s.deliveryDirectives,r,i));const t=this.hls.mainForwardBufferInfo,n=t?t.end-t.len:0,a=(A.edge-n)*1e3,o=e5(A,a);A.updated&&l>this.requestScheduled+o&&(this.requestScheduled=y.loading.start),r!==void 0&&A.canBlockReload?this.requestScheduled=y.loading.first+o-(A.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+othis.loadPlaylist(p),d)}else this.clearTimer()}getDeliveryDirectives(e,s,u,A){let y=J_(e,u);return s!=null&&s.skip&&e.deltaUpdateFailed&&(u=s.msn,A=s.part,y=Ca.No),new Bh(u,A,y)}checkRetry(e){const s=e.details,u=Oo(e),A=e.errorAction,{action:y,retryCount:l=0,retryConfig:c}=A||{},p=!!A&&!!c&&(y===Vn.RetryRequest||!A.resolved&&y===Vn.SendAlternateToPenaltyBox);if(p){var r;if(this.requestScheduled=-1,l>=c.maxNumRetry)return!1;if(u&&(r=e.context)!=null&&r.deliveryDirectives)this.warn(`Retrying playlist loading ${l+1}/${c.maxNumRetry} after "${s}" without delivery-directives`),this.loadPlaylist();else{const i=wd(c,l);this.timer=self.setTimeout(()=>this.loadPlaylist(),i),this.warn(`Retrying playlist loading ${l+1}/${c.maxNumRetry} after "${s}" in ${i}ms`)}e.levelRetry=!0,A.resolved=!0}return p}}class js{constructor(e,s=0,u=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=s,this.totalWeight_=u}sample(e,s){const u=Math.pow(this.alpha_,e);this.estimate_=s*(1-u)+u*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class o5{constructor(e,s,u,A=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=u,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new js(e),this.fast_=new js(s),this.defaultTTFB_=A,this.ttfb_=new js(e)}update(e,s){const{slow_:u,fast_:A,ttfb_:y}=this;u.halfLife!==e&&(this.slow_=new js(e,u.getEstimate(),u.getTotalWeight())),A.halfLife!==s&&(this.fast_=new js(s,A.getEstimate(),A.getTotalWeight())),y.halfLife!==e&&(this.ttfb_=new js(e,y.getEstimate(),y.getTotalWeight()))}sample(e,s){e=Math.max(e,this.minDelayMs_);const u=8*s,A=e/1e3,y=u/A;this.fast_.sample(A,y),this.slow_.sample(A,y)}sampleTTFB(e){const s=e/1e3,u=Math.sqrt(2)*Math.exp(-Math.pow(s,2)/2);this.ttfb_.sample(u,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const Hp={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},jh={};function l5(_,e,s,u,A,y){const l=_.audioCodec?_.audioGroups:null,c=y==null?void 0:y.audioCodec,p=y==null?void 0:y.channels,r=p?parseInt(p):c?1/0:2;let i=null;if(l!=null&&l.length)try{l.length===1&&l[0]?i=e.groups[l[0]].channels:i=l.reduce((t,n)=>{if(n){const a=e.groups[n];if(!a)throw new Error(`Audio track group ${n} not found`);Object.keys(a.channels).forEach(o=>{t[o]=(t[o]||0)+a.channels[o]})}return t},{2:0})}catch{return!0}return _.videoCodec!==void 0&&(_.width>1920&&_.height>1088||_.height>1920&&_.width>1088||_.frameRate>Math.max(u,30)||_.videoRange!=="SDR"&&_.videoRange!==s||_.bitrate>Math.max(A,8e6))||!!i&&Ci(r)&&Object.keys(i).some(t=>parseInt(t)>r)}function c5(_,e,s){const u=_.videoCodec,A=_.audioCodec;if(!u||!A||!s)return Promise.resolve(Hp);const y={width:_.width,height:_.height,bitrate:Math.ceil(Math.max(_.bitrate*.9,_.averageBitrate)),framerate:_.frameRate||30},l=_.videoRange;l!=="SDR"&&(y.transferFunction=l.toLowerCase());const c=u.split(",").map(p=>({type:"media-source",video:Dn(Dn({},y),{},{contentType:La(p,"video")})}));return A&&_.audioGroups&&_.audioGroups.forEach(p=>{var r;p&&((r=e.groups[p])==null||r.tracks.forEach(i=>{if(i.groupId===p){const t=i.channels||"",n=parseFloat(t);Ci(n)&&n>2&&c.push.apply(c,A.split(",").map(a=>({type:"media-source",audio:{contentType:La(a,"audio"),channels:""+n}})))}}))}),Promise.all(c.map(p=>{const r=d5(p);return jh[r]||(jh[r]=s.decodingInfo(p))})).then(p=>({supported:!p.some(r=>!r.supported),configurations:c,decodingInfoResults:p})).catch(p=>({supported:!1,configurations:c,decodingInfoResults:[],error:p}))}function d5(_){const{audio:e,video:s}=_,u=s||e;if(u){const A=u.contentType.split('"')[1];if(s)return`r${s.height}x${s.width}f${Math.ceil(s.framerate)}${s.transferFunction||"sd"}_${A}_${Math.ceil(s.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${A}`}return""}function u5(){if(typeof matchMedia=="function"){const _=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(_.media!==e.media)return _.matches===!0}return!1}function h5(_,e){let s=!1,u=[];return _&&(s=_!=="SDR",u=[_]),e&&(u=e.allowedVideoRanges||Do.slice(0),s=e.preferHDR!==void 0?e.preferHDR:u5(),s?u=u.filter(A=>A!=="SDR"):u=["SDR"]),{preferHDR:s,allowedVideoRanges:u}}function f5(_,e,s,u,A){const y=Object.keys(_),l=u==null?void 0:u.channels,c=u==null?void 0:u.audioCodec,p=l&&parseInt(l)===2;let r=!0,i=!1,t=1/0,n=1/0,a=1/0,o=0,d=[];const{preferHDR:g,allowedVideoRanges:m}=h5(e,A);for(let C=y.length;C--;){const D=_[y[C]];r=D.channels[2]>0,t=Math.min(t,D.minHeight),n=Math.min(n,D.minFramerate),a=Math.min(a,D.minBitrate);const R=m.filter(T=>D.videoRanges[T]>0);R.length>0&&(i=!0,d=R)}t=Ci(t)?t:0,n=Ci(n)?n:0;const v=Math.max(1080,t),b=Math.max(30,n);return a=Ci(a)?a:s,s=Math.max(a,s),i||(e=void 0,d=[]),{codecSet:y.reduce((C,D)=>{const R=_[D];if(D===C)return C;if(R.minBitrate>s)return Yr(D,`min bitrate of ${R.minBitrate} > current estimate of ${s}`),C;if(!R.hasDefaultAudio)return Yr(D,"no renditions with default or auto-select sound found"),C;if(c&&D.indexOf(c.substring(0,4))%5!==0)return Yr(D,`audio codec preference "${c}" not found`),C;if(l&&!p){if(!R.channels[l])return Yr(D,`no renditions with ${l} channel sound found (channels options: ${Object.keys(R.channels)})`),C}else if((!c||p)&&r&&R.channels[2]===0)return Yr(D,"no renditions with stereo sound found"),C;return R.minHeight>v?(Yr(D,`min resolution of ${R.minHeight} > maximum of ${v}`),C):R.minFramerate>b?(Yr(D,`min framerate of ${R.minFramerate} > maximum of ${b}`),C):d.some(T=>R.videoRanges[T]>0)?R.maxScore=Io(C)||R.fragmentError>_[C].fragmentError)?C:(o=R.maxScore,D):(Yr(D,`no variants with VIDEO-RANGE of ${JSON.stringify(d)} found`),C)},void 0),videoRanges:d,preferHDR:g,minFramerate:n,minBitrate:a}}function Yr(_,e){Ft.log(`[abr] start candidates with "${_}" ignored because ${e}`)}function p5(_){return _.reduce((e,s)=>{let u=e.groups[s.groupId];u||(u=e.groups[s.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),u.tracks.push(s);const A=s.channels||"2";return u.channels[A]=(u.channels[A]||0)+1,u.hasDefault=u.hasDefault||s.default,u.hasAutoSelect=u.hasAutoSelect||s.autoselect,u.hasDefault&&(e.hasDefaultAudio=!0),u.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function m5(_,e,s,u){return _.slice(s,u+1).reduce((A,y)=>{if(!y.codecSet)return A;const l=y.audioGroups;let c=A[y.codecSet];c||(A[y.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!l,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,y.bitrate);const p=Math.min(y.height,y.width);return c.minHeight=Math.min(c.minHeight,p),c.minFramerate=Math.min(c.minFramerate,y.frameRate),c.maxScore=Math.max(c.maxScore,y.score),c.fragmentError+=y.fragmentError,c.videoRanges[y.videoRange]=(c.videoRanges[y.videoRange]||0)+1,l&&l.forEach(r=>{if(!r)return;const i=e.groups[r];c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?i.hasDefault:i.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(i.channels).forEach(t=>{c.channels[t]=(c.channels[t]||0)+i.channels[t]})}),A},{})}function jr(_,e,s){if("attrs"in _){const u=e.indexOf(_);if(u!==-1)return u}for(let u=0;uu.indexOf(A)===-1)}function Vs(_,e){const{audioCodec:s,channels:u}=_;return(s===void 0||(e.audioCodec||"").substring(0,4)===s.substring(0,4))&&(u===void 0||u===(e.channels||"2"))}function A5(_,e,s,u,A){const y=e[u],c=e.reduce((n,a,o)=>{const d=a.uri;return(n[d]||(n[d]=[])).push(o),n},{})[y.uri];c.length>1&&(u=Math.max.apply(Math,c));const p=y.videoRange,r=y.frameRate,i=y.codecSet.substring(0,4),t=Vh(e,u,n=>{if(n.videoRange!==p||n.frameRate!==r||n.codecSet.substring(0,4)!==i)return!1;const a=n.audioGroups,o=s.filter(d=>!a||a.indexOf(d.groupId)!==-1);return jr(_,o,A)>-1});return t>-1?t:Vh(e,u,n=>{const a=n.audioGroups,o=s.filter(d=>!a||a.indexOf(d.groupId)!==-1);return jr(_,o,A)>-1})}function Vh(_,e,s){for(let u=e;u;u--)if(s(_[u]))return u;for(let u=e+1;u<_.length;u++)if(s(_[u]))return u;return-1}class y5{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this._abandonRulesCheck=()=>{const{fragCurrent:s,partCurrent:u,hls:A}=this,{autoLevelEnabled:y,media:l}=A;if(!s||!l)return;const c=performance.now(),p=u?u.stats:s.stats,r=u?u.duration:s.duration,i=c-p.loading.start,t=A.minAutoLevel;if(p.aborted||p.loaded&&p.loaded===p.total||s.level<=t){this.clearTimer(),this._nextAutoLevel=-1;return}if(!y||l.paused||!l.playbackRate||!l.readyState)return;const n=A.mainForwardBufferInfo;if(n===null)return;const a=this.bwEstimator.getEstimateTTFB(),o=Math.abs(l.playbackRate);if(i<=Math.max(a,1e3*(r/(o*2))))return;const d=n.len/o,g=p.loading.first?p.loading.first-p.loading.start:-1,m=p.loaded&&g>-1,v=this.getBwEstimate(),b=A.levels,w=b[s.level],C=p.total||Math.max(p.loaded,Math.round(r*w.maxBitrate/8));let D=m?i-g:i;D<1&&m&&(D=Math.min(i,p.loaded*8/v));const R=m?p.loaded*1e3/D:0,T=R?(C-p.loaded)/R:C*8/v+a/1e3;if(T<=d)return;const P=R?R*8:v;let L=Number.POSITIVE_INFINITY,I;for(I=s.level-1;I>t;I--){const O=b[I].maxBitrate;if(L=this.getTimeToLoadFrag(a/1e3,P,r*O,!b[I].details),L=T||L>r*10)return;A.nextLoadLevel=A.nextAutoLevel=I,m?this.bwEstimator.sample(i-Math.min(a,g),p.loaded):this.bwEstimator.sampleTTFB(i);const x=b[I].bitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>x&&this.resetEstimator(x),this.clearTimer(),Ft.warn(`[abr] Fragment ${s.sn}${u?" part "+u.index:""} of level ${s.level} is loading too slowly; Time to underbuffer: ${d.toFixed(3)} s Estimated load time for current fragment: ${T.toFixed(3)} s Estimated load time for down switch fragment: ${L.toFixed(3)} s TTFB estimate: ${g|0} ms Current BW estimate: ${Ci(v)?v|0:"Unknown"} bps New BW estimate: ${this.getBwEstimate()|0} bps - Switching to level ${I} @ ${x|0} bps`),y.trigger(rt.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:u,stats:p})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(Ft.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new a5(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.FRAG_LOADING,this.onFragLoading,this),e.on(rt.FRAG_LOADED,this.onFragLoaded,this),e.on(rt.FRAG_BUFFERED,this.onFragBuffered,this),e.on(rt.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(rt.LEVEL_LOADED,this.onLevelLoaded,this),e.on(rt.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(rt.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(rt.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.FRAG_LOADING,this.onFragLoading,this),e.off(rt.FRAG_LOADED,this.onFragLoaded,this),e.off(rt.FRAG_BUFFERED,this.onFragBuffered,this),e.off(rt.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(rt.LEVEL_LOADED,this.onLevelLoaded,this),e.off(rt.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(rt.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(rt.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,s){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,s){const u=s.frag;if(!this.ignoreFragment(u)){if(!u.bitrateTest){var y;this.fragCurrent=u,this.partCurrent=(y=s.part)!=null?y:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,s){this.clearTimer()}onError(e,s){if(!s.fatal)switch(s.details){case qt.BUFFER_ADD_CODEC_ERROR:case qt.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case qt.FRAG_LOAD_TIMEOUT:{const u=s.frag,{fragCurrent:y,partCurrent:A}=this;if(u&&y&&u.sn===y.sn&&u.level===y.level){const l=performance.now(),c=A?A.stats:u.stats,p=l-c.loading.start,r=c.loading.first?c.loading.first-c.loading.start:-1;if(c.loaded&&r>-1){const t=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(p-Math.min(t,r),c.loaded)}else this.bwEstimator.sampleTTFB(p)}break}}}getTimeToLoadFrag(e,s,u,y){const A=e+u/s,l=y?this.lastLevelLoadSec:0;return A+l}onLevelLoaded(e,s){const u=this.hls.config,{loading:y}=s.stats,A=y.end-y.start;Ci(A)&&(this.lastLevelLoadSec=A/1e3),s.details.live?this.bwEstimator.update(u.abrEwmaSlowLive,u.abrEwmaFastLive):this.bwEstimator.update(u.abrEwmaSlowVoD,u.abrEwmaFastVoD)}onFragLoaded(e,{frag:s,part:u}){const y=u?u.stats:s.stats;if(s.type===Hi.MAIN&&this.bwEstimator.sampleTTFB(y.loading.first-y.loading.start),!this.ignoreFragment(s)){if(this.clearTimer(),s.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const A=u?u.duration:s.duration,l=this.hls.levels[s.level],c=(l.loaded?l.loaded.bytes:0)+y.loaded,p=(l.loaded?l.loaded.duration:0)+A;l.loaded={bytes:c,duration:p},l.realBitrate=Math.round(8*c/p)}if(s.bitrateTest){const A={stats:y,frag:s,part:u,id:s.type};this.onFragBuffered(rt.FRAG_BUFFERED,A),s.bitrateTest=!1}else this.lastLoadedFragLevel=s.level}}onFragBuffered(e,s){const{frag:u,part:y}=s,A=y!=null&&y.stats.loaded?y.stats:u.stats;if(A.aborted||this.ignoreFragment(u))return;const l=A.parsing.end-A.loading.start-Math.min(A.loading.first-A.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(l,A.loaded),A.bwEstimate=this.getBwEstimate(),u.bitrateTest?this.bitrateTestDelay=l/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==Hi.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:s}=this.hls,u=this.getBwEstimate(),y=this.hls.config.maxStarvationDelay,A=this.findBestLevel(u,s,e,0,y,1,1);if(A>-1)return A;const l=this.hls.firstLevel,c=Math.min(Math.max(l,s),e);return Ft.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${l} clamped to ${c}`),c}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,u=this.bwEstimator.canEstimate(),y=this.lastLoadedFragLevel>-1;if(e!==-1&&(!u||!y||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const A=u&&y?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const l=this.hls.levels;if(l.length>Math.max(e,A)&&l[e].loadError<=l[A].loadError)return e}return this._nextAutoLevel=A,this.nextAutoLevelKey=this.getAutoLevelKey(),A}getAutoLevelKey(){var e;return`${this.getBwEstimate()}_${(e=this.hls.mainForwardBufferInfo)==null?void 0:e.len}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:s,hls:u}=this,{maxAutoLevel:y,config:A,minAutoLevel:l,media:c}=u,p=s?s.duration:e?e.duration:0,r=c&&c.playbackRate!==0?Math.abs(c.playbackRate):1,i=this.getBwEstimate(),t=u.mainForwardBufferInfo,n=(t?t.len:0)/r;let a=A.abrBandWidthFactor,o=A.abrBandWidthUpFactor;if(n){const b=this.findBestLevel(i,l,y,n,0,a,o);if(b>=0)return b}let d=p?Math.min(p,A.maxStarvationDelay):A.maxStarvationDelay;if(!n){const b=this.bitrateTestDelay;b&&(d=(p?Math.min(p,A.maxLoadingDelay):A.maxLoadingDelay)-b,Ft.info(`[abr] bitrate test took ${Math.round(1e3*b)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),a=o=1)}const g=this.findBestLevel(i,l,y,n,d,a,o);if(Ft.info(`[abr] ${n?"rebuffering expected":"buffer is empty"}, optimal quality level ${g}`),g>-1)return g;const m=u.levels[l],v=u.levels[u.loadLevel];return(m==null?void 0:m.bitrate)<(v==null?void 0:v.bitrate)?l:u.loadLevel}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,s,u,y,A,l,c){var p;const r=y+A,i=this.lastLoadedFragLevel,t=i===-1?this.hls.firstLevel:i,{fragCurrent:n,partCurrent:a}=this,{levels:o,allAudioTracks:d,loadLevel:g,config:m}=this.hls;if(o.length===1)return 0;const v=o[t],b=!!(v!=null&&(p=v.details)!=null&&p.live),w=g===-1||i===-1;let C,D="SDR",R=(v==null?void 0:v.frameRate)||0;const{audioPreference:T,videoPreference:P}=m,L=this.audioTracksByGroup||(this.audioTracksByGroup=f5(d));if(w){if(this.firstSelection!==-1)return this.firstSelection;const te=this.codecTiers||(this.codecTiers=p5(o,L,s,u)),le=h5(te,D,e,T,P),{codecSet:ne,videoRanges:ee,minFramerate:M,minBitrate:Y,preferHDR:j}=le;C=ne,D=j?ee[ee.length-1]:ee[0],R=M,e=Math.max(e,Y),Ft.log(`[abr] picked start tier ${JSON.stringify(le)}`)}else C=v==null?void 0:v.codecSet,D=v==null?void 0:v.videoRange;const I=a?a.duration:n?n.duration:0,x=this.bwEstimator.getEstimateTTFB()/1e3,O=[];for(let te=u;te>=s;te--){var G,J;const le=o[te],ne=te>t;if(!le)continue;if(m.useMediaCapabilities&&!le.supportedResult&&!le.supportedPromise){const Z=navigator.mediaCapabilities;typeof(Z==null?void 0:Z.decodingInfo)=="function"&&o5(le,L,D,R,e,T)?(le.supportedPromise=l5(le,L,Z),le.supportedPromise.then(X=>{le.supportedResult=X;const oe=this.hls.levels,he=oe.indexOf(le);X.error?Ft.warn(`[abr] MediaCapabilities decodingInfo error: "${X.error}" for level ${he} ${JSON.stringify(X)}`):X.supported||(Ft.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${he} ${JSON.stringify(X)}`),he>-1&&oe.length>1&&(Ft.log(`[abr] Removing unsupported level ${he}`),this.hls.removeLevel(he)))})):le.supportedResult=Hp}if(C&&le.codecSet!==C||D&&le.videoRange!==D||ne&&R>le.frameRate||!ne&&R>0&&R=I*2&&A===0?o[te].averageBitrate:o[te].maxBitrate,z=this.getTimeToLoadFrag(x,Y,j*M,ee===void 0);if(Y>=j&&(te===i||le.loadError===0&&le.fragmentError===0)&&(z<=x||!Ci(z)||b&&!this.bitrateTestDelay||z${te} adjustedbw(${Math.round(Y)})-bitrate=${Math.round(Y-j)} ttfb:${x.toFixed(1)} avgDuration:${M.toFixed(1)} maxFetchDuration:${r.toFixed(1)} fetchDuration:${z.toFixed(1)} firstSelection:${w} codecSet:${C} videoRange:${D} hls.loadLevel:${g}`)),w&&(this.firstSelection=te),te}}return-1}set nextAutoLevel(e){const s=Math.max(this.hls.minAutoLevel,e);this._nextAutoLevel!=s&&(this.nextAutoLevelKey="",this._nextAutoLevel=s)}}class y5{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}var Fn={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class v5{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(rt.BUFFER_APPENDED,this.onBufferAppended,this),e.on(rt.FRAG_BUFFERED,this.onFragBuffered,this),e.on(rt.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(rt.BUFFER_APPENDED,this.onBufferAppended,this),e.off(rt.FRAG_BUFFERED,this.onFragBuffered,this),e.off(rt.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,s){const u=this.activePartLists[s];if(u)for(let y=u.length;y--;){const A=u[y];if(!A)break;const l=A.end;if(A.start<=e&&l!==null&&e<=l)return A}return this.getBufferedFrag(e,s)}getBufferedFrag(e,s){const{fragments:u}=this,y=Object.keys(u);for(let A=y.length;A--;){const l=u[y[A]];if((l==null?void 0:l.body.type)===s&&l.buffered){const c=l.body;if(c.start<=e&&e<=c.end)return c}}return null}detectEvictedFragments(e,s,u,y){this.timeRanges&&(this.timeRanges[e]=s);const A=(y==null?void 0:y.fragment.sn)||-1;Object.keys(this.fragments).forEach(l=>{const c=this.fragments[l];if(!c||A>=c.body.sn)return;if(!c.buffered&&!c.loaded){c.body.type===u&&this.removeFragment(c.body);return}const p=c.range[e];p&&p.time.some(r=>{const i=!this.isTimeBuffered(r.startPTS,r.endPTS,s);return i&&this.removeFragment(c.body),i})})}detectPartialFragments(e){const s=this.timeRanges,{frag:u,part:y}=e;if(!s||u.sn==="initSegment")return;const A=Hs(u),l=this.fragments[A];if(!l||l.buffered&&u.gap)return;const c=!u.relurl;Object.keys(s).forEach(p=>{const r=u.elementaryStreams[p];if(!r)return;const i=s[p],t=c||r.partial===!0;l.range[p]=this.getBufferedTimes(u,y,t,i)}),l.loaded=null,Object.keys(l.range).length?(l.buffered=!0,(l.body.endList=u.endList||l.body.endList)&&(this.endListFragments[l.body.type]=l),eo(l)||this.removeParts(u.sn-1,u.type)):this.removeFragment(l.body)}removeParts(e,s){const u=this.activePartLists[s];u&&(this.activePartLists[s]=u.filter(y=>y.fragment.sn>=e))}fragBuffered(e,s){const u=Hs(e);let y=this.fragments[u];!y&&s&&(y=this.fragments[u]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),y&&(y.loaded=null,y.buffered=!0)}getBufferedTimes(e,s,u,y){const A={time:[],partial:u},l=e.start,c=e.end,p=e.minEndPTS||c,r=e.maxStartPTS||l;for(let i=0;i=t&&p<=n){A.time.push({startPTS:Math.max(l,y.start(i)),endPTS:Math.min(c,y.end(i))});break}else if(lt){const a=Math.max(l,y.start(i)),o=Math.min(c,y.end(i));o>a&&(A.partial=!0,A.time.push({startPTS:a,endPTS:o}))}else if(c<=t)break}return A}getPartialFragment(e){let s=null,u,y,A,l=0;const{bufferPadding:c,fragments:p}=this;return Object.keys(p).forEach(r=>{const i=p[r];i&&eo(i)&&(y=i.body.start-c,A=i.body.end+c,e>=y&&e<=A&&(u=Math.min(e-y,A-e),l<=u&&(s=i.body,l=u)))}),s}isEndListAppended(e){const s=this.endListFragments[e];return s!==void 0&&(s.buffered||eo(s))}getState(e){const s=Hs(e),u=this.fragments[s];return u?u.buffered?eo(u)?Fn.PARTIAL:Fn.OK:Fn.APPENDING:Fn.NOT_LOADED}isTimeBuffered(e,s,u){let y,A;for(let l=0;l=y&&s<=A)return!0;if(s<=y)return!1}return!1}onFragLoaded(e,s){const{frag:u,part:y}=s;if(u.sn==="initSegment"||u.bitrateTest)return;const A=y?null:s,l=Hs(u);this.fragments[l]={body:u,appendedPTS:null,loaded:A,buffered:!1,range:Object.create(null)}}onBufferAppended(e,s){const{frag:u,part:y,timeRanges:A}=s;if(u.sn==="initSegment")return;const l=u.type;if(y){let c=this.activePartLists[l];c||(this.activePartLists[l]=c=[]),c.push(y)}this.timeRanges=A,Object.keys(A).forEach(c=>{const p=A[c];this.detectEvictedFragments(c,p,l,y)})}onFragBuffered(e,s){this.detectPartialFragments(s)}hasFragment(e){const s=Hs(e);return!!this.fragments[s]}hasParts(e){var s;return!!((s=this.activePartLists[e])!=null&&s.length)}removeFragmentsInRange(e,s,u,y,A){y&&!this.hasGaps||Object.keys(this.fragments).forEach(l=>{const c=this.fragments[l];if(!c)return;const p=c.body;p.type!==u||y&&!p.gap||p.starte&&(c.buffered||A)&&this.removeFragment(p)})}removeFragment(e){const s=Hs(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const u=this.activePartLists[e.type];if(u){const y=e.sn;this.activePartLists[e.type]=u.filter(A=>A.fragment.sn!==y)}delete this.fragments[s],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function eo(_){var e,s,u;return _.buffered&&(_.body.gap||((e=_.range.video)==null?void 0:e.partial)||((s=_.range.audio)==null?void 0:s.partial)||((u=_.range.audiovideo)==null?void 0:u.partial))}function Hs(_){return`${_.type}_${_.level}_${_.sn}`}const b5={length:0,start:()=>0,end:()=>0};class mn{static isBuffered(e,s){try{if(e){const u=mn.getBuffered(e);for(let y=0;y=u.start(y)&&s<=u.end(y))return!0}}catch{}return!1}static bufferInfo(e,s,u){try{if(e){const y=mn.getBuffered(e),A=[];let l;for(l=0;lt&&(y[i-1].end=e[r].end):y.push(e[r])}else y.push(e[r])}else y=e;let A=0,l,c=s,p=s;for(let r=0;r=i&&ss.startCC||_&&_.cc{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(a=>a[0]==="GAP")){p(Kh(e));return}else e.gap=!1;const r=this.loader=e.loader=A?new A(y):new l(y),i=Wh(e),t=Gh(y.fragLoadPolicy.default),n={loadPolicy:t,timeout:t.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:zh};e.stats=r.stats,r.load(i,n,{onSuccess:(a,o,d,g)=>{this.resetLoader(e,r);let m=a.data;d.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(m.slice(0,16)),m=m.slice(16)),c({frag:e,part:null,payload:m,networkDetails:g})},onError:(a,o,d,g)=>{this.resetLoader(e,r),p(new Qr({type:Wi.NETWORK_ERROR,details:qt.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:Dn({url:u,data:void 0},a),error:new Error(`HTTP Error ${a.code} ${a.text}`),networkDetails:d,stats:g}))},onAbort:(a,o,d)=>{this.resetLoader(e,r),p(new Qr({type:Wi.NETWORK_ERROR,details:qt.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:d,stats:a}))},onTimeout:(a,o,d)=>{this.resetLoader(e,r),p(new Qr({type:Wi.NETWORK_ERROR,details:qt.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${n.timeout}ms`),networkDetails:d,stats:a}))},onProgress:(a,o,d,g)=>{s&&s({frag:e,part:null,payload:d,networkDetails:g})}})})}loadPart(e,s,u){this.abort();const y=this.config,A=y.fLoader,l=y.loader;return new Promise((c,p)=>{if(this.loader&&this.loader.destroy(),e.gap||s.gap){p(Kh(e,s));return}const r=this.loader=e.loader=A?new A(y):new l(y),i=Wh(e,s),t=Gh(y.fragLoadPolicy.default),n={loadPolicy:t,timeout:t.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:zh};s.stats=r.stats,r.load(i,n,{onSuccess:(a,o,d,g)=>{this.resetLoader(e,r),this.updateStatsFromPart(e,s);const m={frag:e,part:s,payload:a.data,networkDetails:g};u(m),c(m)},onError:(a,o,d,g)=>{this.resetLoader(e,r),p(new Qr({type:Wi.NETWORK_ERROR,details:qt.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:s,response:Dn({url:i.url,data:void 0},a),error:new Error(`HTTP Error ${a.code} ${a.text}`),networkDetails:d,stats:g}))},onAbort:(a,o,d)=>{e.stats.aborted=s.stats.aborted,this.resetLoader(e,r),p(new Qr({type:Wi.NETWORK_ERROR,details:qt.INTERNAL_ABORTED,fatal:!1,frag:e,part:s,error:new Error("Aborted"),networkDetails:d,stats:a}))},onTimeout:(a,o,d)=>{this.resetLoader(e,r),p(new Qr({type:Wi.NETWORK_ERROR,details:qt.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:s,error:new Error(`Timeout after ${n.timeout}ms`),networkDetails:d,stats:a}))}})})}updateStatsFromPart(e,s){const u=e.stats,y=s.stats,A=y.total;if(u.loaded+=y.loaded,A){const p=Math.round(e.duration/s.duration),r=Math.min(Math.round(u.loaded/A),p),t=(p-r)*Math.round(u.loaded/r);u.total=u.loaded+t}else u.total=Math.max(u.loaded,u.total);const l=u.loading,c=y.loading;l.start?l.first+=c.first-c.start:(l.start=c.start,l.first=c.first),l.end=c.end}resetLoader(e,s){e.loader=null,this.loader===s&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),s.destroy()}}function Wh(_,e=null){const s=e||_,u={frag:_,part:e,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},y=s.byteRangeStartOffset,A=s.byteRangeEndOffset;if(Ci(y)&&Ci(A)){var l;let c=y,p=A;if(_.sn==="initSegment"&&((l=_.decryptdata)==null?void 0:l.method)==="AES-128"){const r=A-y;r%16&&(p=A+(16-r%16)),y!==0&&(u.resetIV=!0,c=y-16)}u.rangeStart=c,u.rangeEnd=p}return u}function Kh(_,e){const s=new Error(`GAP ${_.gap?"tag":"attribute"} found`),u={type:Wi.MEDIA_ERROR,details:qt.FRAG_GAP,fatal:!1,frag:_,error:s,networkDetails:null};return e&&(u.part=e),(e||_).stats.aborted=!0,new Qr(u)}class Qr extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class C5{constructor(e,s){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=s}decrypt(e,s){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},s,e)}}class x5{constructor(e,s){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=s}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function k5(_){const e=_.byteLength,s=e&&new DataView(_.buffer).getUint8(e-1);return s?Ts(_,0,e-s):_}class R5{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const s=new DataView(e),u=new Uint32Array(4);for(let y=0;y<4;y++)u[y]=s.getUint32(y*4);return u}initTable(){const e=this.sBox,s=this.invSBox,u=this.subMix,y=u[0],A=u[1],l=u[2],c=u[3],p=this.invSubMix,r=p[0],i=p[1],t=p[2],n=p[3],a=new Uint32Array(256);let o=0,d=0,g=0;for(g=0;g<256;g++)g<128?a[g]=g<<1:a[g]=g<<1^283;for(g=0;g<256;g++){let m=d^d<<1^d<<2^d<<3^d<<4;m=m>>>8^m&255^99,e[o]=m,s[m]=o;const v=a[o],b=a[v],w=a[b];let C=a[m]*257^m*16843008;y[o]=C<<24|C>>>8,A[o]=C<<16|C>>>16,l[o]=C<<8|C>>>24,c[o]=C,C=w*16843009^b*65537^v*257^o*16843008,r[m]=C<<24|C>>>8,i[m]=C<<16|C>>>16,t[m]=C<<8|C>>>24,n[m]=C,o?(o=v^a[a[a[w^v]]],d^=a[a[d]]):o=d=1}}expandKey(e){const s=this.uint8ArrayToUint32Array_(e);let u=!0,y=0;for(;yy?(this.logOnce("WebCrypto AES decrypt"),new C5(y,new Uint8Array(u)).decrypt(e.buffer,A)):Promise.reject(new Error("web crypto not initialized"))).catch(A=>(Ft.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${A.name}: ${A.message}`),this.onWebCryptoError(e,s,u)))}onWebCryptoError(e,s,u){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,s,u);const y=this.flush();if(y)return y.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let s=e;const u=e.length-e.length%I5;return u!==e.length&&(s=Ts(e,0,u),this.remainderData=Ts(e,u)),s}logOnce(e){this.logEnabled&&(Ft.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const L5={toString:function(_){let e="";const s=_.length;for(let u=0;uc.end){const t=l>i;(l{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${A.part?" p: "+A.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(A)};this._doFragLoad(e,s,u,y).then(A=>{if(!A)return;const l=this.state;if(this.fragContextChanged(e)){(l===ni.FRAG_LOADING||!this.fragCurrent&&l===ni.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=ni.IDLE);return}"payload"in A&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(rt.FRAG_LOADED,A)),this._handleFragmentLoadComplete(A)}).catch(A=>{this.state===ni.STOPPED||this.state===ni.ERROR||(this.warn(A),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var s;const{fragmentTracker:u}=this;if(u.getState(e)===Fn.APPENDING){const A=e.type,l=this.getFwdBufferInfo(this.mediaBuffer,A),c=Math.max(e.duration,l?l.len:this.config.maxBufferLength);this.reduceMaxBufferLength(c)&&u.removeFragment(e)}else((s=this.mediaBuffer)==null?void 0:s.buffered.length)===0?u.removeAllFragments():u.hasParts(e.type)&&(u.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),u.getState(e)===Fn.PARTIAL&&u.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const s=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:s,part:null,stats:s.stats,id:s.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,s,u=null){if(!(e-s))return;const y={startOffset:e,endOffset:s,type:u};this.hls.trigger(rt.BUFFER_FLUSHING,y)}_loadInitSegment(e,s){this._doFragLoad(e,s).then(u=>{if(!u||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return u}).then(u=>{const{hls:y}=this,{payload:A}=u,l=e.decryptdata;if(A&&A.byteLength>0&&l!=null&&l.key&&l.iv&&l.method==="AES-128"){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(A),l.key.buffer,l.iv.buffer).catch(p=>{throw y.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.FRAG_DECRYPT_ERROR,fatal:!1,error:p,reason:p.message,frag:e}),p}).then(p=>{const r=self.performance.now();return y.trigger(rt.FRAG_DECRYPTED,{frag:e,payload:p,stats:{tstart:c,tdecrypt:r}}),u.payload=p,this.completeInitSegmentLoad(u)})}return this.completeInitSegmentLoad(u)}).catch(u=>{this.state===ni.STOPPED||this.state===ni.ERROR||(this.warn(u),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:s}=this;if(!s)throw new Error("init load aborted, missing levels");const u=e.frag.stats;this.state=ni.IDLE,e.frag.data=new Uint8Array(e.payload),u.parsing.start=u.buffering.start=self.performance.now(),u.parsing.end=u.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:s}=this;return!e||!s||e.sn!==s.sn||e.level!==s.level}fragBufferedComplete(e,s){var u,y,A,l;const c=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${s?" part: "+s.index:""} of ${this.playlistType===Hi.MAIN?"level":"track"} ${e.level} (frag:[${((u=e.startPTS)!=null?u:NaN).toFixed(3)}-${((y=e.endPTS)!=null?y:NaN).toFixed(3)}] > buffer:${c?L5.toString(mn.getBuffered(c)):"(detached)"})`),e.sn!=="initSegment"){var p;if(e.type!==Hi.SUBTITLE){const i=e.elementaryStreams;if(!Object.keys(i).some(t=>!!i[t])){this.state=ni.IDLE;return}}const r=(p=this.levels)==null?void 0:p[e.level];r!=null&&r.fragmentError&&(this.log(`Resetting level fragment error count of ${r.fragmentError} on frag buffered`),r.fragmentError=0)}this.state=ni.IDLE,c&&(!this.loadedmetadata&&e.type==Hi.MAIN&&c.buffered.length&&((A=this.fragCurrent)==null?void 0:A.sn)===((l=this.fragPrevious)==null?void 0:l.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:s}=this;if(!s)return;const{frag:u,part:y,partsLoaded:A}=e,l=!A||A.length===0||A.some(p=>!p),c=new Td(u.level,u.sn,u.stats.chunkCount+1,0,y?y.index:-1,!l);s.flush(c)}_handleFragmentLoadProgress(e){}_doFragLoad(e,s,u=null,y){var A;const l=s==null?void 0:s.details;if(!this.levels||!l)throw new Error(`frag load aborted, missing level${l?"":" detail"}s`);let c=null;if(e.encrypted&&!((A=e.decryptdata)!=null&&A.key)?(this.log(`Loading key for ${e.sn} of [${l.startSN}-${l.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=ni.KEY_LOADING,this.fragCurrent=e,c=this.keyLoader.load(e).then(i=>{if(!this.fragContextChanged(i.frag))return this.hls.trigger(rt.KEY_LOADED,i),this.state===ni.KEY_LOADING&&(this.state=ni.IDLE),i}),this.hls.trigger(rt.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(c=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&l.encryptedFragments.length&&this.keyLoader.loadClear(e,l.encryptedFragments),u=Math.max(e.start,u||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const i=l.partList;if(i&&y){u>e.end&&l.fragmentHint&&(e=l.fragmentHint);const t=this.getNextPart(i,e,u);if(t>-1){const n=i[t];this.log(`Loading part sn: ${e.sn} p: ${n.index} cc: ${e.cc} of playlist [${l.startSN}-${l.endSN}] parts [0-${t}-${i.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(u.toFixed(3))}`),this.nextLoadPosition=n.start+n.duration,this.state=ni.FRAG_LOADING;let a;return c?a=c.then(o=>!o||this.fragContextChanged(o.frag)?null:this.doFragPartsLoad(e,n,s,y)).catch(o=>this.handleFragLoadError(o)):a=this.doFragPartsLoad(e,n,s,y).catch(o=>this.handleFragLoadError(o)),this.hls.trigger(rt.FRAG_LOADING,{frag:e,part:n,targetBufferTime:u}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):a}else if(!e.url||this.loadedEndOfParts(i,u))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${l?"of ["+l.startSN+"-"+l.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(u.toFixed(3))}`),Ci(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=ni.FRAG_LOADING;const p=this.config.progressive;let r;return p&&c?r=c.then(i=>!i||this.fragContextChanged(i==null?void 0:i.frag)?null:this.fragmentLoader.load(e,y)).catch(i=>this.handleFragLoadError(i)):r=Promise.all([this.fragmentLoader.load(e,p?y:void 0),c]).then(([i])=>(!p&&i&&y&&y(i),i)).catch(i=>this.handleFragLoadError(i)),this.hls.trigger(rt.FRAG_LOADING,{frag:e,targetBufferTime:u}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):r}doFragPartsLoad(e,s,u,y){return new Promise((A,l)=>{var c;const p=[],r=(c=u.details)==null?void 0:c.partList,i=t=>{this.fragmentLoader.loadPart(e,t,y).then(n=>{p[t.index]=n;const a=n.part;this.hls.trigger(rt.FRAG_LOADED,n);const o=Fh(u,e.sn,t.index+1)||Gp(r,e.sn,t.index+1);if(o)i(o);else return A({frag:e,part:a,partsLoaded:p})}).catch(l)};i(s)})}handleFragLoadError(e){if("data"in e){const s=e.data;e.data&&s.details===qt.INTERNAL_ABORTED?this.handleFragLoadAborted(s.frag,s.part):this.hls.trigger(rt.ERROR,s)}else this.hls.trigger(rt.ERROR,{type:Wi.OTHER_ERROR,details:qt.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const s=this.getCurrentContext(e);if(!s||this.state!==ni.PARSING){!this.fragCurrent&&this.state!==ni.STOPPED&&this.state!==ni.ERROR&&(this.state=ni.IDLE);return}const{frag:u,part:y,level:A}=s,l=self.performance.now();u.stats.parsing.end=l,y&&(y.stats.parsing.end=l),this.updateLevelTiming(u,y,A,e.partial)}getCurrentContext(e){const{levels:s,fragCurrent:u}=this,{level:y,sn:A,part:l}=e;if(!(s!=null&&s[y]))return this.warn(`Levels object was unset while buffering fragment ${A} of level ${y}. The current chunk will not be buffered.`),null;const c=s[y],p=l>-1?Fh(c,A,l):null,r=p?p.fragment:e5(c,A,u);return r?(u&&u!==r&&(r.stats=u.stats),{frag:r,part:p,level:c}):null}bufferFragmentData(e,s,u,y,A){var l;if(!e||this.state!==ni.PARSING)return;const{data1:c,data2:p}=e;let r=c;if(c&&p&&(r=Ar(c,p)),!((l=r)!=null&&l.length))return;const i={type:e.type,frag:s,part:u,chunkMeta:y,parent:s.type,data:r};if(this.hls.trigger(rt.BUFFER_APPENDING,i),e.dropped&&e.independent&&!u){if(A)return;this.flushBufferGap(s)}}flushBufferGap(e){const s=this.media;if(!s)return;if(!mn.isBuffered(s,s.currentTime)){this.flushMainBuffer(0,e.start);return}const u=s.currentTime,y=mn.bufferInfo(s,u,0),A=e.duration,l=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),c=Math.max(Math.min(e.start-l,y.end-l),u+l);e.start-c>l&&this.flushMainBuffer(c,e.start)}getFwdBufferInfo(e,s){const u=this.getLoadPosition();return Ci(u)?this.getFwdBufferInfoAtPos(e,u,s):null}getFwdBufferInfoAtPos(e,s,u){const{config:{maxBufferHole:y}}=this,A=mn.bufferInfo(e,s,y);if(A.len===0&&A.nextStart!==void 0){const l=this.fragmentTracker.getBufferedFrag(s,u);if(l&&A.nextStart=u?(s.maxMaxBufferLength/=2,this.warn(`Reduce max buffer length to ${s.maxMaxBufferLength}s`),!0):!1}getAppendedFrag(e,s=Hi.MAIN){const u=this.fragmentTracker.getAppendedFrag(e,Hi.MAIN);return u&&"fragment"in u?u.fragment:u}getNextFragment(e,s){const u=s.fragments,y=u.length;if(!y)return null;const{config:A}=this,l=u[0].start;let c;if(s.live){const p=A.initialLiveManifestSize;if(ys}getNextFragmentLoopLoading(e,s,u,y,A){const l=e.gap,c=this.getNextFragment(this.nextLoadPosition,s);if(c===null)return c;if(e=c,l&&e&&!e.gap&&u.nextStart){const p=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,u.nextStart,y);if(p!==null&&u.len+p.len>=A)return this.log(`buffer full after gaps in "${y}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,s,u){let y=-1,A=!1,l=!0;for(let c=0,p=e.length;c-1&&uu.start&&u.loaded}getInitialLiveFragment(e,s){const u=this.fragPrevious;let y=null;if(u){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${u.programDateTime}`),y=i5(s,u.endProgramDateTime,this.config.maxFragLookUpTolerance)),!y){const A=u.sn+1;if(A>=e.startSN&&A<=e.endSN){const l=s[A-e.startSN];u.cc===l.cc&&(y=l,this.log(`Live playlist, switching playlist, load frag with next SN: ${y.sn}`))}y||(y=r5(s,u.cc),y&&this.log(`Live playlist, switching playlist, load frag with same CC: ${y.sn}`))}}else{const A=this.hls.liveSyncPosition;A!==null&&(y=this.getFragmentAtPosition(A,this.bitrateTest?e.fragmentEnd:e.edge,e))}return y}getFragmentAtPosition(e,s,u){const{config:y}=this;let{fragPrevious:A}=this,{fragments:l,endSN:c}=u;const{fragmentHint:p}=u,r=y.maxFragLookUpTolerance,i=u.partList,t=!!(y.lowLatencyMode&&i!=null&&i.length&&p);t&&p&&!this.bitrateTest&&(l=l.concat(p),c=p.sn);let n;if(es-r?0:r;n=Po(A,l,e,a)}else n=l[l.length-1];if(n){const a=n.sn-u.startSN,o=this.fragmentTracker.getState(n);if((o===Fn.OK||o===Fn.PARTIAL&&n.gap)&&(A=n),A&&n.sn===A.sn&&(!t||i[0].fragment.sn>n.sn)&&A&&n.level===A.level){const g=l[a+1];n.sn=l-s.maxFragLookUpTolerance&&A<=c;if(y!==null&&u.duration>y&&(A${e.startSN} prev-sn: ${p?p.sn:"na"} fragments: ${y}`),r}return A}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,s){let u=this.startPosition;if(u ${(y=this.fragCurrent)==null?void 0:y.url}`);return}const A=s.details===qt.FRAG_GAP;A&&this.fragmentTracker.fragBuffered(u,!0);const l=s.errorAction,{action:c,retryCount:p=0,retryConfig:r}=l||{};if(l&&c===Vn.RetryRequest&&r){this.resetStartWhenNotLoaded(this.levelLastLoaded);const i=wd(r,p);this.warn(`Fragment ${u.sn} of ${e} ${u.level} errored with ${s.details}, retrying loading ${p+1}/${r.maxNumRetry} in ${i}ms`),l.resolved=!0,this.retryDate=self.performance.now()+i,this.state=ni.FRAG_LOADING_WAITING_RETRY}else if(r&&l)if(this.resetFragmentErrors(e),p.5;y&&this.reduceMaxBufferLength(u.len);const A=!y;return A&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${s} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),A}return!1}resetFragmentErrors(e){e===Hi.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==ni.STOPPED&&(this.state=ni.IDLE)}afterBufferFlushed(e,s,u){if(!e)return;const y=mn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(s,y,u),this.state===ni.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=ni.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const s=e?e.details:null;s!=null&&s.live?(this.startPosition=-1,this.setStartPosition(s,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,s,u,y){var A;const l=u.details;if(!l){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((p,r)=>{const i=e.elementaryStreams[r];if(i){const t=i.endPTS-i.startPTS;if(t<=0)return this.warn(`Could not parse fragment ${e.sn} ${r} duration reliably (${t})`),p||!1;const n=y?0:Fp(l,e,i.startPTS,i.endPTS,i.startDTS,i.endDTS);return this.hls.trigger(rt.LEVEL_PTS_UPDATED,{details:l,level:u,drift:n,type:r,frag:e,start:i.startPTS,end:i.endPTS}),!0}return p},!1)&&((A=this.transmuxer)==null?void 0:A.error)===null){const p=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(u.fragmentError===0&&(u.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(p.message),this.hls.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.FRAG_PARSING_ERROR,fatal:!1,error:p,frag:e,reason:`Found no media in msn ${e.sn} of level "${u.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=ni.PARSED,this.hls.trigger(rt.FRAG_PARSED,{frag:e,part:s})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const s=this._state;s!==e&&(this._state=e,this.log(`${s}->${e}`))}get state(){return this._state}}class Wp{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:s}=this;let u;if(e.length)e.length===1?u=e[0]:u=D5(e,s);else return new Uint8Array(0);return this.reset(),u}reset(){this.chunks.length=0,this.dataLength=0}}function D5(_,e){const s=new Uint8Array(e);let u=0;for(let y=0;y<_.length;y++){const A=_[y];s.set(A,u),u+=A.length}return s}function O5(){return typeof __HLS_WORKER_BUNDLE__=="function"}function M5(){const _=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),e=self.URL.createObjectURL(_);return{worker:new self.Worker(e),objectURL:e}}function P5(_){const e=new self.URL(_,self.location.href).href;return{worker:new self.Worker(e),scriptURL:e}}function Ur(_="",e=9e4){return{type:_,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class kd{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,s,u,y){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,s){return!1}appendFrame(e,s,u){}demux(e,s){this.cachedData&&(e=Ar(this.cachedData,e),this.cachedData=null);let u=Ra(e,0),y=u?u.length:0,A;const l=this._audioTrack,c=this._id3Track,p=u?_d(u):void 0,r=e.length;for((this.basePTS===null||this.frameIndex===0&&Ci(p))&&(this.basePTS=B5(p,s,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),u&&u.length>0&&c.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:u,type:xr.audioId3,duration:Number.POSITIVE_INFINITY});y{if(Ci(_))return _*90;const u=s?s.baseTime*9e4/s.timescale:0;return e*9e4+u};function N5(_,e,s,u){let y,A,l,c;const p=navigator.userAgent.toLowerCase(),r=u,i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];y=((e[s+2]&192)>>>6)+1;const t=(e[s+2]&60)>>>2;if(t>i.length-1){const n=new Error(`invalid ADTS sampling index:${t}`);_.emit(rt.ERROR,rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.FRAG_PARSING_ERROR,fatal:!0,error:n,reason:n.message});return}return l=(e[s+2]&1)<<2,l|=(e[s+3]&192)>>>6,Ft.log(`manifest codec:${u}, ADTS type:${y}, samplingIndex:${t}`),/firefox/i.test(p)?t>=6?(y=5,c=new Array(4),A=t-3):(y=2,c=new Array(2),A=t):p.indexOf("android")!==-1?(y=2,c=new Array(2),A=t):(y=5,c=new Array(4),u&&(u.indexOf("mp4a.40.29")!==-1||u.indexOf("mp4a.40.5")!==-1)||!u&&t>=6?A=t-3:((u&&u.indexOf("mp4a.40.2")!==-1&&(t>=6&&l===1||/vivaldi/i.test(p))||!u&&l===1)&&(y=2,c=new Array(2)),A=t)),c[0]=y<<3,c[0]|=(t&14)>>1,c[1]|=(t&1)<<7,c[1]|=l<<3,y===5&&(c[1]|=(A&14)>>1,c[2]=(A&1)<<7,c[2]|=8,c[3]=0),{config:c,samplerate:i[t],channelCount:l,codec:"mp4a.40."+y,manifestCodec:r}}function Kp(_,e){return _[e]===255&&(_[e+1]&246)===240}function qp(_,e){return _[e+1]&1?7:9}function Rd(_,e){return(_[e+3]&3)<<11|_[e+4]<<3|(_[e+5]&224)>>>5}function F5(_,e){return e+5<_.length}function No(_,e){return e+1<_.length&&Kp(_,e)}function U5(_,e){return F5(_,e)&&Kp(_,e)&&Rd(_,e)<=_.length-e}function G5(_,e){if(No(_,e)){const s=qp(_,e);if(e+s>=_.length)return!1;const u=Rd(_,e);if(u<=s)return!1;const y=e+u;return y===_.length||No(_,y)}return!1}function Yp(_,e,s,u,y){if(!_.samplerate){const A=N5(e,s,u,y);if(!A)return;_.config=A.config,_.samplerate=A.samplerate,_.channelCount=A.channelCount,_.codec=A.codec,_.manifestCodec=A.manifestCodec,Ft.log(`parsed codec:${_.codec}, rate:${A.samplerate}, channels:${A.channelCount}`)}}function Jp(_){return 1024*9e4/_}function j5(_,e){const s=qp(_,e);if(e+s<=_.length){const u=Rd(_,e)-s;if(u>0)return{headerLength:s,frameLength:u}}}function Qp(_,e,s,u,y){const A=Jp(_.samplerate),l=u+y*A,c=j5(e,s);let p;if(c){const{frameLength:t,headerLength:n}=c,a=n+t,o=Math.max(0,s+a-e.length);o?(p=new Uint8Array(a-n),p.set(e.subarray(s+n,e.length),0)):p=e.subarray(s+n,s+a);const d={unit:p,pts:l};return o||_.samples.push(d),{sample:d,length:a,missing:o}}const r=e.length-s;return p=new Uint8Array(r),p.set(e.subarray(s,e.length),0),{sample:{unit:p,pts:l},length:r,missing:-1}}let io=null;const V5=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],H5=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],z5=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],W5=[0,1,1,4];function Zp(_,e,s,u,y){if(s+24>e.length)return;const A=Xp(e,s);if(A&&s+A.frameLength<=e.length){const l=A.samplesPerFrame*9e4/A.sampleRate,c=u+y*l,p={unit:e.subarray(s,s+A.frameLength),pts:c,dts:c};return _.config=[],_.channelCount=A.channelCount,_.samplerate=A.sampleRate,_.samples.push(p),{sample:p,length:A.frameLength,missing:0}}}function Xp(_,e){const s=_[e+1]>>3&3,u=_[e+1]>>1&3,y=_[e+2]>>4&15,A=_[e+2]>>2&3;if(s!==1&&y!==0&&y!==15&&A!==3){const l=_[e+2]>>1&1,c=_[e+3]>>6,p=s===3?3-u:u===3?3:4,r=V5[p*14+y-1]*1e3,t=H5[(s===3?0:s===2?1:2)*3+A],n=c===3?1:2,a=z5[s][u],o=W5[u],d=a*8*o,g=Math.floor(a*r/t+l)*o;if(io===null){const b=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);io=b?parseInt(b[1]):0}return!!io&&io<=87&&u===2&&r>=224e3&&c===0&&(_[e+3]=_[e+3]|128),{sampleRate:t,channelCount:n,frameLength:g,samplesPerFrame:d}}}function Id(_,e){return _[e]===255&&(_[e+1]&224)===224&&(_[e+1]&6)!==0}function $p(_,e){return e+1<_.length&&Id(_,e)}function K5(_,e){return Id(_,e)&&4<=_.length-e}function e0(_,e){if(e+1<_.length&&Id(_,e)){const u=Xp(_,e);let y=4;u!=null&&u.frameLength&&(y=u.frameLength);const A=e+y;return A===_.length||$p(_,A)}return!1}class q5 extends kd{constructor(e,s){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=s}resetInitSegment(e,s,u,y){super.resetInitSegment(e,s,u,y),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:s,duration:y,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const s=Ra(e,0);let u=(s==null?void 0:s.length)||0;if(e0(e,u))return!1;for(let y=e.length;u{const l=T_(A);if(Y5.test(l.schemeIdUri)){const c=Ci(l.presentationTime)?l.presentationTime/l.timeScale:s+l.presentationTimeDelta/l.timeScale;let p=l.eventDuration===4294967295?Number.POSITIVE_INFINITY:l.eventDuration/l.timeScale;p<=.001&&(p=Number.POSITIVE_INFINITY);const r=l.payload;u.samples.push({data:r,len:r.byteLength,dts:c,pts:c,type:xr.emsg,duration:p})}})}return u}demuxSampleAes(e,s,u){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const t0=(_,e)=>{let s=0,u=5;e+=u;const y=new Uint32Array(1),A=new Uint32Array(1),l=new Uint8Array(1);for(;u>0;){l[0]=_[e];const c=Math.min(u,8),p=8-c;A[0]=4278190080>>>24+p<>p,s=s?s<e.length||e[s]!==11||e[s+1]!==119)return-1;const A=e[s+4]>>6;if(A>=3)return-1;const c=[48e3,44100,32e3][A],p=e[s+4]&63,i=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][p*3+A]*2;if(s+i>e.length)return-1;const t=e[s+6]>>5;let n=0;t===2?n+=2:(t&1&&t!==1&&(n+=2),t&4&&(n+=2));const a=(e[s+6]<<8|e[s+7])>>12-n&1,d=[2,1,2,3,3,4,4,5][t]+a,g=e[s+5]>>3,m=e[s+5]&7,v=new Uint8Array([A<<6|g<<1|m>>2,(m&3)<<6|t<<3|a<<2|p>>4,p<<4&224]),b=1536/c*9e4,w=u+y*b,C=e.subarray(s,s+i);return _.config=v,_.channelCount=d,_.samplerate=c,_.samples.push({unit:C,pts:w}),i}class n0{constructor(){this.VideoSample=null}createVideoSample(e,s,u,y){return{key:e,frame:!1,pts:s,dts:u,units:[],debug:y,length:0}}getLastNalUnit(e){var s;let u=this.VideoSample,y;if((!u||u.units.length===0)&&(u=e[e.length-1]),(s=u)!=null&&s.units){const A=u.units;y=A[A.length-1]}return y}pushAccessUnit(e,s){if(e.units.length&&e.frame){if(e.pts===void 0){const u=s.samples,y=u.length;if(y){const A=u[y-1];e.pts=A.pts,e.dts=A.dts}else{s.dropped++;return}}s.samples.push(e)}e.debug.length&&Ft.log(e.pts+"/"+e.dts+":"+e.debug)}parseNALu(e,s){const u=s.byteLength;let y=e.naluState||0;const A=y,l=[];let c=0,p,r,i,t=-1,n=0;for(y===-1&&(t=0,n=this.getNALuType(s,0),y=0,c=1);c=0){const a={data:s.subarray(t,r),type:n};l.push(a)}else{const a=this.getLastNalUnit(e.samples);a&&(A&&c<=4-A&&a.state&&(a.data=a.data.subarray(0,a.data.byteLength-A)),r>0&&(a.data=Ar(a.data,s.subarray(0,r)),a.state=0))}c=0&&y>=0){const a={data:s.subarray(t,u),type:n,state:y};l.push(a)}if(l.length===0){const a=this.getLastNalUnit(e.samples);a&&(a.data=Ar(a.data,s))}return e.naluState=y,l}}class xa{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,s=this.bytesAvailable,u=e.byteLength-s,y=new Uint8Array(4),A=Math.min(4,s);if(A===0)throw new Error("no bytes available");y.set(e.subarray(u,u+A)),this.word=new DataView(y.buffer).getUint32(0),this.bitsAvailable=A*8,this.bytesAvailable-=A}skipBits(e){let s;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,s=e>>3,e-=s<<3,this.bytesAvailable-=s,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let s=Math.min(this.bitsAvailable,e);const u=this.word>>>32-s;if(e>32&&Ft.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=s,this.bitsAvailable>0)this.word<<=s;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return s=e-s,s>0&&this.bitsAvailable?u<>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class qh extends n0{parsePES(e,s,u,y,A){const l=this.parseNALu(e,u.data);let c=this.VideoSample,p,r=!1;u.data=null,c&&l.length&&!e.audFound&&(this.pushAccessUnit(c,e),c=this.VideoSample=this.createVideoSample(!1,u.pts,u.dts,"")),l.forEach(i=>{var t;switch(i.type){case 1:{let d=!1;p=!0;const g=i.data;if(r&&g.length>4){const m=this.readSliceType(g);(m===2||m===4||m===7||m===9)&&(d=!0)}if(d){var n;(n=c)!=null&&n.frame&&!c.key&&(this.pushAccessUnit(c,e),c=this.VideoSample=null)}c||(c=this.VideoSample=this.createVideoSample(!0,u.pts,u.dts,"")),c.frame=!0,c.key=d;break}case 5:p=!0,(t=c)!=null&&t.frame&&!c.key&&(this.pushAccessUnit(c,e),c=this.VideoSample=null),c||(c=this.VideoSample=this.createVideoSample(!0,u.pts,u.dts,"")),c.key=!0,c.frame=!0;break;case 6:{p=!0,Ed(i.data,1,u.pts,s.samples);break}case 7:{var a,o;p=!0,r=!0;const d=i.data,g=this.readSPS(d);if(!e.sps||e.width!==g.width||e.height!==g.height||((a=e.pixelRatio)==null?void 0:a[0])!==g.pixelRatio[0]||((o=e.pixelRatio)==null?void 0:o[1])!==g.pixelRatio[1]){e.width=g.width,e.height=g.height,e.pixelRatio=g.pixelRatio,e.sps=[d],e.duration=A;const m=d.subarray(1,4);let v="avc1.";for(let b=0;b<3;b++){let w=m[b].toString(16);w.length<2&&(w="0"+w),v+=w}e.codec=v}break}case 8:p=!0,e.pps=[i.data];break;case 9:p=!0,e.audFound=!0,c&&this.pushAccessUnit(c,e),c=this.VideoSample=this.createVideoSample(!1,u.pts,u.dts,"");break;case 12:p=!0;break;default:p=!1,c&&(c.debug+="unknown NAL "+i.type+" ");break}c&&p&&c.units.push(i)}),y&&c&&(this.pushAccessUnit(c,e),this.VideoSample=null)}getNALuType(e,s){return e[s]&31}readSliceType(e){const s=new xa(e);return s.readUByte(),s.readUEG(),s.readUEG()}skipScalingList(e,s){let u=8,y=8,A;for(let l=0;l{var t;switch(i.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:c||(c=this.VideoSample=this.createVideoSample(!1,u.pts,u.dts,"")),c.frame=!0,p=!0;break;case 16:case 17:case 18:case 21:if(p=!0,r){var n;(n=c)!=null&&n.frame&&!c.key&&(this.pushAccessUnit(c,e),c=this.VideoSample=null)}c||(c=this.VideoSample=this.createVideoSample(!0,u.pts,u.dts,"")),c.key=!0,c.frame=!0;break;case 19:case 20:p=!0,(t=c)!=null&&t.frame&&!c.key&&(this.pushAccessUnit(c,e),c=this.VideoSample=null),c||(c=this.VideoSample=this.createVideoSample(!0,u.pts,u.dts,"")),c.key=!0,c.frame=!0;break;case 39:p=!0,Ed(i.data,2,u.pts,s.samples);break;case 32:if(p=!0,!e.vps){const a=this.readVPS(i.data);e.params=Dn({},a),this.initVPS=i.data}e.vps=[i.data];break;case 33:if(p=!0,r=!0,typeof e.params=="object"){if(e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],i.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const a=this.readSPS(i.data);e.width=a.width,e.height=a.height,e.pixelRatio=a.pixelRatio,e.duration=A,e.codec=a.codecString,e.sps=[];for(const o in a.params)e.params[o]=a.params[o]}e.vps!==void 0&&e.vps[0]===this.initVPS&&e.sps.push(i.data)}c||(c=this.VideoSample=this.createVideoSample(!0,u.pts,u.dts,"")),c.key=!0;break;case 34:if(p=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const a=this.readPPS(i.data);for(const o in a)e.params[o]=a[o]}(this.initVPS!==null||e.pps.length===0)&&e.pps.push(i.data)}break;case 35:p=!0,e.audFound=!0,c&&this.pushAccessUnit(c,e),c=this.VideoSample=this.createVideoSample(!1,u.pts,u.dts,"");break;default:p=!1,c&&(c.debug+="unknown or irrelevant NAL "+i.type+" ");break}c&&p&&c.units.push(i)}),y&&c&&(this.pushAccessUnit(c,e),this.VideoSample=null)}getNALuType(e,s){return(e[s]&126)>>>1}ebsp2rbsp(e){const s=new Uint8Array(e.byteLength);let u=0;for(let y=0;y=2&&e[y]===3&&e[y-1]===0&&e[y-2]===0||(s[u]=e[y],u++);return new Uint8Array(s.buffer,0,u)}readVPS(e){const s=new xa(e);s.readUByte(),s.readUByte(),s.readBits(4),s.skipBits(2),s.readBits(6);const u=s.readBits(3),y=s.readBoolean();return{numTemporalLayers:u+1,temporalIdNested:y}}readSPS(e){const s=new xa(this.ebsp2rbsp(e));s.readUByte(),s.readUByte(),s.readBits(4);const u=s.readBits(3);s.readBoolean();const y=s.readBits(2),A=s.readBoolean(),l=s.readBits(5),c=s.readUByte(),p=s.readUByte(),r=s.readUByte(),i=s.readUByte(),t=s.readUByte(),n=s.readUByte(),a=s.readUByte(),o=s.readUByte(),d=s.readUByte(),g=s.readUByte(),m=s.readUByte(),v=[],b=[];for(let je=0;je0)for(let je=u;je<8;je++)s.readBits(2);for(let je=0;je1&&s.readEG();for(let vt=0;vt0&&tt<16?(j=pe[tt-1],z=ue[tt-1]):tt===255&&(j=s.readBits(16),z=s.readBits(16))}if(s.readBoolean()&&s.readBoolean(),s.readBoolean()&&(s.readBits(3),s.readBoolean(),s.readBoolean()&&(s.readUByte(),s.readUByte(),s.readUByte())),s.readBoolean()&&(s.readUEG(),s.readUEG()),s.readBoolean(),s.readBoolean(),s.readBoolean(),oe=s.readBoolean(),oe&&(T+=s.readUEG(),P+=s.readUEG(),L+=s.readUEG(),I+=s.readUEG()),s.readBoolean()&&(Z=s.readBits(32),X=s.readBits(32),s.readBoolean()&&s.readUEG(),s.readBoolean())){const ue=s.readBoolean(),W=s.readBoolean();let ke=!1;(ue||W)&&(ke=s.readBoolean(),ke&&(s.readUByte(),s.readBits(5),s.readBoolean(),s.readBits(5)),s.readBits(4),s.readBits(4),ke&&s.readBits(4),s.readBits(5),s.readBits(5),s.readBits(5));for(let Ae=0;Ae<=u;Ae++){q=s.readBoolean();const Ye=q||s.readBoolean();let lt=!1;Ye?s.readEG():lt=s.readBoolean();const mt=lt?1:s.readUEG()+1;if(ue)for(let Ue=0;Ue>je&1)<<31-je)>>>0;let Ie=He.toString(16);return l===1&&Ie==="2"&&(Ie="6"),{codecString:`hvc1.${se}${l}.${Ie}.${A?"H":"L"}${m}.B0`,params:{general_tier_flag:A,general_profile_idc:l,general_profile_space:y,general_profile_compatibility_flags:[c,p,r,i],general_constraint_indicator_flags:[t,n,a,o,d,g],general_level_idc:m,bit_depth:x+8,bit_depth_luma_minus8:x,bit_depth_chroma_minus8:O,min_spatial_segmentation_idc:Y,chroma_format_idc:w,frame_rate:{fixed:q,fps:X/Z}},width:ie,height:fe,pixelRatio:[j,z]}}readPPS(e){const s=new xa(this.ebsp2rbsp(e));s.readUByte(),s.readUByte(),s.skipUEG(),s.skipUEG(),s.skipBits(2),s.skipBits(3),s.skipBits(2),s.skipUEG(),s.skipUEG(),s.skipEG(),s.skipBits(2),s.readBoolean()&&s.skipUEG(),s.skipEG(),s.skipEG(),s.skipBits(4);const y=s.readBoolean(),A=s.readBoolean();let l=1;return A&&y?l=0:A?l=3:y&&(l=2),{parallelismType:l}}matchSPS(e,s){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,s).substr(3)}}class Z5{constructor(e,s,u){this.keyData=void 0,this.decrypter=void 0,this.keyData=u,this.decrypter=new Cd(s,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,s,u){const y=e[s].unit;if(y.length<=16)return;const A=y.subarray(16,y.length-y.length%16),l=A.buffer.slice(A.byteOffset,A.byteOffset+A.length);this.decryptBuffer(l).then(c=>{const p=new Uint8Array(c);y.set(p,16),this.decrypter.isSync()||this.decryptAacSamples(e,s+1,u)})}decryptAacSamples(e,s,u){for(;;s++){if(s>=e.length){u();return}if(!(e[s].unit.length<32)&&(this.decryptAacSample(e,s,u),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const s=Math.floor((e.length-48)/160)*16+16,u=new Int8Array(s);let y=0;for(let A=32;A{A.data=this.getAvcDecryptedUnit(l,p),this.decrypter.isSync()||this.decryptAvcSamples(e,s,u+1,y)})}decryptAvcSamples(e,s,u,y){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;s++,u=0){if(s>=e.length){y();return}const A=e[s].units;for(;!(u>=A.length);u++){const l=A[u];if(!(l.data.length<=48||l.type!==1&&l.type!==5)&&(this.decryptAvcSample(e,s,u,y,l),!this.decrypter.isSync()))return}}}}const Pn=188;class os{constructor(e,s,u){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=s,this.typeSupported=u,this.videoParser=null}static probe(e){const s=os.syncOffset(e);return s>0&&Ft.warn(`MPEG2-TS detected but first sync word found @ offset ${s}`),s!==-1}static syncOffset(e){const s=e.length;let u=Math.min(Pn*5,s-Pn)+1,y=0;for(;y1&&(l===0&&c>2||p+Pn>u))return l}else{if(c)return-1;break}y++}return-1}static createTrack(e,s){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:kp[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?s:void 0}}resetInitSegment(e,s,u,y){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=os.createTrack("video"),this._audioTrack=os.createTrack("audio",y),this._id3Track=os.createTrack("id3"),this._txtTrack=os.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=s,this.videoCodec=u,this._duration=y}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:s,_id3Track:u}=this;e&&(e.pesData=null),s&&(s.pesData=null),u&&(u.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,s,u=!1,y=!1){u||(this.sampleAes=null);let A;const l=this._videoTrack,c=this._audioTrack,p=this._id3Track,r=this._txtTrack;let i=l.pid,t=l.pesData,n=c.pid,a=p.pid,o=c.pesData,d=p.pesData,g=null,m=this.pmtParsed,v=this._pmtId,b=e.length;if(this.remainderData&&(e=Ar(this.remainderData,e),b=e.length,this.remainderData=null),b>4;let I;if(L>1){if(I=R+5+e[R+4],I===R+Pn)continue}else I=R+4;switch(P){case i:if(T){if(t&&(A=zs(t))){if(this.videoParser===null)switch(l.segmentCodec){case"avc":this.videoParser=new qh;break;case"hevc":this.videoParser=new Yh;break}this.videoParser!==null&&this.videoParser.parsePES(l,r,A,!1,this._duration)}t={data:[],size:0}}t&&(t.data.push(e.subarray(I,R+Pn)),t.size+=R+Pn-I);break;case n:if(T){if(o&&(A=zs(o)))switch(c.segmentCodec){case"aac":this.parseAACPES(c,A);break;case"mp3":this.parseMPEGPES(c,A);break;case"ac3":this.parseAC3PES(c,A);break}o={data:[],size:0}}o&&(o.data.push(e.subarray(I,R+Pn)),o.size+=R+Pn-I);break;case a:T&&(d&&(A=zs(d))&&this.parseID3PES(p,A),d={data:[],size:0}),d&&(d.data.push(e.subarray(I,R+Pn)),d.size+=R+Pn-I);break;case 0:T&&(I+=e[I]+1),v=this._pmtId=X5(e,I);break;case v:{T&&(I+=e[I]+1);const x=$5(e,I,this.typeSupported,u);i=x.videoPid,i>0&&(l.pid=i,l.segmentCodec=x.segmentVideoCodec),n=x.audioPid,n>0&&(c.pid=n,c.segmentCodec=x.segmentAudioCodec),a=x.id3Pid,a>0&&(p.pid=a),g!==null&&!m&&(Ft.warn(`MPEG-TS PMT found at ${R} after unknown PID '${g}'. Backtracking to sync byte @${w} to parse all TS packets.`),g=null,R=w-188),m=this.pmtParsed=!0;break}case 17:case 8191:break;default:g=P;break}}else C++;if(C>0){const R=new Error(`Found ${C} TS packet/s that do not start with 0x47`);this.observer.emit(rt.ERROR,rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.FRAG_PARSING_ERROR,fatal:!1,error:R,reason:R.message})}l.pesData=t,c.pesData=o,p.pesData=d;const D={audioTrack:c,videoTrack:l,id3Track:p,textTrack:r};return y&&this.extractRemainingSamples(D),D}flush(){const{remainderData:e}=this;this.remainderData=null;let s;return e?s=this.demux(e,-1,!1,!0):s={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(s),this.sampleAes?this.decrypt(s,this.sampleAes):s}extractRemainingSamples(e){const{audioTrack:s,videoTrack:u,id3Track:y,textTrack:A}=e,l=u.pesData,c=s.pesData,p=y.pesData;let r;if(l&&(r=zs(l))){if(this.videoParser===null)switch(u.segmentCodec){case"avc":this.videoParser=new qh;break;case"hevc":this.videoParser=new Yh;break}this.videoParser!==null&&(this.videoParser.parsePES(u,A,r,!0,this._duration),u.pesData=null)}else u.pesData=l;if(c&&(r=zs(c))){switch(s.segmentCodec){case"aac":this.parseAACPES(s,r);break;case"mp3":this.parseMPEGPES(s,r);break;case"ac3":this.parseAC3PES(s,r);break}s.pesData=null}else c!=null&&c.size&&Ft.log("last AAC PES packet truncated,might overlap between fragments"),s.pesData=c;p&&(r=zs(p))?(this.parseID3PES(y,r),y.pesData=null):y.pesData=p}demuxSampleAes(e,s,u){const y=this.demux(e,u,!0,!this.config.progressive),A=this.sampleAes=new Z5(this.observer,this.config,s);return this.decrypt(y,A)}decrypt(e,s){return new Promise(u=>{const{audioTrack:y,videoTrack:A}=e;y.samples&&y.segmentCodec==="aac"?s.decryptAacSamples(y.samples,0,()=>{A.samples?s.decryptAvcSamples(A.samples,0,0,()=>{u(e)}):u(e)}):A.samples&&s.decryptAvcSamples(A.samples,0,0,()=>{u(e)})})}destroy(){this._duration=0}parseAACPES(e,s){let u=0;const y=this.aacOverFlow;let A=s.data;if(y){this.aacOverFlow=null;const t=y.missing,n=y.sample.unit.byteLength;if(t===-1)A=Ar(y.sample.unit,A);else{const a=n-t;y.sample.unit.set(A.subarray(0,t),a),e.samples.push(y.sample),u=y.missing}}let l,c;for(l=u,c=A.length;l0;)c+=p}}parseID3PES(e,s){if(s.pts===void 0){Ft.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const u=xn({},s,{type:this._videoTrack?xr.emsg:xr.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(u)}}function qc(_,e){return((_[e+1]&31)<<8)+_[e+2]}function X5(_,e){return(_[e+10]&31)<<8|_[e+11]}function $5(_,e,s,u){const y={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},A=(_[e+1]&15)<<8|_[e+2],l=e+3+A-4,c=(_[e+10]&15)<<8|_[e+11];for(e+=12+c;e0){let i=e+5,t=r;for(;t>2;){switch(_[i]){case 106:s.ac3!==!0?Ft.log("AC-3 audio found, not supported in this browser for now"):(y.audioPid=p,y.segmentAudioCodec="ac3");break}const a=_[i+1]+2;i+=a,t-=a}}break;case 194:case 135:Ft.warn("Unsupported EC-3 in M2TS found");break;case 36:y.videoPid===-1&&(y.videoPid=p,y.segmentVideoCodec="hevc",Ft.log("HEVC in M2TS found"));break}e+=r+5}return y}function gc(_){Ft.log(`${_} with AES-128-CBC encryption found in unencrypted stream`)}function zs(_){let e=0,s,u,y,A,l;const c=_.data;if(!_||_.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=Ar(c[0],c[1]),c.splice(1,1);if(s=c[0],(s[0]<<16)+(s[1]<<8)+s[2]===1){if(u=(s[4]<<8)+s[5],u&&u>_.size-6)return null;const r=s[7];r&192&&(A=(s[9]&14)*536870912+(s[10]&255)*4194304+(s[11]&254)*16384+(s[12]&255)*128+(s[13]&254)/2,r&64?(l=(s[14]&14)*536870912+(s[15]&255)*4194304+(s[16]&254)*16384+(s[17]&255)*128+(s[18]&254)/2,A-l>60*9e4&&(Ft.warn(`${Math.round((A-l)/9e4)}s delta between PTS and DTS, align them`),A=l)):l=A),y=s[8];let i=y+9;if(_.size<=i)return null;_.size-=i;const t=new Uint8Array(_.size);for(let n=0,a=c.length;no){i-=o;continue}else s=s.subarray(i),o-=i,i=0;t.set(s,e),e+=o}return u&&(u-=y+3),{data:t,pts:A,dts:l,len:u}}return null}class e4 extends kd{resetInitSegment(e,s,u,y){super.resetInitSegment(e,s,u,y),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:s,duration:y,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const s=Ra(e,0);let u=(s==null?void 0:s.length)||0;if(s&&e[u]===11&&e[u+1]===119&&_d(s)!==void 0&&t0(e,u)<=16)return!1;for(let y=e.length;u>24&255,l[1]=u>>16&255,l[2]=u>>8&255,l[3]=u&255,l.set(e,4),y=0,u=8;y>24&255,e>>16&255,e>>8&255,e&255,u>>24,u>>16&255,u>>8&255,u&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))}static mdia(e){return Nt.box(Nt.types.mdia,Nt.mdhd(e.timescale,e.duration),Nt.hdlr(e.type),Nt.minf(e))}static mfhd(e){return Nt.box(Nt.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?Nt.box(Nt.types.minf,Nt.box(Nt.types.smhd,Nt.SMHD),Nt.DINF,Nt.stbl(e)):Nt.box(Nt.types.minf,Nt.box(Nt.types.vmhd,Nt.VMHD),Nt.DINF,Nt.stbl(e))}static moof(e,s,u){return Nt.box(Nt.types.moof,Nt.mfhd(e),Nt.traf(u,s))}static moov(e){let s=e.length;const u=[];for(;s--;)u[s]=Nt.trak(e[s]);return Nt.box.apply(null,[Nt.types.moov,Nt.mvhd(e[0].timescale,e[0].duration)].concat(u).concat(Nt.mvex(e)))}static mvex(e){let s=e.length;const u=[];for(;s--;)u[s]=Nt.trex(e[s]);return Nt.box.apply(null,[Nt.types.mvex,...u])}static mvhd(e,s){s*=e;const u=Math.floor(s/(as+1)),y=Math.floor(s%(as+1)),A=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,u>>24,u>>16&255,u>>8&255,u&255,y>>24,y>>16&255,y>>8&255,y&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 Nt.box(Nt.types.mvhd,A)}static sdtp(e){const s=e.samples||[],u=new Uint8Array(4+s.length);let y,A;for(y=0;y>>8&255),s.push(l&255),s=s.concat(Array.prototype.slice.call(A));for(y=0;y>>8&255),u.push(l&255),u=u.concat(Array.prototype.slice.call(A));const c=Nt.box(Nt.types.avcC,new Uint8Array([1,s[3],s[4],s[5],255,224|e.sps.length].concat(s).concat([e.pps.length]).concat(u))),p=e.width,r=e.height,i=e.pixelRatio[0],t=e.pixelRatio[1];return Nt.box(Nt.types.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,p>>8&255,p&255,r>>8&255,r&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),c,Nt.box(Nt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Nt.box(Nt.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,t>>24,t>>16&255,t>>8&255,t&255])))}static esds(e){const s=e.config.length;return new Uint8Array([0,0,0,0,3,23+s,0,1,0,4,15+s,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([s]).concat(e.config).concat([6,1,2]))}static audioStsd(e){const s=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,s>>8&255,s&255,0,0])}static mp4a(e){return Nt.box(Nt.types.mp4a,Nt.audioStsd(e),Nt.box(Nt.types.esds,Nt.esds(e)))}static mp3(e){return Nt.box(Nt.types[".mp3"],Nt.audioStsd(e))}static ac3(e){return Nt.box(Nt.types["ac-3"],Nt.audioStsd(e),Nt.box(Nt.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?Nt.box(Nt.types.stsd,Nt.STSD,Nt.mp3(e)):e.segmentCodec==="ac3"?Nt.box(Nt.types.stsd,Nt.STSD,Nt.ac3(e)):Nt.box(Nt.types.stsd,Nt.STSD,Nt.mp4a(e)):e.segmentCodec==="avc"?Nt.box(Nt.types.stsd,Nt.STSD,Nt.avc1(e)):Nt.box(Nt.types.stsd,Nt.STSD,Nt.hvc1(e))}static tkhd(e){const s=e.id,u=e.duration*e.timescale,y=e.width,A=e.height,l=Math.floor(u/(as+1)),c=Math.floor(u%(as+1));return Nt.box(Nt.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,s>>24&255,s>>16&255,s>>8&255,s&255,0,0,0,0,l>>24,l>>16&255,l>>8&255,l&255,c>>24,c>>16&255,c>>8&255,c&255,0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,y>>8&255,y&255,0,0,A>>8&255,A&255,0,0]))}static traf(e,s){const u=Nt.sdtp(e),y=e.id,A=Math.floor(s/(as+1)),l=Math.floor(s%(as+1));return Nt.box(Nt.types.traf,Nt.box(Nt.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),Nt.box(Nt.types.tfdt,new Uint8Array([1,0,0,0,A>>24,A>>16&255,A>>8&255,A&255,l>>24,l>>16&255,l>>8&255,l&255])),Nt.trun(e,u.length+16+20+8+16+8+8),u)}static trak(e){return e.duration=e.duration||4294967295,Nt.box(Nt.types.trak,Nt.tkhd(e),Nt.mdia(e))}static trex(e){const s=e.id;return Nt.box(Nt.types.trex,new Uint8Array([0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,s){const u=e.samples||[],y=u.length,A=12+16*y,l=new Uint8Array(A);let c,p,r,i,t,n;for(s+=8+A,l.set([e.type==="video"?1:0,0,15,1,y>>>24&255,y>>>16&255,y>>>8&255,y&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255],0),c=0;c>>24&255,r>>>16&255,r>>>8&255,r&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t.isLeading<<2|t.dependsOn,t.isDependedOn<<6|t.hasRedundancy<<4|t.paddingValue<<1|t.isNonSync,t.degradPrio&61440,t.degradPrio&15,n>>>24&255,n>>>16&255,n>>>8&255,n&255],12+16*c);return Nt.box(Nt.types.trun,l)}static initSegment(e){Nt.types||Nt.init();const s=Nt.moov(e);return Ar(Nt.FTYP,s)}static hvc1(e){const s=e.params,u=[e.vps,e.sps,e.pps],y=4,A=new Uint8Array([1,s.general_profile_space<<6|(s.general_tier_flag?32:0)|s.general_profile_idc,s.general_profile_compatibility_flags[0],s.general_profile_compatibility_flags[1],s.general_profile_compatibility_flags[2],s.general_profile_compatibility_flags[3],s.general_constraint_indicator_flags[0],s.general_constraint_indicator_flags[1],s.general_constraint_indicator_flags[2],s.general_constraint_indicator_flags[3],s.general_constraint_indicator_flags[4],s.general_constraint_indicator_flags[5],s.general_level_idc,240|s.min_spatial_segmentation_idc>>8,255&s.min_spatial_segmentation_idc,252|s.parallelismType,252|s.chroma_format_idc,248|s.bit_depth_luma_minus8,248|s.bit_depth_chroma_minus8,0,parseInt(s.frame_rate.fps),y-1|s.temporal_id_nested<<2|s.num_temporal_layers<<3|(s.frame_rate.fixed?64:0),u.length]);let l=A.length;for(let o=0;o>8,u[o][d].length&255]),l),l+=2,c.set(u[o][d],l),l+=u[o][d].length}const r=Nt.box(Nt.types.hvcC,c),i=e.width,t=e.height,n=e.pixelRatio[0],a=e.pixelRatio[1];return Nt.box(Nt.types.hvc1,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,i>>8&255,i&255,t>>8&255,t&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),r,Nt.box(Nt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Nt.box(Nt.types.pasp,new Uint8Array([n>>24,n>>16&255,n>>8&255,n&255,a>>24,a>>16&255,a>>8&255,a&255])))}}Nt.types=void 0;Nt.HDLR_TYPES=void 0;Nt.STTS=void 0;Nt.STSC=void 0;Nt.STCO=void 0;Nt.STSZ=void 0;Nt.VMHD=void 0;Nt.SMHD=void 0;Nt.STSD=void 0;Nt.FTYP=void 0;Nt.DINF=void 0;const r0=9e4;function Ld(_,e,s=1,u=!1){const y=_*e*s;return u?Math.round(y):y}function t4(_,e,s=1,u=!1){return Ld(_,e,1/s,u)}function Sa(_,e=!1){return Ld(_,1e3,1/r0,e)}function i4(_,e=1){return Ld(_,r0,1/e)}const n4=10*1e3,Qh=1024,r4=1152,s4=1536;let Ws=null,Ac=null;class go{constructor(e,s,u,y=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=s,this.typeSupported=u,this.ISGenerated=!1,Ws===null){const l=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ws=l?parseInt(l[1]):0}if(Ac===null){const A=navigator.userAgent.match(/Safari\/(\d+)/i);Ac=A?parseInt(A[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){Ft.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){Ft.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){Ft.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let s=!1;const u=e.reduce((y,A)=>{const l=A.pts-y;return l<-4294967296?(s=!0,gr(y,A.pts)):l>0?y:A.pts},e[0].pts);return s&&Ft.debug("PTS rollover detected"),u}remux(e,s,u,y,A,l,c,p){let r,i,t,n,a,o,d=A,g=A;const m=e.pid>-1,v=s.pid>-1,b=s.samples.length,w=e.samples.length>0,C=c&&b>0||b>1;if((!m||w)&&(!v||C)||this.ISGenerated||c){if(this.ISGenerated){var R,T,P,L;const G=this.videoTrackConfig;G&&(s.width!==G.width||s.height!==G.height||((R=s.pixelRatio)==null?void 0:R[0])!==((T=G.pixelRatio)==null?void 0:T[0])||((P=s.pixelRatio)==null?void 0:P[1])!==((L=G.pixelRatio)==null?void 0:L[1]))&&this.resetInitSegment()}else t=this.generateIS(e,s,A,l);const I=this.isVideoContiguous;let x=-1,O;if(C&&(x=a4(s.samples),!I&&this.config.forceKeyFrameOnDiscontinuity))if(o=!0,x>0){Ft.warn(`[mp4-remuxer]: Dropped ${x} out of ${b} video samples due to a missing keyframe`);const G=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(x),s.dropped+=x,g+=(s.samples[0].pts-G)/s.inputTimeScale,O=g}else x===-1&&(Ft.warn(`[mp4-remuxer]: No keyframe found out of ${b} video samples`),o=!1);if(this.ISGenerated){if(w&&C){const G=this.getVideoStartPts(s.samples),te=(gr(e.samples[0].pts,G)-G)/s.inputTimeScale;d+=Math.max(0,te),g+=Math.max(0,-te)}if(w){if(e.samplerate||(Ft.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),t=this.generateIS(e,s,A,l)),i=this.remuxAudio(e,d,this.isAudioContiguous,l,v||C||p===Hi.AUDIO?g:void 0),C){const G=i?i.endPTS-i.startPTS:0;s.inputTimeScale||(Ft.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),t=this.generateIS(e,s,A,l)),r=this.remuxVideo(s,g,I,G)}}else C&&(r=this.remuxVideo(s,g,I,0));r&&(r.firstKeyFrame=x,r.independent=x!==-1,r.firstKeyFramePTS=O)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(u.samples.length&&(a=s0(u,A,this._initPTS,this._initDTS)),y.samples.length&&(n=a0(y,A,this._initPTS))),{audio:i,video:r,initSegment:t,independent:o,text:n,id3:a}}generateIS(e,s,u,y){const A=e.samples,l=s.samples,c=this.typeSupported,p={},r=this._initPTS;let i=!r||y,t="audio/mp4",n,a,o;if(i&&(n=a=1/0),e.config&&A.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":c.mpeg?(t="audio/mpeg",e.codec=""):c.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}p.audio={id:"audio",container:t,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&c.mpeg?new Uint8Array(0):Nt.initSegment([e]),metadata:{channelCount:e.channelCount}},i&&(o=e.inputTimeScale,!r||o!==r.timescale?n=a=A[0].pts-Math.round(o*u):i=!1)}if(s.sps&&s.pps&&l.length){if(s.timescale=s.inputTimeScale,p.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:Nt.initSegment([s]),metadata:{width:s.width,height:s.height}},i)if(o=s.inputTimeScale,!r||o!==r.timescale){const d=this.getVideoStartPts(l),g=Math.round(o*u);a=Math.min(a,gr(l[0].dts,d)-g),n=Math.min(n,d-g)}else i=!1;this.videoTrackConfig={width:s.width,height:s.height,pixelRatio:s.pixelRatio}}if(Object.keys(p).length)return this.ISGenerated=!0,i?(this._initPTS={baseTime:n,timescale:o},this._initDTS={baseTime:a,timescale:o}):n=o=void 0,{tracks:p,initPTS:n,timescale:o}}remuxVideo(e,s,u,y){const A=e.inputTimeScale,l=e.samples,c=[],p=l.length,r=this._initPTS;let i=this.nextAvcDts,t=8,n=this.videoSampleDuration,a,o,d=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,m=!1;if(!u||i===null){const ee=s*A,M=l[0].pts-gr(l[0].dts,l[0].pts);Ws&&i!==null&&Math.abs(ee-M-i)<15e3?u=!0:i=ee-M}const v=r.baseTime*A/r.timescale;for(let ee=0;ee0?ee-1:ee].dts&&(m=!0)}m&&l.sort(function(ee,M){const Y=ee.dts-M.dts,j=ee.pts-M.pts;return Y||j}),a=l[0].dts,o=l[l.length-1].dts;const b=o-a,w=b?Math.round(b/(p-1)):n||e.inputTimeScale/30;if(u){const ee=a-i,M=ee>w,Y=ee<-1;if((M||Y)&&(M?Ft.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Sa(ee,!0)} ms (${ee}dts) hole between fragments detected at ${s.toFixed(3)}`):Ft.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Sa(-ee,!0)} ms (${ee}dts) overlapping between fragments detected at ${s.toFixed(3)}`),!Y||i>=l[0].pts||Ws)){a=i;const j=l[0].pts-ee;if(M)l[0].dts=a,l[0].pts=j;else for(let z=0;zj);z++)l[z].dts-=ee,l[z].pts-=ee;Ft.log(`Video: Initial PTS/DTS adjusted: ${Sa(j,!0)}/${Sa(a,!0)}, delta: ${Sa(ee,!0)} ms`)}}a=Math.max(0,a);let C=0,D=0,R=a;for(let ee=0;ee0?M.dts-l[ee-1].dts:w;if(z=ee>0?M.pts-l[ee-1].pts:w,Z.stretchShortVideoTrack&&this.nextAudioPts!==null){const oe=Math.floor(Z.maxBufferHole*A),he=(y?d+y*A:this.nextAudioPts)-M.pts;he>oe?(n=he-X,n<0?n=X:I=!0,Ft.log(`[mp4-remuxer]: It is approximately ${he/90} ms to the next segment; using duration ${n/90} ms for the last video frame.`)):n=X}else n=X}const q=Math.round(M.pts-M.dts);x=Math.min(x,n),G=Math.max(G,n),O=Math.min(O,z),J=Math.max(J,z),c.push(new Zh(M.key,n,j,q))}if(c.length){if(Ws){if(Ws<70){const ee=c[0].flags;ee.dependsOn=2,ee.isNonSync=0}}else if(Ac&&J-O0&&(y&&Math.abs(v-m)<9e3||Math.abs(gr(d[0].pts-b,v)-m)<20*i),d.forEach(function(te){te.pts=gr(te.pts-b,v)}),!u||m<0){if(d=d.filter(te=>te.pts>=0),!d.length)return;A===0?m=0:y&&!o?m=Math.max(0,v):m=d[0].pts}if(e.segmentCodec==="aac"){const te=this.config.maxAudioFramesDrift;for(let le=0,ne=m;le=te*i&&j0){R+=g;try{D=new Uint8Array(R)}catch(j){this.observer.emit(rt.ERROR,rt.ERROR,{type:Wi.MUX_ERROR,details:qt.REMUX_ALLOC_ERROR,fatal:!1,error:j,bytes:R,reason:`fail allocating audio mdat ${R}`});return}n||(new DataView(D.buffer).setUint32(0,R),D.set(Nt.types.mdat,4))}else return;D.set(ee,g);const Y=ee.byteLength;g+=Y,a.push(new Zh(!0,r,Y,0)),C=M}const P=a.length;if(!P)return;const L=a[a.length-1];this.nextAudioPts=m=C+p*L.duration;const I=n?new Uint8Array(0):Nt.moof(e.sequenceNumber++,w/p,xn({},e,{samples:a}));e.samples=[];const x=w/l,O=m/l,J={data1:I,data2:D,startPTS:x,endPTS:O,startDTS:x,endDTS:O,type:"audio",hasAudio:!0,hasVideo:!1,nb:P};return this.isAudioContiguous=!0,J}remuxEmptyAudio(e,s,u,y){const A=e.inputTimeScale,l=e.samplerate?e.samplerate:A,c=A/l,p=this.nextAudioPts,r=this._initDTS,i=r.baseTime*9e4/r.timescale,t=(p!==null?p:y.startDTS*A)+i,n=y.endDTS*A+i,a=c*Qh,o=Math.ceil((n-t)/a),d=Jh.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(Ft.warn("[mp4-remuxer]: remux empty Audio"),!d){Ft.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const g=[];for(let m=0;m4294967296;)_+=s;return _}function a4(_){for(let e=0;e<_.length;e++)if(_[e].key)return e;return-1}function s0(_,e,s,u){const y=_.samples.length;if(!y)return;const A=_.inputTimeScale;for(let c=0;cl.pts-c.pts);const A=_.samples;return _.samples=[],{samples:A}}class Zh{constructor(e,s,u,y){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=s,this.size=u,this.cts=y,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class o4{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,s,u,y){this.audioCodec=s,this.videoCodec=u,this.generateInitSegment(A_(e,y)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:s,videoCodec:u}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const y=this.initData=Lp(e);y.audio&&(s=Xh(y.audio,fn.AUDIO)),y.video&&(u=Xh(y.video,fn.VIDEO));const A={};y.audio&&y.video?A.audiovideo={container:"video/mp4",codec:s+","+u,initSegment:e,id:"main"}:y.audio?A.audio={container:"audio/mp4",codec:s,initSegment:e,id:"audio"}:y.video?A.video={container:"video/mp4",codec:u,initSegment:e,id:"main"}:Ft.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=A}remux(e,s,u,y,A,l){var c,p;let{initPTS:r,lastEndTime:i}=this;const t={audio:void 0,video:void 0,text:y,id3:u,initSegment:void 0};Ci(i)||(i=this.lastEndTime=A||0);const n=s.samples;if(!(n!=null&&n.length))return t;const a={initPTS:void 0,timescale:1};let o=this.initData;if((c=o)!=null&&c.length||(this.generateInitSegment(n),o=this.initData),!((p=o)!=null&&p.length))return Ft.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),t;this.emitInitSegment&&(a.tracks=this.initTracks,this.emitInitSegment=!1);const d=v_(n,o),g=y_(o,n),m=g===null?A:g;(l4(r,m,A,d)||a.timescale!==r.timescale&&l)&&(a.initPTS=m-A,r&&r.timescale===1&&Ft.warn(`Adjusting initPTS by ${a.initPTS-r.baseTime}`),this.initPTS=r={baseTime:a.initPTS,timescale:1});const v=e?m-r.baseTime/r.timescale:i,b=v+d;__(o,n,r.baseTime/r.timescale),d>0?this.lastEndTime=b:(Ft.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const w=!!o.audio,C=!!o.video;let D="";w&&(D+="audio"),C&&(D+="video");const R={data1:n,startPTS:v,startDTS:v,endPTS:b,endDTS:b,type:D,hasAudio:w,hasVideo:C,nb:1,dropped:0};return t.audio=R.type==="audio"?R:void 0,t.video=R.type!=="audio"?R:void 0,t.initSegment=a,t.id3=s0(u,A,r,r),y.samples.length&&(t.text=a0(y,A,r)),t}}function l4(_,e,s,u){if(_===null)return!0;const y=Math.max(u,1),A=e-_.baseTime/_.timescale;return Math.abs(A-s)>y}function Xh(_,e){const s=_==null?void 0:_.codec;if(s&&s.length>4)return s;if(e===fn.AUDIO){if(s==="ec-3"||s==="ac-3"||s==="alac")return s;if(s==="fLaC"||s==="Opus")return Lo(s,!1);const u="mp4a.40.5";return Ft.info(`Parsed audio codec "${s}" or audio object type not handled. Using "${u}"`),u}return Ft.warn(`Unhandled video codec "${s}"`),s==="hvc1"||s==="hev1"?"hvc1.1.6.L120.90":s==="av01"?"av01.0.04M.08":"avc1.42e01e"}let Zr;try{Zr=self.performance.now.bind(self.performance)}catch{Ft.debug("Unable to use Performance API on this environment"),Zr=oa==null?void 0:oa.Date.now}const Ao=[{demux:J5,remux:o4},{demux:os,remux:go},{demux:q5,remux:go},{demux:e4,remux:go}];Ao.splice(2,0,{demux:Q5,remux:go});class $h{constructor(e,s,u,y,A){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=s,this.config=u,this.vendor=y,this.id=A}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,s,u,y){const A=u.transmuxing;A.executeStart=Zr();let l=new Uint8Array(e);const{currentTransmuxState:c,transmuxConfig:p}=this;y&&(this.currentTransmuxState=y);const{contiguous:r,discontinuity:i,trackSwitch:t,accurateTimeOffset:n,timeOffset:a,initSegmentChange:o}=y||c,{audioCodec:d,videoCodec:g,defaultInitPts:m,duration:v,initSegmentData:b}=p,w=c4(l,s);if(w&&w.method==="AES-128"){const T=this.getDecrypter();if(T.isSync()){let P=T.softwareDecrypt(l,w.key.buffer,w.iv.buffer);if(u.part>-1&&(P=T.flush()),!P)return A.executeEnd=Zr(),yc(u);l=new Uint8Array(P)}else return this.decryptionPromise=T.webCryptoDecrypt(l,w.key.buffer,w.iv.buffer).then(P=>{const L=this.push(P,null,u);return this.decryptionPromise=null,L}),this.decryptionPromise}const C=this.needsProbing(i,t);if(C){const T=this.configureTransmuxer(l);if(T)return Ft.warn(`[transmuxer] ${T.message}`),this.observer.emit(rt.ERROR,rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.FRAG_PARSING_ERROR,fatal:!1,error:T,reason:T.message}),A.executeEnd=Zr(),yc(u)}(i||t||o||C)&&this.resetInitSegment(b,d,g,v,s),(i||o||C)&&this.resetInitialTimestamp(m),r||this.resetContiguity();const D=this.transmux(l,w,a,n,u),R=this.currentTransmuxState;return R.contiguous=!0,R.discontinuity=!1,R.trackSwitch=!1,A.executeEnd=Zr(),D}flush(e){const s=e.transmuxing;s.executeStart=Zr();const{decrypter:u,currentTransmuxState:y,decryptionPromise:A}=this;if(A)return A.then(()=>this.flush(e));const l=[],{timeOffset:c}=y;if(u){const t=u.flush();t&&l.push(this.push(t,null,e))}const{demuxer:p,remuxer:r}=this;if(!p||!r)return s.executeEnd=Zr(),[yc(e)];const i=p.flush(c);return yo(i)?i.then(t=>(this.flushRemux(l,t,e),l)):(this.flushRemux(l,i,e),l)}flushRemux(e,s,u){const{audioTrack:y,videoTrack:A,id3Track:l,textTrack:c}=s,{accurateTimeOffset:p,timeOffset:r}=this.currentTransmuxState;Ft.log(`[transmuxer.ts]: Flushed fragment ${u.sn}${u.part>-1?" p: "+u.part:""} of level ${u.level}`);const i=this.remuxer.remux(y,A,l,c,r,p,!0,this.id);e.push({remuxResult:i,chunkMeta:u}),u.transmuxing.executeEnd=Zr()}resetInitialTimestamp(e){const{demuxer:s,remuxer:u}=this;!s||!u||(s.resetTimeStamp(e),u.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:s}=this;!e||!s||(e.resetContiguity(),s.resetNextTimestamp())}resetInitSegment(e,s,u,y,A){const{demuxer:l,remuxer:c}=this;!l||!c||(l.resetInitSegment(e,s,u,y),c.resetInitSegment(e,s,u,A))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,s,u,y,A){let l;return s&&s.method==="SAMPLE-AES"?l=this.transmuxSampleAes(e,s,u,y,A):l=this.transmuxUnencrypted(e,u,y,A),l}transmuxUnencrypted(e,s,u,y){const{audioTrack:A,videoTrack:l,id3Track:c,textTrack:p}=this.demuxer.demux(e,s,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(A,l,c,p,s,u,!1,this.id),chunkMeta:y}}transmuxSampleAes(e,s,u,y,A){return this.demuxer.demuxSampleAes(e,s,u).then(l=>({remuxResult:this.remuxer.remux(l.audioTrack,l.videoTrack,l.id3Track,l.textTrack,u,y,!1,this.id),chunkMeta:A}))}configureTransmuxer(e){const{config:s,observer:u,typeSupported:y,vendor:A}=this;let l;for(let n=0,a=Ao.length;n0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(s=e),s}const yc=_=>({remuxResult:{},chunkMeta:_});function yo(_){return"then"in _&&_.then instanceof Function}class d4{constructor(e,s,u,y,A){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=s,this.initSegmentData=u,this.duration=y,this.defaultInitPts=A||null}}class u4{constructor(e,s,u,y,A,l){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=s,this.accurateTimeOffset=u,this.trackSwitch=y,this.timeOffset=A,this.initSegmentChange=l}}var o0={exports:{}};(function(_){var e=Object.prototype.hasOwnProperty,s="~";function u(){}Object.create&&(u.prototype=Object.create(null),new u().__proto__||(s=!1));function y(p,r,i){this.fn=p,this.context=r,this.once=i||!1}function A(p,r,i,t,n){if(typeof i!="function")throw new TypeError("The listener must be a function");var a=new y(i,t||p,n),o=s?s+r:r;return p._events[o]?p._events[o].fn?p._events[o]=[p._events[o],a]:p._events[o].push(a):(p._events[o]=a,p._eventsCount++),p}function l(p,r){--p._eventsCount===0?p._events=new u:delete p._events[r]}function c(){this._events=new u,this._eventsCount=0}c.prototype.eventNames=function(){var r=[],i,t;if(this._eventsCount===0)return r;for(t in i=this._events)e.call(i,t)&&r.push(s?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(i)):r},c.prototype.listeners=function(r){var i=s?s+r:r,t=this._events[i];if(!t)return[];if(t.fn)return[t.fn];for(var n=0,a=t.length,o=new Array(a);n{t=t||{},t.frag=this.frag,t.id=this.id,i===rt.ERROR&&(this.error=t.error),this.hls.trigger(i,t)};this.observer=new Dd,this.observer.on(rt.FRAG_DECRYPTED,l),this.observer.on(rt.ERROR,l);const c=ua(A.preferManagedMediaSource)||{isTypeSupported:()=>!1},p={mpeg:c.isTypeSupported("audio/mpeg"),mp3:c.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:c.isTypeSupported('audio/mp4; codecs="ac-3"')},r=navigator.vendor;if(this.useWorker&&typeof Worker<"u"&&(A.workerPath||O5())){try{A.workerPath?(Ft.log(`loading Web Worker ${A.workerPath} for "${s}"`),this.workerContext=P5(A.workerPath)):(Ft.log(`injecting Web Worker for "${s}"`),this.workerContext=M5()),this.onwmsg=n=>this.onWorkerMessage(n);const{worker:t}=this.workerContext;t.addEventListener("message",this.onwmsg),t.onerror=n=>{const a=new Error(`${n.message} (${n.filename}:${n.lineno})`);A.enableWorker=!1,Ft.warn(`Error in "${s}" Web Worker, fallback to inline`),this.hls.trigger(rt.ERROR,{type:Wi.OTHER_ERROR,details:qt.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:a})},t.postMessage({cmd:"init",typeSupported:p,vendor:r,id:s,config:JSON.stringify(A)})}catch(t){Ft.warn(`Error setting up "${s}" Web Worker, fallback to inline`,t),this.resetWorker(),this.error=null,this.transmuxer=new $h(this.observer,p,A,r,s)}return}this.transmuxer=new $h(this.observer,p,A,r,s)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:s}=this.workerContext;s&&self.URL.revokeObjectURL(s),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,s,u,y,A,l,c,p,r,i){var t,n;r.transmuxing.start=self.performance.now();const{transmuxer:a}=this,o=l?l.start:A.start,d=A.decryptdata,g=this.frag,m=!(g&&A.cc===g.cc),v=!(g&&r.level===g.level),b=g?r.sn-g.sn:-1,w=this.part?r.part-this.part.index:-1,C=b===0&&r.id>1&&r.id===(g==null?void 0:g.stats.chunkCount),D=!v&&(b===1||b===0&&(w===1||C&&w<=0)),R=self.performance.now();(v||b||A.stats.parsing.start===0)&&(A.stats.parsing.start=R),l&&(w||!D)&&(l.stats.parsing.start=R);const T=!(g&&((t=A.initSegment)==null?void 0:t.url)===((n=g.initSegment)==null?void 0:n.url)),P=new u4(m,D,p,v,o,T);if(!D||m||T){Ft.log(`[transmuxer-interface, ${A.type}]: Starting new transmux session for sn: ${r.sn} p: ${r.part} level: ${r.level} id: ${r.id} + Switching to level ${I} @ ${x|0} bps`),A.trigger(rt.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:u,stats:p})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(Ft.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new o5(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.FRAG_LOADING,this.onFragLoading,this),e.on(rt.FRAG_LOADED,this.onFragLoaded,this),e.on(rt.FRAG_BUFFERED,this.onFragBuffered,this),e.on(rt.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(rt.LEVEL_LOADED,this.onLevelLoaded,this),e.on(rt.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(rt.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(rt.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.FRAG_LOADING,this.onFragLoading,this),e.off(rt.FRAG_LOADED,this.onFragLoaded,this),e.off(rt.FRAG_BUFFERED,this.onFragBuffered,this),e.off(rt.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(rt.LEVEL_LOADED,this.onLevelLoaded,this),e.off(rt.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(rt.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(rt.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,s){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,s){const u=s.frag;if(!this.ignoreFragment(u)){if(!u.bitrateTest){var A;this.fragCurrent=u,this.partCurrent=(A=s.part)!=null?A:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,s){this.clearTimer()}onError(e,s){if(!s.fatal)switch(s.details){case qt.BUFFER_ADD_CODEC_ERROR:case qt.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case qt.FRAG_LOAD_TIMEOUT:{const u=s.frag,{fragCurrent:A,partCurrent:y}=this;if(u&&A&&u.sn===A.sn&&u.level===A.level){const l=performance.now(),c=y?y.stats:u.stats,p=l-c.loading.start,r=c.loading.first?c.loading.first-c.loading.start:-1;if(c.loaded&&r>-1){const t=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(p-Math.min(t,r),c.loaded)}else this.bwEstimator.sampleTTFB(p)}break}}}getTimeToLoadFrag(e,s,u,A){const y=e+u/s,l=A?this.lastLevelLoadSec:0;return y+l}onLevelLoaded(e,s){const u=this.hls.config,{loading:A}=s.stats,y=A.end-A.start;Ci(y)&&(this.lastLevelLoadSec=y/1e3),s.details.live?this.bwEstimator.update(u.abrEwmaSlowLive,u.abrEwmaFastLive):this.bwEstimator.update(u.abrEwmaSlowVoD,u.abrEwmaFastVoD)}onFragLoaded(e,{frag:s,part:u}){const A=u?u.stats:s.stats;if(s.type===Hi.MAIN&&this.bwEstimator.sampleTTFB(A.loading.first-A.loading.start),!this.ignoreFragment(s)){if(this.clearTimer(),s.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const y=u?u.duration:s.duration,l=this.hls.levels[s.level],c=(l.loaded?l.loaded.bytes:0)+A.loaded,p=(l.loaded?l.loaded.duration:0)+y;l.loaded={bytes:c,duration:p},l.realBitrate=Math.round(8*c/p)}if(s.bitrateTest){const y={stats:A,frag:s,part:u,id:s.type};this.onFragBuffered(rt.FRAG_BUFFERED,y),s.bitrateTest=!1}else this.lastLoadedFragLevel=s.level}}onFragBuffered(e,s){const{frag:u,part:A}=s,y=A!=null&&A.stats.loaded?A.stats:u.stats;if(y.aborted||this.ignoreFragment(u))return;const l=y.parsing.end-y.loading.start-Math.min(y.loading.first-y.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(l,y.loaded),y.bwEstimate=this.getBwEstimate(),u.bitrateTest?this.bitrateTestDelay=l/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==Hi.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:s}=this.hls,u=this.getBwEstimate(),A=this.hls.config.maxStarvationDelay,y=this.findBestLevel(u,s,e,0,A,1,1);if(y>-1)return y;const l=this.hls.firstLevel,c=Math.min(Math.max(l,s),e);return Ft.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${l} clamped to ${c}`),c}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,u=this.bwEstimator.canEstimate(),A=this.lastLoadedFragLevel>-1;if(e!==-1&&(!u||!A||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const y=u&&A?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const l=this.hls.levels;if(l.length>Math.max(e,y)&&l[e].loadError<=l[y].loadError)return e}return this._nextAutoLevel=y,this.nextAutoLevelKey=this.getAutoLevelKey(),y}getAutoLevelKey(){var e;return`${this.getBwEstimate()}_${(e=this.hls.mainForwardBufferInfo)==null?void 0:e.len}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:s,hls:u}=this,{maxAutoLevel:A,config:y,minAutoLevel:l,media:c}=u,p=s?s.duration:e?e.duration:0,r=c&&c.playbackRate!==0?Math.abs(c.playbackRate):1,i=this.getBwEstimate(),t=u.mainForwardBufferInfo,n=(t?t.len:0)/r;let a=y.abrBandWidthFactor,o=y.abrBandWidthUpFactor;if(n){const b=this.findBestLevel(i,l,A,n,0,a,o);if(b>=0)return b}let d=p?Math.min(p,y.maxStarvationDelay):y.maxStarvationDelay;if(!n){const b=this.bitrateTestDelay;b&&(d=(p?Math.min(p,y.maxLoadingDelay):y.maxLoadingDelay)-b,Ft.info(`[abr] bitrate test took ${Math.round(1e3*b)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),a=o=1)}const g=this.findBestLevel(i,l,A,n,d,a,o);if(Ft.info(`[abr] ${n?"rebuffering expected":"buffer is empty"}, optimal quality level ${g}`),g>-1)return g;const m=u.levels[l],v=u.levels[u.loadLevel];return(m==null?void 0:m.bitrate)<(v==null?void 0:v.bitrate)?l:u.loadLevel}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,s,u,A,y,l,c){var p;const r=A+y,i=this.lastLoadedFragLevel,t=i===-1?this.hls.firstLevel:i,{fragCurrent:n,partCurrent:a}=this,{levels:o,allAudioTracks:d,loadLevel:g,config:m}=this.hls;if(o.length===1)return 0;const v=o[t],b=!!(v!=null&&(p=v.details)!=null&&p.live),w=g===-1||i===-1;let C,D="SDR",R=(v==null?void 0:v.frameRate)||0;const{audioPreference:T,videoPreference:P}=m,L=this.audioTracksByGroup||(this.audioTracksByGroup=p5(d));if(w){if(this.firstSelection!==-1)return this.firstSelection;const te=this.codecTiers||(this.codecTiers=m5(o,L,s,u)),le=f5(te,D,e,T,P),{codecSet:ne,videoRanges:ee,minFramerate:M,minBitrate:Y,preferHDR:j}=le;C=ne,D=j?ee[ee.length-1]:ee[0],R=M,e=Math.max(e,Y),Ft.log(`[abr] picked start tier ${JSON.stringify(le)}`)}else C=v==null?void 0:v.codecSet,D=v==null?void 0:v.videoRange;const I=a?a.duration:n?n.duration:0,x=this.bwEstimator.getEstimateTTFB()/1e3,O=[];for(let te=u;te>=s;te--){var G,J;const le=o[te],ne=te>t;if(!le)continue;if(m.useMediaCapabilities&&!le.supportedResult&&!le.supportedPromise){const Z=navigator.mediaCapabilities;typeof(Z==null?void 0:Z.decodingInfo)=="function"&&l5(le,L,D,R,e,T)?(le.supportedPromise=c5(le,L,Z),le.supportedPromise.then(X=>{le.supportedResult=X;const oe=this.hls.levels,he=oe.indexOf(le);X.error?Ft.warn(`[abr] MediaCapabilities decodingInfo error: "${X.error}" for level ${he} ${JSON.stringify(X)}`):X.supported||(Ft.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${he} ${JSON.stringify(X)}`),he>-1&&oe.length>1&&(Ft.log(`[abr] Removing unsupported level ${he}`),this.hls.removeLevel(he)))})):le.supportedResult=Hp}if(C&&le.codecSet!==C||D&&le.videoRange!==D||ne&&R>le.frameRate||!ne&&R>0&&R=I*2&&y===0?o[te].averageBitrate:o[te].maxBitrate,z=this.getTimeToLoadFrag(x,Y,j*M,ee===void 0);if(Y>=j&&(te===i||le.loadError===0&&le.fragmentError===0)&&(z<=x||!Ci(z)||b&&!this.bitrateTestDelay||z${te} adjustedbw(${Math.round(Y)})-bitrate=${Math.round(Y-j)} ttfb:${x.toFixed(1)} avgDuration:${M.toFixed(1)} maxFetchDuration:${r.toFixed(1)} fetchDuration:${z.toFixed(1)} firstSelection:${w} codecSet:${C} videoRange:${D} hls.loadLevel:${g}`)),w&&(this.firstSelection=te),te}}return-1}set nextAutoLevel(e){const s=Math.max(this.hls.minAutoLevel,e);this._nextAutoLevel!=s&&(this.nextAutoLevelKey="",this._nextAutoLevel=s)}}class v5{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}var Fn={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class b5{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(rt.BUFFER_APPENDED,this.onBufferAppended,this),e.on(rt.FRAG_BUFFERED,this.onFragBuffered,this),e.on(rt.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(rt.BUFFER_APPENDED,this.onBufferAppended,this),e.off(rt.FRAG_BUFFERED,this.onFragBuffered,this),e.off(rt.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,s){const u=this.activePartLists[s];if(u)for(let A=u.length;A--;){const y=u[A];if(!y)break;const l=y.end;if(y.start<=e&&l!==null&&e<=l)return y}return this.getBufferedFrag(e,s)}getBufferedFrag(e,s){const{fragments:u}=this,A=Object.keys(u);for(let y=A.length;y--;){const l=u[A[y]];if((l==null?void 0:l.body.type)===s&&l.buffered){const c=l.body;if(c.start<=e&&e<=c.end)return c}}return null}detectEvictedFragments(e,s,u,A){this.timeRanges&&(this.timeRanges[e]=s);const y=(A==null?void 0:A.fragment.sn)||-1;Object.keys(this.fragments).forEach(l=>{const c=this.fragments[l];if(!c||y>=c.body.sn)return;if(!c.buffered&&!c.loaded){c.body.type===u&&this.removeFragment(c.body);return}const p=c.range[e];p&&p.time.some(r=>{const i=!this.isTimeBuffered(r.startPTS,r.endPTS,s);return i&&this.removeFragment(c.body),i})})}detectPartialFragments(e){const s=this.timeRanges,{frag:u,part:A}=e;if(!s||u.sn==="initSegment")return;const y=Hs(u),l=this.fragments[y];if(!l||l.buffered&&u.gap)return;const c=!u.relurl;Object.keys(s).forEach(p=>{const r=u.elementaryStreams[p];if(!r)return;const i=s[p],t=c||r.partial===!0;l.range[p]=this.getBufferedTimes(u,A,t,i)}),l.loaded=null,Object.keys(l.range).length?(l.buffered=!0,(l.body.endList=u.endList||l.body.endList)&&(this.endListFragments[l.body.type]=l),eo(l)||this.removeParts(u.sn-1,u.type)):this.removeFragment(l.body)}removeParts(e,s){const u=this.activePartLists[s];u&&(this.activePartLists[s]=u.filter(A=>A.fragment.sn>=e))}fragBuffered(e,s){const u=Hs(e);let A=this.fragments[u];!A&&s&&(A=this.fragments[u]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),A&&(A.loaded=null,A.buffered=!0)}getBufferedTimes(e,s,u,A){const y={time:[],partial:u},l=e.start,c=e.end,p=e.minEndPTS||c,r=e.maxStartPTS||l;for(let i=0;i=t&&p<=n){y.time.push({startPTS:Math.max(l,A.start(i)),endPTS:Math.min(c,A.end(i))});break}else if(lt){const a=Math.max(l,A.start(i)),o=Math.min(c,A.end(i));o>a&&(y.partial=!0,y.time.push({startPTS:a,endPTS:o}))}else if(c<=t)break}return y}getPartialFragment(e){let s=null,u,A,y,l=0;const{bufferPadding:c,fragments:p}=this;return Object.keys(p).forEach(r=>{const i=p[r];i&&eo(i)&&(A=i.body.start-c,y=i.body.end+c,e>=A&&e<=y&&(u=Math.min(e-A,y-e),l<=u&&(s=i.body,l=u)))}),s}isEndListAppended(e){const s=this.endListFragments[e];return s!==void 0&&(s.buffered||eo(s))}getState(e){const s=Hs(e),u=this.fragments[s];return u?u.buffered?eo(u)?Fn.PARTIAL:Fn.OK:Fn.APPENDING:Fn.NOT_LOADED}isTimeBuffered(e,s,u){let A,y;for(let l=0;l=A&&s<=y)return!0;if(s<=A)return!1}return!1}onFragLoaded(e,s){const{frag:u,part:A}=s;if(u.sn==="initSegment"||u.bitrateTest)return;const y=A?null:s,l=Hs(u);this.fragments[l]={body:u,appendedPTS:null,loaded:y,buffered:!1,range:Object.create(null)}}onBufferAppended(e,s){const{frag:u,part:A,timeRanges:y}=s;if(u.sn==="initSegment")return;const l=u.type;if(A){let c=this.activePartLists[l];c||(this.activePartLists[l]=c=[]),c.push(A)}this.timeRanges=y,Object.keys(y).forEach(c=>{const p=y[c];this.detectEvictedFragments(c,p,l,A)})}onFragBuffered(e,s){this.detectPartialFragments(s)}hasFragment(e){const s=Hs(e);return!!this.fragments[s]}hasParts(e){var s;return!!((s=this.activePartLists[e])!=null&&s.length)}removeFragmentsInRange(e,s,u,A,y){A&&!this.hasGaps||Object.keys(this.fragments).forEach(l=>{const c=this.fragments[l];if(!c)return;const p=c.body;p.type!==u||A&&!p.gap||p.starte&&(c.buffered||y)&&this.removeFragment(p)})}removeFragment(e){const s=Hs(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const u=this.activePartLists[e.type];if(u){const A=e.sn;this.activePartLists[e.type]=u.filter(y=>y.fragment.sn!==A)}delete this.fragments[s],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function eo(_){var e,s,u;return _.buffered&&(_.body.gap||((e=_.range.video)==null?void 0:e.partial)||((s=_.range.audio)==null?void 0:s.partial)||((u=_.range.audiovideo)==null?void 0:u.partial))}function Hs(_){return`${_.type}_${_.level}_${_.sn}`}const _5={length:0,start:()=>0,end:()=>0};class mn{static isBuffered(e,s){try{if(e){const u=mn.getBuffered(e);for(let A=0;A=u.start(A)&&s<=u.end(A))return!0}}catch{}return!1}static bufferInfo(e,s,u){try{if(e){const A=mn.getBuffered(e),y=[];let l;for(l=0;lt&&(A[i-1].end=e[r].end):A.push(e[r])}else A.push(e[r])}else A=e;let y=0,l,c=s,p=s;for(let r=0;r=i&&ss.startCC||_&&_.cc{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(a=>a[0]==="GAP")){p(Kh(e));return}else e.gap=!1;const r=this.loader=e.loader=y?new y(A):new l(A),i=Wh(e),t=Gh(A.fragLoadPolicy.default),n={loadPolicy:t,timeout:t.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:zh};e.stats=r.stats,r.load(i,n,{onSuccess:(a,o,d,g)=>{this.resetLoader(e,r);let m=a.data;d.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(m.slice(0,16)),m=m.slice(16)),c({frag:e,part:null,payload:m,networkDetails:g})},onError:(a,o,d,g)=>{this.resetLoader(e,r),p(new Qr({type:Wi.NETWORK_ERROR,details:qt.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:Dn({url:u,data:void 0},a),error:new Error(`HTTP Error ${a.code} ${a.text}`),networkDetails:d,stats:g}))},onAbort:(a,o,d)=>{this.resetLoader(e,r),p(new Qr({type:Wi.NETWORK_ERROR,details:qt.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:d,stats:a}))},onTimeout:(a,o,d)=>{this.resetLoader(e,r),p(new Qr({type:Wi.NETWORK_ERROR,details:qt.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${n.timeout}ms`),networkDetails:d,stats:a}))},onProgress:(a,o,d,g)=>{s&&s({frag:e,part:null,payload:d,networkDetails:g})}})})}loadPart(e,s,u){this.abort();const A=this.config,y=A.fLoader,l=A.loader;return new Promise((c,p)=>{if(this.loader&&this.loader.destroy(),e.gap||s.gap){p(Kh(e,s));return}const r=this.loader=e.loader=y?new y(A):new l(A),i=Wh(e,s),t=Gh(A.fragLoadPolicy.default),n={loadPolicy:t,timeout:t.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:zh};s.stats=r.stats,r.load(i,n,{onSuccess:(a,o,d,g)=>{this.resetLoader(e,r),this.updateStatsFromPart(e,s);const m={frag:e,part:s,payload:a.data,networkDetails:g};u(m),c(m)},onError:(a,o,d,g)=>{this.resetLoader(e,r),p(new Qr({type:Wi.NETWORK_ERROR,details:qt.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:s,response:Dn({url:i.url,data:void 0},a),error:new Error(`HTTP Error ${a.code} ${a.text}`),networkDetails:d,stats:g}))},onAbort:(a,o,d)=>{e.stats.aborted=s.stats.aborted,this.resetLoader(e,r),p(new Qr({type:Wi.NETWORK_ERROR,details:qt.INTERNAL_ABORTED,fatal:!1,frag:e,part:s,error:new Error("Aborted"),networkDetails:d,stats:a}))},onTimeout:(a,o,d)=>{this.resetLoader(e,r),p(new Qr({type:Wi.NETWORK_ERROR,details:qt.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:s,error:new Error(`Timeout after ${n.timeout}ms`),networkDetails:d,stats:a}))}})})}updateStatsFromPart(e,s){const u=e.stats,A=s.stats,y=A.total;if(u.loaded+=A.loaded,y){const p=Math.round(e.duration/s.duration),r=Math.min(Math.round(u.loaded/y),p),t=(p-r)*Math.round(u.loaded/r);u.total=u.loaded+t}else u.total=Math.max(u.loaded,u.total);const l=u.loading,c=A.loading;l.start?l.first+=c.first-c.start:(l.start=c.start,l.first=c.first),l.end=c.end}resetLoader(e,s){e.loader=null,this.loader===s&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),s.destroy()}}function Wh(_,e=null){const s=e||_,u={frag:_,part:e,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},A=s.byteRangeStartOffset,y=s.byteRangeEndOffset;if(Ci(A)&&Ci(y)){var l;let c=A,p=y;if(_.sn==="initSegment"&&((l=_.decryptdata)==null?void 0:l.method)==="AES-128"){const r=y-A;r%16&&(p=y+(16-r%16)),A!==0&&(u.resetIV=!0,c=A-16)}u.rangeStart=c,u.rangeEnd=p}return u}function Kh(_,e){const s=new Error(`GAP ${_.gap?"tag":"attribute"} found`),u={type:Wi.MEDIA_ERROR,details:qt.FRAG_GAP,fatal:!1,frag:_,error:s,networkDetails:null};return e&&(u.part=e),(e||_).stats.aborted=!0,new Qr(u)}class Qr extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class x5{constructor(e,s){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=s}decrypt(e,s){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},s,e)}}class k5{constructor(e,s){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=s}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function R5(_){const e=_.byteLength,s=e&&new DataView(_.buffer).getUint8(e-1);return s?Ts(_,0,e-s):_}class I5{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const s=new DataView(e),u=new Uint32Array(4);for(let A=0;A<4;A++)u[A]=s.getUint32(A*4);return u}initTable(){const e=this.sBox,s=this.invSBox,u=this.subMix,A=u[0],y=u[1],l=u[2],c=u[3],p=this.invSubMix,r=p[0],i=p[1],t=p[2],n=p[3],a=new Uint32Array(256);let o=0,d=0,g=0;for(g=0;g<256;g++)g<128?a[g]=g<<1:a[g]=g<<1^283;for(g=0;g<256;g++){let m=d^d<<1^d<<2^d<<3^d<<4;m=m>>>8^m&255^99,e[o]=m,s[m]=o;const v=a[o],b=a[v],w=a[b];let C=a[m]*257^m*16843008;A[o]=C<<24|C>>>8,y[o]=C<<16|C>>>16,l[o]=C<<8|C>>>24,c[o]=C,C=w*16843009^b*65537^v*257^o*16843008,r[m]=C<<24|C>>>8,i[m]=C<<16|C>>>16,t[m]=C<<8|C>>>24,n[m]=C,o?(o=v^a[a[a[w^v]]],d^=a[a[d]]):o=d=1}}expandKey(e){const s=this.uint8ArrayToUint32Array_(e);let u=!0,A=0;for(;AA?(this.logOnce("WebCrypto AES decrypt"),new x5(A,new Uint8Array(u)).decrypt(e.buffer,y)):Promise.reject(new Error("web crypto not initialized"))).catch(y=>(Ft.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${y.name}: ${y.message}`),this.onWebCryptoError(e,s,u)))}onWebCryptoError(e,s,u){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,s,u);const A=this.flush();if(A)return A.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let s=e;const u=e.length-e.length%L5;return u!==e.length&&(s=Ts(e,0,u),this.remainderData=Ts(e,u)),s}logOnce(e){this.logEnabled&&(Ft.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const D5={toString:function(_){let e="";const s=_.length;for(let u=0;uc.end){const t=l>i;(l{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${y.part?" p: "+y.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(y)};this._doFragLoad(e,s,u,A).then(y=>{if(!y)return;const l=this.state;if(this.fragContextChanged(e)){(l===ni.FRAG_LOADING||!this.fragCurrent&&l===ni.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=ni.IDLE);return}"payload"in y&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(rt.FRAG_LOADED,y)),this._handleFragmentLoadComplete(y)}).catch(y=>{this.state===ni.STOPPED||this.state===ni.ERROR||(this.warn(y),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var s;const{fragmentTracker:u}=this;if(u.getState(e)===Fn.APPENDING){const y=e.type,l=this.getFwdBufferInfo(this.mediaBuffer,y),c=Math.max(e.duration,l?l.len:this.config.maxBufferLength);this.reduceMaxBufferLength(c)&&u.removeFragment(e)}else((s=this.mediaBuffer)==null?void 0:s.buffered.length)===0?u.removeAllFragments():u.hasParts(e.type)&&(u.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),u.getState(e)===Fn.PARTIAL&&u.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const s=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:s,part:null,stats:s.stats,id:s.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,s,u=null){if(!(e-s))return;const A={startOffset:e,endOffset:s,type:u};this.hls.trigger(rt.BUFFER_FLUSHING,A)}_loadInitSegment(e,s){this._doFragLoad(e,s).then(u=>{if(!u||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return u}).then(u=>{const{hls:A}=this,{payload:y}=u,l=e.decryptdata;if(y&&y.byteLength>0&&l!=null&&l.key&&l.iv&&l.method==="AES-128"){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(y),l.key.buffer,l.iv.buffer).catch(p=>{throw A.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.FRAG_DECRYPT_ERROR,fatal:!1,error:p,reason:p.message,frag:e}),p}).then(p=>{const r=self.performance.now();return A.trigger(rt.FRAG_DECRYPTED,{frag:e,payload:p,stats:{tstart:c,tdecrypt:r}}),u.payload=p,this.completeInitSegmentLoad(u)})}return this.completeInitSegmentLoad(u)}).catch(u=>{this.state===ni.STOPPED||this.state===ni.ERROR||(this.warn(u),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:s}=this;if(!s)throw new Error("init load aborted, missing levels");const u=e.frag.stats;this.state=ni.IDLE,e.frag.data=new Uint8Array(e.payload),u.parsing.start=u.buffering.start=self.performance.now(),u.parsing.end=u.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:s}=this;return!e||!s||e.sn!==s.sn||e.level!==s.level}fragBufferedComplete(e,s){var u,A,y,l;const c=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${s?" part: "+s.index:""} of ${this.playlistType===Hi.MAIN?"level":"track"} ${e.level} (frag:[${((u=e.startPTS)!=null?u:NaN).toFixed(3)}-${((A=e.endPTS)!=null?A:NaN).toFixed(3)}] > buffer:${c?D5.toString(mn.getBuffered(c)):"(detached)"})`),e.sn!=="initSegment"){var p;if(e.type!==Hi.SUBTITLE){const i=e.elementaryStreams;if(!Object.keys(i).some(t=>!!i[t])){this.state=ni.IDLE;return}}const r=(p=this.levels)==null?void 0:p[e.level];r!=null&&r.fragmentError&&(this.log(`Resetting level fragment error count of ${r.fragmentError} on frag buffered`),r.fragmentError=0)}this.state=ni.IDLE,c&&(!this.loadedmetadata&&e.type==Hi.MAIN&&c.buffered.length&&((y=this.fragCurrent)==null?void 0:y.sn)===((l=this.fragPrevious)==null?void 0:l.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:s}=this;if(!s)return;const{frag:u,part:A,partsLoaded:y}=e,l=!y||y.length===0||y.some(p=>!p),c=new Td(u.level,u.sn,u.stats.chunkCount+1,0,A?A.index:-1,!l);s.flush(c)}_handleFragmentLoadProgress(e){}_doFragLoad(e,s,u=null,A){var y;const l=s==null?void 0:s.details;if(!this.levels||!l)throw new Error(`frag load aborted, missing level${l?"":" detail"}s`);let c=null;if(e.encrypted&&!((y=e.decryptdata)!=null&&y.key)?(this.log(`Loading key for ${e.sn} of [${l.startSN}-${l.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=ni.KEY_LOADING,this.fragCurrent=e,c=this.keyLoader.load(e).then(i=>{if(!this.fragContextChanged(i.frag))return this.hls.trigger(rt.KEY_LOADED,i),this.state===ni.KEY_LOADING&&(this.state=ni.IDLE),i}),this.hls.trigger(rt.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(c=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&l.encryptedFragments.length&&this.keyLoader.loadClear(e,l.encryptedFragments),u=Math.max(e.start,u||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const i=l.partList;if(i&&A){u>e.end&&l.fragmentHint&&(e=l.fragmentHint);const t=this.getNextPart(i,e,u);if(t>-1){const n=i[t];this.log(`Loading part sn: ${e.sn} p: ${n.index} cc: ${e.cc} of playlist [${l.startSN}-${l.endSN}] parts [0-${t}-${i.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(u.toFixed(3))}`),this.nextLoadPosition=n.start+n.duration,this.state=ni.FRAG_LOADING;let a;return c?a=c.then(o=>!o||this.fragContextChanged(o.frag)?null:this.doFragPartsLoad(e,n,s,A)).catch(o=>this.handleFragLoadError(o)):a=this.doFragPartsLoad(e,n,s,A).catch(o=>this.handleFragLoadError(o)),this.hls.trigger(rt.FRAG_LOADING,{frag:e,part:n,targetBufferTime:u}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):a}else if(!e.url||this.loadedEndOfParts(i,u))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${l?"of ["+l.startSN+"-"+l.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(u.toFixed(3))}`),Ci(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=ni.FRAG_LOADING;const p=this.config.progressive;let r;return p&&c?r=c.then(i=>!i||this.fragContextChanged(i==null?void 0:i.frag)?null:this.fragmentLoader.load(e,A)).catch(i=>this.handleFragLoadError(i)):r=Promise.all([this.fragmentLoader.load(e,p?A:void 0),c]).then(([i])=>(!p&&i&&A&&A(i),i)).catch(i=>this.handleFragLoadError(i)),this.hls.trigger(rt.FRAG_LOADING,{frag:e,targetBufferTime:u}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):r}doFragPartsLoad(e,s,u,A){return new Promise((y,l)=>{var c;const p=[],r=(c=u.details)==null?void 0:c.partList,i=t=>{this.fragmentLoader.loadPart(e,t,A).then(n=>{p[t.index]=n;const a=n.part;this.hls.trigger(rt.FRAG_LOADED,n);const o=Fh(u,e.sn,t.index+1)||Gp(r,e.sn,t.index+1);if(o)i(o);else return y({frag:e,part:a,partsLoaded:p})}).catch(l)};i(s)})}handleFragLoadError(e){if("data"in e){const s=e.data;e.data&&s.details===qt.INTERNAL_ABORTED?this.handleFragLoadAborted(s.frag,s.part):this.hls.trigger(rt.ERROR,s)}else this.hls.trigger(rt.ERROR,{type:Wi.OTHER_ERROR,details:qt.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const s=this.getCurrentContext(e);if(!s||this.state!==ni.PARSING){!this.fragCurrent&&this.state!==ni.STOPPED&&this.state!==ni.ERROR&&(this.state=ni.IDLE);return}const{frag:u,part:A,level:y}=s,l=self.performance.now();u.stats.parsing.end=l,A&&(A.stats.parsing.end=l),this.updateLevelTiming(u,A,y,e.partial)}getCurrentContext(e){const{levels:s,fragCurrent:u}=this,{level:A,sn:y,part:l}=e;if(!(s!=null&&s[A]))return this.warn(`Levels object was unset while buffering fragment ${y} of level ${A}. The current chunk will not be buffered.`),null;const c=s[A],p=l>-1?Fh(c,y,l):null,r=p?p.fragment:t5(c,y,u);return r?(u&&u!==r&&(r.stats=u.stats),{frag:r,part:p,level:c}):null}bufferFragmentData(e,s,u,A,y){var l;if(!e||this.state!==ni.PARSING)return;const{data1:c,data2:p}=e;let r=c;if(c&&p&&(r=Ar(c,p)),!((l=r)!=null&&l.length))return;const i={type:e.type,frag:s,part:u,chunkMeta:A,parent:s.type,data:r};if(this.hls.trigger(rt.BUFFER_APPENDING,i),e.dropped&&e.independent&&!u){if(y)return;this.flushBufferGap(s)}}flushBufferGap(e){const s=this.media;if(!s)return;if(!mn.isBuffered(s,s.currentTime)){this.flushMainBuffer(0,e.start);return}const u=s.currentTime,A=mn.bufferInfo(s,u,0),y=e.duration,l=Math.min(this.config.maxFragLookUpTolerance*2,y*.25),c=Math.max(Math.min(e.start-l,A.end-l),u+l);e.start-c>l&&this.flushMainBuffer(c,e.start)}getFwdBufferInfo(e,s){const u=this.getLoadPosition();return Ci(u)?this.getFwdBufferInfoAtPos(e,u,s):null}getFwdBufferInfoAtPos(e,s,u){const{config:{maxBufferHole:A}}=this,y=mn.bufferInfo(e,s,A);if(y.len===0&&y.nextStart!==void 0){const l=this.fragmentTracker.getBufferedFrag(s,u);if(l&&y.nextStart=u?(s.maxMaxBufferLength/=2,this.warn(`Reduce max buffer length to ${s.maxMaxBufferLength}s`),!0):!1}getAppendedFrag(e,s=Hi.MAIN){const u=this.fragmentTracker.getAppendedFrag(e,Hi.MAIN);return u&&"fragment"in u?u.fragment:u}getNextFragment(e,s){const u=s.fragments,A=u.length;if(!A)return null;const{config:y}=this,l=u[0].start;let c;if(s.live){const p=y.initialLiveManifestSize;if(As}getNextFragmentLoopLoading(e,s,u,A,y){const l=e.gap,c=this.getNextFragment(this.nextLoadPosition,s);if(c===null)return c;if(e=c,l&&e&&!e.gap&&u.nextStart){const p=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,u.nextStart,A);if(p!==null&&u.len+p.len>=y)return this.log(`buffer full after gaps in "${A}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,s,u){let A=-1,y=!1,l=!0;for(let c=0,p=e.length;c-1&&uu.start&&u.loaded}getInitialLiveFragment(e,s){const u=this.fragPrevious;let A=null;if(u){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${u.programDateTime}`),A=n5(s,u.endProgramDateTime,this.config.maxFragLookUpTolerance)),!A){const y=u.sn+1;if(y>=e.startSN&&y<=e.endSN){const l=s[y-e.startSN];u.cc===l.cc&&(A=l,this.log(`Live playlist, switching playlist, load frag with next SN: ${A.sn}`))}A||(A=s5(s,u.cc),A&&this.log(`Live playlist, switching playlist, load frag with same CC: ${A.sn}`))}}else{const y=this.hls.liveSyncPosition;y!==null&&(A=this.getFragmentAtPosition(y,this.bitrateTest?e.fragmentEnd:e.edge,e))}return A}getFragmentAtPosition(e,s,u){const{config:A}=this;let{fragPrevious:y}=this,{fragments:l,endSN:c}=u;const{fragmentHint:p}=u,r=A.maxFragLookUpTolerance,i=u.partList,t=!!(A.lowLatencyMode&&i!=null&&i.length&&p);t&&p&&!this.bitrateTest&&(l=l.concat(p),c=p.sn);let n;if(es-r?0:r;n=Po(y,l,e,a)}else n=l[l.length-1];if(n){const a=n.sn-u.startSN,o=this.fragmentTracker.getState(n);if((o===Fn.OK||o===Fn.PARTIAL&&n.gap)&&(y=n),y&&n.sn===y.sn&&(!t||i[0].fragment.sn>n.sn)&&y&&n.level===y.level){const g=l[a+1];n.sn=l-s.maxFragLookUpTolerance&&y<=c;if(A!==null&&u.duration>A&&(y${e.startSN} prev-sn: ${p?p.sn:"na"} fragments: ${A}`),r}return y}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,s){let u=this.startPosition;if(u ${(A=this.fragCurrent)==null?void 0:A.url}`);return}const y=s.details===qt.FRAG_GAP;y&&this.fragmentTracker.fragBuffered(u,!0);const l=s.errorAction,{action:c,retryCount:p=0,retryConfig:r}=l||{};if(l&&c===Vn.RetryRequest&&r){this.resetStartWhenNotLoaded(this.levelLastLoaded);const i=wd(r,p);this.warn(`Fragment ${u.sn} of ${e} ${u.level} errored with ${s.details}, retrying loading ${p+1}/${r.maxNumRetry} in ${i}ms`),l.resolved=!0,this.retryDate=self.performance.now()+i,this.state=ni.FRAG_LOADING_WAITING_RETRY}else if(r&&l)if(this.resetFragmentErrors(e),p.5;A&&this.reduceMaxBufferLength(u.len);const y=!A;return y&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${s} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),y}return!1}resetFragmentErrors(e){e===Hi.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==ni.STOPPED&&(this.state=ni.IDLE)}afterBufferFlushed(e,s,u){if(!e)return;const A=mn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(s,A,u),this.state===ni.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=ni.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const s=e?e.details:null;s!=null&&s.live?(this.startPosition=-1,this.setStartPosition(s,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,s,u,A){var y;const l=u.details;if(!l){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((p,r)=>{const i=e.elementaryStreams[r];if(i){const t=i.endPTS-i.startPTS;if(t<=0)return this.warn(`Could not parse fragment ${e.sn} ${r} duration reliably (${t})`),p||!1;const n=A?0:Fp(l,e,i.startPTS,i.endPTS,i.startDTS,i.endDTS);return this.hls.trigger(rt.LEVEL_PTS_UPDATED,{details:l,level:u,drift:n,type:r,frag:e,start:i.startPTS,end:i.endPTS}),!0}return p},!1)&&((y=this.transmuxer)==null?void 0:y.error)===null){const p=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(u.fragmentError===0&&(u.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(p.message),this.hls.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.FRAG_PARSING_ERROR,fatal:!1,error:p,frag:e,reason:`Found no media in msn ${e.sn} of level "${u.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=ni.PARSED,this.hls.trigger(rt.FRAG_PARSED,{frag:e,part:s})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const s=this._state;s!==e&&(this._state=e,this.log(`${s}->${e}`))}get state(){return this._state}}class Wp{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:s}=this;let u;if(e.length)e.length===1?u=e[0]:u=O5(e,s);else return new Uint8Array(0);return this.reset(),u}reset(){this.chunks.length=0,this.dataLength=0}}function O5(_,e){const s=new Uint8Array(e);let u=0;for(let A=0;A<_.length;A++){const y=_[A];s.set(y,u),u+=y.length}return s}function M5(){return typeof __HLS_WORKER_BUNDLE__=="function"}function P5(){const _=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),e=self.URL.createObjectURL(_);return{worker:new self.Worker(e),objectURL:e}}function B5(_){const e=new self.URL(_,self.location.href).href;return{worker:new self.Worker(e),scriptURL:e}}function Ur(_="",e=9e4){return{type:_,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class kd{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,s,u,A){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,s){return!1}appendFrame(e,s,u){}demux(e,s){this.cachedData&&(e=Ar(this.cachedData,e),this.cachedData=null);let u=Ra(e,0),A=u?u.length:0,y;const l=this._audioTrack,c=this._id3Track,p=u?_d(u):void 0,r=e.length;for((this.basePTS===null||this.frameIndex===0&&Ci(p))&&(this.basePTS=N5(p,s,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),u&&u.length>0&&c.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:u,type:xr.audioId3,duration:Number.POSITIVE_INFINITY});A{if(Ci(_))return _*90;const u=s?s.baseTime*9e4/s.timescale:0;return e*9e4+u};function F5(_,e,s,u){let A,y,l,c;const p=navigator.userAgent.toLowerCase(),r=u,i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];A=((e[s+2]&192)>>>6)+1;const t=(e[s+2]&60)>>>2;if(t>i.length-1){const n=new Error(`invalid ADTS sampling index:${t}`);_.emit(rt.ERROR,rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.FRAG_PARSING_ERROR,fatal:!0,error:n,reason:n.message});return}return l=(e[s+2]&1)<<2,l|=(e[s+3]&192)>>>6,Ft.log(`manifest codec:${u}, ADTS type:${A}, samplingIndex:${t}`),/firefox/i.test(p)?t>=6?(A=5,c=new Array(4),y=t-3):(A=2,c=new Array(2),y=t):p.indexOf("android")!==-1?(A=2,c=new Array(2),y=t):(A=5,c=new Array(4),u&&(u.indexOf("mp4a.40.29")!==-1||u.indexOf("mp4a.40.5")!==-1)||!u&&t>=6?y=t-3:((u&&u.indexOf("mp4a.40.2")!==-1&&(t>=6&&l===1||/vivaldi/i.test(p))||!u&&l===1)&&(A=2,c=new Array(2)),y=t)),c[0]=A<<3,c[0]|=(t&14)>>1,c[1]|=(t&1)<<7,c[1]|=l<<3,A===5&&(c[1]|=(y&14)>>1,c[2]=(y&1)<<7,c[2]|=8,c[3]=0),{config:c,samplerate:i[t],channelCount:l,codec:"mp4a.40."+A,manifestCodec:r}}function Kp(_,e){return _[e]===255&&(_[e+1]&246)===240}function qp(_,e){return _[e+1]&1?7:9}function Rd(_,e){return(_[e+3]&3)<<11|_[e+4]<<3|(_[e+5]&224)>>>5}function U5(_,e){return e+5<_.length}function No(_,e){return e+1<_.length&&Kp(_,e)}function G5(_,e){return U5(_,e)&&Kp(_,e)&&Rd(_,e)<=_.length-e}function j5(_,e){if(No(_,e)){const s=qp(_,e);if(e+s>=_.length)return!1;const u=Rd(_,e);if(u<=s)return!1;const A=e+u;return A===_.length||No(_,A)}return!1}function Yp(_,e,s,u,A){if(!_.samplerate){const y=F5(e,s,u,A);if(!y)return;_.config=y.config,_.samplerate=y.samplerate,_.channelCount=y.channelCount,_.codec=y.codec,_.manifestCodec=y.manifestCodec,Ft.log(`parsed codec:${_.codec}, rate:${y.samplerate}, channels:${y.channelCount}`)}}function Jp(_){return 1024*9e4/_}function V5(_,e){const s=qp(_,e);if(e+s<=_.length){const u=Rd(_,e)-s;if(u>0)return{headerLength:s,frameLength:u}}}function Qp(_,e,s,u,A){const y=Jp(_.samplerate),l=u+A*y,c=V5(e,s);let p;if(c){const{frameLength:t,headerLength:n}=c,a=n+t,o=Math.max(0,s+a-e.length);o?(p=new Uint8Array(a-n),p.set(e.subarray(s+n,e.length),0)):p=e.subarray(s+n,s+a);const d={unit:p,pts:l};return o||_.samples.push(d),{sample:d,length:a,missing:o}}const r=e.length-s;return p=new Uint8Array(r),p.set(e.subarray(s,e.length),0),{sample:{unit:p,pts:l},length:r,missing:-1}}let io=null;const H5=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],z5=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],W5=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],K5=[0,1,1,4];function Zp(_,e,s,u,A){if(s+24>e.length)return;const y=Xp(e,s);if(y&&s+y.frameLength<=e.length){const l=y.samplesPerFrame*9e4/y.sampleRate,c=u+A*l,p={unit:e.subarray(s,s+y.frameLength),pts:c,dts:c};return _.config=[],_.channelCount=y.channelCount,_.samplerate=y.sampleRate,_.samples.push(p),{sample:p,length:y.frameLength,missing:0}}}function Xp(_,e){const s=_[e+1]>>3&3,u=_[e+1]>>1&3,A=_[e+2]>>4&15,y=_[e+2]>>2&3;if(s!==1&&A!==0&&A!==15&&y!==3){const l=_[e+2]>>1&1,c=_[e+3]>>6,p=s===3?3-u:u===3?3:4,r=H5[p*14+A-1]*1e3,t=z5[(s===3?0:s===2?1:2)*3+y],n=c===3?1:2,a=W5[s][u],o=K5[u],d=a*8*o,g=Math.floor(a*r/t+l)*o;if(io===null){const b=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);io=b?parseInt(b[1]):0}return!!io&&io<=87&&u===2&&r>=224e3&&c===0&&(_[e+3]=_[e+3]|128),{sampleRate:t,channelCount:n,frameLength:g,samplesPerFrame:d}}}function Id(_,e){return _[e]===255&&(_[e+1]&224)===224&&(_[e+1]&6)!==0}function $p(_,e){return e+1<_.length&&Id(_,e)}function q5(_,e){return Id(_,e)&&4<=_.length-e}function e0(_,e){if(e+1<_.length&&Id(_,e)){const u=Xp(_,e);let A=4;u!=null&&u.frameLength&&(A=u.frameLength);const y=e+A;return y===_.length||$p(_,y)}return!1}class Y5 extends kd{constructor(e,s){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=s}resetInitSegment(e,s,u,A){super.resetInitSegment(e,s,u,A),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:s,duration:A,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const s=Ra(e,0);let u=(s==null?void 0:s.length)||0;if(e0(e,u))return!1;for(let A=e.length;u{const l=C_(y);if(J5.test(l.schemeIdUri)){const c=Ci(l.presentationTime)?l.presentationTime/l.timeScale:s+l.presentationTimeDelta/l.timeScale;let p=l.eventDuration===4294967295?Number.POSITIVE_INFINITY:l.eventDuration/l.timeScale;p<=.001&&(p=Number.POSITIVE_INFINITY);const r=l.payload;u.samples.push({data:r,len:r.byteLength,dts:c,pts:c,type:xr.emsg,duration:p})}})}return u}demuxSampleAes(e,s,u){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const t0=(_,e)=>{let s=0,u=5;e+=u;const A=new Uint32Array(1),y=new Uint32Array(1),l=new Uint8Array(1);for(;u>0;){l[0]=_[e];const c=Math.min(u,8),p=8-c;y[0]=4278190080>>>24+p<>p,s=s?s<e.length||e[s]!==11||e[s+1]!==119)return-1;const y=e[s+4]>>6;if(y>=3)return-1;const c=[48e3,44100,32e3][y],p=e[s+4]&63,i=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][p*3+y]*2;if(s+i>e.length)return-1;const t=e[s+6]>>5;let n=0;t===2?n+=2:(t&1&&t!==1&&(n+=2),t&4&&(n+=2));const a=(e[s+6]<<8|e[s+7])>>12-n&1,d=[2,1,2,3,3,4,4,5][t]+a,g=e[s+5]>>3,m=e[s+5]&7,v=new Uint8Array([y<<6|g<<1|m>>2,(m&3)<<6|t<<3|a<<2|p>>4,p<<4&224]),b=1536/c*9e4,w=u+A*b,C=e.subarray(s,s+i);return _.config=v,_.channelCount=d,_.samplerate=c,_.samples.push({unit:C,pts:w}),i}class n0{constructor(){this.VideoSample=null}createVideoSample(e,s,u,A){return{key:e,frame:!1,pts:s,dts:u,units:[],debug:A,length:0}}getLastNalUnit(e){var s;let u=this.VideoSample,A;if((!u||u.units.length===0)&&(u=e[e.length-1]),(s=u)!=null&&s.units){const y=u.units;A=y[y.length-1]}return A}pushAccessUnit(e,s){if(e.units.length&&e.frame){if(e.pts===void 0){const u=s.samples,A=u.length;if(A){const y=u[A-1];e.pts=y.pts,e.dts=y.dts}else{s.dropped++;return}}s.samples.push(e)}e.debug.length&&Ft.log(e.pts+"/"+e.dts+":"+e.debug)}parseNALu(e,s){const u=s.byteLength;let A=e.naluState||0;const y=A,l=[];let c=0,p,r,i,t=-1,n=0;for(A===-1&&(t=0,n=this.getNALuType(s,0),A=0,c=1);c=0){const a={data:s.subarray(t,r),type:n};l.push(a)}else{const a=this.getLastNalUnit(e.samples);a&&(y&&c<=4-y&&a.state&&(a.data=a.data.subarray(0,a.data.byteLength-y)),r>0&&(a.data=Ar(a.data,s.subarray(0,r)),a.state=0))}c=0&&A>=0){const a={data:s.subarray(t,u),type:n,state:A};l.push(a)}if(l.length===0){const a=this.getLastNalUnit(e.samples);a&&(a.data=Ar(a.data,s))}return e.naluState=A,l}}class xa{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,s=this.bytesAvailable,u=e.byteLength-s,A=new Uint8Array(4),y=Math.min(4,s);if(y===0)throw new Error("no bytes available");A.set(e.subarray(u,u+y)),this.word=new DataView(A.buffer).getUint32(0),this.bitsAvailable=y*8,this.bytesAvailable-=y}skipBits(e){let s;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,s=e>>3,e-=s<<3,this.bytesAvailable-=s,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let s=Math.min(this.bitsAvailable,e);const u=this.word>>>32-s;if(e>32&&Ft.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=s,this.bitsAvailable>0)this.word<<=s;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return s=e-s,s>0&&this.bitsAvailable?u<>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class qh extends n0{parsePES(e,s,u,A,y){const l=this.parseNALu(e,u.data);let c=this.VideoSample,p,r=!1;u.data=null,c&&l.length&&!e.audFound&&(this.pushAccessUnit(c,e),c=this.VideoSample=this.createVideoSample(!1,u.pts,u.dts,"")),l.forEach(i=>{var t;switch(i.type){case 1:{let d=!1;p=!0;const g=i.data;if(r&&g.length>4){const m=this.readSliceType(g);(m===2||m===4||m===7||m===9)&&(d=!0)}if(d){var n;(n=c)!=null&&n.frame&&!c.key&&(this.pushAccessUnit(c,e),c=this.VideoSample=null)}c||(c=this.VideoSample=this.createVideoSample(!0,u.pts,u.dts,"")),c.frame=!0,c.key=d;break}case 5:p=!0,(t=c)!=null&&t.frame&&!c.key&&(this.pushAccessUnit(c,e),c=this.VideoSample=null),c||(c=this.VideoSample=this.createVideoSample(!0,u.pts,u.dts,"")),c.key=!0,c.frame=!0;break;case 6:{p=!0,Ed(i.data,1,u.pts,s.samples);break}case 7:{var a,o;p=!0,r=!0;const d=i.data,g=this.readSPS(d);if(!e.sps||e.width!==g.width||e.height!==g.height||((a=e.pixelRatio)==null?void 0:a[0])!==g.pixelRatio[0]||((o=e.pixelRatio)==null?void 0:o[1])!==g.pixelRatio[1]){e.width=g.width,e.height=g.height,e.pixelRatio=g.pixelRatio,e.sps=[d],e.duration=y;const m=d.subarray(1,4);let v="avc1.";for(let b=0;b<3;b++){let w=m[b].toString(16);w.length<2&&(w="0"+w),v+=w}e.codec=v}break}case 8:p=!0,e.pps=[i.data];break;case 9:p=!0,e.audFound=!0,c&&this.pushAccessUnit(c,e),c=this.VideoSample=this.createVideoSample(!1,u.pts,u.dts,"");break;case 12:p=!0;break;default:p=!1,c&&(c.debug+="unknown NAL "+i.type+" ");break}c&&p&&c.units.push(i)}),A&&c&&(this.pushAccessUnit(c,e),this.VideoSample=null)}getNALuType(e,s){return e[s]&31}readSliceType(e){const s=new xa(e);return s.readUByte(),s.readUEG(),s.readUEG()}skipScalingList(e,s){let u=8,A=8,y;for(let l=0;l{var t;switch(i.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:c||(c=this.VideoSample=this.createVideoSample(!1,u.pts,u.dts,"")),c.frame=!0,p=!0;break;case 16:case 17:case 18:case 21:if(p=!0,r){var n;(n=c)!=null&&n.frame&&!c.key&&(this.pushAccessUnit(c,e),c=this.VideoSample=null)}c||(c=this.VideoSample=this.createVideoSample(!0,u.pts,u.dts,"")),c.key=!0,c.frame=!0;break;case 19:case 20:p=!0,(t=c)!=null&&t.frame&&!c.key&&(this.pushAccessUnit(c,e),c=this.VideoSample=null),c||(c=this.VideoSample=this.createVideoSample(!0,u.pts,u.dts,"")),c.key=!0,c.frame=!0;break;case 39:p=!0,Ed(i.data,2,u.pts,s.samples);break;case 32:if(p=!0,!e.vps){const a=this.readVPS(i.data);e.params=Dn({},a),this.initVPS=i.data}e.vps=[i.data];break;case 33:if(p=!0,r=!0,typeof e.params=="object"){if(e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],i.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const a=this.readSPS(i.data);e.width=a.width,e.height=a.height,e.pixelRatio=a.pixelRatio,e.duration=y,e.codec=a.codecString,e.sps=[];for(const o in a.params)e.params[o]=a.params[o]}e.vps!==void 0&&e.vps[0]===this.initVPS&&e.sps.push(i.data)}c||(c=this.VideoSample=this.createVideoSample(!0,u.pts,u.dts,"")),c.key=!0;break;case 34:if(p=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const a=this.readPPS(i.data);for(const o in a)e.params[o]=a[o]}(this.initVPS!==null||e.pps.length===0)&&e.pps.push(i.data)}break;case 35:p=!0,e.audFound=!0,c&&this.pushAccessUnit(c,e),c=this.VideoSample=this.createVideoSample(!1,u.pts,u.dts,"");break;default:p=!1,c&&(c.debug+="unknown or irrelevant NAL "+i.type+" ");break}c&&p&&c.units.push(i)}),A&&c&&(this.pushAccessUnit(c,e),this.VideoSample=null)}getNALuType(e,s){return(e[s]&126)>>>1}ebsp2rbsp(e){const s=new Uint8Array(e.byteLength);let u=0;for(let A=0;A=2&&e[A]===3&&e[A-1]===0&&e[A-2]===0||(s[u]=e[A],u++);return new Uint8Array(s.buffer,0,u)}readVPS(e){const s=new xa(e);s.readUByte(),s.readUByte(),s.readBits(4),s.skipBits(2),s.readBits(6);const u=s.readBits(3),A=s.readBoolean();return{numTemporalLayers:u+1,temporalIdNested:A}}readSPS(e){const s=new xa(this.ebsp2rbsp(e));s.readUByte(),s.readUByte(),s.readBits(4);const u=s.readBits(3);s.readBoolean();const A=s.readBits(2),y=s.readBoolean(),l=s.readBits(5),c=s.readUByte(),p=s.readUByte(),r=s.readUByte(),i=s.readUByte(),t=s.readUByte(),n=s.readUByte(),a=s.readUByte(),o=s.readUByte(),d=s.readUByte(),g=s.readUByte(),m=s.readUByte(),v=[],b=[];for(let je=0;je0)for(let je=u;je<8;je++)s.readBits(2);for(let je=0;je1&&s.readEG();for(let vt=0;vt0&&tt<16?(j=pe[tt-1],z=ue[tt-1]):tt===255&&(j=s.readBits(16),z=s.readBits(16))}if(s.readBoolean()&&s.readBoolean(),s.readBoolean()&&(s.readBits(3),s.readBoolean(),s.readBoolean()&&(s.readUByte(),s.readUByte(),s.readUByte())),s.readBoolean()&&(s.readUEG(),s.readUEG()),s.readBoolean(),s.readBoolean(),s.readBoolean(),oe=s.readBoolean(),oe&&(T+=s.readUEG(),P+=s.readUEG(),L+=s.readUEG(),I+=s.readUEG()),s.readBoolean()&&(Z=s.readBits(32),X=s.readBits(32),s.readBoolean()&&s.readUEG(),s.readBoolean())){const ue=s.readBoolean(),W=s.readBoolean();let ke=!1;(ue||W)&&(ke=s.readBoolean(),ke&&(s.readUByte(),s.readBits(5),s.readBoolean(),s.readBits(5)),s.readBits(4),s.readBits(4),ke&&s.readBits(4),s.readBits(5),s.readBits(5),s.readBits(5));for(let Ae=0;Ae<=u;Ae++){q=s.readBoolean();const Ye=q||s.readBoolean();let lt=!1;Ye?s.readEG():lt=s.readBoolean();const mt=lt?1:s.readUEG()+1;if(ue)for(let Ue=0;Ue>je&1)<<31-je)>>>0;let Ie=He.toString(16);return l===1&&Ie==="2"&&(Ie="6"),{codecString:`hvc1.${se}${l}.${Ie}.${y?"H":"L"}${m}.B0`,params:{general_tier_flag:y,general_profile_idc:l,general_profile_space:A,general_profile_compatibility_flags:[c,p,r,i],general_constraint_indicator_flags:[t,n,a,o,d,g],general_level_idc:m,bit_depth:x+8,bit_depth_luma_minus8:x,bit_depth_chroma_minus8:O,min_spatial_segmentation_idc:Y,chroma_format_idc:w,frame_rate:{fixed:q,fps:X/Z}},width:ie,height:fe,pixelRatio:[j,z]}}readPPS(e){const s=new xa(this.ebsp2rbsp(e));s.readUByte(),s.readUByte(),s.skipUEG(),s.skipUEG(),s.skipBits(2),s.skipBits(3),s.skipBits(2),s.skipUEG(),s.skipUEG(),s.skipEG(),s.skipBits(2),s.readBoolean()&&s.skipUEG(),s.skipEG(),s.skipEG(),s.skipBits(4);const A=s.readBoolean(),y=s.readBoolean();let l=1;return y&&A?l=0:y?l=3:A&&(l=2),{parallelismType:l}}matchSPS(e,s){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,s).substr(3)}}class X5{constructor(e,s,u){this.keyData=void 0,this.decrypter=void 0,this.keyData=u,this.decrypter=new Cd(s,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,s,u){const A=e[s].unit;if(A.length<=16)return;const y=A.subarray(16,A.length-A.length%16),l=y.buffer.slice(y.byteOffset,y.byteOffset+y.length);this.decryptBuffer(l).then(c=>{const p=new Uint8Array(c);A.set(p,16),this.decrypter.isSync()||this.decryptAacSamples(e,s+1,u)})}decryptAacSamples(e,s,u){for(;;s++){if(s>=e.length){u();return}if(!(e[s].unit.length<32)&&(this.decryptAacSample(e,s,u),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const s=Math.floor((e.length-48)/160)*16+16,u=new Int8Array(s);let A=0;for(let y=32;y{y.data=this.getAvcDecryptedUnit(l,p),this.decrypter.isSync()||this.decryptAvcSamples(e,s,u+1,A)})}decryptAvcSamples(e,s,u,A){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;s++,u=0){if(s>=e.length){A();return}const y=e[s].units;for(;!(u>=y.length);u++){const l=y[u];if(!(l.data.length<=48||l.type!==1&&l.type!==5)&&(this.decryptAvcSample(e,s,u,A,l),!this.decrypter.isSync()))return}}}}const Pn=188;class os{constructor(e,s,u){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=s,this.typeSupported=u,this.videoParser=null}static probe(e){const s=os.syncOffset(e);return s>0&&Ft.warn(`MPEG2-TS detected but first sync word found @ offset ${s}`),s!==-1}static syncOffset(e){const s=e.length;let u=Math.min(Pn*5,s-Pn)+1,A=0;for(;A1&&(l===0&&c>2||p+Pn>u))return l}else{if(c)return-1;break}A++}return-1}static createTrack(e,s){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:kp[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?s:void 0}}resetInitSegment(e,s,u,A){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=os.createTrack("video"),this._audioTrack=os.createTrack("audio",A),this._id3Track=os.createTrack("id3"),this._txtTrack=os.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=s,this.videoCodec=u,this._duration=A}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:s,_id3Track:u}=this;e&&(e.pesData=null),s&&(s.pesData=null),u&&(u.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,s,u=!1,A=!1){u||(this.sampleAes=null);let y;const l=this._videoTrack,c=this._audioTrack,p=this._id3Track,r=this._txtTrack;let i=l.pid,t=l.pesData,n=c.pid,a=p.pid,o=c.pesData,d=p.pesData,g=null,m=this.pmtParsed,v=this._pmtId,b=e.length;if(this.remainderData&&(e=Ar(this.remainderData,e),b=e.length,this.remainderData=null),b>4;let I;if(L>1){if(I=R+5+e[R+4],I===R+Pn)continue}else I=R+4;switch(P){case i:if(T){if(t&&(y=zs(t))){if(this.videoParser===null)switch(l.segmentCodec){case"avc":this.videoParser=new qh;break;case"hevc":this.videoParser=new Yh;break}this.videoParser!==null&&this.videoParser.parsePES(l,r,y,!1,this._duration)}t={data:[],size:0}}t&&(t.data.push(e.subarray(I,R+Pn)),t.size+=R+Pn-I);break;case n:if(T){if(o&&(y=zs(o)))switch(c.segmentCodec){case"aac":this.parseAACPES(c,y);break;case"mp3":this.parseMPEGPES(c,y);break;case"ac3":this.parseAC3PES(c,y);break}o={data:[],size:0}}o&&(o.data.push(e.subarray(I,R+Pn)),o.size+=R+Pn-I);break;case a:T&&(d&&(y=zs(d))&&this.parseID3PES(p,y),d={data:[],size:0}),d&&(d.data.push(e.subarray(I,R+Pn)),d.size+=R+Pn-I);break;case 0:T&&(I+=e[I]+1),v=this._pmtId=$5(e,I);break;case v:{T&&(I+=e[I]+1);const x=e4(e,I,this.typeSupported,u);i=x.videoPid,i>0&&(l.pid=i,l.segmentCodec=x.segmentVideoCodec),n=x.audioPid,n>0&&(c.pid=n,c.segmentCodec=x.segmentAudioCodec),a=x.id3Pid,a>0&&(p.pid=a),g!==null&&!m&&(Ft.warn(`MPEG-TS PMT found at ${R} after unknown PID '${g}'. Backtracking to sync byte @${w} to parse all TS packets.`),g=null,R=w-188),m=this.pmtParsed=!0;break}case 17:case 8191:break;default:g=P;break}}else C++;if(C>0){const R=new Error(`Found ${C} TS packet/s that do not start with 0x47`);this.observer.emit(rt.ERROR,rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.FRAG_PARSING_ERROR,fatal:!1,error:R,reason:R.message})}l.pesData=t,c.pesData=o,p.pesData=d;const D={audioTrack:c,videoTrack:l,id3Track:p,textTrack:r};return A&&this.extractRemainingSamples(D),D}flush(){const{remainderData:e}=this;this.remainderData=null;let s;return e?s=this.demux(e,-1,!1,!0):s={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(s),this.sampleAes?this.decrypt(s,this.sampleAes):s}extractRemainingSamples(e){const{audioTrack:s,videoTrack:u,id3Track:A,textTrack:y}=e,l=u.pesData,c=s.pesData,p=A.pesData;let r;if(l&&(r=zs(l))){if(this.videoParser===null)switch(u.segmentCodec){case"avc":this.videoParser=new qh;break;case"hevc":this.videoParser=new Yh;break}this.videoParser!==null&&(this.videoParser.parsePES(u,y,r,!0,this._duration),u.pesData=null)}else u.pesData=l;if(c&&(r=zs(c))){switch(s.segmentCodec){case"aac":this.parseAACPES(s,r);break;case"mp3":this.parseMPEGPES(s,r);break;case"ac3":this.parseAC3PES(s,r);break}s.pesData=null}else c!=null&&c.size&&Ft.log("last AAC PES packet truncated,might overlap between fragments"),s.pesData=c;p&&(r=zs(p))?(this.parseID3PES(A,r),A.pesData=null):A.pesData=p}demuxSampleAes(e,s,u){const A=this.demux(e,u,!0,!this.config.progressive),y=this.sampleAes=new X5(this.observer,this.config,s);return this.decrypt(A,y)}decrypt(e,s){return new Promise(u=>{const{audioTrack:A,videoTrack:y}=e;A.samples&&A.segmentCodec==="aac"?s.decryptAacSamples(A.samples,0,()=>{y.samples?s.decryptAvcSamples(y.samples,0,0,()=>{u(e)}):u(e)}):y.samples&&s.decryptAvcSamples(y.samples,0,0,()=>{u(e)})})}destroy(){this._duration=0}parseAACPES(e,s){let u=0;const A=this.aacOverFlow;let y=s.data;if(A){this.aacOverFlow=null;const t=A.missing,n=A.sample.unit.byteLength;if(t===-1)y=Ar(A.sample.unit,y);else{const a=n-t;A.sample.unit.set(y.subarray(0,t),a),e.samples.push(A.sample),u=A.missing}}let l,c;for(l=u,c=y.length;l0;)c+=p}}parseID3PES(e,s){if(s.pts===void 0){Ft.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const u=xn({},s,{type:this._videoTrack?xr.emsg:xr.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(u)}}function qc(_,e){return((_[e+1]&31)<<8)+_[e+2]}function $5(_,e){return(_[e+10]&31)<<8|_[e+11]}function e4(_,e,s,u){const A={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},y=(_[e+1]&15)<<8|_[e+2],l=e+3+y-4,c=(_[e+10]&15)<<8|_[e+11];for(e+=12+c;e0){let i=e+5,t=r;for(;t>2;){switch(_[i]){case 106:s.ac3!==!0?Ft.log("AC-3 audio found, not supported in this browser for now"):(A.audioPid=p,A.segmentAudioCodec="ac3");break}const a=_[i+1]+2;i+=a,t-=a}}break;case 194:case 135:Ft.warn("Unsupported EC-3 in M2TS found");break;case 36:A.videoPid===-1&&(A.videoPid=p,A.segmentVideoCodec="hevc",Ft.log("HEVC in M2TS found"));break}e+=r+5}return A}function gc(_){Ft.log(`${_} with AES-128-CBC encryption found in unencrypted stream`)}function zs(_){let e=0,s,u,A,y,l;const c=_.data;if(!_||_.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=Ar(c[0],c[1]),c.splice(1,1);if(s=c[0],(s[0]<<16)+(s[1]<<8)+s[2]===1){if(u=(s[4]<<8)+s[5],u&&u>_.size-6)return null;const r=s[7];r&192&&(y=(s[9]&14)*536870912+(s[10]&255)*4194304+(s[11]&254)*16384+(s[12]&255)*128+(s[13]&254)/2,r&64?(l=(s[14]&14)*536870912+(s[15]&255)*4194304+(s[16]&254)*16384+(s[17]&255)*128+(s[18]&254)/2,y-l>60*9e4&&(Ft.warn(`${Math.round((y-l)/9e4)}s delta between PTS and DTS, align them`),y=l)):l=y),A=s[8];let i=A+9;if(_.size<=i)return null;_.size-=i;const t=new Uint8Array(_.size);for(let n=0,a=c.length;no){i-=o;continue}else s=s.subarray(i),o-=i,i=0;t.set(s,e),e+=o}return u&&(u-=A+3),{data:t,pts:y,dts:l,len:u}}return null}class t4 extends kd{resetInitSegment(e,s,u,A){super.resetInitSegment(e,s,u,A),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:s,duration:A,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const s=Ra(e,0);let u=(s==null?void 0:s.length)||0;if(s&&e[u]===11&&e[u+1]===119&&_d(s)!==void 0&&t0(e,u)<=16)return!1;for(let A=e.length;u>24&255,l[1]=u>>16&255,l[2]=u>>8&255,l[3]=u&255,l.set(e,4),A=0,u=8;A>24&255,e>>16&255,e>>8&255,e&255,u>>24,u>>16&255,u>>8&255,u&255,A>>24,A>>16&255,A>>8&255,A&255,85,196,0,0]))}static mdia(e){return Nt.box(Nt.types.mdia,Nt.mdhd(e.timescale,e.duration),Nt.hdlr(e.type),Nt.minf(e))}static mfhd(e){return Nt.box(Nt.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?Nt.box(Nt.types.minf,Nt.box(Nt.types.smhd,Nt.SMHD),Nt.DINF,Nt.stbl(e)):Nt.box(Nt.types.minf,Nt.box(Nt.types.vmhd,Nt.VMHD),Nt.DINF,Nt.stbl(e))}static moof(e,s,u){return Nt.box(Nt.types.moof,Nt.mfhd(e),Nt.traf(u,s))}static moov(e){let s=e.length;const u=[];for(;s--;)u[s]=Nt.trak(e[s]);return Nt.box.apply(null,[Nt.types.moov,Nt.mvhd(e[0].timescale,e[0].duration)].concat(u).concat(Nt.mvex(e)))}static mvex(e){let s=e.length;const u=[];for(;s--;)u[s]=Nt.trex(e[s]);return Nt.box.apply(null,[Nt.types.mvex,...u])}static mvhd(e,s){s*=e;const u=Math.floor(s/(as+1)),A=Math.floor(s%(as+1)),y=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,u>>24,u>>16&255,u>>8&255,u&255,A>>24,A>>16&255,A>>8&255,A&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 Nt.box(Nt.types.mvhd,y)}static sdtp(e){const s=e.samples||[],u=new Uint8Array(4+s.length);let A,y;for(A=0;A>>8&255),s.push(l&255),s=s.concat(Array.prototype.slice.call(y));for(A=0;A>>8&255),u.push(l&255),u=u.concat(Array.prototype.slice.call(y));const c=Nt.box(Nt.types.avcC,new Uint8Array([1,s[3],s[4],s[5],255,224|e.sps.length].concat(s).concat([e.pps.length]).concat(u))),p=e.width,r=e.height,i=e.pixelRatio[0],t=e.pixelRatio[1];return Nt.box(Nt.types.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,p>>8&255,p&255,r>>8&255,r&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),c,Nt.box(Nt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Nt.box(Nt.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,t>>24,t>>16&255,t>>8&255,t&255])))}static esds(e){const s=e.config.length;return new Uint8Array([0,0,0,0,3,23+s,0,1,0,4,15+s,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([s]).concat(e.config).concat([6,1,2]))}static audioStsd(e){const s=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,s>>8&255,s&255,0,0])}static mp4a(e){return Nt.box(Nt.types.mp4a,Nt.audioStsd(e),Nt.box(Nt.types.esds,Nt.esds(e)))}static mp3(e){return Nt.box(Nt.types[".mp3"],Nt.audioStsd(e))}static ac3(e){return Nt.box(Nt.types["ac-3"],Nt.audioStsd(e),Nt.box(Nt.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?Nt.box(Nt.types.stsd,Nt.STSD,Nt.mp3(e)):e.segmentCodec==="ac3"?Nt.box(Nt.types.stsd,Nt.STSD,Nt.ac3(e)):Nt.box(Nt.types.stsd,Nt.STSD,Nt.mp4a(e)):e.segmentCodec==="avc"?Nt.box(Nt.types.stsd,Nt.STSD,Nt.avc1(e)):Nt.box(Nt.types.stsd,Nt.STSD,Nt.hvc1(e))}static tkhd(e){const s=e.id,u=e.duration*e.timescale,A=e.width,y=e.height,l=Math.floor(u/(as+1)),c=Math.floor(u%(as+1));return Nt.box(Nt.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,s>>24&255,s>>16&255,s>>8&255,s&255,0,0,0,0,l>>24,l>>16&255,l>>8&255,l&255,c>>24,c>>16&255,c>>8&255,c&255,0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,A>>8&255,A&255,0,0,y>>8&255,y&255,0,0]))}static traf(e,s){const u=Nt.sdtp(e),A=e.id,y=Math.floor(s/(as+1)),l=Math.floor(s%(as+1));return Nt.box(Nt.types.traf,Nt.box(Nt.types.tfhd,new Uint8Array([0,0,0,0,A>>24,A>>16&255,A>>8&255,A&255])),Nt.box(Nt.types.tfdt,new Uint8Array([1,0,0,0,y>>24,y>>16&255,y>>8&255,y&255,l>>24,l>>16&255,l>>8&255,l&255])),Nt.trun(e,u.length+16+20+8+16+8+8),u)}static trak(e){return e.duration=e.duration||4294967295,Nt.box(Nt.types.trak,Nt.tkhd(e),Nt.mdia(e))}static trex(e){const s=e.id;return Nt.box(Nt.types.trex,new Uint8Array([0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,s){const u=e.samples||[],A=u.length,y=12+16*A,l=new Uint8Array(y);let c,p,r,i,t,n;for(s+=8+y,l.set([e.type==="video"?1:0,0,15,1,A>>>24&255,A>>>16&255,A>>>8&255,A&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255],0),c=0;c>>24&255,r>>>16&255,r>>>8&255,r&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t.isLeading<<2|t.dependsOn,t.isDependedOn<<6|t.hasRedundancy<<4|t.paddingValue<<1|t.isNonSync,t.degradPrio&61440,t.degradPrio&15,n>>>24&255,n>>>16&255,n>>>8&255,n&255],12+16*c);return Nt.box(Nt.types.trun,l)}static initSegment(e){Nt.types||Nt.init();const s=Nt.moov(e);return Ar(Nt.FTYP,s)}static hvc1(e){const s=e.params,u=[e.vps,e.sps,e.pps],A=4,y=new Uint8Array([1,s.general_profile_space<<6|(s.general_tier_flag?32:0)|s.general_profile_idc,s.general_profile_compatibility_flags[0],s.general_profile_compatibility_flags[1],s.general_profile_compatibility_flags[2],s.general_profile_compatibility_flags[3],s.general_constraint_indicator_flags[0],s.general_constraint_indicator_flags[1],s.general_constraint_indicator_flags[2],s.general_constraint_indicator_flags[3],s.general_constraint_indicator_flags[4],s.general_constraint_indicator_flags[5],s.general_level_idc,240|s.min_spatial_segmentation_idc>>8,255&s.min_spatial_segmentation_idc,252|s.parallelismType,252|s.chroma_format_idc,248|s.bit_depth_luma_minus8,248|s.bit_depth_chroma_minus8,0,parseInt(s.frame_rate.fps),A-1|s.temporal_id_nested<<2|s.num_temporal_layers<<3|(s.frame_rate.fixed?64:0),u.length]);let l=y.length;for(let o=0;o>8,u[o][d].length&255]),l),l+=2,c.set(u[o][d],l),l+=u[o][d].length}const r=Nt.box(Nt.types.hvcC,c),i=e.width,t=e.height,n=e.pixelRatio[0],a=e.pixelRatio[1];return Nt.box(Nt.types.hvc1,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,i>>8&255,i&255,t>>8&255,t&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),r,Nt.box(Nt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Nt.box(Nt.types.pasp,new Uint8Array([n>>24,n>>16&255,n>>8&255,n&255,a>>24,a>>16&255,a>>8&255,a&255])))}}Nt.types=void 0;Nt.HDLR_TYPES=void 0;Nt.STTS=void 0;Nt.STSC=void 0;Nt.STCO=void 0;Nt.STSZ=void 0;Nt.VMHD=void 0;Nt.SMHD=void 0;Nt.STSD=void 0;Nt.FTYP=void 0;Nt.DINF=void 0;const r0=9e4;function Ld(_,e,s=1,u=!1){const A=_*e*s;return u?Math.round(A):A}function i4(_,e,s=1,u=!1){return Ld(_,e,1/s,u)}function Sa(_,e=!1){return Ld(_,1e3,1/r0,e)}function n4(_,e=1){return Ld(_,r0,1/e)}const r4=10*1e3,Qh=1024,s4=1152,a4=1536;let Ws=null,Ac=null;class go{constructor(e,s,u,A=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=s,this.typeSupported=u,this.ISGenerated=!1,Ws===null){const l=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ws=l?parseInt(l[1]):0}if(Ac===null){const y=navigator.userAgent.match(/Safari\/(\d+)/i);Ac=y?parseInt(y[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){Ft.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){Ft.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){Ft.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let s=!1;const u=e.reduce((A,y)=>{const l=y.pts-A;return l<-4294967296?(s=!0,gr(A,y.pts)):l>0?A:y.pts},e[0].pts);return s&&Ft.debug("PTS rollover detected"),u}remux(e,s,u,A,y,l,c,p){let r,i,t,n,a,o,d=y,g=y;const m=e.pid>-1,v=s.pid>-1,b=s.samples.length,w=e.samples.length>0,C=c&&b>0||b>1;if((!m||w)&&(!v||C)||this.ISGenerated||c){if(this.ISGenerated){var R,T,P,L;const G=this.videoTrackConfig;G&&(s.width!==G.width||s.height!==G.height||((R=s.pixelRatio)==null?void 0:R[0])!==((T=G.pixelRatio)==null?void 0:T[0])||((P=s.pixelRatio)==null?void 0:P[1])!==((L=G.pixelRatio)==null?void 0:L[1]))&&this.resetInitSegment()}else t=this.generateIS(e,s,y,l);const I=this.isVideoContiguous;let x=-1,O;if(C&&(x=o4(s.samples),!I&&this.config.forceKeyFrameOnDiscontinuity))if(o=!0,x>0){Ft.warn(`[mp4-remuxer]: Dropped ${x} out of ${b} video samples due to a missing keyframe`);const G=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(x),s.dropped+=x,g+=(s.samples[0].pts-G)/s.inputTimeScale,O=g}else x===-1&&(Ft.warn(`[mp4-remuxer]: No keyframe found out of ${b} video samples`),o=!1);if(this.ISGenerated){if(w&&C){const G=this.getVideoStartPts(s.samples),te=(gr(e.samples[0].pts,G)-G)/s.inputTimeScale;d+=Math.max(0,te),g+=Math.max(0,-te)}if(w){if(e.samplerate||(Ft.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),t=this.generateIS(e,s,y,l)),i=this.remuxAudio(e,d,this.isAudioContiguous,l,v||C||p===Hi.AUDIO?g:void 0),C){const G=i?i.endPTS-i.startPTS:0;s.inputTimeScale||(Ft.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),t=this.generateIS(e,s,y,l)),r=this.remuxVideo(s,g,I,G)}}else C&&(r=this.remuxVideo(s,g,I,0));r&&(r.firstKeyFrame=x,r.independent=x!==-1,r.firstKeyFramePTS=O)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(u.samples.length&&(a=s0(u,y,this._initPTS,this._initDTS)),A.samples.length&&(n=a0(A,y,this._initPTS))),{audio:i,video:r,initSegment:t,independent:o,text:n,id3:a}}generateIS(e,s,u,A){const y=e.samples,l=s.samples,c=this.typeSupported,p={},r=this._initPTS;let i=!r||A,t="audio/mp4",n,a,o;if(i&&(n=a=1/0),e.config&&y.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":c.mpeg?(t="audio/mpeg",e.codec=""):c.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}p.audio={id:"audio",container:t,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&c.mpeg?new Uint8Array(0):Nt.initSegment([e]),metadata:{channelCount:e.channelCount}},i&&(o=e.inputTimeScale,!r||o!==r.timescale?n=a=y[0].pts-Math.round(o*u):i=!1)}if(s.sps&&s.pps&&l.length){if(s.timescale=s.inputTimeScale,p.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:Nt.initSegment([s]),metadata:{width:s.width,height:s.height}},i)if(o=s.inputTimeScale,!r||o!==r.timescale){const d=this.getVideoStartPts(l),g=Math.round(o*u);a=Math.min(a,gr(l[0].dts,d)-g),n=Math.min(n,d-g)}else i=!1;this.videoTrackConfig={width:s.width,height:s.height,pixelRatio:s.pixelRatio}}if(Object.keys(p).length)return this.ISGenerated=!0,i?(this._initPTS={baseTime:n,timescale:o},this._initDTS={baseTime:a,timescale:o}):n=o=void 0,{tracks:p,initPTS:n,timescale:o}}remuxVideo(e,s,u,A){const y=e.inputTimeScale,l=e.samples,c=[],p=l.length,r=this._initPTS;let i=this.nextAvcDts,t=8,n=this.videoSampleDuration,a,o,d=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,m=!1;if(!u||i===null){const ee=s*y,M=l[0].pts-gr(l[0].dts,l[0].pts);Ws&&i!==null&&Math.abs(ee-M-i)<15e3?u=!0:i=ee-M}const v=r.baseTime*y/r.timescale;for(let ee=0;ee0?ee-1:ee].dts&&(m=!0)}m&&l.sort(function(ee,M){const Y=ee.dts-M.dts,j=ee.pts-M.pts;return Y||j}),a=l[0].dts,o=l[l.length-1].dts;const b=o-a,w=b?Math.round(b/(p-1)):n||e.inputTimeScale/30;if(u){const ee=a-i,M=ee>w,Y=ee<-1;if((M||Y)&&(M?Ft.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Sa(ee,!0)} ms (${ee}dts) hole between fragments detected at ${s.toFixed(3)}`):Ft.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Sa(-ee,!0)} ms (${ee}dts) overlapping between fragments detected at ${s.toFixed(3)}`),!Y||i>=l[0].pts||Ws)){a=i;const j=l[0].pts-ee;if(M)l[0].dts=a,l[0].pts=j;else for(let z=0;zj);z++)l[z].dts-=ee,l[z].pts-=ee;Ft.log(`Video: Initial PTS/DTS adjusted: ${Sa(j,!0)}/${Sa(a,!0)}, delta: ${Sa(ee,!0)} ms`)}}a=Math.max(0,a);let C=0,D=0,R=a;for(let ee=0;ee0?M.dts-l[ee-1].dts:w;if(z=ee>0?M.pts-l[ee-1].pts:w,Z.stretchShortVideoTrack&&this.nextAudioPts!==null){const oe=Math.floor(Z.maxBufferHole*y),he=(A?d+A*y:this.nextAudioPts)-M.pts;he>oe?(n=he-X,n<0?n=X:I=!0,Ft.log(`[mp4-remuxer]: It is approximately ${he/90} ms to the next segment; using duration ${n/90} ms for the last video frame.`)):n=X}else n=X}const q=Math.round(M.pts-M.dts);x=Math.min(x,n),G=Math.max(G,n),O=Math.min(O,z),J=Math.max(J,z),c.push(new Zh(M.key,n,j,q))}if(c.length){if(Ws){if(Ws<70){const ee=c[0].flags;ee.dependsOn=2,ee.isNonSync=0}}else if(Ac&&J-O0&&(A&&Math.abs(v-m)<9e3||Math.abs(gr(d[0].pts-b,v)-m)<20*i),d.forEach(function(te){te.pts=gr(te.pts-b,v)}),!u||m<0){if(d=d.filter(te=>te.pts>=0),!d.length)return;y===0?m=0:A&&!o?m=Math.max(0,v):m=d[0].pts}if(e.segmentCodec==="aac"){const te=this.config.maxAudioFramesDrift;for(let le=0,ne=m;le=te*i&&j0){R+=g;try{D=new Uint8Array(R)}catch(j){this.observer.emit(rt.ERROR,rt.ERROR,{type:Wi.MUX_ERROR,details:qt.REMUX_ALLOC_ERROR,fatal:!1,error:j,bytes:R,reason:`fail allocating audio mdat ${R}`});return}n||(new DataView(D.buffer).setUint32(0,R),D.set(Nt.types.mdat,4))}else return;D.set(ee,g);const Y=ee.byteLength;g+=Y,a.push(new Zh(!0,r,Y,0)),C=M}const P=a.length;if(!P)return;const L=a[a.length-1];this.nextAudioPts=m=C+p*L.duration;const I=n?new Uint8Array(0):Nt.moof(e.sequenceNumber++,w/p,xn({},e,{samples:a}));e.samples=[];const x=w/l,O=m/l,J={data1:I,data2:D,startPTS:x,endPTS:O,startDTS:x,endDTS:O,type:"audio",hasAudio:!0,hasVideo:!1,nb:P};return this.isAudioContiguous=!0,J}remuxEmptyAudio(e,s,u,A){const y=e.inputTimeScale,l=e.samplerate?e.samplerate:y,c=y/l,p=this.nextAudioPts,r=this._initDTS,i=r.baseTime*9e4/r.timescale,t=(p!==null?p:A.startDTS*y)+i,n=A.endDTS*y+i,a=c*Qh,o=Math.ceil((n-t)/a),d=Jh.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(Ft.warn("[mp4-remuxer]: remux empty Audio"),!d){Ft.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const g=[];for(let m=0;m4294967296;)_+=s;return _}function o4(_){for(let e=0;e<_.length;e++)if(_[e].key)return e;return-1}function s0(_,e,s,u){const A=_.samples.length;if(!A)return;const y=_.inputTimeScale;for(let c=0;cl.pts-c.pts);const y=_.samples;return _.samples=[],{samples:y}}class Zh{constructor(e,s,u,A){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=s,this.size=u,this.cts=A,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class l4{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,s,u,A){this.audioCodec=s,this.videoCodec=u,this.generateInitSegment(y_(e,A)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:s,videoCodec:u}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const A=this.initData=Lp(e);A.audio&&(s=Xh(A.audio,fn.AUDIO)),A.video&&(u=Xh(A.video,fn.VIDEO));const y={};A.audio&&A.video?y.audiovideo={container:"video/mp4",codec:s+","+u,initSegment:e,id:"main"}:A.audio?y.audio={container:"audio/mp4",codec:s,initSegment:e,id:"audio"}:A.video?y.video={container:"video/mp4",codec:u,initSegment:e,id:"main"}:Ft.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=y}remux(e,s,u,A,y,l){var c,p;let{initPTS:r,lastEndTime:i}=this;const t={audio:void 0,video:void 0,text:A,id3:u,initSegment:void 0};Ci(i)||(i=this.lastEndTime=y||0);const n=s.samples;if(!(n!=null&&n.length))return t;const a={initPTS:void 0,timescale:1};let o=this.initData;if((c=o)!=null&&c.length||(this.generateInitSegment(n),o=this.initData),!((p=o)!=null&&p.length))return Ft.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),t;this.emitInitSegment&&(a.tracks=this.initTracks,this.emitInitSegment=!1);const d=b_(n,o),g=v_(o,n),m=g===null?y:g;(c4(r,m,y,d)||a.timescale!==r.timescale&&l)&&(a.initPTS=m-y,r&&r.timescale===1&&Ft.warn(`Adjusting initPTS by ${a.initPTS-r.baseTime}`),this.initPTS=r={baseTime:a.initPTS,timescale:1});const v=e?m-r.baseTime/r.timescale:i,b=v+d;E_(o,n,r.baseTime/r.timescale),d>0?this.lastEndTime=b:(Ft.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const w=!!o.audio,C=!!o.video;let D="";w&&(D+="audio"),C&&(D+="video");const R={data1:n,startPTS:v,startDTS:v,endPTS:b,endDTS:b,type:D,hasAudio:w,hasVideo:C,nb:1,dropped:0};return t.audio=R.type==="audio"?R:void 0,t.video=R.type!=="audio"?R:void 0,t.initSegment=a,t.id3=s0(u,y,r,r),A.samples.length&&(t.text=a0(A,y,r)),t}}function c4(_,e,s,u){if(_===null)return!0;const A=Math.max(u,1),y=e-_.baseTime/_.timescale;return Math.abs(y-s)>A}function Xh(_,e){const s=_==null?void 0:_.codec;if(s&&s.length>4)return s;if(e===fn.AUDIO){if(s==="ec-3"||s==="ac-3"||s==="alac")return s;if(s==="fLaC"||s==="Opus")return Lo(s,!1);const u="mp4a.40.5";return Ft.info(`Parsed audio codec "${s}" or audio object type not handled. Using "${u}"`),u}return Ft.warn(`Unhandled video codec "${s}"`),s==="hvc1"||s==="hev1"?"hvc1.1.6.L120.90":s==="av01"?"av01.0.04M.08":"avc1.42e01e"}let Zr;try{Zr=self.performance.now.bind(self.performance)}catch{Ft.debug("Unable to use Performance API on this environment"),Zr=oa==null?void 0:oa.Date.now}const Ao=[{demux:Q5,remux:l4},{demux:os,remux:go},{demux:Y5,remux:go},{demux:t4,remux:go}];Ao.splice(2,0,{demux:Z5,remux:go});class $h{constructor(e,s,u,A,y){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=s,this.config=u,this.vendor=A,this.id=y}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,s,u,A){const y=u.transmuxing;y.executeStart=Zr();let l=new Uint8Array(e);const{currentTransmuxState:c,transmuxConfig:p}=this;A&&(this.currentTransmuxState=A);const{contiguous:r,discontinuity:i,trackSwitch:t,accurateTimeOffset:n,timeOffset:a,initSegmentChange:o}=A||c,{audioCodec:d,videoCodec:g,defaultInitPts:m,duration:v,initSegmentData:b}=p,w=d4(l,s);if(w&&w.method==="AES-128"){const T=this.getDecrypter();if(T.isSync()){let P=T.softwareDecrypt(l,w.key.buffer,w.iv.buffer);if(u.part>-1&&(P=T.flush()),!P)return y.executeEnd=Zr(),yc(u);l=new Uint8Array(P)}else return this.decryptionPromise=T.webCryptoDecrypt(l,w.key.buffer,w.iv.buffer).then(P=>{const L=this.push(P,null,u);return this.decryptionPromise=null,L}),this.decryptionPromise}const C=this.needsProbing(i,t);if(C){const T=this.configureTransmuxer(l);if(T)return Ft.warn(`[transmuxer] ${T.message}`),this.observer.emit(rt.ERROR,rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.FRAG_PARSING_ERROR,fatal:!1,error:T,reason:T.message}),y.executeEnd=Zr(),yc(u)}(i||t||o||C)&&this.resetInitSegment(b,d,g,v,s),(i||o||C)&&this.resetInitialTimestamp(m),r||this.resetContiguity();const D=this.transmux(l,w,a,n,u),R=this.currentTransmuxState;return R.contiguous=!0,R.discontinuity=!1,R.trackSwitch=!1,y.executeEnd=Zr(),D}flush(e){const s=e.transmuxing;s.executeStart=Zr();const{decrypter:u,currentTransmuxState:A,decryptionPromise:y}=this;if(y)return y.then(()=>this.flush(e));const l=[],{timeOffset:c}=A;if(u){const t=u.flush();t&&l.push(this.push(t,null,e))}const{demuxer:p,remuxer:r}=this;if(!p||!r)return s.executeEnd=Zr(),[yc(e)];const i=p.flush(c);return yo(i)?i.then(t=>(this.flushRemux(l,t,e),l)):(this.flushRemux(l,i,e),l)}flushRemux(e,s,u){const{audioTrack:A,videoTrack:y,id3Track:l,textTrack:c}=s,{accurateTimeOffset:p,timeOffset:r}=this.currentTransmuxState;Ft.log(`[transmuxer.ts]: Flushed fragment ${u.sn}${u.part>-1?" p: "+u.part:""} of level ${u.level}`);const i=this.remuxer.remux(A,y,l,c,r,p,!0,this.id);e.push({remuxResult:i,chunkMeta:u}),u.transmuxing.executeEnd=Zr()}resetInitialTimestamp(e){const{demuxer:s,remuxer:u}=this;!s||!u||(s.resetTimeStamp(e),u.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:s}=this;!e||!s||(e.resetContiguity(),s.resetNextTimestamp())}resetInitSegment(e,s,u,A,y){const{demuxer:l,remuxer:c}=this;!l||!c||(l.resetInitSegment(e,s,u,A),c.resetInitSegment(e,s,u,y))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,s,u,A,y){let l;return s&&s.method==="SAMPLE-AES"?l=this.transmuxSampleAes(e,s,u,A,y):l=this.transmuxUnencrypted(e,u,A,y),l}transmuxUnencrypted(e,s,u,A){const{audioTrack:y,videoTrack:l,id3Track:c,textTrack:p}=this.demuxer.demux(e,s,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(y,l,c,p,s,u,!1,this.id),chunkMeta:A}}transmuxSampleAes(e,s,u,A,y){return this.demuxer.demuxSampleAes(e,s,u).then(l=>({remuxResult:this.remuxer.remux(l.audioTrack,l.videoTrack,l.id3Track,l.textTrack,u,A,!1,this.id),chunkMeta:y}))}configureTransmuxer(e){const{config:s,observer:u,typeSupported:A,vendor:y}=this;let l;for(let n=0,a=Ao.length;n0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(s=e),s}const yc=_=>({remuxResult:{},chunkMeta:_});function yo(_){return"then"in _&&_.then instanceof Function}class u4{constructor(e,s,u,A,y){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=s,this.initSegmentData=u,this.duration=A,this.defaultInitPts=y||null}}class h4{constructor(e,s,u,A,y,l){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=s,this.accurateTimeOffset=u,this.trackSwitch=A,this.timeOffset=y,this.initSegmentChange=l}}var o0={exports:{}};(function(_){var e=Object.prototype.hasOwnProperty,s="~";function u(){}Object.create&&(u.prototype=Object.create(null),new u().__proto__||(s=!1));function A(p,r,i){this.fn=p,this.context=r,this.once=i||!1}function y(p,r,i,t,n){if(typeof i!="function")throw new TypeError("The listener must be a function");var a=new A(i,t||p,n),o=s?s+r:r;return p._events[o]?p._events[o].fn?p._events[o]=[p._events[o],a]:p._events[o].push(a):(p._events[o]=a,p._eventsCount++),p}function l(p,r){--p._eventsCount===0?p._events=new u:delete p._events[r]}function c(){this._events=new u,this._eventsCount=0}c.prototype.eventNames=function(){var r=[],i,t;if(this._eventsCount===0)return r;for(t in i=this._events)e.call(i,t)&&r.push(s?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(i)):r},c.prototype.listeners=function(r){var i=s?s+r:r,t=this._events[i];if(!t)return[];if(t.fn)return[t.fn];for(var n=0,a=t.length,o=new Array(a);n{t=t||{},t.frag=this.frag,t.id=this.id,i===rt.ERROR&&(this.error=t.error),this.hls.trigger(i,t)};this.observer=new Dd,this.observer.on(rt.FRAG_DECRYPTED,l),this.observer.on(rt.ERROR,l);const c=ua(y.preferManagedMediaSource)||{isTypeSupported:()=>!1},p={mpeg:c.isTypeSupported("audio/mpeg"),mp3:c.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:c.isTypeSupported('audio/mp4; codecs="ac-3"')},r=navigator.vendor;if(this.useWorker&&typeof Worker<"u"&&(y.workerPath||M5())){try{y.workerPath?(Ft.log(`loading Web Worker ${y.workerPath} for "${s}"`),this.workerContext=B5(y.workerPath)):(Ft.log(`injecting Web Worker for "${s}"`),this.workerContext=P5()),this.onwmsg=n=>this.onWorkerMessage(n);const{worker:t}=this.workerContext;t.addEventListener("message",this.onwmsg),t.onerror=n=>{const a=new Error(`${n.message} (${n.filename}:${n.lineno})`);y.enableWorker=!1,Ft.warn(`Error in "${s}" Web Worker, fallback to inline`),this.hls.trigger(rt.ERROR,{type:Wi.OTHER_ERROR,details:qt.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:a})},t.postMessage({cmd:"init",typeSupported:p,vendor:r,id:s,config:JSON.stringify(y)})}catch(t){Ft.warn(`Error setting up "${s}" Web Worker, fallback to inline`,t),this.resetWorker(),this.error=null,this.transmuxer=new $h(this.observer,p,y,r,s)}return}this.transmuxer=new $h(this.observer,p,y,r,s)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:s}=this.workerContext;s&&self.URL.revokeObjectURL(s),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,s,u,A,y,l,c,p,r,i){var t,n;r.transmuxing.start=self.performance.now();const{transmuxer:a}=this,o=l?l.start:y.start,d=y.decryptdata,g=this.frag,m=!(g&&y.cc===g.cc),v=!(g&&r.level===g.level),b=g?r.sn-g.sn:-1,w=this.part?r.part-this.part.index:-1,C=b===0&&r.id>1&&r.id===(g==null?void 0:g.stats.chunkCount),D=!v&&(b===1||b===0&&(w===1||C&&w<=0)),R=self.performance.now();(v||b||y.stats.parsing.start===0)&&(y.stats.parsing.start=R),l&&(w||!D)&&(l.stats.parsing.start=R);const T=!(g&&((t=y.initSegment)==null?void 0:t.url)===((n=g.initSegment)==null?void 0:n.url)),P=new h4(m,D,p,v,o,T);if(!D||m||T){Ft.log(`[transmuxer-interface, ${y.type}]: Starting new transmux session for sn: ${r.sn} p: ${r.part} level: ${r.level} id: ${r.id} discontinuity: ${m} trackSwitch: ${v} contiguous: ${D} accurateTimeOffset: ${p} timeOffset: ${o} - initSegmentChange: ${T}`);const L=new d4(u,y,s,c,i);this.configureTransmuxer(L)}if(this.frag=A,this.part=l,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:d,chunkMeta:r,state:P},e instanceof ArrayBuffer?[e]:[]);else if(a){const L=a.push(e,d,r,P);yo(L)?(a.async=!0,L.then(I=>{this.handleTransmuxComplete(I)}).catch(I=>{this.transmuxerError(I,r,"transmuxer-interface push error")})):(a.async=!1,this.handleTransmuxComplete(L))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:s}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(s){let u=s.flush(e);yo(u)||s.async?(yo(u)||(u=Promise.resolve(u)),u.then(A=>{this.handleFlushResult(A,e)}).catch(A=>{this.transmuxerError(A,e,"transmuxer-interface flush error")})):this.handleFlushResult(u,e)}}transmuxerError(e,s,u){this.hls&&(this.error=e,this.hls.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.FRAG_PARSING_ERROR,chunkMeta:s,fatal:!1,error:e,err:e,reason:u}))}handleFlushResult(e,s){e.forEach(u=>{this.handleTransmuxComplete(u)}),this.onFlush(s)}onWorkerMessage(e){const s=e.data,u=this.hls;switch(s.event){case"init":{var y;const A=(y=this.workerContext)==null?void 0:y.objectURL;A&&self.URL.revokeObjectURL(A);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}case"workerLog":Ft[s.data.logType]&&Ft[s.data.logType](s.data.message);break;default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,u.trigger(s.event,s.data);break}}}configureTransmuxer(e){const{transmuxer:s}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):s&&s.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}function c0(_,e){if(_.length!==e.length)return!1;for(let s=0;s<_.length;s++)if(!ca(_[s].attrs,e[s].attrs))return!1;return!0}function ca(_,e,s){const u=_["STABLE-RENDITION-ID"];return u&&!s?u===e["STABLE-RENDITION-ID"]:!(s||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(y=>_[y]!==e[y])}function Yc(_,e){return e.label.toLowerCase()===_.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(_.lang||"").toLowerCase())}const ef=100;class f4 extends xd{constructor(e,s,u){super(e,s,u,"[audio-stream-controller]",Hi.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.LEVEL_LOADED,this.onLevelLoaded,this),e.on(rt.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(rt.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(rt.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(rt.ERROR,this.onError,this),e.on(rt.BUFFER_RESET,this.onBufferReset,this),e.on(rt.BUFFER_CREATED,this.onBufferCreated,this),e.on(rt.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(rt.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(rt.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(rt.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.LEVEL_LOADED,this.onLevelLoaded,this),e.off(rt.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(rt.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(rt.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(rt.ERROR,this.onError,this),e.off(rt.BUFFER_RESET,this.onBufferReset,this),e.off(rt.BUFFER_CREATED,this.onBufferCreated,this),e.off(rt.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(rt.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(rt.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(rt.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:s,id:u,initPTS:y,timescale:A}){if(u==="main"){const l=s.cc;this.initPTS[s.cc]={baseTime:y,timescale:A},this.log(`InitPTS for cc: ${l} found from main: ${y}`),this.videoTrackCC=l,this.state===ni.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=ni.STOPPED;return}const s=this.lastCurrentTime;this.stopLoad(),this.setInterval(ef),s>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${s.toFixed(3)}`),e=s,this.state=ni.IDLE):(this.loadedmetadata=!1,this.state=ni.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case ni.IDLE:this.doTickIdle();break;case ni.WAITING_TRACK:{var e;const{levels:u,trackId:y}=this,A=u==null||(e=u[y])==null?void 0:e.details;if(A){if(this.waitForCdnTuneIn(A))break;this.state=ni.WAITING_INIT_PTS}break}case ni.FRAG_LOADING_WAITING_RETRY:{var s;const u=performance.now(),y=this.retryDate;if(!y||u>=y||(s=this.media)!=null&&s.seeking){const{levels:A,trackId:l}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((A==null?void 0:A[l])||null),this.state=ni.IDLE}break}case ni.WAITING_INIT_PTS:{const u=this.waitingData;if(u){const{frag:y,part:A,cache:l,complete:c}=u;if(this.initPTS[y.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=ni.FRAG_LOADING;const p=l.flush(),r={frag:y,part:A,payload:p,networkDetails:null};this._handleFragmentLoadProgress(r),c&&super._handleFragmentLoadComplete(r)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${y.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const p=this.getLoadPosition(),r=mn.bufferInfo(this.mediaBuffer,p,this.config.maxBufferHole);Kc(r.end,this.config.maxFragLookUpTolerance,y)<0&&(this.log(`Waiting fragment cc (${y.cc}) @ ${y.start} cancelled because another fragment at ${r.end} is needed`),this.clearWaitingFragment())}}else this.state=ni.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=ni.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:s,media:u,trackId:y}=this,A=e.config;if(!u&&(this.startFragRequested||!A.startFragPrefetch)||!(s!=null&&s[y]))return;const l=s[y],c=l.details;if(!c||c.live&&this.levelLastLoaded!==l||this.waitForCdnTuneIn(c)){this.state=ni.WAITING_TRACK;return}const p=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&p&&(this.bufferFlushed=!1,this.afterBufferFlushed(p,fn.AUDIO,Hi.AUDIO));const r=this.getFwdBufferInfo(p,Hi.AUDIO);if(r===null)return;const{bufferedTrack:i,switchingTrack:t}=this;if(!t&&this._streamEnded(r,c)){e.trigger(rt.BUFFER_EOS,{type:"audio"}),this.state=ni.ENDED;return}const n=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,Hi.MAIN),a=r.len,o=this.getMaxBufferLength(n==null?void 0:n.len),d=c.fragments,g=d[0].start;let m=this.flushing?this.getLoadPosition():r.end;if(t&&u){const C=this.getLoadPosition();i&&!ca(t.attrs,i.attrs)&&(m=C),c.PTSKnown&&Cg||r.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),u.currentTime=g+.05)}if(a>=o&&!t&&mn.end+c.targetduration;if(w||!(n!=null&&n.len)&&r.len){const C=this.getAppendedFrag(v.start,Hi.MAIN);if(C===null||(b||(b=!!C.gap||!!w&&n.len===0),w&&!b||b&&r.nextStart&&r.nextStartnew la(u))}onAudioTrackSwitching(e,s){const u=!!s.url;this.trackId=s.id;const{fragCurrent:y}=this;y&&(y.abortRequests(),this.removeUnbufferedFrags(y.start)),this.resetLoadingState(),u?this.setInterval(ef):this.resetTransmuxer(),u?(this.switchingTrack=s,this.state=ni.IDLE,this.flushAudioIfNeeded(s)):(this.switchingTrack=null,this.bufferedTrack=s,this.state=ni.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,s){this.mainDetails=s.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(rt.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,s){var u;if(this.mainDetails==null){this.cachedTrackLoadedData=s;return}const{levels:y}=this,{details:A,id:l}=s;if(!y){this.warn(`Audio tracks were reset while loading level ${l}`);return}this.log(`Audio track ${l} loaded [${A.startSN},${A.endSN}]${A.lastPartSn?`[part-${A.lastPartSn}-${A.lastPartIndex}]`:""},duration:${A.totalduration}`);const c=y[l];let p=0;if(A.live||(u=c.details)!=null&&u.live){this.checkLiveUpdate(A);const i=this.mainDetails;if(A.deltaUpdateFailed||!i)return;if(!c.details&&A.hasProgramDateTime&&i.hasProgramDateTime)Bo(A,i),p=A.fragments[0].start;else{var r;p=this.alignPlaylists(A,c.details,(r=this.levelLastLoaded)==null?void 0:r.details)}}c.details=A,this.levelLastLoaded=c,!this.startFragRequested&&(this.mainDetails||!A.live)&&this.setStartPosition(c.details,p),this.state===ni.WAITING_TRACK&&!this.waitForCdnTuneIn(A)&&(this.state=ni.IDLE),this.tick()}_handleFragmentLoadProgress(e){var s;const{frag:u,part:y,payload:A}=e,{config:l,trackId:c,levels:p}=this;if(!p){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${u.sn} of level ${u.level} will not be buffered`);return}const r=p[c];if(!r){this.warn("Audio track is undefined on fragment load progress");return}const i=r.details;if(!i){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(u.start);return}const t=l.defaultAudioCodec||r.audioCodec||"mp4a.40.2";let n=this.transmuxer;n||(n=this.transmuxer=new l0(this.hls,Hi.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const a=this.initPTS[u.cc],o=(s=u.initSegment)==null?void 0:s.data;if(a!==void 0){const g=y?y.index:-1,m=g!==-1,v=new Td(u.level,u.sn,u.stats.chunkCount,A.byteLength,g,m);n.push(A,o,t,"",u,y,i.totalduration,!1,v,a)}else{this.log(`Unknown video PTS for cc ${u.cc}, waiting for video PTS before demuxing audio frag ${u.sn} of [${i.startSN} ,${i.endSN}],track ${c}`);const{cache:d}=this.waitingData=this.waitingData||{frag:u,part:y,cache:new Wp,complete:!1};d.push(new Uint8Array(A)),this.waitingVideoCC=this.videoTrackCC,this.state=ni.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,s){const u=s.tracks.audio;u&&(this.mediaBuffer=u.buffer||null),s.tracks.video&&(this.videoBuffer=s.tracks.video.buffer||null)}onFragBuffered(e,s){const{frag:u,part:y}=s;if(u.type!==Hi.AUDIO){if(!this.loadedmetadata&&u.type===Hi.MAIN){const A=this.videoBuffer||this.media;A&&mn.getBuffered(A).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(u)){this.warn(`Fragment ${u.sn}${y?" p: "+y.index:""} of level ${u.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(u.sn!=="initSegment"){this.fragPrevious=u;const A=this.switchingTrack;A&&(this.bufferedTrack=A,this.switchingTrack=null,this.hls.trigger(rt.AUDIO_TRACK_SWITCHED,Dn({},A)))}this.fragBufferedComplete(u,y)}onError(e,s){var u;if(s.fatal){this.state=ni.ERROR;return}switch(s.details){case qt.FRAG_GAP:case qt.FRAG_PARSING_ERROR:case qt.FRAG_DECRYPT_ERROR:case qt.FRAG_LOAD_ERROR:case qt.FRAG_LOAD_TIMEOUT:case qt.KEY_LOAD_ERROR:case qt.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Hi.AUDIO,s);break;case qt.AUDIO_TRACK_LOAD_ERROR:case qt.AUDIO_TRACK_LOAD_TIMEOUT:case qt.LEVEL_PARSING_ERROR:!s.levelRetry&&this.state===ni.WAITING_TRACK&&((u=s.context)==null?void 0:u.type)===ln.AUDIO_TRACK&&(this.state=ni.IDLE);break;case qt.BUFFER_APPEND_ERROR:case qt.BUFFER_FULL_ERROR:if(!s.parent||s.parent!=="audio")return;if(s.details===qt.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(s)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case qt.INTERNAL_EXCEPTION:this.recoverWorkerError(s);break}}onBufferFlushing(e,{type:s}){s!==fn.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:s}){if(s!==fn.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===ni.ENDED&&(this.state=ni.IDLE);const u=this.mediaBuffer||this.media;u&&(this.afterBufferFlushed(u,s,Hi.AUDIO),this.tick())}}_handleTransmuxComplete(e){var s;const u="audio",{hls:y}=this,{remuxResult:A,chunkMeta:l}=e,c=this.getCurrentContext(l);if(!c){this.resetWhenMissingContext(l);return}const{frag:p,part:r,level:i}=c,{details:t}=i,{audio:n,text:a,id3:o,initSegment:d}=A;if(this.fragContextChanged(p)||!t){this.fragmentTracker.removeFragment(p);return}if(this.state=ni.PARSING,this.switchingTrack&&n&&this.completeAudioSwitch(this.switchingTrack),d!=null&&d.tracks){const g=p.initSegment||p;this._bufferInitSegment(i,d.tracks,g,l),y.trigger(rt.FRAG_PARSING_INIT_SEGMENT,{frag:g,id:u,tracks:d.tracks})}if(n){const{startPTS:g,endPTS:m,startDTS:v,endDTS:b}=n;r&&(r.elementaryStreams[fn.AUDIO]={startPTS:g,endPTS:m,startDTS:v,endDTS:b}),p.setElementaryStreamInfo(fn.AUDIO,g,m,v,b),this.bufferFragmentData(n,p,r,l)}if(o!=null&&(s=o.samples)!=null&&s.length){const g=xn({id:u,frag:p,details:t},o);y.trigger(rt.FRAG_PARSING_METADATA,g)}if(a){const g=xn({id:u,frag:p,details:t},a);y.trigger(rt.FRAG_PARSING_USERDATA,g)}}_bufferInitSegment(e,s,u,y){if(this.state!==ni.PARSING)return;s.video&&delete s.video;const A=s.audio;if(!A)return;A.id="audio";const l=e.audioCodec;this.log(`Init audio buffer, container:${A.container}, codecs[level/parsed]=[${l}/${A.codec}]`),l&&l.split(",").length===1&&(A.levelCodec=l),this.hls.trigger(rt.BUFFER_CODECS,s);const c=A.initSegment;if(c!=null&&c.byteLength){const p={type:"audio",frag:u,part:null,chunkMeta:y,parent:u.type,data:c};this.hls.trigger(rt.BUFFER_APPENDING,p)}this.tickImmediate()}loadFragment(e,s,u){const y=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||y===Fn.NOT_LOADED||y===Fn.PARTIAL){var A;if(e.sn==="initSegment")this._loadInitSegment(e,s);else if((A=s.details)!=null&&A.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=ni.WAITING_INIT_PTS;const l=this.mainDetails;l&&l.fragments[0].start!==s.details.fragments[0].start&&Bo(s.details,l)}else this.startFragRequested=!0,super.loadFragment(e,s,u)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){const{media:s,bufferedTrack:u}=this,y=u==null?void 0:u.attrs,A=e.attrs;s&&y&&(y.CHANNELS!==A.CHANNELS||u.name!==e.name||u.lang!==e.lang)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}completeAudioSwitch(e){const{hls:s}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,s.trigger(rt.AUDIO_TRACK_SWITCHED,Dn({},e))}}class p4 extends Sd{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.on(rt.LEVEL_LOADING,this.onLevelLoading,this),e.on(rt.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(rt.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(rt.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.off(rt.LEVEL_LOADING,this.onLevelLoading,this),e.off(rt.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(rt.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(rt.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,s){this.tracks=s.audioTracks||[]}onAudioTrackLoaded(e,s){const{id:u,groupId:y,details:A}=s,l=this.tracksInGroup[u];if(!l||l.groupId!==y){this.warn(`Audio track with id:${u} and group:${y} not found in active group ${l==null?void 0:l.groupId}`);return}const c=l.details;l.details=s.details,this.log(`Audio track ${u} "${l.name}" lang:${l.lang} group:${y} loaded [${A.startSN}-${A.endSN}]`),u===this.trackId&&this.playlistLoaded(u,s,c)}onLevelLoading(e,s){this.switchLevel(s.level)}onLevelSwitching(e,s){this.switchLevel(s.level)}switchLevel(e){const s=this.hls.levels[e];if(!s)return;const u=s.audioGroups||null,y=this.groupIds;let A=this.currentTrack;if(!u||(y==null?void 0:y.length)!==(u==null?void 0:u.length)||u!=null&&u.some(c=>(y==null?void 0:y.indexOf(c))===-1)){this.groupIds=u,this.trackId=-1,this.currentTrack=null;const c=this.tracks.filter(n=>!u||u.indexOf(n.groupId)!==-1);if(c.length)this.selectDefaultTrack&&!c.some(n=>n.default)&&(this.selectDefaultTrack=!1),c.forEach((n,a)=>{n.id=a});else if(!A&&!this.tracksInGroup.length)return;this.tracksInGroup=c;const p=this.hls.config.audioPreference;if(!A&&p){const n=jr(p,c,Vs);if(n>-1)A=c[n];else{const a=jr(p,this.tracks);A=this.tracks[a]}}let r=this.findTrackId(A);r===-1&&A&&(r=this.findTrackId(null));const i={audioTracks:c};this.log(`Updating audio tracks, ${c.length} track(s) found in group(s): ${u==null?void 0:u.join(",")}`),this.hls.trigger(rt.AUDIO_TRACKS_UPDATED,i);const t=this.trackId;if(r!==-1&&t===-1)this.setAudioTrack(r);else if(c.length&&t===-1){var l;const n=new Error(`No audio track selected for current audio group-ID(s): ${(l=this.groupIds)==null?void 0:l.join(",")} track count: ${c.length}`);this.warn(n.message),this.hls.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:n})}}else this.shouldReloadPlaylist(A)&&this.setAudioTrack(this.trackId)}onError(e,s){s.fatal||!s.context||s.context.type===ln.AUDIO_TRACK&&s.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(s.context.groupId)!==-1)&&(this.requestScheduled=-1,this.checkRetry(s))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const s=this.hls;if(s.config.audioPreference=e,e){const u=this.allAudioTracks;if(this.selectDefaultTrack=!1,u.length){const y=this.currentTrack;if(y&&na(e,y,Vs))return y;const A=jr(e,this.tracksInGroup,Vs);if(A>-1){const l=this.tracksInGroup[A];return this.setAudioTrack(A),l}else if(y){let l=s.loadLevel;l===-1&&(l=s.firstAutoLevel);const c=g5(e,s.levels,u,l,Vs);if(c===-1)return null;s.nextLoadLevel=c}if(e.channels||e.audioCodec){const l=jr(e,u);if(l>-1)return u[l]}}}return null}setAudioTrack(e){const s=this.tracksInGroup;if(e<0||e>=s.length){this.warn(`Invalid audio track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const u=this.currentTrack,y=s[e],A=y.details&&!y.details.live;if(e===this.trackId&&y===u&&A||(this.log(`Switching to audio-track ${e} "${y.name}" lang:${y.lang} group:${y.groupId} channels:${y.channels}`),this.trackId=e,this.currentTrack=y,this.hls.trigger(rt.AUDIO_TRACK_SWITCHING,Dn({},y)),A))return;const l=this.switchParams(y.url,u==null?void 0:u.details);this.loadPlaylist(l)}findTrackId(e){const s=this.tracksInGroup;for(let u=0;u=A[r].start&&c<=A[r].end){l=A[r];break}const p=u.start+u.duration;l?l.end=p:(l={start:c,end:p},A.push(l)),this.fragmentTracker.fragBuffered(u),this.fragBufferedComplete(u,null)}onBufferFlushing(e,s){const{startOffset:u,endOffset:y}=s;if(u===0&&y!==Number.POSITIVE_INFINITY){const A=y-1;if(A<=0)return;s.endOffsetSubtitles=Math.max(0,A),this.tracksBuffered.forEach(l=>{for(let c=0;cnew la(u));return}this.tracksBuffered=[],this.levels=s.map(u=>{const y=new la(u);return this.tracksBuffered[y.id]=[],y}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Hi.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,s){var u;if(this.currentTrackId=s.id,!((u=this.levels)!=null&&u.length)||this.currentTrackId===-1){this.clearInterval();return}const y=this.levels[this.currentTrackId];y!=null&&y.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,y&&this.setInterval(tf)}onSubtitleTrackLoaded(e,s){var u;const{currentTrackId:y,levels:A}=this,{details:l,id:c}=s;if(!A){this.warn(`Subtitle tracks were reset while loading level ${c}`);return}const p=A[y];if(c>=A.length||c!==y||!p)return;this.log(`Subtitle track ${c} loaded [${l.startSN},${l.endSN}]${l.lastPartSn?`[part-${l.lastPartSn}-${l.lastPartIndex}]`:""},duration:${l.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let r=0;if(l.live||(u=p.details)!=null&&u.live){const t=this.mainDetails;if(l.deltaUpdateFailed||!t)return;const n=t.fragments[0];if(!p.details)l.hasProgramDateTime&&t.hasProgramDateTime?(Bo(l,t),r=l.fragments[0].start):n&&(r=n.start,Wc(l,r));else{var i;r=this.alignPlaylists(l,p.details,(i=this.levelLastLoaded)==null?void 0:i.details),r===0&&n&&(r=n.start,Wc(l,r))}}p.details=l,this.levelLastLoaded=p,!this.startFragRequested&&(this.mainDetails||!l.live)&&this.setStartPosition(p.details,r),this.tick(),l.live&&!this.fragCurrent&&this.media&&this.state===ni.IDLE&&(Po(null,l.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),p.details=void 0))}_handleFragmentLoadComplete(e){const{frag:s,payload:u}=e,y=s.decryptdata,A=this.hls;if(!this.fragContextChanged(s)&&u&&u.byteLength>0&&y!=null&&y.key&&y.iv&&y.method==="AES-128"){const l=performance.now();this.decrypter.decrypt(new Uint8Array(u),y.key.buffer,y.iv.buffer).catch(c=>{throw A.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.FRAG_DECRYPT_ERROR,fatal:!1,error:c,reason:c.message,frag:s}),c}).then(c=>{const p=performance.now();A.trigger(rt.FRAG_DECRYPTED,{frag:s,payload:c,stats:{tstart:l,tdecrypt:p}})}).catch(c=>{this.warn(`${c.name}: ${c.message}`),this.state=ni.IDLE})}}doTick(){if(!this.media){this.state=ni.IDLE;return}if(this.state===ni.IDLE){const{currentTrackId:e,levels:s}=this,u=s==null?void 0:s[e];if(!u||!s.length||!u.details)return;const{config:y}=this,A=this.getLoadPosition(),l=mn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],A,y.maxBufferHole),{end:c,len:p}=l,r=this.getFwdBufferInfo(this.media,Hi.MAIN),i=u.details,t=this.getMaxBufferLength(r==null?void 0:r.len)+i.levelTargetDuration;if(p>t)return;const n=i.fragments,a=n.length,o=i.edge;let d=null;const g=this.fragPrevious;if(co-m?0:m;d=Po(g,n,Math.max(n[0].start,c),v),!d&&g&&g.start{if(y=y>>>0,y>A-1)throw new DOMException(`Failed to execute '${u}' on 'TimeRanges': The index provided (${y}) is greater than the maximum bound (${A})`);return e[y][u]};this.buffered={get length(){return e.length},end(u){return s("end",u,e.length)},start(u){return s("start",u,e.length)}}}}class A4 extends Sd{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let s=null;const u=po(this.media.textTracks);for(let A=0;A-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.on(rt.LEVEL_LOADING,this.onLevelLoading,this),e.on(rt.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(rt.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(rt.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.off(rt.LEVEL_LOADING,this.onLevelLoading,this),e.off(rt.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(rt.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(rt.ERROR,this.onError,this)}onMediaAttached(e,s){this.media=s.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),po(this.media.textTracks).forEach(s=>{Zs(s)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,s){this.tracks=s.subtitleTracks}onSubtitleTrackLoaded(e,s){const{id:u,groupId:y,details:A}=s,l=this.tracksInGroup[u];if(!l||l.groupId!==y){this.warn(`Subtitle track with id:${u} and group:${y} not found in active group ${l==null?void 0:l.groupId}`);return}const c=l.details;l.details=s.details,this.log(`Subtitle track ${u} "${l.name}" lang:${l.lang} group:${y} loaded [${A.startSN}-${A.endSN}]`),u===this.trackId&&this.playlistLoaded(u,s,c)}onLevelLoading(e,s){this.switchLevel(s.level)}onLevelSwitching(e,s){this.switchLevel(s.level)}switchLevel(e){const s=this.hls.levels[e];if(!s)return;const u=s.subtitleGroups||null,y=this.groupIds;let A=this.currentTrack;if(!u||(y==null?void 0:y.length)!==(u==null?void 0:u.length)||u!=null&&u.some(l=>(y==null?void 0:y.indexOf(l))===-1)){this.groupIds=u,this.trackId=-1,this.currentTrack=null;const l=this.tracks.filter(i=>!u||u.indexOf(i.groupId)!==-1);if(l.length)this.selectDefaultTrack&&!l.some(i=>i.default)&&(this.selectDefaultTrack=!1),l.forEach((i,t)=>{i.id=t});else if(!A&&!this.tracksInGroup.length)return;this.tracksInGroup=l;const c=this.hls.config.subtitlePreference;if(!A&&c){this.selectDefaultTrack=!1;const i=jr(c,l);if(i>-1)A=l[i];else{const t=jr(c,this.tracks);A=this.tracks[t]}}let p=this.findTrackId(A);p===-1&&A&&(p=this.findTrackId(null));const r={subtitleTracks:l};this.log(`Updating subtitle tracks, ${l.length} track(s) found in "${u==null?void 0:u.join(",")}" group-id`),this.hls.trigger(rt.SUBTITLE_TRACKS_UPDATED,r),p!==-1&&this.trackId===-1&&this.setSubtitleTrack(p)}else this.shouldReloadPlaylist(A)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const s=this.tracksInGroup,u=this.selectDefaultTrack;for(let y=0;y-1){const A=this.tracksInGroup[y];return this.setSubtitleTrack(y),A}else{if(u)return null;{const A=jr(e,s);if(A>-1)return s[A]}}}}return null}loadPlaylist(e){super.loadPlaylist();const s=this.currentTrack;if(this.shouldLoadPlaylist(s)&&s){const u=s.id,y=s.groupId;let A=s.url;if(e)try{A=e.addDirectives(A)}catch(l){this.warn(`Could not construct new URL with HLS Delivery Directives: ${l}`)}this.log(`Loading subtitle playlist for id ${u}`),this.hls.trigger(rt.SUBTITLE_TRACK_LOADING,{url:A,id:u,groupId:y,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const s=po(e.textTracks),u=this.currentTrack;let y;if(u&&(y=s.filter(A=>Yc(u,A))[0],y||this.warn(`Unable to find subtitle TextTrack with name "${u.name}" and language "${u.lang}"`)),[].slice.call(s).forEach(A=>{A.mode!=="disabled"&&A!==y&&(A.mode="disabled")}),y){const A=this.subtitleDisplay?"showing":"hidden";y.mode!==A&&(y.mode=A)}}setSubtitleTrack(e){const s=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=s.length||!Ci(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const u=this.currentTrack,y=s[e]||null;if(this.trackId=e,this.currentTrack=y,this.toggleTrackModes(),!y){this.hls.trigger(rt.SUBTITLE_TRACK_SWITCH,{id:e});return}const A=!!y.details&&!y.details.live;if(e===this.trackId&&y===u&&A)return;this.log(`Switching to subtitle-track ${e}`+(y?` "${y.name}" lang:${y.lang} group:${y.groupId}`:""));const{id:l,groupId:c="",name:p,type:r,url:i}=y;this.hls.trigger(rt.SUBTITLE_TRACK_SWITCH,{id:l,groupId:c,name:p,type:r,url:i});const t=this.switchParams(y.url,u==null?void 0:u.details);this.loadPlaylist(t)}}class y4{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,s,u){const y=this.queues[s];y.push(e),y.length===1&&!u&&this.executeNext(s)}insertAbort(e,s){this.queues[s].unshift(e),this.executeNext(s)}appendBlocker(e){let s;const u=new Promise(A=>{s=A}),y={execute:s,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(y,e),u}executeNext(e){const s=this.queues[e];if(s.length){const u=s[0];try{u.execute()}catch(y){Ft.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${y}`),u.onError(y);const A=this.buffers[e];A!=null&&A.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const nf=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class v4{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=u=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=u=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:u,mediaSource:y}=this;this.log("Media source opened"),u&&(u.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(rt.MEDIA_ATTACHED,{media:u,mediaSource:y})),y&&y.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:u,_objectUrl:y}=this;u!==y&&Ft.error(`Media element src was set while attaching MediaSource (${y} > ${u})`)},this.hls=e;const s="[buffer-controller]";this.appendSource=e.config.preferManagedMediaSource,this.log=Ft.log.bind(Ft,s),this.warn=Ft.warn.bind(Ft,s),this.error=Ft.error.bind(Ft,s),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:e}=this;e.on(rt.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.on(rt.BUFFER_RESET,this.onBufferReset,this),e.on(rt.BUFFER_APPENDING,this.onBufferAppending,this),e.on(rt.BUFFER_CODECS,this.onBufferCodecs,this),e.on(rt.BUFFER_EOS,this.onBufferEos,this),e.on(rt.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(rt.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(rt.FRAG_PARSED,this.onFragParsed,this),e.on(rt.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(rt.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.off(rt.BUFFER_RESET,this.onBufferReset,this),e.off(rt.BUFFER_APPENDING,this.onBufferAppending,this),e.off(rt.BUFFER_CODECS,this.onBufferCodecs,this),e.off(rt.BUFFER_EOS,this.onBufferEos,this),e.off(rt.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(rt.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(rt.FRAG_PARSED,this.onFragParsed,this),e.off(rt.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new y4(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,s){let u=2;(s.audio&&!s.video||!s.altAudio)&&(u=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=u,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,s){const u=this.media=s.media,y=ua(this.appendSource);if(u&&y){var A;const l=this.mediaSource=new y;this.log(`created media source: ${(A=l.constructor)==null?void 0:A.name}`),l.addEventListener("sourceopen",this._onMediaSourceOpen),l.addEventListener("sourceended",this._onMediaSourceEnded),l.addEventListener("sourceclose",this._onMediaSourceClose),l.addEventListener("startstreaming",this._onStartStreaming),l.addEventListener("endstreaming",this._onEndStreaming);const c=this._objectUrl=self.URL.createObjectURL(l);if(this.appendSource)try{u.removeAttribute("src");const p=self.ManagedMediaSource;u.disableRemotePlayback=u.disableRemotePlayback||p&&l instanceof p,rf(u),b4(u,c),u.load()}catch{u.src=c}else u.src=c;u.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:s,_objectUrl:u}=this;if(s){if(this.log("media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(y){this.warn(`onMediaDetaching: ${y.message} while calling endOfStream`)}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),s.removeEventListener("startstreaming",this._onStartStreaming),s.removeEventListener("endstreaming",this._onEndStreaming),e&&(e.removeEventListener("emptied",this._onMediaEmptied),u&&self.URL.revokeObjectURL(u),this.mediaSrc===u?(e.removeAttribute("src"),this.appendSource&&rf(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(rt.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{this.resetBuffer(e)}),this._initSourceBuffer()}resetBuffer(e){const s=this.sourceBuffer[e];try{if(s){var u;this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,(u=this.mediaSource)!=null&&u.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(s)}}catch(y){this.warn(`onBufferReset ${e}`,y)}}onBufferCodecs(e,s){const u=this.getSourceBufferTypes().length,y=Object.keys(s);if(y.forEach(l=>{if(u){const p=this.tracks[l];if(p&&typeof p.buffer.changeType=="function"){var c;const{id:r,codec:i,levelCodec:t,container:n,metadata:a}=s[l],o=Sh(p.codec,p.levelCodec),d=o==null?void 0:o.replace(nf,"$1");let g=Sh(i,t);const m=(c=g)==null?void 0:c.replace(nf,"$1");if(g&&d!==m){l.slice(0,5)==="audio"&&(g=Lo(g,this.hls.config.preferManagedMediaSource));const v=`${n};codecs=${g}`;this.appendChangeType(l,v),this.log(`switching codec ${o} to ${g}`),this.tracks[l]={buffer:p.buffer,codec:i,container:n,levelCodec:t,metadata:a,id:r}}}}else this.pendingTracks[l]=s[l]}),u)return;const A=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==A&&(this.log(`${A} bufferCodec event(s) expected ${y.join(",")}`),this.bufferCodecEventsExpected=A),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(e,s){const{operationQueue:u}=this,y={execute:()=>{const A=this.sourceBuffer[e];A&&(this.log(`changing ${e} sourceBuffer type to ${s}`),A.changeType(s)),u.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:A=>{this.warn(`Failed to change ${e} SourceBuffer type`,A)}};u.append(y,e,!!this.pendingTracks[e])}onBufferAppending(e,s){const{hls:u,operationQueue:y,tracks:A}=this,{data:l,type:c,frag:p,part:r,chunkMeta:i}=s,t=i.buffering[c],n=self.performance.now();t.start=n;const a=p.stats.buffering,o=r?r.stats.buffering:null;a.start===0&&(a.start=n),o&&o.start===0&&(o.start=n);const d=A.audio;let g=!1;c==="audio"&&(d==null?void 0:d.container)==="audio/mpeg"&&(g=!this.lastMpegAudioChunk||i.id===1||this.lastMpegAudioChunk.sn!==i.sn,this.lastMpegAudioChunk=i);const m=p.start,v={execute:()=>{if(t.executeStart=self.performance.now(),g){const b=this.sourceBuffer[c];if(b){const w=m-b.timestampOffset;Math.abs(w)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${m} (delta: ${w}) sn: ${p.sn})`),b.timestampOffset=m)}}this.appendExecutor(l,c)},onStart:()=>{},onComplete:()=>{const b=self.performance.now();t.executeEnd=t.end=b,a.first===0&&(a.first=b),o&&o.first===0&&(o.first=b);const{sourceBuffer:w}=this,C={};for(const D in w)C[D]=mn.getBuffered(w[D]);this.appendErrors[c]=0,c==="audio"||c==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(rt.BUFFER_APPENDED,{type:c,frag:p,part:r,chunkMeta:i,parent:p.type,timeRanges:C})},onError:b=>{const w={type:Wi.MEDIA_ERROR,parent:p.type,details:qt.BUFFER_APPEND_ERROR,sourceBufferName:c,frag:p,part:r,chunkMeta:i,error:b,err:b,fatal:!1};if(b.code===DOMException.QUOTA_EXCEEDED_ERR)w.details=qt.BUFFER_FULL_ERROR;else{const C=++this.appendErrors[c];w.details=qt.BUFFER_APPEND_ERROR,this.warn(`Failed ${C}/${u.config.appendErrorMaxRetry} times to append segment in "${c}" sourceBuffer`),C>=u.config.appendErrorMaxRetry&&(w.fatal=!0)}u.trigger(rt.ERROR,w)}};y.append(v,c,!!this.pendingTracks[c])}onBufferFlushing(e,s){const{operationQueue:u}=this,y=A=>({execute:this.removeExecutor.bind(this,A,s.startOffset,s.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(rt.BUFFER_FLUSHED,{type:A})},onError:l=>{this.warn(`Failed to remove from ${A} SourceBuffer`,l)}});s.type?u.append(y(s.type),s.type):this.getSourceBufferTypes().forEach(A=>{u.append(y(A),A)})}onFragParsed(e,s){const{frag:u,part:y}=s,A=[],l=y?y.elementaryStreams:u.elementaryStreams;l[fn.AUDIOVIDEO]?A.push("audiovideo"):(l[fn.AUDIO]&&A.push("audio"),l[fn.VIDEO]&&A.push("video"));const c=()=>{const p=self.performance.now();u.stats.buffering.end=p,y&&(y.stats.buffering.end=p);const r=y?y.stats:u.stats;this.hls.trigger(rt.FRAG_BUFFERED,{frag:u,part:y,stats:r,id:u.type})};A.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${u.type} level: ${u.level} sn: ${u.sn}`),this.blockBuffers(c,A)}onFragChanged(e,s){this.trimBuffers()}onBufferEos(e,s){this.getSourceBufferTypes().reduce((y,A)=>{const l=this.sourceBuffer[A];return l&&(!s.type||s.type===A)&&(l.ending=!0,l.ended||(l.ended=!0,this.log(`${A} sourceBuffer now EOS`))),y&&!!(!l||l.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(A=>{const l=this.sourceBuffer[A];l&&(l.ending=!1)});const{mediaSource:y}=this;if(!y||y.readyState!=="open"){y&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${y.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),y.endOfStream()}))}onLevelUpdated(e,{details:s}){s.fragments.length&&(this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:s,media:u}=this;if(!u||s===null||!this.getSourceBufferTypes().length)return;const A=e.config,l=u.currentTime,c=s.levelTargetDuration,p=s.live&&A.liveBackBufferLength!==null?A.liveBackBufferLength:A.backBufferLength;if(Ci(p)&&p>0){const r=Math.max(p,c),i=Math.floor(l/c)*c-r;this.flushBackBuffer(l,c,i)}if(Ci(A.frontBufferFlushThreshold)&&A.frontBufferFlushThreshold>0){const r=Math.max(A.maxBufferLength,A.frontBufferFlushThreshold),i=Math.max(r,c),t=Math.floor(l/c)*c+i;this.flushFrontBuffer(l,c,t)}}flushBackBuffer(e,s,u){const{details:y,sourceBuffer:A}=this;this.getSourceBufferTypes().forEach(c=>{const p=A[c];if(p){const r=mn.getBuffered(p);if(r.length>0&&u>r.start(0)){if(this.hls.trigger(rt.BACK_BUFFER_REACHED,{bufferEnd:u}),y!=null&&y.live)this.hls.trigger(rt.LIVE_BACK_BUFFER_REACHED,{bufferEnd:u});else if(p.ended&&r.end(r.length-1)-e{const c=y[l];if(c){const p=mn.getBuffered(c),r=p.length;if(r<2)return;const i=p.start(r-1),t=p.end(r-1);if(u>i||e>=i&&e<=t)return;if(c.ended&&e-t<2*s){this.log(`Cannot flush ${l} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(rt.BUFFER_FLUSHING,{startOffset:i,endOffset:1/0,type:l})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:s,media:u,mediaSource:y}=this,A=e.fragments[0].start+e.totalduration,l=u.duration,c=Ci(y.duration)?y.duration:0;e.live&&s.config.liveDurationInfinity?(y.duration=1/0,this.updateSeekableRange(e)):(A>c&&A>l||!Ci(l))&&(this.log(`Updating Media Source duration to ${A.toFixed(3)}`),y.duration=A)}updateSeekableRange(e){const s=this.mediaSource,u=e.fragments;if(u.length&&e.live&&s!=null&&s.setLiveSeekableRange){const A=Math.max(0,u[0].start),l=Math.max(A,A+e.totalduration);this.log(`Media Source duration is set to ${s.duration}. Setting seekable range to ${A}-${l}.`),s.setLiveSeekableRange(A,l)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:s,pendingTracks:u}=this,y=Object.keys(u).length;if(y&&(!e||y===2||"audiovideo"in u)){this.createSourceBuffers(u),this.pendingTracks={};const A=this.getSourceBufferTypes();if(A.length)this.hls.trigger(rt.BUFFER_CREATED,{tracks:this.tracks}),A.forEach(l=>{s.executeNext(l)});else{const l=new Error("could not create source buffer for media codec(s)");this.hls.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:l,reason:l.message})}}}createSourceBuffers(e){const{sourceBuffer:s,mediaSource:u}=this;if(!u)throw Error("createSourceBuffers called when mediaSource was null");for(const y in e)if(!s[y]){const A=e[y];if(!A)throw Error(`source buffer exists for track ${y}, however track does not`);let l=A.levelCodec||A.codec;l&&y.slice(0,5)==="audio"&&(l=Lo(l,this.hls.config.preferManagedMediaSource));const c=`${A.container};codecs=${l}`;this.log(`creating sourceBuffer(${c})`);try{const p=s[y]=u.addSourceBuffer(c),r=y;this.addBufferListener(r,"updatestart",this._onSBUpdateStart),this.addBufferListener(r,"updateend",this._onSBUpdateEnd),this.addBufferListener(r,"error",this._onSBUpdateError),this.addBufferListener(r,"bufferedchange",(i,t)=>{const n=t.removedRanges;n!=null&&n.length&&this.hls.trigger(rt.BUFFER_FLUSHED,{type:y})}),this.tracks[y]={buffer:p,codec:l,container:A.container,levelCodec:A.levelCodec,metadata:A.metadata,id:A.id}}catch(p){this.error(`error while trying to add sourceBuffer: ${p.message}`),this.hls.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:p,sourceBufferName:y,mimeType:c})}}}get mediaSrc(){var e;const s=((e=this.media)==null?void 0:e.firstChild)||this.media;return s==null?void 0:s.src}_onSBUpdateStart(e){const{operationQueue:s}=this;s.current(e).onStart()}_onSBUpdateEnd(e){var s;if(((s=this.mediaSource)==null?void 0:s.readyState)==="closed"){this.resetBuffer(e);return}const{operationQueue:u}=this;u.current(e).onComplete(),u.shiftAndExecuteNext(e)}_onSBUpdateError(e,s){var u;const y=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(u=this.mediaSource)==null?void 0:u.readyState}`);this.error(`${y}`,s),this.hls.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:y,fatal:!1});const A=this.operationQueue.current(e);A&&A.onError(y)}removeExecutor(e,s,u){const{media:y,mediaSource:A,operationQueue:l,sourceBuffer:c}=this,p=c[e];if(!y||!A||!p){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),l.shiftAndExecuteNext(e);return}const r=Ci(y.duration)?y.duration:1/0,i=Ci(A.duration)?A.duration:1/0,t=Math.max(0,s),n=Math.min(u,r,i);n>t&&(!p.ending||p.ended)?(p.ended=!1,this.log(`Removing [${t},${n}] from the ${e} SourceBuffer`),p.remove(t,n)):l.shiftAndExecuteNext(e)}appendExecutor(e,s){const u=this.sourceBuffer[s];if(!u){if(!this.pendingTracks[s])throw new Error(`Attempting to append to the ${s} SourceBuffer, but it does not exist`);return}u.ended=!1,u.appendBuffer(e)}blockBuffers(e,s=this.getSourceBufferTypes()){if(!s.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:u}=this,y=s.map(A=>u.appendBlocker(A));Promise.all(y).then(()=>{e(),s.forEach(A=>{const l=this.sourceBuffer[A];l!=null&&l.updating||u.shiftAndExecuteNext(A)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,s,u){const y=this.sourceBuffer[e];if(!y)return;const A=u.bind(this,e);this.listeners[e].push({event:s,listener:A}),y.addEventListener(s,A)}removeBufferListeners(e){const s=this.sourceBuffer[e];s&&this.listeners[e].forEach(u=>{s.removeEventListener(u.event,u.listener)})}}function rf(_){const e=_.querySelectorAll("source");[].slice.call(e).forEach(s=>{_.removeChild(s)})}function b4(_,e){const s=self.document.createElement("source");s.type="video/mp4",s.src=e,_.appendChild(s)}const sf={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},d0=function(e){let s=e;return sf.hasOwnProperty(e)&&(s=sf[e]),String.fromCharCode(s)},Cr=15,Jr=100,_4={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},E4={17:2,18:4,21:6,22:8,23:10,19:13,20:15},w4={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},S4={25:2,26:4,29:6,30:8,31:10,27:13,28:15},T4=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class C4{constructor(){this.time=null,this.verboseLevel=0}log(e,s){if(this.verboseLevel>=e){const u=typeof s=="function"?s():s;Ft.log(`${this.time} [${e}] ${u}`)}}}const ys=function(e){const s=[];for(let u=0;uJr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Jr)}moveCursor(e){const s=this.pos+e;if(e>1)for(let u=this.pos+1;u=144&&this.backSpace();const s=d0(e);if(this.pos>=Jr){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+s+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(s,this.currPenState),this.moveCursor(1)}clearFromPos(e){let s;for(s=e;s"pacData = "+JSON.stringify(e));let s=e.row-1;if(this.nrRollUpRows&&s"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,s=this.rows.splice(e,1)[0];s.clear(),this.rows.splice(this.currRow,0,s),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const s=[];let u="",y=-1;for(let A=0;A0&&(e?u="["+s.join(" | ")+"]":u=s.join(` -`)),u}getTextAndFormat(){return this.rows}}class af{constructor(e,s,u){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=s,this.mode=null,this.verbose=0,this.displayedMemory=new vc(u),this.nonDisplayedMemory=new vc(u),this.lastOutputScreen=new vc(u),this.currRollUpRow=this.displayedMemory.rows[Cr-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=u}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Cr-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let u=0;us+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const s={flash:!1};if(s.underline=e%2===1,s.italics=e>=46,s.italics)s.foreground="white";else{const u=Math.floor(e/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];s.foreground=y[u]}this.logger.log(2,"MIDROW: "+JSON.stringify(s)),this.writeScreen.setPen(s)}outputDataUpdate(e=!1){const s=this.logger.time;s!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=s:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,s,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:s),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class of{constructor(e,s,u){this.channels=void 0,this.currentChannel=0,this.cmdHistory=cf(),this.logger=void 0;const y=this.logger=new C4;this.channels=[null,new af(e,s,y),new af(e+1,u,y)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,s){this.channels[e].setHandler(s)}addData(e,s){let u,y,A,l=!1;this.logger.time=e;for(let c=0;c ("+ys([y,A])+")"),u=this.parseCmd(y,A),u||(u=this.parseMidrow(y,A)),u||(u=this.parsePAC(y,A)),u||(u=this.parseBackgroundAttributes(y,A)),!u&&(l=this.parseChars(y,A),l)){const p=this.currentChannel;p&&p>0?this.channels[p].insertChars(l):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!u&&!l&&this.logger.log(2,"Couldn't parse cleaned data "+ys([y,A])+" orig: "+ys([s[c],s[c+1]]))}}parseCmd(e,s){const{cmdHistory:u}=this,y=(e===20||e===28||e===21||e===29)&&s>=32&&s<=47,A=(e===23||e===31)&&s>=33&&s<=35;if(!(y||A))return!1;if(lf(e,s,u))return Ks(null,null,u),this.logger.log(3,"Repeated command ("+ys([e,s])+") is dropped"),!0;const l=e===20||e===21||e===23?1:2,c=this.channels[l];return e===20||e===21||e===28||e===29?s===32?c.ccRCL():s===33?c.ccBS():s===34?c.ccAOF():s===35?c.ccAON():s===36?c.ccDER():s===37?c.ccRU(2):s===38?c.ccRU(3):s===39?c.ccRU(4):s===40?c.ccFON():s===41?c.ccRDC():s===42?c.ccTR():s===43?c.ccRTD():s===44?c.ccEDM():s===45?c.ccCR():s===46?c.ccENM():s===47&&c.ccEOC():c.ccTO(s-32),Ks(e,s,u),this.currentChannel=l,!0}parseMidrow(e,s){let u=0;if((e===17||e===25)&&s>=32&&s<=47){if(e===17?u=1:u=2,u!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const y=this.channels[u];return y?(y.ccMIDROW(s),this.logger.log(3,"MIDROW ("+ys([e,s])+")"),!0):!1}return!1}parsePAC(e,s){let u;const y=this.cmdHistory,A=(e>=17&&e<=23||e>=25&&e<=31)&&s>=64&&s<=127,l=(e===16||e===24)&&s>=64&&s<=95;if(!(A||l))return!1;if(lf(e,s,y))return Ks(null,null,y),!0;const c=e<=23?1:2;s>=64&&s<=95?u=c===1?_4[e]:w4[e]:u=c===1?E4[e]:S4[e];const p=this.channels[c];return p?(p.setPAC(this.interpretPAC(u,s)),Ks(e,s,y),this.currentChannel=c,!0):!1}interpretPAC(e,s){let u;const y={color:null,italics:!1,indent:null,underline:!1,row:e};return s>95?u=s-96:u=s-64,y.underline=(u&1)===1,u<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(u/2)]:u<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((u-16)/2)*4,y}parseChars(e,s){let u,y=null,A=null;if(e>=25?(u=2,A=e-8):(u=1,A=e),A>=17&&A<=19){let l;A===17?l=s+80:A===18?l=s+112:l=s+144,this.logger.log(2,"Special char '"+d0(l)+"' in channel "+u),y=[l]}else e>=32&&e<=127&&(y=s===0?[e]:[e,s]);if(y){const l=ys(y);this.logger.log(3,"Char codes = "+l.join(",")),Ks(e,s,this.cmdHistory)}return y}parseBackgroundAttributes(e,s){const u=(e===16||e===24)&&s>=32&&s<=47,y=(e===23||e===31)&&s>=45&&s<=47;if(!(u||y))return!1;let A;const l={};e===16||e===24?(A=Math.floor((s-32)/2),l.background=T4[A],s%2===1&&(l.background=l.background+"_semi")):s===45?l.background="transparent":(l.foreground="black",s===47&&(l.underline=!0));const c=e<=23?1:2;return this.channels[c].setBkgData(l),Ks(e,s,this.cmdHistory),!0}reset(){for(let e=0;ee)&&(this.startTime=e),this.endTime=s,this.screen=u,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var Od=function(){if(oa!=null&&oa.VTTCue)return self.VTTCue;const _=["","lr","rl"],e=["start","middle","end","left","right"];function s(c,p){if(typeof p!="string"||!Array.isArray(c))return!1;const r=p.toLowerCase();return~c.indexOf(r)?r:!1}function u(c){return s(_,c)}function y(c){return s(e,c)}function A(c,...p){let r=1;for(;r100)throw new Error("Position must be between 0 and 100.");D=L,this.hasBeenReset=!0}})),Object.defineProperty(i,"positionAlign",A({},t,{get:function(){return R},set:function(L){const I=y(L);if(!I)throw new SyntaxError("An invalid or illegal string was specified.");R=I,this.hasBeenReset=!0}})),Object.defineProperty(i,"size",A({},t,{get:function(){return T},set:function(L){if(L<0||L>100)throw new Error("Size must be between 0 and 100.");T=L,this.hasBeenReset=!0}})),Object.defineProperty(i,"align",A({},t,{get:function(){return P},set:function(L){const I=y(L);if(!I)throw new SyntaxError("An invalid or illegal string was specified.");P=I,this.hasBeenReset=!0}})),i.displayState=void 0}return l.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},l}();class R4{decode(e,s){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function h0(_){function e(u,y,A,l){return(u|0)*3600+(y|0)*60+(A|0)+parseFloat(l||0)}const s=_.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return s?parseFloat(s[2])>59?e(s[2],s[3],0,s[4]):e(s[1],s[2],s[3],s[4]):null}class I4{constructor(){this.values=Object.create(null)}set(e,s){!this.get(e)&&s!==""&&(this.values[e]=s)}get(e,s,u){return u?this.has(e)?this.values[e]:s[u]:this.has(e)?this.values[e]:s}has(e){return e in this.values}alt(e,s,u){for(let y=0;y=0&&u<=100)return this.set(e,u),!0}return!1}}function f0(_,e,s,u){const y=u?_.split(u):[_];for(const A in y){if(typeof y[A]!="string")continue;const l=y[A].split(s);if(l.length!==2)continue;const c=l[0],p=l[1];e(c,p)}}const Jc=new Od(0,0,""),ro=Jc.align==="middle"?"middle":"center";function L4(_,e,s){const u=_;function y(){const c=h0(_);if(c===null)throw new Error("Malformed timestamp: "+u);return _=_.replace(/^[^\sa-zA-Z-]+/,""),c}function A(c,p){const r=new I4;f0(c,function(n,a){let o;switch(n){case"region":for(let d=s.length-1;d>=0;d--)if(s[d].id===a){r.set(n,s[d].region);break}break;case"vertical":r.alt(n,a,["rl","lr"]);break;case"line":o=a.split(","),r.integer(n,o[0]),r.percent(n,o[0])&&r.set("snapToLines",!1),r.alt(n,o[0],["auto"]),o.length===2&&r.alt("lineAlign",o[1],["start",ro,"end"]);break;case"position":o=a.split(","),r.percent(n,o[0]),o.length===2&&r.alt("positionAlign",o[1],["start",ro,"end","line-left","line-right","auto"]);break;case"size":r.percent(n,a);break;case"align":r.alt(n,a,["start",ro,"end","left","right"]);break}},/:/,/\s/),p.region=r.get("region",null),p.vertical=r.get("vertical","");let i=r.get("line","auto");i==="auto"&&Jc.line===-1&&(i=-1),p.line=i,p.lineAlign=r.get("lineAlign","start"),p.snapToLines=r.get("snapToLines",!0),p.size=r.get("size",100),p.align=r.get("align",ro);let t=r.get("position","auto");t==="auto"&&Jc.position===50&&(t=p.align==="start"||p.align==="left"?0:p.align==="end"||p.align==="right"?100:50),p.position=t}function l(){_=_.replace(/^\s+/,"")}if(l(),e.startTime=y(),l(),_.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+u);_=_.slice(3),l(),e.endTime=y(),l(),A(_,e)}function p0(_){return _.replace(//gi,` -`)}class D4{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new R4,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const s=this;e&&(s.buffer+=s.decoder.decode(e,{stream:!0}));function u(){let A=s.buffer,l=0;for(A=p0(A);l")===-1){s.cue.id=A;continue}case"CUE":if(!s.cue){s.state="BADCUE";continue}try{L4(A,s.cue,s.regionList)}catch{s.cue=null,s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":{const c=A.indexOf("-->")!==-1;if(!A||c&&(l=!0)){s.oncue&&s.cue&&s.oncue(s.cue),s.cue=null,s.state="ID";continue}if(s.cue===null)continue;s.cue.text&&(s.cue.text+=` -`),s.cue.text+=A}continue;case"BADCUE":A||(s.state="ID")}}}catch{s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=` - -`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(s){e.onparsingerror&&e.onparsingerror(s)}return e.onflush&&e.onflush(),this}}const O4=/\r\n|\n\r|\n|\r/g,bc=function(e,s,u=0){return e.slice(u,u+s.length)===s},M4=function(e){let s=parseInt(e.slice(-3));const u=parseInt(e.slice(-6,-4)),y=parseInt(e.slice(-9,-7)),A=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!Ci(s)||!Ci(u)||!Ci(y)||!Ci(A))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return s+=1e3*u,s+=60*1e3*y,s+=60*60*1e3*A,s},_c=function(e){let s=5381,u=e.length;for(;u;)s=s*33^e.charCodeAt(--u);return(s>>>0).toString()};function Md(_,e,s){return _c(_.toString())+_c(e.toString())+_c(s)}const P4=function(e,s,u){let y=e[s],A=e[y.prevCC];if(!A||!A.new&&y.new){e.ccOffset=e.presentationOffset=y.start,y.new=!1;return}for(;(l=A)!=null&&l.new;){var l;e.ccOffset+=y.start-A.start,y.new=!1,y=A,A=e[y.prevCC]}e.presentationOffset=u};function B4(_,e,s,u,y,A,l){const c=new D4,p=Vr(new Uint8Array(_)).trim().replace(O4,` + initSegmentChange: ${T}`);const L=new u4(u,A,s,c,i);this.configureTransmuxer(L)}if(this.frag=y,this.part=l,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:d,chunkMeta:r,state:P},e instanceof ArrayBuffer?[e]:[]);else if(a){const L=a.push(e,d,r,P);yo(L)?(a.async=!0,L.then(I=>{this.handleTransmuxComplete(I)}).catch(I=>{this.transmuxerError(I,r,"transmuxer-interface push error")})):(a.async=!1,this.handleTransmuxComplete(L))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:s}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(s){let u=s.flush(e);yo(u)||s.async?(yo(u)||(u=Promise.resolve(u)),u.then(y=>{this.handleFlushResult(y,e)}).catch(y=>{this.transmuxerError(y,e,"transmuxer-interface flush error")})):this.handleFlushResult(u,e)}}transmuxerError(e,s,u){this.hls&&(this.error=e,this.hls.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.FRAG_PARSING_ERROR,chunkMeta:s,fatal:!1,error:e,err:e,reason:u}))}handleFlushResult(e,s){e.forEach(u=>{this.handleTransmuxComplete(u)}),this.onFlush(s)}onWorkerMessage(e){const s=e.data,u=this.hls;switch(s.event){case"init":{var A;const y=(A=this.workerContext)==null?void 0:A.objectURL;y&&self.URL.revokeObjectURL(y);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}case"workerLog":Ft[s.data.logType]&&Ft[s.data.logType](s.data.message);break;default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,u.trigger(s.event,s.data);break}}}configureTransmuxer(e){const{transmuxer:s}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):s&&s.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}function c0(_,e){if(_.length!==e.length)return!1;for(let s=0;s<_.length;s++)if(!ca(_[s].attrs,e[s].attrs))return!1;return!0}function ca(_,e,s){const u=_["STABLE-RENDITION-ID"];return u&&!s?u===e["STABLE-RENDITION-ID"]:!(s||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(A=>_[A]!==e[A])}function Yc(_,e){return e.label.toLowerCase()===_.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(_.lang||"").toLowerCase())}const ef=100;class p4 extends xd{constructor(e,s,u){super(e,s,u,"[audio-stream-controller]",Hi.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.LEVEL_LOADED,this.onLevelLoaded,this),e.on(rt.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(rt.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(rt.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(rt.ERROR,this.onError,this),e.on(rt.BUFFER_RESET,this.onBufferReset,this),e.on(rt.BUFFER_CREATED,this.onBufferCreated,this),e.on(rt.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(rt.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(rt.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(rt.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.LEVEL_LOADED,this.onLevelLoaded,this),e.off(rt.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(rt.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(rt.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(rt.ERROR,this.onError,this),e.off(rt.BUFFER_RESET,this.onBufferReset,this),e.off(rt.BUFFER_CREATED,this.onBufferCreated,this),e.off(rt.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(rt.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(rt.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(rt.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:s,id:u,initPTS:A,timescale:y}){if(u==="main"){const l=s.cc;this.initPTS[s.cc]={baseTime:A,timescale:y},this.log(`InitPTS for cc: ${l} found from main: ${A}`),this.videoTrackCC=l,this.state===ni.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=ni.STOPPED;return}const s=this.lastCurrentTime;this.stopLoad(),this.setInterval(ef),s>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${s.toFixed(3)}`),e=s,this.state=ni.IDLE):(this.loadedmetadata=!1,this.state=ni.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case ni.IDLE:this.doTickIdle();break;case ni.WAITING_TRACK:{var e;const{levels:u,trackId:A}=this,y=u==null||(e=u[A])==null?void 0:e.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=ni.WAITING_INIT_PTS}break}case ni.FRAG_LOADING_WAITING_RETRY:{var s;const u=performance.now(),A=this.retryDate;if(!A||u>=A||(s=this.media)!=null&&s.seeking){const{levels:y,trackId:l}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((y==null?void 0:y[l])||null),this.state=ni.IDLE}break}case ni.WAITING_INIT_PTS:{const u=this.waitingData;if(u){const{frag:A,part:y,cache:l,complete:c}=u;if(this.initPTS[A.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=ni.FRAG_LOADING;const p=l.flush(),r={frag:A,part:y,payload:p,networkDetails:null};this._handleFragmentLoadProgress(r),c&&super._handleFragmentLoadComplete(r)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${A.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const p=this.getLoadPosition(),r=mn.bufferInfo(this.mediaBuffer,p,this.config.maxBufferHole);Kc(r.end,this.config.maxFragLookUpTolerance,A)<0&&(this.log(`Waiting fragment cc (${A.cc}) @ ${A.start} cancelled because another fragment at ${r.end} is needed`),this.clearWaitingFragment())}}else this.state=ni.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=ni.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:s,media:u,trackId:A}=this,y=e.config;if(!u&&(this.startFragRequested||!y.startFragPrefetch)||!(s!=null&&s[A]))return;const l=s[A],c=l.details;if(!c||c.live&&this.levelLastLoaded!==l||this.waitForCdnTuneIn(c)){this.state=ni.WAITING_TRACK;return}const p=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&p&&(this.bufferFlushed=!1,this.afterBufferFlushed(p,fn.AUDIO,Hi.AUDIO));const r=this.getFwdBufferInfo(p,Hi.AUDIO);if(r===null)return;const{bufferedTrack:i,switchingTrack:t}=this;if(!t&&this._streamEnded(r,c)){e.trigger(rt.BUFFER_EOS,{type:"audio"}),this.state=ni.ENDED;return}const n=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,Hi.MAIN),a=r.len,o=this.getMaxBufferLength(n==null?void 0:n.len),d=c.fragments,g=d[0].start;let m=this.flushing?this.getLoadPosition():r.end;if(t&&u){const C=this.getLoadPosition();i&&!ca(t.attrs,i.attrs)&&(m=C),c.PTSKnown&&Cg||r.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),u.currentTime=g+.05)}if(a>=o&&!t&&mn.end+c.targetduration;if(w||!(n!=null&&n.len)&&r.len){const C=this.getAppendedFrag(v.start,Hi.MAIN);if(C===null||(b||(b=!!C.gap||!!w&&n.len===0),w&&!b||b&&r.nextStart&&r.nextStartnew la(u))}onAudioTrackSwitching(e,s){const u=!!s.url;this.trackId=s.id;const{fragCurrent:A}=this;A&&(A.abortRequests(),this.removeUnbufferedFrags(A.start)),this.resetLoadingState(),u?this.setInterval(ef):this.resetTransmuxer(),u?(this.switchingTrack=s,this.state=ni.IDLE,this.flushAudioIfNeeded(s)):(this.switchingTrack=null,this.bufferedTrack=s,this.state=ni.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,s){this.mainDetails=s.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(rt.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,s){var u;if(this.mainDetails==null){this.cachedTrackLoadedData=s;return}const{levels:A}=this,{details:y,id:l}=s;if(!A){this.warn(`Audio tracks were reset while loading level ${l}`);return}this.log(`Audio track ${l} loaded [${y.startSN},${y.endSN}]${y.lastPartSn?`[part-${y.lastPartSn}-${y.lastPartIndex}]`:""},duration:${y.totalduration}`);const c=A[l];let p=0;if(y.live||(u=c.details)!=null&&u.live){this.checkLiveUpdate(y);const i=this.mainDetails;if(y.deltaUpdateFailed||!i)return;if(!c.details&&y.hasProgramDateTime&&i.hasProgramDateTime)Bo(y,i),p=y.fragments[0].start;else{var r;p=this.alignPlaylists(y,c.details,(r=this.levelLastLoaded)==null?void 0:r.details)}}c.details=y,this.levelLastLoaded=c,!this.startFragRequested&&(this.mainDetails||!y.live)&&this.setStartPosition(c.details,p),this.state===ni.WAITING_TRACK&&!this.waitForCdnTuneIn(y)&&(this.state=ni.IDLE),this.tick()}_handleFragmentLoadProgress(e){var s;const{frag:u,part:A,payload:y}=e,{config:l,trackId:c,levels:p}=this;if(!p){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${u.sn} of level ${u.level} will not be buffered`);return}const r=p[c];if(!r){this.warn("Audio track is undefined on fragment load progress");return}const i=r.details;if(!i){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(u.start);return}const t=l.defaultAudioCodec||r.audioCodec||"mp4a.40.2";let n=this.transmuxer;n||(n=this.transmuxer=new l0(this.hls,Hi.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const a=this.initPTS[u.cc],o=(s=u.initSegment)==null?void 0:s.data;if(a!==void 0){const g=A?A.index:-1,m=g!==-1,v=new Td(u.level,u.sn,u.stats.chunkCount,y.byteLength,g,m);n.push(y,o,t,"",u,A,i.totalduration,!1,v,a)}else{this.log(`Unknown video PTS for cc ${u.cc}, waiting for video PTS before demuxing audio frag ${u.sn} of [${i.startSN} ,${i.endSN}],track ${c}`);const{cache:d}=this.waitingData=this.waitingData||{frag:u,part:A,cache:new Wp,complete:!1};d.push(new Uint8Array(y)),this.waitingVideoCC=this.videoTrackCC,this.state=ni.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,s){const u=s.tracks.audio;u&&(this.mediaBuffer=u.buffer||null),s.tracks.video&&(this.videoBuffer=s.tracks.video.buffer||null)}onFragBuffered(e,s){const{frag:u,part:A}=s;if(u.type!==Hi.AUDIO){if(!this.loadedmetadata&&u.type===Hi.MAIN){const y=this.videoBuffer||this.media;y&&mn.getBuffered(y).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(u)){this.warn(`Fragment ${u.sn}${A?" p: "+A.index:""} of level ${u.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(u.sn!=="initSegment"){this.fragPrevious=u;const y=this.switchingTrack;y&&(this.bufferedTrack=y,this.switchingTrack=null,this.hls.trigger(rt.AUDIO_TRACK_SWITCHED,Dn({},y)))}this.fragBufferedComplete(u,A)}onError(e,s){var u;if(s.fatal){this.state=ni.ERROR;return}switch(s.details){case qt.FRAG_GAP:case qt.FRAG_PARSING_ERROR:case qt.FRAG_DECRYPT_ERROR:case qt.FRAG_LOAD_ERROR:case qt.FRAG_LOAD_TIMEOUT:case qt.KEY_LOAD_ERROR:case qt.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Hi.AUDIO,s);break;case qt.AUDIO_TRACK_LOAD_ERROR:case qt.AUDIO_TRACK_LOAD_TIMEOUT:case qt.LEVEL_PARSING_ERROR:!s.levelRetry&&this.state===ni.WAITING_TRACK&&((u=s.context)==null?void 0:u.type)===ln.AUDIO_TRACK&&(this.state=ni.IDLE);break;case qt.BUFFER_APPEND_ERROR:case qt.BUFFER_FULL_ERROR:if(!s.parent||s.parent!=="audio")return;if(s.details===qt.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(s)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case qt.INTERNAL_EXCEPTION:this.recoverWorkerError(s);break}}onBufferFlushing(e,{type:s}){s!==fn.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:s}){if(s!==fn.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===ni.ENDED&&(this.state=ni.IDLE);const u=this.mediaBuffer||this.media;u&&(this.afterBufferFlushed(u,s,Hi.AUDIO),this.tick())}}_handleTransmuxComplete(e){var s;const u="audio",{hls:A}=this,{remuxResult:y,chunkMeta:l}=e,c=this.getCurrentContext(l);if(!c){this.resetWhenMissingContext(l);return}const{frag:p,part:r,level:i}=c,{details:t}=i,{audio:n,text:a,id3:o,initSegment:d}=y;if(this.fragContextChanged(p)||!t){this.fragmentTracker.removeFragment(p);return}if(this.state=ni.PARSING,this.switchingTrack&&n&&this.completeAudioSwitch(this.switchingTrack),d!=null&&d.tracks){const g=p.initSegment||p;this._bufferInitSegment(i,d.tracks,g,l),A.trigger(rt.FRAG_PARSING_INIT_SEGMENT,{frag:g,id:u,tracks:d.tracks})}if(n){const{startPTS:g,endPTS:m,startDTS:v,endDTS:b}=n;r&&(r.elementaryStreams[fn.AUDIO]={startPTS:g,endPTS:m,startDTS:v,endDTS:b}),p.setElementaryStreamInfo(fn.AUDIO,g,m,v,b),this.bufferFragmentData(n,p,r,l)}if(o!=null&&(s=o.samples)!=null&&s.length){const g=xn({id:u,frag:p,details:t},o);A.trigger(rt.FRAG_PARSING_METADATA,g)}if(a){const g=xn({id:u,frag:p,details:t},a);A.trigger(rt.FRAG_PARSING_USERDATA,g)}}_bufferInitSegment(e,s,u,A){if(this.state!==ni.PARSING)return;s.video&&delete s.video;const y=s.audio;if(!y)return;y.id="audio";const l=e.audioCodec;this.log(`Init audio buffer, container:${y.container}, codecs[level/parsed]=[${l}/${y.codec}]`),l&&l.split(",").length===1&&(y.levelCodec=l),this.hls.trigger(rt.BUFFER_CODECS,s);const c=y.initSegment;if(c!=null&&c.byteLength){const p={type:"audio",frag:u,part:null,chunkMeta:A,parent:u.type,data:c};this.hls.trigger(rt.BUFFER_APPENDING,p)}this.tickImmediate()}loadFragment(e,s,u){const A=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||A===Fn.NOT_LOADED||A===Fn.PARTIAL){var y;if(e.sn==="initSegment")this._loadInitSegment(e,s);else if((y=s.details)!=null&&y.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=ni.WAITING_INIT_PTS;const l=this.mainDetails;l&&l.fragments[0].start!==s.details.fragments[0].start&&Bo(s.details,l)}else this.startFragRequested=!0,super.loadFragment(e,s,u)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){const{media:s,bufferedTrack:u}=this,A=u==null?void 0:u.attrs,y=e.attrs;s&&A&&(A.CHANNELS!==y.CHANNELS||u.name!==e.name||u.lang!==e.lang)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}completeAudioSwitch(e){const{hls:s}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,s.trigger(rt.AUDIO_TRACK_SWITCHED,Dn({},e))}}class m4 extends Sd{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.on(rt.LEVEL_LOADING,this.onLevelLoading,this),e.on(rt.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(rt.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(rt.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.off(rt.LEVEL_LOADING,this.onLevelLoading,this),e.off(rt.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(rt.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(rt.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,s){this.tracks=s.audioTracks||[]}onAudioTrackLoaded(e,s){const{id:u,groupId:A,details:y}=s,l=this.tracksInGroup[u];if(!l||l.groupId!==A){this.warn(`Audio track with id:${u} and group:${A} not found in active group ${l==null?void 0:l.groupId}`);return}const c=l.details;l.details=s.details,this.log(`Audio track ${u} "${l.name}" lang:${l.lang} group:${A} loaded [${y.startSN}-${y.endSN}]`),u===this.trackId&&this.playlistLoaded(u,s,c)}onLevelLoading(e,s){this.switchLevel(s.level)}onLevelSwitching(e,s){this.switchLevel(s.level)}switchLevel(e){const s=this.hls.levels[e];if(!s)return;const u=s.audioGroups||null,A=this.groupIds;let y=this.currentTrack;if(!u||(A==null?void 0:A.length)!==(u==null?void 0:u.length)||u!=null&&u.some(c=>(A==null?void 0:A.indexOf(c))===-1)){this.groupIds=u,this.trackId=-1,this.currentTrack=null;const c=this.tracks.filter(n=>!u||u.indexOf(n.groupId)!==-1);if(c.length)this.selectDefaultTrack&&!c.some(n=>n.default)&&(this.selectDefaultTrack=!1),c.forEach((n,a)=>{n.id=a});else if(!y&&!this.tracksInGroup.length)return;this.tracksInGroup=c;const p=this.hls.config.audioPreference;if(!y&&p){const n=jr(p,c,Vs);if(n>-1)y=c[n];else{const a=jr(p,this.tracks);y=this.tracks[a]}}let r=this.findTrackId(y);r===-1&&y&&(r=this.findTrackId(null));const i={audioTracks:c};this.log(`Updating audio tracks, ${c.length} track(s) found in group(s): ${u==null?void 0:u.join(",")}`),this.hls.trigger(rt.AUDIO_TRACKS_UPDATED,i);const t=this.trackId;if(r!==-1&&t===-1)this.setAudioTrack(r);else if(c.length&&t===-1){var l;const n=new Error(`No audio track selected for current audio group-ID(s): ${(l=this.groupIds)==null?void 0:l.join(",")} track count: ${c.length}`);this.warn(n.message),this.hls.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:n})}}else this.shouldReloadPlaylist(y)&&this.setAudioTrack(this.trackId)}onError(e,s){s.fatal||!s.context||s.context.type===ln.AUDIO_TRACK&&s.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(s.context.groupId)!==-1)&&(this.requestScheduled=-1,this.checkRetry(s))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const s=this.hls;if(s.config.audioPreference=e,e){const u=this.allAudioTracks;if(this.selectDefaultTrack=!1,u.length){const A=this.currentTrack;if(A&&na(e,A,Vs))return A;const y=jr(e,this.tracksInGroup,Vs);if(y>-1){const l=this.tracksInGroup[y];return this.setAudioTrack(y),l}else if(A){let l=s.loadLevel;l===-1&&(l=s.firstAutoLevel);const c=A5(e,s.levels,u,l,Vs);if(c===-1)return null;s.nextLoadLevel=c}if(e.channels||e.audioCodec){const l=jr(e,u);if(l>-1)return u[l]}}}return null}setAudioTrack(e){const s=this.tracksInGroup;if(e<0||e>=s.length){this.warn(`Invalid audio track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const u=this.currentTrack,A=s[e],y=A.details&&!A.details.live;if(e===this.trackId&&A===u&&y||(this.log(`Switching to audio-track ${e} "${A.name}" lang:${A.lang} group:${A.groupId} channels:${A.channels}`),this.trackId=e,this.currentTrack=A,this.hls.trigger(rt.AUDIO_TRACK_SWITCHING,Dn({},A)),y))return;const l=this.switchParams(A.url,u==null?void 0:u.details);this.loadPlaylist(l)}findTrackId(e){const s=this.tracksInGroup;for(let u=0;u=y[r].start&&c<=y[r].end){l=y[r];break}const p=u.start+u.duration;l?l.end=p:(l={start:c,end:p},y.push(l)),this.fragmentTracker.fragBuffered(u),this.fragBufferedComplete(u,null)}onBufferFlushing(e,s){const{startOffset:u,endOffset:A}=s;if(u===0&&A!==Number.POSITIVE_INFINITY){const y=A-1;if(y<=0)return;s.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(l=>{for(let c=0;cnew la(u));return}this.tracksBuffered=[],this.levels=s.map(u=>{const A=new la(u);return this.tracksBuffered[A.id]=[],A}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Hi.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,s){var u;if(this.currentTrackId=s.id,!((u=this.levels)!=null&&u.length)||this.currentTrackId===-1){this.clearInterval();return}const A=this.levels[this.currentTrackId];A!=null&&A.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,A&&this.setInterval(tf)}onSubtitleTrackLoaded(e,s){var u;const{currentTrackId:A,levels:y}=this,{details:l,id:c}=s;if(!y){this.warn(`Subtitle tracks were reset while loading level ${c}`);return}const p=y[A];if(c>=y.length||c!==A||!p)return;this.log(`Subtitle track ${c} loaded [${l.startSN},${l.endSN}]${l.lastPartSn?`[part-${l.lastPartSn}-${l.lastPartIndex}]`:""},duration:${l.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let r=0;if(l.live||(u=p.details)!=null&&u.live){const t=this.mainDetails;if(l.deltaUpdateFailed||!t)return;const n=t.fragments[0];if(!p.details)l.hasProgramDateTime&&t.hasProgramDateTime?(Bo(l,t),r=l.fragments[0].start):n&&(r=n.start,Wc(l,r));else{var i;r=this.alignPlaylists(l,p.details,(i=this.levelLastLoaded)==null?void 0:i.details),r===0&&n&&(r=n.start,Wc(l,r))}}p.details=l,this.levelLastLoaded=p,!this.startFragRequested&&(this.mainDetails||!l.live)&&this.setStartPosition(p.details,r),this.tick(),l.live&&!this.fragCurrent&&this.media&&this.state===ni.IDLE&&(Po(null,l.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),p.details=void 0))}_handleFragmentLoadComplete(e){const{frag:s,payload:u}=e,A=s.decryptdata,y=this.hls;if(!this.fragContextChanged(s)&&u&&u.byteLength>0&&A!=null&&A.key&&A.iv&&A.method==="AES-128"){const l=performance.now();this.decrypter.decrypt(new Uint8Array(u),A.key.buffer,A.iv.buffer).catch(c=>{throw y.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.FRAG_DECRYPT_ERROR,fatal:!1,error:c,reason:c.message,frag:s}),c}).then(c=>{const p=performance.now();y.trigger(rt.FRAG_DECRYPTED,{frag:s,payload:c,stats:{tstart:l,tdecrypt:p}})}).catch(c=>{this.warn(`${c.name}: ${c.message}`),this.state=ni.IDLE})}}doTick(){if(!this.media){this.state=ni.IDLE;return}if(this.state===ni.IDLE){const{currentTrackId:e,levels:s}=this,u=s==null?void 0:s[e];if(!u||!s.length||!u.details)return;const{config:A}=this,y=this.getLoadPosition(),l=mn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],y,A.maxBufferHole),{end:c,len:p}=l,r=this.getFwdBufferInfo(this.media,Hi.MAIN),i=u.details,t=this.getMaxBufferLength(r==null?void 0:r.len)+i.levelTargetDuration;if(p>t)return;const n=i.fragments,a=n.length,o=i.edge;let d=null;const g=this.fragPrevious;if(co-m?0:m;d=Po(g,n,Math.max(n[0].start,c),v),!d&&g&&g.start{if(A=A>>>0,A>y-1)throw new DOMException(`Failed to execute '${u}' on 'TimeRanges': The index provided (${A}) is greater than the maximum bound (${y})`);return e[A][u]};this.buffered={get length(){return e.length},end(u){return s("end",u,e.length)},start(u){return s("start",u,e.length)}}}}class y4 extends Sd{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let s=null;const u=po(this.media.textTracks);for(let y=0;y-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.on(rt.LEVEL_LOADING,this.onLevelLoading,this),e.on(rt.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(rt.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(rt.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.off(rt.LEVEL_LOADING,this.onLevelLoading,this),e.off(rt.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(rt.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(rt.ERROR,this.onError,this)}onMediaAttached(e,s){this.media=s.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),po(this.media.textTracks).forEach(s=>{Zs(s)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,s){this.tracks=s.subtitleTracks}onSubtitleTrackLoaded(e,s){const{id:u,groupId:A,details:y}=s,l=this.tracksInGroup[u];if(!l||l.groupId!==A){this.warn(`Subtitle track with id:${u} and group:${A} not found in active group ${l==null?void 0:l.groupId}`);return}const c=l.details;l.details=s.details,this.log(`Subtitle track ${u} "${l.name}" lang:${l.lang} group:${A} loaded [${y.startSN}-${y.endSN}]`),u===this.trackId&&this.playlistLoaded(u,s,c)}onLevelLoading(e,s){this.switchLevel(s.level)}onLevelSwitching(e,s){this.switchLevel(s.level)}switchLevel(e){const s=this.hls.levels[e];if(!s)return;const u=s.subtitleGroups||null,A=this.groupIds;let y=this.currentTrack;if(!u||(A==null?void 0:A.length)!==(u==null?void 0:u.length)||u!=null&&u.some(l=>(A==null?void 0:A.indexOf(l))===-1)){this.groupIds=u,this.trackId=-1,this.currentTrack=null;const l=this.tracks.filter(i=>!u||u.indexOf(i.groupId)!==-1);if(l.length)this.selectDefaultTrack&&!l.some(i=>i.default)&&(this.selectDefaultTrack=!1),l.forEach((i,t)=>{i.id=t});else if(!y&&!this.tracksInGroup.length)return;this.tracksInGroup=l;const c=this.hls.config.subtitlePreference;if(!y&&c){this.selectDefaultTrack=!1;const i=jr(c,l);if(i>-1)y=l[i];else{const t=jr(c,this.tracks);y=this.tracks[t]}}let p=this.findTrackId(y);p===-1&&y&&(p=this.findTrackId(null));const r={subtitleTracks:l};this.log(`Updating subtitle tracks, ${l.length} track(s) found in "${u==null?void 0:u.join(",")}" group-id`),this.hls.trigger(rt.SUBTITLE_TRACKS_UPDATED,r),p!==-1&&this.trackId===-1&&this.setSubtitleTrack(p)}else this.shouldReloadPlaylist(y)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const s=this.tracksInGroup,u=this.selectDefaultTrack;for(let A=0;A-1){const y=this.tracksInGroup[A];return this.setSubtitleTrack(A),y}else{if(u)return null;{const y=jr(e,s);if(y>-1)return s[y]}}}}return null}loadPlaylist(e){super.loadPlaylist();const s=this.currentTrack;if(this.shouldLoadPlaylist(s)&&s){const u=s.id,A=s.groupId;let y=s.url;if(e)try{y=e.addDirectives(y)}catch(l){this.warn(`Could not construct new URL with HLS Delivery Directives: ${l}`)}this.log(`Loading subtitle playlist for id ${u}`),this.hls.trigger(rt.SUBTITLE_TRACK_LOADING,{url:y,id:u,groupId:A,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const s=po(e.textTracks),u=this.currentTrack;let A;if(u&&(A=s.filter(y=>Yc(u,y))[0],A||this.warn(`Unable to find subtitle TextTrack with name "${u.name}" and language "${u.lang}"`)),[].slice.call(s).forEach(y=>{y.mode!=="disabled"&&y!==A&&(y.mode="disabled")}),A){const y=this.subtitleDisplay?"showing":"hidden";A.mode!==y&&(A.mode=y)}}setSubtitleTrack(e){const s=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=s.length||!Ci(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const u=this.currentTrack,A=s[e]||null;if(this.trackId=e,this.currentTrack=A,this.toggleTrackModes(),!A){this.hls.trigger(rt.SUBTITLE_TRACK_SWITCH,{id:e});return}const y=!!A.details&&!A.details.live;if(e===this.trackId&&A===u&&y)return;this.log(`Switching to subtitle-track ${e}`+(A?` "${A.name}" lang:${A.lang} group:${A.groupId}`:""));const{id:l,groupId:c="",name:p,type:r,url:i}=A;this.hls.trigger(rt.SUBTITLE_TRACK_SWITCH,{id:l,groupId:c,name:p,type:r,url:i});const t=this.switchParams(A.url,u==null?void 0:u.details);this.loadPlaylist(t)}}class v4{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,s,u){const A=this.queues[s];A.push(e),A.length===1&&!u&&this.executeNext(s)}insertAbort(e,s){this.queues[s].unshift(e),this.executeNext(s)}appendBlocker(e){let s;const u=new Promise(y=>{s=y}),A={execute:s,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(A,e),u}executeNext(e){const s=this.queues[e];if(s.length){const u=s[0];try{u.execute()}catch(A){Ft.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${A}`),u.onError(A);const y=this.buffers[e];y!=null&&y.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const nf=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class b4{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=u=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=u=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:u,mediaSource:A}=this;this.log("Media source opened"),u&&(u.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(rt.MEDIA_ATTACHED,{media:u,mediaSource:A})),A&&A.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:u,_objectUrl:A}=this;u!==A&&Ft.error(`Media element src was set while attaching MediaSource (${A} > ${u})`)},this.hls=e;const s="[buffer-controller]";this.appendSource=e.config.preferManagedMediaSource,this.log=Ft.log.bind(Ft,s),this.warn=Ft.warn.bind(Ft,s),this.error=Ft.error.bind(Ft,s),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:e}=this;e.on(rt.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.on(rt.BUFFER_RESET,this.onBufferReset,this),e.on(rt.BUFFER_APPENDING,this.onBufferAppending,this),e.on(rt.BUFFER_CODECS,this.onBufferCodecs,this),e.on(rt.BUFFER_EOS,this.onBufferEos,this),e.on(rt.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(rt.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(rt.FRAG_PARSED,this.onFragParsed,this),e.on(rt.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(rt.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.off(rt.BUFFER_RESET,this.onBufferReset,this),e.off(rt.BUFFER_APPENDING,this.onBufferAppending,this),e.off(rt.BUFFER_CODECS,this.onBufferCodecs,this),e.off(rt.BUFFER_EOS,this.onBufferEos,this),e.off(rt.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(rt.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(rt.FRAG_PARSED,this.onFragParsed,this),e.off(rt.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new v4(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,s){let u=2;(s.audio&&!s.video||!s.altAudio)&&(u=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=u,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,s){const u=this.media=s.media,A=ua(this.appendSource);if(u&&A){var y;const l=this.mediaSource=new A;this.log(`created media source: ${(y=l.constructor)==null?void 0:y.name}`),l.addEventListener("sourceopen",this._onMediaSourceOpen),l.addEventListener("sourceended",this._onMediaSourceEnded),l.addEventListener("sourceclose",this._onMediaSourceClose),l.addEventListener("startstreaming",this._onStartStreaming),l.addEventListener("endstreaming",this._onEndStreaming);const c=this._objectUrl=self.URL.createObjectURL(l);if(this.appendSource)try{u.removeAttribute("src");const p=self.ManagedMediaSource;u.disableRemotePlayback=u.disableRemotePlayback||p&&l instanceof p,rf(u),_4(u,c),u.load()}catch{u.src=c}else u.src=c;u.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:s,_objectUrl:u}=this;if(s){if(this.log("media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(A){this.warn(`onMediaDetaching: ${A.message} while calling endOfStream`)}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),s.removeEventListener("startstreaming",this._onStartStreaming),s.removeEventListener("endstreaming",this._onEndStreaming),e&&(e.removeEventListener("emptied",this._onMediaEmptied),u&&self.URL.revokeObjectURL(u),this.mediaSrc===u?(e.removeAttribute("src"),this.appendSource&&rf(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(rt.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{this.resetBuffer(e)}),this._initSourceBuffer()}resetBuffer(e){const s=this.sourceBuffer[e];try{if(s){var u;this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,(u=this.mediaSource)!=null&&u.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(s)}}catch(A){this.warn(`onBufferReset ${e}`,A)}}onBufferCodecs(e,s){const u=this.getSourceBufferTypes().length,A=Object.keys(s);if(A.forEach(l=>{if(u){const p=this.tracks[l];if(p&&typeof p.buffer.changeType=="function"){var c;const{id:r,codec:i,levelCodec:t,container:n,metadata:a}=s[l],o=Sh(p.codec,p.levelCodec),d=o==null?void 0:o.replace(nf,"$1");let g=Sh(i,t);const m=(c=g)==null?void 0:c.replace(nf,"$1");if(g&&d!==m){l.slice(0,5)==="audio"&&(g=Lo(g,this.hls.config.preferManagedMediaSource));const v=`${n};codecs=${g}`;this.appendChangeType(l,v),this.log(`switching codec ${o} to ${g}`),this.tracks[l]={buffer:p.buffer,codec:i,container:n,levelCodec:t,metadata:a,id:r}}}}else this.pendingTracks[l]=s[l]}),u)return;const y=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==y&&(this.log(`${y} bufferCodec event(s) expected ${A.join(",")}`),this.bufferCodecEventsExpected=y),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(e,s){const{operationQueue:u}=this,A={execute:()=>{const y=this.sourceBuffer[e];y&&(this.log(`changing ${e} sourceBuffer type to ${s}`),y.changeType(s)),u.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:y=>{this.warn(`Failed to change ${e} SourceBuffer type`,y)}};u.append(A,e,!!this.pendingTracks[e])}onBufferAppending(e,s){const{hls:u,operationQueue:A,tracks:y}=this,{data:l,type:c,frag:p,part:r,chunkMeta:i}=s,t=i.buffering[c],n=self.performance.now();t.start=n;const a=p.stats.buffering,o=r?r.stats.buffering:null;a.start===0&&(a.start=n),o&&o.start===0&&(o.start=n);const d=y.audio;let g=!1;c==="audio"&&(d==null?void 0:d.container)==="audio/mpeg"&&(g=!this.lastMpegAudioChunk||i.id===1||this.lastMpegAudioChunk.sn!==i.sn,this.lastMpegAudioChunk=i);const m=p.start,v={execute:()=>{if(t.executeStart=self.performance.now(),g){const b=this.sourceBuffer[c];if(b){const w=m-b.timestampOffset;Math.abs(w)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${m} (delta: ${w}) sn: ${p.sn})`),b.timestampOffset=m)}}this.appendExecutor(l,c)},onStart:()=>{},onComplete:()=>{const b=self.performance.now();t.executeEnd=t.end=b,a.first===0&&(a.first=b),o&&o.first===0&&(o.first=b);const{sourceBuffer:w}=this,C={};for(const D in w)C[D]=mn.getBuffered(w[D]);this.appendErrors[c]=0,c==="audio"||c==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(rt.BUFFER_APPENDED,{type:c,frag:p,part:r,chunkMeta:i,parent:p.type,timeRanges:C})},onError:b=>{const w={type:Wi.MEDIA_ERROR,parent:p.type,details:qt.BUFFER_APPEND_ERROR,sourceBufferName:c,frag:p,part:r,chunkMeta:i,error:b,err:b,fatal:!1};if(b.code===DOMException.QUOTA_EXCEEDED_ERR)w.details=qt.BUFFER_FULL_ERROR;else{const C=++this.appendErrors[c];w.details=qt.BUFFER_APPEND_ERROR,this.warn(`Failed ${C}/${u.config.appendErrorMaxRetry} times to append segment in "${c}" sourceBuffer`),C>=u.config.appendErrorMaxRetry&&(w.fatal=!0)}u.trigger(rt.ERROR,w)}};A.append(v,c,!!this.pendingTracks[c])}onBufferFlushing(e,s){const{operationQueue:u}=this,A=y=>({execute:this.removeExecutor.bind(this,y,s.startOffset,s.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(rt.BUFFER_FLUSHED,{type:y})},onError:l=>{this.warn(`Failed to remove from ${y} SourceBuffer`,l)}});s.type?u.append(A(s.type),s.type):this.getSourceBufferTypes().forEach(y=>{u.append(A(y),y)})}onFragParsed(e,s){const{frag:u,part:A}=s,y=[],l=A?A.elementaryStreams:u.elementaryStreams;l[fn.AUDIOVIDEO]?y.push("audiovideo"):(l[fn.AUDIO]&&y.push("audio"),l[fn.VIDEO]&&y.push("video"));const c=()=>{const p=self.performance.now();u.stats.buffering.end=p,A&&(A.stats.buffering.end=p);const r=A?A.stats:u.stats;this.hls.trigger(rt.FRAG_BUFFERED,{frag:u,part:A,stats:r,id:u.type})};y.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${u.type} level: ${u.level} sn: ${u.sn}`),this.blockBuffers(c,y)}onFragChanged(e,s){this.trimBuffers()}onBufferEos(e,s){this.getSourceBufferTypes().reduce((A,y)=>{const l=this.sourceBuffer[y];return l&&(!s.type||s.type===y)&&(l.ending=!0,l.ended||(l.ended=!0,this.log(`${y} sourceBuffer now EOS`))),A&&!!(!l||l.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(y=>{const l=this.sourceBuffer[y];l&&(l.ending=!1)});const{mediaSource:A}=this;if(!A||A.readyState!=="open"){A&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${A.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),A.endOfStream()}))}onLevelUpdated(e,{details:s}){s.fragments.length&&(this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:s,media:u}=this;if(!u||s===null||!this.getSourceBufferTypes().length)return;const y=e.config,l=u.currentTime,c=s.levelTargetDuration,p=s.live&&y.liveBackBufferLength!==null?y.liveBackBufferLength:y.backBufferLength;if(Ci(p)&&p>0){const r=Math.max(p,c),i=Math.floor(l/c)*c-r;this.flushBackBuffer(l,c,i)}if(Ci(y.frontBufferFlushThreshold)&&y.frontBufferFlushThreshold>0){const r=Math.max(y.maxBufferLength,y.frontBufferFlushThreshold),i=Math.max(r,c),t=Math.floor(l/c)*c+i;this.flushFrontBuffer(l,c,t)}}flushBackBuffer(e,s,u){const{details:A,sourceBuffer:y}=this;this.getSourceBufferTypes().forEach(c=>{const p=y[c];if(p){const r=mn.getBuffered(p);if(r.length>0&&u>r.start(0)){if(this.hls.trigger(rt.BACK_BUFFER_REACHED,{bufferEnd:u}),A!=null&&A.live)this.hls.trigger(rt.LIVE_BACK_BUFFER_REACHED,{bufferEnd:u});else if(p.ended&&r.end(r.length-1)-e{const c=A[l];if(c){const p=mn.getBuffered(c),r=p.length;if(r<2)return;const i=p.start(r-1),t=p.end(r-1);if(u>i||e>=i&&e<=t)return;if(c.ended&&e-t<2*s){this.log(`Cannot flush ${l} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(rt.BUFFER_FLUSHING,{startOffset:i,endOffset:1/0,type:l})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:s,media:u,mediaSource:A}=this,y=e.fragments[0].start+e.totalduration,l=u.duration,c=Ci(A.duration)?A.duration:0;e.live&&s.config.liveDurationInfinity?(A.duration=1/0,this.updateSeekableRange(e)):(y>c&&y>l||!Ci(l))&&(this.log(`Updating Media Source duration to ${y.toFixed(3)}`),A.duration=y)}updateSeekableRange(e){const s=this.mediaSource,u=e.fragments;if(u.length&&e.live&&s!=null&&s.setLiveSeekableRange){const y=Math.max(0,u[0].start),l=Math.max(y,y+e.totalduration);this.log(`Media Source duration is set to ${s.duration}. Setting seekable range to ${y}-${l}.`),s.setLiveSeekableRange(y,l)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:s,pendingTracks:u}=this,A=Object.keys(u).length;if(A&&(!e||A===2||"audiovideo"in u)){this.createSourceBuffers(u),this.pendingTracks={};const y=this.getSourceBufferTypes();if(y.length)this.hls.trigger(rt.BUFFER_CREATED,{tracks:this.tracks}),y.forEach(l=>{s.executeNext(l)});else{const l=new Error("could not create source buffer for media codec(s)");this.hls.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:l,reason:l.message})}}}createSourceBuffers(e){const{sourceBuffer:s,mediaSource:u}=this;if(!u)throw Error("createSourceBuffers called when mediaSource was null");for(const A in e)if(!s[A]){const y=e[A];if(!y)throw Error(`source buffer exists for track ${A}, however track does not`);let l=y.levelCodec||y.codec;l&&A.slice(0,5)==="audio"&&(l=Lo(l,this.hls.config.preferManagedMediaSource));const c=`${y.container};codecs=${l}`;this.log(`creating sourceBuffer(${c})`);try{const p=s[A]=u.addSourceBuffer(c),r=A;this.addBufferListener(r,"updatestart",this._onSBUpdateStart),this.addBufferListener(r,"updateend",this._onSBUpdateEnd),this.addBufferListener(r,"error",this._onSBUpdateError),this.addBufferListener(r,"bufferedchange",(i,t)=>{const n=t.removedRanges;n!=null&&n.length&&this.hls.trigger(rt.BUFFER_FLUSHED,{type:A})}),this.tracks[A]={buffer:p,codec:l,container:y.container,levelCodec:y.levelCodec,metadata:y.metadata,id:y.id}}catch(p){this.error(`error while trying to add sourceBuffer: ${p.message}`),this.hls.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:p,sourceBufferName:A,mimeType:c})}}}get mediaSrc(){var e;const s=((e=this.media)==null?void 0:e.firstChild)||this.media;return s==null?void 0:s.src}_onSBUpdateStart(e){const{operationQueue:s}=this;s.current(e).onStart()}_onSBUpdateEnd(e){var s;if(((s=this.mediaSource)==null?void 0:s.readyState)==="closed"){this.resetBuffer(e);return}const{operationQueue:u}=this;u.current(e).onComplete(),u.shiftAndExecuteNext(e)}_onSBUpdateError(e,s){var u;const A=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(u=this.mediaSource)==null?void 0:u.readyState}`);this.error(`${A}`,s),this.hls.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:A,fatal:!1});const y=this.operationQueue.current(e);y&&y.onError(A)}removeExecutor(e,s,u){const{media:A,mediaSource:y,operationQueue:l,sourceBuffer:c}=this,p=c[e];if(!A||!y||!p){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),l.shiftAndExecuteNext(e);return}const r=Ci(A.duration)?A.duration:1/0,i=Ci(y.duration)?y.duration:1/0,t=Math.max(0,s),n=Math.min(u,r,i);n>t&&(!p.ending||p.ended)?(p.ended=!1,this.log(`Removing [${t},${n}] from the ${e} SourceBuffer`),p.remove(t,n)):l.shiftAndExecuteNext(e)}appendExecutor(e,s){const u=this.sourceBuffer[s];if(!u){if(!this.pendingTracks[s])throw new Error(`Attempting to append to the ${s} SourceBuffer, but it does not exist`);return}u.ended=!1,u.appendBuffer(e)}blockBuffers(e,s=this.getSourceBufferTypes()){if(!s.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:u}=this,A=s.map(y=>u.appendBlocker(y));Promise.all(A).then(()=>{e(),s.forEach(y=>{const l=this.sourceBuffer[y];l!=null&&l.updating||u.shiftAndExecuteNext(y)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,s,u){const A=this.sourceBuffer[e];if(!A)return;const y=u.bind(this,e);this.listeners[e].push({event:s,listener:y}),A.addEventListener(s,y)}removeBufferListeners(e){const s=this.sourceBuffer[e];s&&this.listeners[e].forEach(u=>{s.removeEventListener(u.event,u.listener)})}}function rf(_){const e=_.querySelectorAll("source");[].slice.call(e).forEach(s=>{_.removeChild(s)})}function _4(_,e){const s=self.document.createElement("source");s.type="video/mp4",s.src=e,_.appendChild(s)}const sf={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},d0=function(e){let s=e;return sf.hasOwnProperty(e)&&(s=sf[e]),String.fromCharCode(s)},Cr=15,Jr=100,E4={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},w4={17:2,18:4,21:6,22:8,23:10,19:13,20:15},S4={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},T4={25:2,26:4,29:6,30:8,31:10,27:13,28:15},C4=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class x4{constructor(){this.time=null,this.verboseLevel=0}log(e,s){if(this.verboseLevel>=e){const u=typeof s=="function"?s():s;Ft.log(`${this.time} [${e}] ${u}`)}}}const ys=function(e){const s=[];for(let u=0;uJr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Jr)}moveCursor(e){const s=this.pos+e;if(e>1)for(let u=this.pos+1;u=144&&this.backSpace();const s=d0(e);if(this.pos>=Jr){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+s+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(s,this.currPenState),this.moveCursor(1)}clearFromPos(e){let s;for(s=e;s"pacData = "+JSON.stringify(e));let s=e.row-1;if(this.nrRollUpRows&&s"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,s=this.rows.splice(e,1)[0];s.clear(),this.rows.splice(this.currRow,0,s),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const s=[];let u="",A=-1;for(let y=0;y0&&(e?u="["+s.join(" | ")+"]":u=s.join(` +`)),u}getTextAndFormat(){return this.rows}}class af{constructor(e,s,u){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=s,this.mode=null,this.verbose=0,this.displayedMemory=new vc(u),this.nonDisplayedMemory=new vc(u),this.lastOutputScreen=new vc(u),this.currRollUpRow=this.displayedMemory.rows[Cr-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=u}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Cr-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let u=0;us+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const s={flash:!1};if(s.underline=e%2===1,s.italics=e>=46,s.italics)s.foreground="white";else{const u=Math.floor(e/2)-16,A=["white","green","blue","cyan","red","yellow","magenta"];s.foreground=A[u]}this.logger.log(2,"MIDROW: "+JSON.stringify(s)),this.writeScreen.setPen(s)}outputDataUpdate(e=!1){const s=this.logger.time;s!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=s:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,s,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:s),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class of{constructor(e,s,u){this.channels=void 0,this.currentChannel=0,this.cmdHistory=cf(),this.logger=void 0;const A=this.logger=new x4;this.channels=[null,new af(e,s,A),new af(e+1,u,A)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,s){this.channels[e].setHandler(s)}addData(e,s){let u,A,y,l=!1;this.logger.time=e;for(let c=0;c ("+ys([A,y])+")"),u=this.parseCmd(A,y),u||(u=this.parseMidrow(A,y)),u||(u=this.parsePAC(A,y)),u||(u=this.parseBackgroundAttributes(A,y)),!u&&(l=this.parseChars(A,y),l)){const p=this.currentChannel;p&&p>0?this.channels[p].insertChars(l):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!u&&!l&&this.logger.log(2,"Couldn't parse cleaned data "+ys([A,y])+" orig: "+ys([s[c],s[c+1]]))}}parseCmd(e,s){const{cmdHistory:u}=this,A=(e===20||e===28||e===21||e===29)&&s>=32&&s<=47,y=(e===23||e===31)&&s>=33&&s<=35;if(!(A||y))return!1;if(lf(e,s,u))return Ks(null,null,u),this.logger.log(3,"Repeated command ("+ys([e,s])+") is dropped"),!0;const l=e===20||e===21||e===23?1:2,c=this.channels[l];return e===20||e===21||e===28||e===29?s===32?c.ccRCL():s===33?c.ccBS():s===34?c.ccAOF():s===35?c.ccAON():s===36?c.ccDER():s===37?c.ccRU(2):s===38?c.ccRU(3):s===39?c.ccRU(4):s===40?c.ccFON():s===41?c.ccRDC():s===42?c.ccTR():s===43?c.ccRTD():s===44?c.ccEDM():s===45?c.ccCR():s===46?c.ccENM():s===47&&c.ccEOC():c.ccTO(s-32),Ks(e,s,u),this.currentChannel=l,!0}parseMidrow(e,s){let u=0;if((e===17||e===25)&&s>=32&&s<=47){if(e===17?u=1:u=2,u!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const A=this.channels[u];return A?(A.ccMIDROW(s),this.logger.log(3,"MIDROW ("+ys([e,s])+")"),!0):!1}return!1}parsePAC(e,s){let u;const A=this.cmdHistory,y=(e>=17&&e<=23||e>=25&&e<=31)&&s>=64&&s<=127,l=(e===16||e===24)&&s>=64&&s<=95;if(!(y||l))return!1;if(lf(e,s,A))return Ks(null,null,A),!0;const c=e<=23?1:2;s>=64&&s<=95?u=c===1?E4[e]:S4[e]:u=c===1?w4[e]:T4[e];const p=this.channels[c];return p?(p.setPAC(this.interpretPAC(u,s)),Ks(e,s,A),this.currentChannel=c,!0):!1}interpretPAC(e,s){let u;const A={color:null,italics:!1,indent:null,underline:!1,row:e};return s>95?u=s-96:u=s-64,A.underline=(u&1)===1,u<=13?A.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(u/2)]:u<=15?(A.italics=!0,A.color="white"):A.indent=Math.floor((u-16)/2)*4,A}parseChars(e,s){let u,A=null,y=null;if(e>=25?(u=2,y=e-8):(u=1,y=e),y>=17&&y<=19){let l;y===17?l=s+80:y===18?l=s+112:l=s+144,this.logger.log(2,"Special char '"+d0(l)+"' in channel "+u),A=[l]}else e>=32&&e<=127&&(A=s===0?[e]:[e,s]);if(A){const l=ys(A);this.logger.log(3,"Char codes = "+l.join(",")),Ks(e,s,this.cmdHistory)}return A}parseBackgroundAttributes(e,s){const u=(e===16||e===24)&&s>=32&&s<=47,A=(e===23||e===31)&&s>=45&&s<=47;if(!(u||A))return!1;let y;const l={};e===16||e===24?(y=Math.floor((s-32)/2),l.background=C4[y],s%2===1&&(l.background=l.background+"_semi")):s===45?l.background="transparent":(l.foreground="black",s===47&&(l.underline=!0));const c=e<=23?1:2;return this.channels[c].setBkgData(l),Ks(e,s,this.cmdHistory),!0}reset(){for(let e=0;ee)&&(this.startTime=e),this.endTime=s,this.screen=u,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var Od=function(){if(oa!=null&&oa.VTTCue)return self.VTTCue;const _=["","lr","rl"],e=["start","middle","end","left","right"];function s(c,p){if(typeof p!="string"||!Array.isArray(c))return!1;const r=p.toLowerCase();return~c.indexOf(r)?r:!1}function u(c){return s(_,c)}function A(c){return s(e,c)}function y(c,...p){let r=1;for(;r100)throw new Error("Position must be between 0 and 100.");D=L,this.hasBeenReset=!0}})),Object.defineProperty(i,"positionAlign",y({},t,{get:function(){return R},set:function(L){const I=A(L);if(!I)throw new SyntaxError("An invalid or illegal string was specified.");R=I,this.hasBeenReset=!0}})),Object.defineProperty(i,"size",y({},t,{get:function(){return T},set:function(L){if(L<0||L>100)throw new Error("Size must be between 0 and 100.");T=L,this.hasBeenReset=!0}})),Object.defineProperty(i,"align",y({},t,{get:function(){return P},set:function(L){const I=A(L);if(!I)throw new SyntaxError("An invalid or illegal string was specified.");P=I,this.hasBeenReset=!0}})),i.displayState=void 0}return l.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},l}();class I4{decode(e,s){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function h0(_){function e(u,A,y,l){return(u|0)*3600+(A|0)*60+(y|0)+parseFloat(l||0)}const s=_.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return s?parseFloat(s[2])>59?e(s[2],s[3],0,s[4]):e(s[1],s[2],s[3],s[4]):null}class L4{constructor(){this.values=Object.create(null)}set(e,s){!this.get(e)&&s!==""&&(this.values[e]=s)}get(e,s,u){return u?this.has(e)?this.values[e]:s[u]:this.has(e)?this.values[e]:s}has(e){return e in this.values}alt(e,s,u){for(let A=0;A=0&&u<=100)return this.set(e,u),!0}return!1}}function f0(_,e,s,u){const A=u?_.split(u):[_];for(const y in A){if(typeof A[y]!="string")continue;const l=A[y].split(s);if(l.length!==2)continue;const c=l[0],p=l[1];e(c,p)}}const Jc=new Od(0,0,""),ro=Jc.align==="middle"?"middle":"center";function D4(_,e,s){const u=_;function A(){const c=h0(_);if(c===null)throw new Error("Malformed timestamp: "+u);return _=_.replace(/^[^\sa-zA-Z-]+/,""),c}function y(c,p){const r=new L4;f0(c,function(n,a){let o;switch(n){case"region":for(let d=s.length-1;d>=0;d--)if(s[d].id===a){r.set(n,s[d].region);break}break;case"vertical":r.alt(n,a,["rl","lr"]);break;case"line":o=a.split(","),r.integer(n,o[0]),r.percent(n,o[0])&&r.set("snapToLines",!1),r.alt(n,o[0],["auto"]),o.length===2&&r.alt("lineAlign",o[1],["start",ro,"end"]);break;case"position":o=a.split(","),r.percent(n,o[0]),o.length===2&&r.alt("positionAlign",o[1],["start",ro,"end","line-left","line-right","auto"]);break;case"size":r.percent(n,a);break;case"align":r.alt(n,a,["start",ro,"end","left","right"]);break}},/:/,/\s/),p.region=r.get("region",null),p.vertical=r.get("vertical","");let i=r.get("line","auto");i==="auto"&&Jc.line===-1&&(i=-1),p.line=i,p.lineAlign=r.get("lineAlign","start"),p.snapToLines=r.get("snapToLines",!0),p.size=r.get("size",100),p.align=r.get("align",ro);let t=r.get("position","auto");t==="auto"&&Jc.position===50&&(t=p.align==="start"||p.align==="left"?0:p.align==="end"||p.align==="right"?100:50),p.position=t}function l(){_=_.replace(/^\s+/,"")}if(l(),e.startTime=A(),l(),_.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+u);_=_.slice(3),l(),e.endTime=A(),l(),y(_,e)}function p0(_){return _.replace(//gi,` +`)}class O4{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new I4,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const s=this;e&&(s.buffer+=s.decoder.decode(e,{stream:!0}));function u(){let y=s.buffer,l=0;for(y=p0(y);l")===-1){s.cue.id=y;continue}case"CUE":if(!s.cue){s.state="BADCUE";continue}try{D4(y,s.cue,s.regionList)}catch{s.cue=null,s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":{const c=y.indexOf("-->")!==-1;if(!y||c&&(l=!0)){s.oncue&&s.cue&&s.oncue(s.cue),s.cue=null,s.state="ID";continue}if(s.cue===null)continue;s.cue.text&&(s.cue.text+=` +`),s.cue.text+=y}continue;case"BADCUE":y||(s.state="ID")}}}catch{s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=` + +`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(s){e.onparsingerror&&e.onparsingerror(s)}return e.onflush&&e.onflush(),this}}const M4=/\r\n|\n\r|\n|\r/g,bc=function(e,s,u=0){return e.slice(u,u+s.length)===s},P4=function(e){let s=parseInt(e.slice(-3));const u=parseInt(e.slice(-6,-4)),A=parseInt(e.slice(-9,-7)),y=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!Ci(s)||!Ci(u)||!Ci(A)||!Ci(y))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return s+=1e3*u,s+=60*1e3*A,s+=60*60*1e3*y,s},_c=function(e){let s=5381,u=e.length;for(;u;)s=s*33^e.charCodeAt(--u);return(s>>>0).toString()};function Md(_,e,s){return _c(_.toString())+_c(e.toString())+_c(s)}const B4=function(e,s,u){let A=e[s],y=e[A.prevCC];if(!y||!y.new&&A.new){e.ccOffset=e.presentationOffset=A.start,A.new=!1;return}for(;(l=y)!=null&&l.new;){var l;e.ccOffset+=A.start-y.start,A.new=!1,A=y,y=e[A.prevCC]}e.presentationOffset=u};function N4(_,e,s,u,A,y,l){const c=new O4,p=Vr(new Uint8Array(_)).trim().replace(M4,` `).split(` -`),r=[],i=e?i4(e.baseTime,e.timescale):0;let t="00:00.000",n=0,a=0,o,d=!0;c.oncue=function(g){const m=s[u];let v=s.ccOffset;const b=(n-i)/9e4;if(m!=null&&m.new&&(a!==void 0?v=s.ccOffset=m.start:P4(s,u,b)),b){if(!e){o=new Error("Missing initPTS for VTT MPEGTS");return}v=b-s.presentationOffset}const w=g.endTime-g.startTime,C=gr((g.startTime+v-a)*9e4,y*9e4)/9e4;g.startTime=Math.max(C,0),g.endTime=Math.max(C+w,0);const D=g.text.trim();g.text=decodeURIComponent(encodeURIComponent(D)),g.id||(g.id=Md(g.startTime,g.endTime,D)),g.endTime>0&&r.push(g)},c.onparsingerror=function(g){o=g},c.onflush=function(){if(o){l(o);return}A(r)},p.forEach(g=>{if(d)if(bc(g,"X-TIMESTAMP-MAP=")){d=!1,g.slice(16).split(",").forEach(m=>{bc(m,"LOCAL:")?t=m.slice(6):bc(m,"MPEGTS:")&&(n=parseInt(m.slice(7)))});try{a=M4(t)/1e3}catch(m){o=m}return}else g===""&&(d=!1);c.parse(g+` -`)}),c.flush()}const Ec="stpp.ttml.im1t",m0=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,g0=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,N4={left:"start",center:"center",right:"end",start:"start",end:"end"};function df(_,e,s,u){const y=Zi(new Uint8Array(_),["mdat"]);if(y.length===0){u(new Error("Could not parse IMSC1 mdat"));return}const A=y.map(c=>Vr(c)),l=t4(e.baseTime,1,e.timescale);try{A.forEach(c=>s(F4(c,l)))}catch(c){u(c)}}function F4(_,e){const y=new DOMParser().parseFromString(_,"text/xml").getElementsByTagName("tt")[0];if(!y)throw new Error("Invalid ttml");const A={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},l=Object.keys(A).reduce((t,n)=>(t[n]=y.getAttribute(`ttp:${n}`)||A[n],t),{}),c=y.getAttribute("xml:space")!=="preserve",p=uf(wc(y,"styling","style")),r=uf(wc(y,"layout","region")),i=wc(y,"body","[begin]");return[].map.call(i,t=>{const n=A0(t,c);if(!n||!t.hasAttribute("begin"))return null;const a=Tc(t.getAttribute("begin"),l),o=Tc(t.getAttribute("dur"),l);let d=Tc(t.getAttribute("end"),l);if(a===null)throw hf(t);if(d===null){if(o===null)throw hf(t);d=a+o}const g=new Od(a-e,d-e,n);g.id=Md(g.startTime,g.endTime,g.text);const m=r[t.getAttribute("region")],v=p[t.getAttribute("style")],b=U4(m,v,p),{textAlign:w}=b;if(w){const C=N4[w];C&&(g.lineAlign=C),g.align=w}return xn(g,b),g}).filter(t=>t!==null)}function wc(_,e,s){const u=_.getElementsByTagName(e)[0];return u?[].slice.call(u.querySelectorAll(s)):[]}function uf(_){return _.reduce((e,s)=>{const u=s.getAttribute("xml:id");return u&&(e[u]=s),e},{})}function A0(_,e){return[].slice.call(_.childNodes).reduce((s,u,y)=>{var A;return u.nodeName==="br"&&y?s+` -`:(A=u.childNodes)!=null&&A.length?A0(u,e):e?s+u.textContent.trim().replace(/\s+/g," "):s+u.textContent},"")}function U4(_,e,s){const u="http://www.w3.org/ns/ttml#styling";let y=null;const A=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],l=_!=null&&_.hasAttribute("style")?_.getAttribute("style"):null;return l&&s.hasOwnProperty(l)&&(y=s[l]),A.reduce((c,p)=>{const r=Sc(e,u,p)||Sc(_,u,p)||Sc(y,u,p);return r&&(c[p]=r),c},{})}function Sc(_,e,s){return _&&_.hasAttributeNS(e,s)?_.getAttributeNS(e,s):null}function hf(_){return new Error(`Could not parse ttml timestamp ${_}`)}function Tc(_,e){if(!_)return null;let s=h0(_);return s===null&&(m0.test(_)?s=G4(_,e):g0.test(_)&&(s=j4(_,e))),s}function G4(_,e){const s=m0.exec(_),u=(s[4]|0)+(s[5]|0)/e.subFrameRate;return(s[1]|0)*3600+(s[2]|0)*60+(s[3]|0)+u/e.frameRate}function j4(_,e){const s=g0.exec(_),u=Number(s[1]);switch(s[2]){case"h":return u*3600;case"m":return u*60;case"ms":return u*1e3;case"f":return u/e.frameRate;case"t":return u/e.tickRate}return u}class V4{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=pf(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(rt.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(rt.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(rt.FRAG_LOADING,this.onFragLoading,this),e.on(rt.FRAG_LOADED,this.onFragLoaded,this),e.on(rt.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(rt.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(rt.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(rt.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(rt.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(rt.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(rt.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(rt.FRAG_LOADING,this.onFragLoading,this),e.off(rt.FRAG_LOADED,this.onFragLoaded,this),e.off(rt.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(rt.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(rt.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(rt.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(rt.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new no(this,"textTrack1"),s=new no(this,"textTrack2"),u=new no(this,"textTrack3"),y=new no(this,"textTrack4");this.cea608Parser1=new of(1,e,s),this.cea608Parser2=new of(3,u,y)}}addCues(e,s,u,y,A){let l=!1;for(let c=A.length;c--;){const p=A[c],r=H4(p[0],p[1],s,u);if(r>=0&&(p[0]=Math.min(p[0],s),p[1]=Math.max(p[1],u),l=!0,r/(u-s)>.5))return}if(l||A.push([s,u]),this.config.renderTextTracksNatively){const c=this.captionsTracks[e];this.Cues.newCue(c,s,u,y)}else{const c=this.Cues.newCue(null,s,u,y);this.hls.trigger(rt.CUES_PARSED,{type:"captions",cues:c,track:e})}}onInitPtsFound(e,{frag:s,id:u,initPTS:y,timescale:A}){const{unparsedVttFrags:l}=this;u==="main"&&(this.initPTS[s.cc]={baseTime:y,timescale:A}),l.length&&(this.unparsedVttFrags=[],l.forEach(c=>{this.onFragLoaded(rt.FRAG_LOADED,c)}))}getExistingTrack(e,s){const{media:u}=this;if(u)for(let y=0;y{Zs(e[s]),delete e[s]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=pf(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const s=e.textTracks;if(s)for(let u=0;uA.textCodec===Ec);if(this.config.enableWebVTT||y&&this.config.enableIMSC1){if(c0(this.tracks,u)){this.tracks=u;return}if(this.textTracks=[],this.tracks=u,this.config.renderTextTracksNatively){const l=this.media,c=l?po(l.textTracks):null;if(this.tracks.forEach((p,r)=>{let i;if(c){let t=null;for(let n=0;nr!==null).map(r=>r.label);p.length&&Ft.warn(`Media element contains unused subtitle tracks: ${p.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const l=this.tracks.map(c=>({label:c.name,kind:c.type.toLowerCase(),default:c.default,subtitleTrack:c}));this.hls.trigger(rt.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:l})}}}onManifestLoaded(e,s){this.config.enableCEA708Captions&&s.captions&&s.captions.forEach(u=>{const y=/(?:CC|SERVICE)([1-4])/.exec(u.instreamId);if(!y)return;const A=`textTrack${y[1]}`,l=this.captionsProperties[A];l&&(l.label=u.name,u.lang&&(l.languageCode=u.lang),l.media=u)})}closedCaptionsForLevel(e){const s=this.hls.levels[e.level];return s==null?void 0:s.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,s){this.initCea608Parsers();const{cea608Parser1:u,cea608Parser2:y,lastCc:A,lastSn:l,lastPartIndex:c}=this;if(!(!this.enabled||!u||!y)&&s.frag.type===Hi.MAIN){var p,r;const{cc:i,sn:t}=s.frag,n=(p=s==null||(r=s.part)==null?void 0:r.index)!=null?p:-1;t===l+1||t===l&&n===c+1||i===A||(u.reset(),y.reset()),this.lastCc=i,this.lastSn=t,this.lastPartIndex=n}}onFragLoaded(e,s){const{frag:u,payload:y}=s;if(u.type===Hi.SUBTITLE)if(y.byteLength){const A=u.decryptdata,l="stats"in s;if(A==null||!A.encrypted||l){const c=this.tracks[u.level],p=this.vttCCs;p[u.cc]||(p[u.cc]={start:u.start,prevCC:this.prevCC,new:!0},this.prevCC=u.cc),c&&c.textCodec===Ec?this._parseIMSC1(u,y):this._parseVTTs(s)}}else this.hls.trigger(rt.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,s){const u=this.hls;df(s,this.initPTS[e.cc],y=>{this._appendCues(y,e.level),u.trigger(rt.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},y=>{Ft.log(`Failed to parse IMSC1: ${y}`),u.trigger(rt.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:y})})}_parseVTTs(e){var s;const{frag:u,payload:y}=e,{initPTS:A,unparsedVttFrags:l}=this,c=A.length-1;if(!A[u.cc]&&c===-1){l.push(e);return}const p=this.hls,r=(s=u.initSegment)!=null&&s.data?Ar(u.initSegment.data,new Uint8Array(y)):y;B4(r,this.initPTS[u.cc],this.vttCCs,u.cc,u.start,i=>{this._appendCues(i,u.level),p.trigger(rt.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},i=>{const t=i.message==="Missing initPTS for VTT MPEGTS";t?l.push(e):this._fallbackToIMSC1(u,y),Ft.log(`Failed to parse VTT cue: ${i}`),!(t&&c>u.cc)&&p.trigger(rt.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:i})})}_fallbackToIMSC1(e,s){const u=this.tracks[e.level];u.textCodec||df(s,this.initPTS[e.cc],()=>{u.textCodec=Ec,this._parseIMSC1(e,s)},()=>{u.textCodec="wvtt"})}_appendCues(e,s){const u=this.hls;if(this.config.renderTextTracksNatively){const y=this.textTracks[s];if(!y||y.mode==="disabled")return;e.forEach(A=>Np(y,A))}else{const y=this.tracks[s];if(!y)return;const A=y.default?"default":"subtitles"+s;u.trigger(rt.CUES_PARSED,{type:"subtitles",cues:e,track:A})}}onFragDecrypted(e,s){const{frag:u}=s;u.type===Hi.SUBTITLE&&this.onFragLoaded(rt.FRAG_LOADED,s)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,s){this.initCea608Parsers();const{cea608Parser1:u,cea608Parser2:y}=this;if(!this.enabled||!u||!y)return;const{frag:A,samples:l}=s;if(!(A.type===Hi.MAIN&&this.closedCaptionsForLevel(A)==="NONE"))for(let c=0;cVc(c[p],s,u))}if(this.config.renderTextTracksNatively&&s===0&&y!==void 0){const{textTracks:c}=this;Object.keys(c).forEach(p=>Vc(c[p],s,y))}}}extractCea608Data(e){const s=[[],[]],u=e[0]&31;let y=2;for(let A=0;Athis.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=s.autoLevelCapping}}}getMaxLevel(e){const s=this.hls.levels;if(!s.length)return-1;const u=s.filter((y,A)=>this.isLevelAllowed(y)&&A<=e);return this.clientRect=null,Pd.getMaxLevelByMediaSize(u,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,s={width:0,height:0};if(e){const u=e.getBoundingClientRect();s.width=u.width,s.height=u.height,!s.width&&!s.height&&(s.width=u.right-u.left||e.width||0,s.height=u.bottom-u.top||e.height||0)}return this.clientRect=s,s}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return e}isLevelAllowed(e){return!this.restrictedLevels.some(u=>e.bitrate===u.bitrate&&e.width===u.width&&e.height===u.height)}static getMaxLevelByMediaSize(e,s,u){if(!(e!=null&&e.length))return-1;const y=(c,p)=>p?c.width!==p.width||c.height!==p.height:!0;let A=e.length-1;const l=Math.max(s,u);for(let c=0;c=l||p.height>=l)&&y(p,e[c+1])){A=c;break}}return A}}class z4{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(rt.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(rt.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,s){const u=this.hls.config;if(u.capLevelOnFPSDrop){const y=s.media instanceof self.HTMLVideoElement?s.media:null;this.media=y,y&&typeof y.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),u.fpsDroppedMonitoringPeriod)}}checkFPS(e,s,u){const y=performance.now();if(s){if(this.lastTime){const A=y-this.lastTime,l=u-this.lastDroppedFrames,c=s-this.lastDecodedFrames,p=1e3*l/A,r=this.hls;if(r.trigger(rt.FPS_DROP,{currentDropped:l,currentDecoded:c,totalDroppedFrames:u}),p>0&&l>r.config.fpsDroppedMonitoringThreshold*c){let i=r.currentLevel;Ft.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=i)&&(i=i-1,r.trigger(rt.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:r.currentLevel}),r.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=y,this.lastDroppedFrames=u,this.lastDecodedFrames=s}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const s=e.getVideoPlaybackQuality();this.checkFPS(e,s.totalVideoFrames,s.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const so="[eme]";class ra{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=ra.CDMCleanupPromise?[ra.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=Ft.debug.bind(Ft,so),this.log=Ft.log.bind(Ft,so),this.warn=Ft.warn.bind(Ft,so),this.error=Ft.error.bind(Ft,so),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(rt.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(rt.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(rt.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(rt.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(rt.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(rt.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:s,widevineLicenseUrl:u}=this.config,y=s[e];if(y)return y.licenseUrl;if(e===vn.WIDEVINE&&u)return u;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:s}=this.config,u=s[e];if(u)return u.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const s=this.hls.levels,u=(l,c,p)=>!!l&&p.indexOf(l)===c,y=s.map(l=>l.audioCodec).filter(u),A=s.map(l=>l.videoCodec).filter(u);return y.length+A.length===0&&A.push("avc1.42e01e"),new Promise((l,c)=>{const p=r=>{const i=r.shift();this.getMediaKeysPromise(i,y,A).then(t=>l({keySystem:i,mediaKeys:t})).catch(t=>{r.length?p(r):t instanceof mr?c(t):c(new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))})};p(e)})}requestMediaKeySystemAccess(e,s){const{requestMediaKeySystemAccessFunc:u}=this.config;if(typeof u!="function"){let y=`Configured requestMediaKeySystemAccess is not a function ${u}`;return Sp===null&&self.location.protocol==="http:"&&(y=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(y))}return u(e,s)}getMediaKeysPromise(e,s,u){const y=n_(e,s,u,this.config.drmSystemOptions),A=this.keySystemAccessPromises[e];let l=A==null?void 0:A.keySystemAccess;if(!l){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(y)}`),l=this.requestMediaKeySystemAccess(e,y);const c=this.keySystemAccessPromises[e]={keySystemAccess:l};return l.catch(p=>{this.log(`Failed to obtain access to key-system "${e}": ${p}`)}),l.then(p=>{this.log(`Access for key-system "${p.keySystem}" obtained`);const r=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),c.mediaKeys=p.createMediaKeys().then(i=>(this.log(`Media-keys created for "${e}"`),r.then(t=>t?this.setMediaKeysServerCertificate(i,e,t):i))),c.mediaKeys.catch(i=>{this.error(`Failed to create media-keys for "${e}"}: ${i}`)}),c.mediaKeys})}return l.then(()=>A.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:s,mediaKeys:u}){this.log(`Creating key-system session "${s}" keyId: ${Fr.hexDump(e.keyId||[])}`);const y=u.createSession(),A={decryptdata:e,keySystem:s,mediaKeys:u,mediaKeysSession:y,keyStatus:"status-pending"};return this.mediaKeySessions.push(A),A}renewKeySession(e){const s=e.decryptdata;if(s.pssh){const u=this.createMediaKeySessionContext(e),y=this.getKeyIdString(s),A="cenc";this.keyIdToKeySessionPromise[y]=this.generateRequestWithPreferredKeySession(u,A,s.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Fr.hexDump(e.keyId)}updateKeySession(e,s){var u;const y=e.mediaKeysSession;return this.log(`Updating key-session "${y.sessionId}" for keyID ${Fr.hexDump(((u=e.decryptdata)==null?void 0:u.keyId)||[])} - } (data length: ${s&&s.byteLength})`),y.update(s)}selectKeySystemFormat(e){const s=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${s.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(s)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((s,u)=>{const y=oc(this.config),A=e.map(yh).filter(l=>!!l&&y.indexOf(l)!==-1);return this.getKeySystemSelectionPromise(A).then(({keySystem:l})=>{const c=vh(l);c?s(c):u(new Error(`Unable to find format for key-system "${l}"`))}).catch(u)})}loadKey(e){const s=e.keyInfo.decryptdata,u=this.getKeyIdString(s),y=`(keyId: ${u} format: "${s.keyFormat}" method: ${s.method} uri: ${s.uri})`;this.log(`Starting session for key ${y}`);let A=this.keyIdToKeySessionPromise[u];return A||(A=this.keyIdToKeySessionPromise[u]=this.getKeySystemForKeyPromise(s).then(({keySystem:l,mediaKeys:c})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${y}`),this.attemptSetMediaKeys(l,c).then(()=>{this.throwIfDestroyed();const p=this.createMediaKeySessionContext({keySystem:l,mediaKeys:c,decryptdata:s});return this.generateRequestWithPreferredKeySession(p,"cenc",s.pssh,"playlist-key")}))),A.catch(l=>this.handleError(l))),A}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof mr?this.hls.trigger(rt.ERROR,e.data):this.hls.trigger(rt.ERROR,{type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const s=this.getKeyIdString(e),u=this.keyIdToKeySessionPromise[s];if(!u){const y=yh(e.keyFormat),A=y?[y]:oc(this.config);return this.attemptKeySystemAccess(A)}return u}getKeySystemSelectionPromise(e){if(e.length||(e=oc(this.config)),e.length===0)throw new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:s,initData:u}=e;if(this.debug(`"${e.type}" event: init data type: "${s}"`),u===null)return;let y,A;if(s==="sinf"&&this.config.drmSystems[vn.FAIRPLAY]){const i=In(new Uint8Array(u));try{const t=vd(JSON.parse(i).sinf),n=Dp(new Uint8Array(t));if(!n)return;y=n.subarray(8,24),A=vn.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const i=k_(u);if(i===null)return;i.version===0&&i.systemId===wp.WIDEVINE&&i.data&&(y=i.data.subarray(8,24)),A=i_(i.systemId)}if(!A||!y)return;const l=Fr.hexDump(y),{keyIdToKeySessionPromise:c,mediaKeySessions:p}=this;let r=c[l];for(let i=0;ithis.generateRequestWithPreferredKeySession(t,s,u,"encrypted-event-key-match"));break}}r||(r=c[l]=this.getKeySystemSelectionPromise([A]).then(({keySystem:i,mediaKeys:t})=>{var n;this.throwIfDestroyed();const a=new Ia("ISO-23001-7",l,(n=vh(i))!=null?n:"");return a.pssh=new Uint8Array(u),a.keyId=y,this.attemptSetMediaKeys(i,t).then(()=>{this.throwIfDestroyed();const o=this.createMediaKeySessionContext({decryptdata:a,keySystem:i,mediaKeys:t});return this.generateRequestWithPreferredKeySession(o,s,u,"encrypted-event-no-match")})})),r.catch(i=>this.handleError(i))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,s){const u=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const y=Promise.all(u).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(s)});return this.setMediaKeysQueue.push(y),y.then(()=>{this.log(`Media-keys set for "${e}"`),u.push(y),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(A=>u.indexOf(A)===-1)})}generateRequestWithPreferredKeySession(e,s,u,y){var A,l;const c=(A=this.config.drmSystems)==null||(l=A[e.keySystem])==null?void 0:l.generateRequest;if(c)try{const o=c.call(this.hls,s,u,e);if(!o)throw new Error("Invalid response from configured generateRequest filter");s=o.initDataType,u=e.decryptdata.pssh=o.initData?new Uint8Array(o.initData):null}catch(o){var p;if(this.warn(o.message),(p=this.hls)!=null&&p.config.debug)throw o}if(u===null)return this.log(`Skipping key-session request for "${y}" (no initData)`),Promise.resolve(e);const r=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${y}": ${r} (init data type: ${s} length: ${u?u.byteLength:null})`);const i=new Dd,t=e._onmessage=o=>{const d=e.mediaKeysSession;if(!d){i.emit("error",new Error("invalid state"));return}const{messageType:g,message:m}=o;this.log(`"${g}" message event for session "${d.sessionId}" message size: ${m.byteLength}`),g==="license-request"||g==="license-renewal"?this.renewLicense(e,m).catch(v=>{this.handleError(v),i.emit("error",v)}):g==="license-release"?e.keySystem===vn.FAIRPLAY&&(this.updateKeySession(e,Gc("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${g}"`)},n=e._onkeystatuseschange=o=>{if(!e.mediaKeysSession){i.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const g=e.keyStatus;i.emit("keyStatus",g),g==="expired"&&(this.warn(`${e.keySystem} expired for key ${r}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",t),e.mediaKeysSession.addEventListener("keystatuseschange",n);const a=new Promise((o,d)=>{i.on("error",d),i.on("keyStatus",g=>{g.startsWith("usable")?o():g==="output-restricted"?d(new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):g==="internal-error"?d(new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${g}"`)):g==="expired"?d(new Error("key expired while generating request")):this.warn(`unhandled key status change "${g}"`)})});return e.mediaKeysSession.generateRequest(s,u).then(()=>{var o;this.log(`Request generated for key-session "${(o=e.mediaKeysSession)==null?void 0:o.sessionId}" keyId: ${r}`)}).catch(o=>{throw new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_NO_SESSION,error:o,fatal:!1},`Error generating key-session request: ${o}`)}).then(()=>a).catch(o=>{throw i.removeAllListeners(),this.removeSession(e),o}).then(()=>(i.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((s,u)=>{this.log(`key status change "${s}" for keyStatuses keyId: ${Fr.hexDump("buffer"in u?new Uint8Array(u.buffer,u.byteOffset,u.byteLength):new Uint8Array(u))} session keyId: ${Fr.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=s})}fetchServerCertificate(e){const s=this.config,u=s.loader,y=new u(s),A=this.getServerCertificateUrl(e);return A?(this.log(`Fetching server certificate for "${e}"`),new Promise((l,c)=>{const p={responseType:"arraybuffer",url:A},r=s.certLoadPolicy.default,i={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},t={onSuccess:(n,a,o,d)=>{l(n.data)},onError:(n,a,o,d)=>{c(new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:Dn({url:p.url,data:void 0},n)},`"${e}" certificate request failed (${A}). Status: ${n.code} (${n.text})`))},onTimeout:(n,a,o)=>{c(new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:p.url,data:void 0}},`"${e}" certificate request timed out (${A})`))},onAbort:(n,a,o)=>{c(new Error("aborted"))}};y.load(p,i,t)})):Promise.resolve()}setMediaKeysServerCertificate(e,s,u){return new Promise((y,A)=>{e.setServerCertificate(u).then(l=>{this.log(`setServerCertificate ${l?"success":"not supported by CDM"} (${u==null?void 0:u.byteLength}) on "${s}"`),y(e)}).catch(l=>{A(new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:l,fatal:!0},l.message))})})}renewLicense(e,s){return this.requestLicense(e,new Uint8Array(s)).then(u=>this.updateKeySession(e,new Uint8Array(u)).catch(y=>{throw new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:y,fatal:!0},y.message)}))}unpackPlayReadyKeyMessage(e,s){const u=String.fromCharCode.apply(null,new Uint16Array(s.buffer));if(!u.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),s;const y=new DOMParser().parseFromString(u,"application/xml"),A=y.querySelectorAll("HttpHeader");if(A.length>0){let i;for(let t=0,n=A.length;t in key message");return Gc(atob(r))}setupLicenseXHR(e,s,u,y){const A=this.config.licenseXhrSetup;return A?Promise.resolve().then(()=>{if(!u.decryptdata)throw new Error("Key removed");return A.call(this.hls,e,s,u,y)}).catch(l=>{if(!u.decryptdata)throw l;return e.open("POST",s,!0),A.call(this.hls,e,s,u,y)}).then(l=>(e.readyState||e.open("POST",s,!0),{xhr:e,licenseChallenge:l||y})):(e.open("POST",s,!0),Promise.resolve({xhr:e,licenseChallenge:y}))}requestLicense(e,s){const u=this.config.keyLoadPolicy.default;return new Promise((y,A)=>{const l=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${l}`);const c=new XMLHttpRequest;c.responseType="arraybuffer",c.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return A(new Error("invalid state"));if(c.readyState===4)if(c.status===200){this._requestLicenseFailureCount=0;let p=c.response;this.log(`License received ${p instanceof ArrayBuffer?p.byteLength:p}`);const r=this.config.licenseResponseCallback;if(r)try{p=r.call(this.hls,c,l,e)}catch(i){this.error(i)}y(p)}else{const p=u.errorRetry,r=p?p.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>r||c.status>=400&&c.status<500)A(new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:c,response:{url:l,data:void 0,code:c.status,text:c.statusText}},`License Request XHR failed (${l}). Status: ${c.status} (${c.statusText})`));else{const i=r-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${i} attempts left`),this.requestLicense(e,s).then(y,A)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=c,this.setupLicenseXHR(c,l,e,s).then(({xhr:p,licenseChallenge:r})=>{e.keySystem==vn.PLAYREADY&&(r=this.unpackPlayReadyKeyMessage(p,r)),p.send(r)})})}onMediaAttached(e,s){if(!this.config.emeEnabled)return;const u=s.media;this.media=u,u.addEventListener("encrypted",this.onMediaEncrypted),u.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,s=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Ia.clearKeyUriToKeyIdMap();const u=s.length;ra.CDMCleanupPromise=Promise.all(s.map(y=>this.removeSession(y)).concat(e==null?void 0:e.setMediaKeys(null).catch(y=>{this.log(`Could not clear media keys: ${y}`)}))).then(()=>{u&&(this.log("finished closing key sessions and clearing media keys"),s.length=0)}).catch(y=>{this.log(`Could not close sessions and clear media keys: ${y}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:s}){if(!(!s||!this.config.emeEnabled)&&!this.keyFormatPromise){const u=s.reduce((y,A)=>(y.indexOf(A.keyFormat)===-1&&y.push(A.keyFormat),y),[]);this.log(`Selecting key-system from session-keys ${u.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(u)}}removeSession(e){const{mediaKeysSession:s,licenseXhr:u}=e;if(s){this.log(`Remove licenses and keys and close session ${s.sessionId}`),e._onmessage&&(s.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(s.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),u&&u.readyState!==XMLHttpRequest.DONE&&u.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const y=this.mediaKeySessions.indexOf(e);return y>-1&&this.mediaKeySessions.splice(y,1),s.remove().catch(A=>{this.log(`Could not remove session: ${A}`)}).then(()=>s.close()).catch(A=>{this.log(`Could not close session: ${A}`)})}}}ra.CDMCleanupPromise=void 0;class mr extends Error{constructor(e,s){super(s),this.data=void 0,e.error||(e.error=new Error(s)),this.data=e,e.err=e.error}}var zn;(function(_){_.MANIFEST="m",_.AUDIO="a",_.VIDEO="v",_.MUXED="av",_.INIT="i",_.CAPTION="c",_.TIMED_TEXT="tt",_.KEY="k",_.OTHER="o"})(zn||(zn={}));var Qc;(function(_){_.DASH="d",_.HLS="h",_.SMOOTH="s",_.OTHER="o"})(Qc||(Qc={}));var _s;(function(_){_.OBJECT="CMCD-Object",_.REQUEST="CMCD-Request",_.SESSION="CMCD-Session",_.STATUS="CMCD-Status"})(_s||(_s={}));const W4={[_s.OBJECT]:["br","d","ot","tb"],[_s.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[_s.SESSION]:["cid","pr","sf","sid","st","v"],[_s.STATUS]:["bs","rtp"]};class da{constructor(e,s){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(u=>u instanceof da?u:new da(u))),this.value=e,this.params=s}}class v0{constructor(e){this.description=void 0,this.description=e}}const K4="Dict";function q4(_){return Array.isArray(_)?JSON.stringify(_):_ instanceof Map?"Map{}":_ instanceof Set?"Set{}":typeof _=="object"?JSON.stringify(_):String(_)}function Y4(_,e,s,u){return new Error(`failed to ${_} "${q4(e)}" as ${s}`,{cause:u})}const mf="Bare Item",J4="Boolean",Q4="Byte Sequence",Z4="Decimal",X4="Integer";function $4(_){return _<-999999999999999||999999999999999<_}const e8=/[\x00-\x1f\x7f]+/,t8="Token",i8="Key";function Hr(_,e,s){return Y4("serialize",_,e,s)}function n8(_){if(typeof _!="boolean")throw Hr(_,J4);return _?"?1":"?0"}function r8(_){return btoa(String.fromCharCode(..._))}function s8(_){if(ArrayBuffer.isView(_)===!1)throw Hr(_,Q4);return`:${r8(_)}:`}function b0(_){if($4(_))throw Hr(_,X4);return _.toString()}function a8(_){return`@${b0(_.getTime()/1e3)}`}function _0(_,e){if(_<0)return-_0(-_,e);const s=Math.pow(10,e);if(Math.abs(_*s%1-.5)12)throw Hr(_,Z4);const s=e.toString();return s.includes(".")?s:`${s}.0`}const l8="String";function c8(_){if(e8.test(_))throw Hr(_,l8);return`"${_.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function d8(_){return _.description||_.toString().slice(7,-1)}function gf(_){const e=d8(_);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Hr(e,t8);return e}function Zc(_){switch(typeof _){case"number":if(!Ci(_))throw Hr(_,mf);return Number.isInteger(_)?b0(_):o8(_);case"string":return c8(_);case"symbol":return gf(_);case"boolean":return n8(_);case"object":if(_ instanceof Date)return a8(_);if(_ instanceof Uint8Array)return s8(_);if(_ instanceof v0)return gf(_);default:throw Hr(_,mf)}}function Xc(_){if(/^[a-z*][a-z0-9\-_.*]*$/.test(_)===!1)throw Hr(_,i8);return _}function Bd(_){return _==null?"":Object.entries(_).map(([e,s])=>s===!0?`;${Xc(e)}`:`;${Xc(e)}=${Zc(s)}`).join("")}function E0(_){return _ instanceof da?`${Zc(_.value)}${Bd(_.params)}`:Zc(_)}function u8(_){return`(${_.value.map(E0).join(" ")})${Bd(_.params)}`}function h8(_,e={whitespace:!0}){if(typeof _!="object")throw Hr(_,K4);const s=_ instanceof Map?_.entries():Object.entries(_),u=e!=null&&e.whitespace?" ":"";return Array.from(s).map(([y,A])=>{A instanceof da||(A=new da(A));let l=Xc(y);return A.value===!0?l+=Bd(A.params):(l+="=",Array.isArray(A.value)?l+=u8(A):l+=E0(A)),l}).join(`,${u}`)}function f8(_,e){return h8(_,e)}const p8=_=>_==="ot"||_==="sf"||_==="st",m8=_=>typeof _=="number"?Ci(_):_!=null&&_!==""&&_!==!1;function g8(_,e){const s=new URL(_),u=new URL(e);if(s.origin!==u.origin)return _;const y=s.pathname.split("/").slice(1),A=u.pathname.split("/").slice(1,-1);for(;y[0]===A[0];)y.shift(),A.shift();for(;A.length;)A.shift(),y.unshift("..");return y.join("/")}function A8(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),s=e.toString();return URL.revokeObjectURL(e),s.slice(s.lastIndexOf("/")+1)}catch{let s=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,y=>{const A=(s+Math.random()*16)%16|0;return s=Math.floor(s/16),(y=="x"?A:A&3|8).toString(16)})}}}const vo=_=>Math.round(_),y8=(_,e)=>(e!=null&&e.baseUrl&&(_=g8(_,e.baseUrl)),encodeURIComponent(_)),ao=_=>vo(_/100)*100,v8={br:vo,d:vo,bl:ao,dl:ao,mtp:ao,nor:y8,rtp:ao,tb:vo};function b8(_,e){const s={};if(_==null||typeof _!="object")return s;const u=Object.keys(_).sort(),y=xn({},v8,e==null?void 0:e.formatters),A=e==null?void 0:e.filter;return u.forEach(l=>{if(A!=null&&A(l))return;let c=_[l];const p=y[l];p&&(c=p(c,e)),!(l==="v"&&c===1)&&(l=="pr"&&c===1||m8(c)&&(p8(l)&&typeof c=="string"&&(c=new v0(c)),s[l]=c))}),s}function w0(_,e={}){return _?f8(b8(_,e),xn({whitespace:!1},e)):""}function _8(_,e={}){if(!_)return{};const s=Object.entries(_),u=Object.entries(W4).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),y=s.reduce((A,l)=>{var c,p;const[r,i]=l,t=((c=u.find(n=>n[1].includes(r)))==null?void 0:c[0])||_s.REQUEST;return(p=A[t])!=null||(A[t]={}),A[t][r]=i,A},{});return Object.entries(y).reduce((A,[l,c])=>(A[l]=w0(c,e),A),{})}function E8(_,e,s){return xn(_,_8(e,s))}const w8="CMCD";function S8(_,e={}){if(!_)return"";const s=w0(_,e);return`${w8}=${encodeURIComponent(s)}`}const Af=/CMCD=[^&#]+/;function T8(_,e,s){const u=S8(e,s);if(!u)return _;if(Af.test(_))return _.replace(Af,u);const y=_.includes("?")?"&":"?";return`${_}${y}${u}`}class C8{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=y=>{try{this.apply(y,{ot:zn.MANIFEST,su:!this.initialized})}catch(A){Ft.warn("Could not generate manifest CMCD data.",A)}},this.applyFragmentData=y=>{try{const A=y.frag,l=this.hls.levels[A.level],c=this.getObjectType(A),p={d:A.duration*1e3,ot:c};(c===zn.VIDEO||c===zn.AUDIO||c==zn.MUXED)&&(p.br=l.bitrate/1e3,p.tb=this.getTopBandwidth(c)/1e3,p.bl=this.getBufferLength(c)),this.apply(y,p)}catch(A){Ft.warn("Could not generate segment CMCD data.",A)}},this.hls=e;const s=this.config=e.config,{cmcd:u}=s;u!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=u.sessionId||A8(),this.cid=u.contentId,this.useHeaders=u.useHeaders===!0,this.includeKeys=u.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(rt.MEDIA_DETACHED,this.onMediaDetached,this),e.on(rt.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(rt.MEDIA_DETACHED,this.onMediaDetached,this),e.off(rt.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,s){var u,y;this.audioBuffer=(u=s.tracks.audio)==null?void 0:u.buffer,this.videoBuffer=(y=s.tracks.video)==null?void 0:y.buffer}createData(){var e;return{v:1,sf:Qc.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,s={}){xn(s,this.createData());const u=s.ot===zn.INIT||s.ot===zn.VIDEO||s.ot===zn.MUXED;this.starved&&u&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering);const{includeKeys:y}=this;y&&(s=Object.keys(s).reduce((A,l)=>(y.includes(l)&&(A[l]=s[l]),A),{})),this.useHeaders?(e.headers||(e.headers={}),E8(e.headers,s)):e.url=T8(e.url,s)}getObjectType(e){const{type:s}=e;if(s==="subtitle")return zn.TIMED_TEXT;if(e.sn==="initSegment")return zn.INIT;if(s==="audio")return zn.AUDIO;if(s==="main")return this.hls.audioTracks.length?zn.VIDEO:zn.MUXED}getTopBandwidth(e){let s=0,u;const y=this.hls;if(e===zn.AUDIO)u=y.audioTracks;else{const A=y.maxAutoLevel,l=A>-1?A+1:y.levels.length;u=y.levels.slice(0,l)}for(const A of u)A.bitrate>s&&(s=A.bitrate);return s>0?s:NaN}getBufferLength(e){const s=this.hls.media,u=e===zn.AUDIO?this.audioBuffer:this.videoBuffer;return!u||!s?NaN:mn.bufferInfo(u,s.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,s=this.applyPlaylistData,u=e||this.config.loader;return class{constructor(A){this.loader=void 0,this.loader=new u(A)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(A,l,c){s(A),this.loader.load(A,l,c)}}}createFragmentLoader(){const{fLoader:e}=this.config,s=this.applyFragmentData,u=e||this.config.loader;return class{constructor(A){this.loader=void 0,this.loader=new u(A)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(A,l,c){s(A),this.loader.load(A,l,c)}}}}const x8=3e5;class k8{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=Ft.log.bind(Ft,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.on(rt.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.off(rt.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const s=this.levels;s&&(this.levels=s.filter(u=>u!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,s){const{contentSteering:u}=s;u!==null&&(this.pathwayId=u.pathwayId,this.uri=u.uri,this.started&&this.startLoad())}onManifestParsed(e,s){this.audioTracks=s.audioTracks,this.subtitleTracks=s.subtitleTracks}onError(e,s){const{errorAction:u}=s;if((u==null?void 0:u.action)===Vn.SendAlternateToPenaltyBox&&u.flags===Tr.MoveAllAlternatesMatchingHost){const y=this.levels;let A=this.pathwayPriority,l=this.pathwayId;if(s.context){const{groupId:c,pathwayId:p,type:r}=s.context;c&&y?l=this.getPathwayForGroupId(c,r,l):p&&(l=p)}l in this.penalizedPathways||(this.penalizedPathways[l]=performance.now()),!A&&y&&(A=y.reduce((c,p)=>(c.indexOf(p.pathwayId)===-1&&c.push(p.pathwayId),c),[])),A&&A.length>1&&(this.updatePathwayPriority(A),u.resolved=this.pathwayId!==l),u.resolved||Ft.warn(`Could not resolve ${s.details} ("${s.error.message}") with content-steering for Pathway: ${l} levels: ${y&&y.length} priorities: ${JSON.stringify(A)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let s=this.getLevelsForPathway(this.pathwayId);if(s.length===0){const u=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${u}"`),s=this.getLevelsForPathway(u),this.pathwayId=u}return s.length!==e.length?(this.log(`Found ${s.length}/${e.length} levels in Pathway "${this.pathwayId}"`),s):e}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(s=>e===s.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let s;const u=this.penalizedPathways,y=performance.now();Object.keys(u).forEach(A=>{y-u[A]>x8&&delete u[A]});for(let A=0;A0){this.log(`Setting Pathway to "${l}"`),this.pathwayId=l,jp(s),this.hls.trigger(rt.LEVELS_UPDATED,{levels:s});const r=this.hls.levels[c];p&&r&&this.levels&&(r.attrs["STABLE-VARIANT-ID"]!==p.attrs["STABLE-VARIANT-ID"]&&r.bitrate!==p.bitrate&&this.log(`Unstable Pathways change from bitrate ${p.bitrate} to ${r.bitrate}`),this.hls.nextLoadLevel=c);break}}}getPathwayForGroupId(e,s,u){const y=this.getLevelsForPathway(u).concat(this.levels||[]);for(let A=0;A{const{ID:l,"BASE-ID":c,"URI-REPLACEMENT":p}=A;if(s.some(i=>i.pathwayId===l))return;const r=this.getLevelsForPathway(c).map(i=>{const t=new bn(i.attrs);t["PATHWAY-ID"]=l;const n=t.AUDIO&&`${t.AUDIO}_clone_${l}`,a=t.SUBTITLES&&`${t.SUBTITLES}_clone_${l}`;n&&(u[t.AUDIO]=n,t.AUDIO=n),a&&(y[t.SUBTITLES]=a,t.SUBTITLES=a);const o=S0(i.uri,t["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",p),d=new la({attrs:t,audioCodec:i.audioCodec,bitrate:i.bitrate,height:i.height,name:i.name,url:o,videoCodec:i.videoCodec,width:i.width});if(i.audioGroups)for(let g=1;g{this.log(`Loaded steering manifest: "${y}"`);const o=i.data;if(o.VERSION!==1){this.log(`Steering VERSION ${o.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=o.TTL;const{"RELOAD-URI":d,"PATHWAY-CLONES":g,"PATHWAY-PRIORITY":m}=o;if(d)try{this.uri=new self.URL(d,y).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${d}`);return}this.scheduleRefresh(this.uri||n.url),g&&this.clonePathways(g);const v={steeringManifest:o,url:y.toString()};this.hls.trigger(rt.STEERING_MANIFEST_LOADED,v),m&&this.updatePathwayPriority(m)},onError:(i,t,n,a)=>{if(this.log(`Error loading steering manifest: ${i.code} ${i.text} (${t.url})`),this.stopLoad(),i.code===410){this.enabled=!1,this.log(`Steering manifest ${t.url} no longer available`);return}let o=this.timeToLoad*1e3;if(i.code===429){const d=this.loader;if(typeof(d==null?void 0:d.getResponseHeader)=="function"){const g=d.getResponseHeader("Retry-After");g&&(o=parseFloat(g)*1e3)}this.log(`Steering manifest ${t.url} rate limited`);return}this.scheduleRefresh(this.uri||t.url,o)},onTimeout:(i,t,n)=>{this.log(`Timeout loading steering manifest (${t.url})`),this.scheduleRefresh(this.uri||t.url)}};this.log(`Requesting steering manifest: ${y}`),this.loader.load(A,p,r)}scheduleRefresh(e,s=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var u;const y=(u=this.hls)==null?void 0:u.media;if(y&&!y.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},s)}}function yf(_,e,s,u){_&&Object.keys(e).forEach(y=>{const A=_.filter(l=>l.groupId===y).map(l=>{const c=xn({},l);return c.details=void 0,c.attrs=new bn(c.attrs),c.url=c.attrs.URI=S0(l.url,l.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",s),c.groupId=c.attrs["GROUP-ID"]=e[y],c.attrs["PATHWAY-ID"]=u,c});_.push(...A)})}function S0(_,e,s,u){const{HOST:y,PARAMS:A,[s]:l}=u;let c;e&&(c=l==null?void 0:l[e],c&&(_=c));const p=new self.URL(_);return y&&!c&&(p.host=y),A&&Object.keys(A).sort().forEach(r=>{r&&p.searchParams.set(r,A[r])}),p.href}const R8=/^age:\s*[\d.]+\s*$/im;class T0{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new Zo,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null,this.stats=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,s,u){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=s,this.callbacks=u,this.loadInternal()}loadInternal(){const{config:e,context:s}=this;if(!e||!s)return;const u=this.loader=new self.XMLHttpRequest,y=this.stats;y.loading.first=0,y.loaded=0,y.aborted=!1;const A=this.xhrSetup;A?Promise.resolve().then(()=>{if(!this.stats.aborted)return A(u,s.url)}).catch(l=>(u.open("GET",s.url,!0),A(u,s.url))).then(()=>{this.stats.aborted||this.openAndSendXhr(u,s,e)}).catch(l=>{this.callbacks.onError({code:u.status,text:l.message},s,u,y)}):this.openAndSendXhr(u,s,e)}openAndSendXhr(e,s,u){e.readyState||e.open("GET",s.url,!0);const y=s.headers,{maxTimeToFirstByteMs:A,maxLoadTimeMs:l}=u.loadPolicy;if(y)for(const c in y)e.setRequestHeader(c,y[c]);s.rangeEnd&&e.setRequestHeader("Range","bytes="+s.rangeStart+"-"+(s.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=s.responseType,self.clearTimeout(this.requestTimeout),u.timeout=A&&Ci(A)?A:l,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),u.timeout),e.send()}readystatechange(){const{context:e,loader:s,stats:u}=this;if(!e||!s)return;const y=s.readyState,A=this.config;if(!u.aborted&&y>=2&&(u.loading.first===0&&(u.loading.first=Math.max(self.performance.now(),u.loading.start),A.timeout!==A.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),A.timeout=A.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),A.loadPolicy.maxLoadTimeMs-(u.loading.first-u.loading.start)))),y===4)){self.clearTimeout(this.requestTimeout),s.onreadystatechange=null,s.onprogress=null;const l=s.status,c=s.responseType!=="text";if(l>=200&&l<300&&(c&&s.response||s.responseText!==null)){u.loading.end=Math.max(self.performance.now(),u.loading.first);const p=c?s.response:s.responseText,r=s.responseType==="arraybuffer"?p.byteLength:p.length;if(u.loaded=u.total=r,u.bwEstimate=u.total*8e3/(u.loading.end-u.loading.first),!this.callbacks)return;const i=this.callbacks.onProgress;if(i&&i(u,e,p,s),!this.callbacks)return;const t={url:s.responseURL,data:p,code:l};this.callbacks.onSuccess(t,u,e,s)}else{const p=A.loadPolicy.errorRetry,r=u.retry,i={url:e.url,data:void 0,code:l};Mo(p,r,!1,i)?this.retry(p):(Ft.error(`${l} while loading ${e.url}`),this.callbacks.onError({code:l,text:s.statusText},e,s,u))}}}loadtimeout(){var e;const s=(e=this.config)==null?void 0:e.loadPolicy.timeoutRetry,u=this.stats.retry;if(Mo(s,u,!0))this.retry(s);else{var y;Ft.warn(`timeout while loading ${(y=this.context)==null?void 0:y.url}`);const A=this.callbacks;A&&(this.abortInternal(),A.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:s,stats:u}=this;this.retryDelay=wd(e,u.retry),u.retry++,Ft.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${s==null?void 0:s.url}, retrying ${u.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const s=this.stats;s.loaded=e.loaded,e.lengthComputable&&(s.total=e.total)}getCacheAge(){let e=null;if(this.loader&&R8.test(this.loader.getAllResponseHeaders())){const s=this.loader.getResponseHeader("age");e=s?parseFloat(s):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function I8(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const L8=/(\d+)-(\d+)\/(\d+)/;class vf{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||P8,this.controller=new self.AbortController,this.stats=new Zo}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,s,u){const y=this.stats;if(y.loading.start)throw new Error("Loader can only be used once.");y.loading.start=self.performance.now();const A=D8(e,this.controller.signal),l=u.onProgress,c=e.responseType==="arraybuffer",p=c?"byteLength":"length",{maxTimeToFirstByteMs:r,maxLoadTimeMs:i}=s.loadPolicy;this.context=e,this.config=s,this.callbacks=u,this.request=this.fetchSetup(e,A),self.clearTimeout(this.requestTimeout),s.timeout=r&&Ci(r)?r:i,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),u.onTimeout(y,e,this.response)},s.timeout),self.fetch(this.request).then(t=>{this.response=this.loader=t;const n=Math.max(self.performance.now(),y.loading.start);if(self.clearTimeout(this.requestTimeout),s.timeout=i,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),u.onTimeout(y,e,this.response)},i-(n-y.loading.start)),!t.ok){const{status:a,statusText:o}=t;throw new B8(o||"fetch, bad network response",a,t)}return y.loading.first=n,y.total=M8(t.headers)||y.total,l&&Ci(s.highWaterMark)?this.loadProgressively(t,y,e,s.highWaterMark,l):c?t.arrayBuffer():e.responseType==="json"?t.json():t.text()}).then(t=>{const n=this.response;if(!n)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),y.loading.end=Math.max(self.performance.now(),y.loading.first);const a=t[p];a&&(y.loaded=y.total=a);const o={url:n.url,data:t,code:n.status};l&&!Ci(s.highWaterMark)&&l(y,e,t,n),u.onSuccess(o,y,e,n)}).catch(t=>{if(self.clearTimeout(this.requestTimeout),y.aborted)return;const n=t&&t.code||0,a=t?t.message:null;u.onError({code:n,text:a},e,t?t.details:null,y)})}getCacheAge(){let e=null;if(this.response){const s=this.response.headers.get("age");e=s?parseFloat(s):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,s,u,y=0,A){const l=new Wp,c=e.body.getReader(),p=()=>c.read().then(r=>{if(r.done)return l.dataLength&&A(s,u,l.flush(),e),Promise.resolve(new ArrayBuffer(0));const i=r.value,t=i.length;return s.loaded+=t,t=y&&A(s,u,l.flush(),e)):A(s,u,i,e),p()}).catch(()=>Promise.reject());return p()}}function D8(_,e){const s={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(xn({},_.headers))};return _.rangeEnd&&s.headers.set("Range","bytes="+_.rangeStart+"-"+String(_.rangeEnd-1)),s}function O8(_){const e=L8.exec(_);if(e)return parseInt(e[2])-parseInt(e[1])+1}function M8(_){const e=_.get("Content-Range");if(e){const u=O8(e);if(Ci(u))return u}const s=_.get("Content-Length");if(s)return parseInt(s)}function P8(_,e){return new self.Request(_.url,e)}class B8 extends Error{constructor(e,s,u){super(e),this.code=void 0,this.details=void 0,this.code=s,this.details=u}}const N8=/\s/,F8={newCue(_,e,s,u){const y=[];let A,l,c,p,r;const i=self.VTTCue||self.TextTrackCue;for(let n=0;n=16?p--:p++;const a=p0(r.trim()),o=Md(e,s,a);_!=null&&(t=_.cues)!=null&&t.getCueById(o)||(l=new i(e,s,a),l.id=o,l.line=n+1,l.align="left",l.position=10+Math.min(80,Math.floor(p*8/32)*10),y.push(l))}return _&&y.length&&(y.sort((n,a)=>n.line==="auto"||a.line==="auto"?0:n.line>8&&a.line>8?a.line-n.line:n.line-a.line),y.forEach(n=>Np(_,n))),y}},U8={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},C0=Dn(Dn({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:T0,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:A5,bufferController:v4,capLevelController:Pd,errorController:s5,fpsController:z4,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Sp,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:U8},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},G8()),{},{subtitleStreamController:m4,subtitleTrackController:A4,timelineController:V4,audioStreamController:f4,audioTrackController:p4,emeController:ra,cmcdController:C8,contentSteeringController:k8});function G8(){return{cueHandler:F8,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function j8(_,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const s=$c(_),u=["manifest","level","frag"],y=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return u.forEach(A=>{const l=`${A==="level"?"playlist":A}LoadPolicy`,c=e[l]===void 0,p=[];y.forEach(r=>{const i=`${A}Loading${r}`,t=e[i];if(t!==void 0&&c){p.push(i);const n=s[l].default;switch(e[l]={default:n},r){case"TimeOut":n.maxLoadTimeMs=t,n.maxTimeToFirstByteMs=t;break;case"MaxRetry":n.errorRetry.maxNumRetry=t,n.timeoutRetry.maxNumRetry=t;break;case"RetryDelay":n.errorRetry.retryDelayMs=t,n.timeoutRetry.retryDelayMs=t;break;case"MaxRetryTimeout":n.errorRetry.maxRetryDelayMs=t,n.timeoutRetry.maxRetryDelayMs=t;break}}}),p.length&&Ft.warn(`hls.js config: "${p.join('", "')}" setting(s) are deprecated, use "${l}": ${JSON.stringify(e[l])}`)}),Dn(Dn({},s),e)}function $c(_){return _&&typeof _=="object"?Array.isArray(_)?_.map($c):Object.keys(_).reduce((e,s)=>(e[s]=$c(_[s]),e),{}):_}function V8(_){const e=_.loader;e!==vf&&e!==T0?(Ft.log("[config]: Custom loader detected, cannot enable progressive streaming"),_.progressive=!1):I8()&&(_.loader=vf,_.progressive=!0,_.enableSoftwareAES=!0,Ft.log("[config]: Progressive streaming enabled, using FetchLoader"))}let Cc;class H8 extends Sd{constructor(e,s){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=s,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(rt.LEVEL_LOADED,this.onLevelLoaded,this),e.on(rt.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(rt.FRAG_BUFFERED,this.onFragBuffered,this),e.on(rt.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(rt.LEVEL_LOADED,this.onLevelLoaded,this),e.off(rt.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(rt.FRAG_BUFFERED,this.onFragBuffered,this),e.off(rt.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(s=>{s.loadError=0,s.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,s){this.resetLevels()}onManifestLoaded(e,s){const u=this.hls.config.preferManagedMediaSource,y=[],A={},l={};let c=!1,p=!1,r=!1;s.levels.forEach(i=>{var t,n;const a=i.attrs;let{audioCodec:o,videoCodec:d}=i;((t=o)==null?void 0:t.indexOf("mp4a.40.34"))!==-1&&(Cc||(Cc=/chrome|firefox/i.test(navigator.userAgent)),Cc&&(i.audioCodec=o=void 0)),o&&(i.audioCodec=o=Lo(o,u)),((n=d)==null?void 0:n.indexOf("avc1"))===0&&(d=i.videoCodec=M_(d));const{width:g,height:m,unknownCodecs:v}=i;if(c||(c=!!(g&&m)),p||(p=!!d),r||(r=!!o),v!=null&&v.length||o&&!uc(o,"audio",u)||d&&!uc(d,"video",u))return;const{CODECS:b,"FRAME-RATE":w,"HDCP-LEVEL":C,"PATHWAY-ID":D,RESOLUTION:R,"VIDEO-RANGE":T}=a,L=`${`${D||"."}-`}${i.bitrate}-${R}-${w}-${b}-${T}-${C}`;if(A[L])if(A[L].uri!==i.url&&!i.attrs["PATHWAY-ID"]){const I=l[L]+=1;i.attrs["PATHWAY-ID"]=new Array(I+1).join(".");const x=new la(i);A[L]=x,y.push(x)}else A[L].addGroupId("audio",a.AUDIO),A[L].addGroupId("text",a.SUBTITLES);else{const I=new la(i);A[L]=I,l[L]=1,y.push(I)}}),this.filterAndSortMediaOptions(y,s,c,p,r)}filterAndSortMediaOptions(e,s,u,y,A){let l=[],c=[],p=e;if((u||y)&&A&&(p=p.filter(({videoCodec:o,videoRange:d,width:g,height:m})=>(!!o||!!(g&&m))&&q_(d))),p.length===0){Promise.resolve().then(()=>{if(this.hls){s.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(s.levels[0].attrs)}`);const o=new Error("no level with compatible codecs found in manifest");this.hls.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:s.url,error:o,reason:o.message})}});return}if(s.audioTracks){const{preferManagedMediaSource:o}=this.hls.config;l=s.audioTracks.filter(d=>!d.audioCodec||uc(d.audioCodec,"audio",o)),bf(l)}s.subtitles&&(c=s.subtitles,bf(c));const r=p.slice(0);p.sort((o,d)=>{if(o.attrs["HDCP-LEVEL"]!==d.attrs["HDCP-LEVEL"])return(o.attrs["HDCP-LEVEL"]||"")>(d.attrs["HDCP-LEVEL"]||"")?1:-1;if(u&&o.height!==d.height)return o.height-d.height;if(o.frameRate!==d.frameRate)return o.frameRate-d.frameRate;if(o.videoRange!==d.videoRange)return Do.indexOf(o.videoRange)-Do.indexOf(d.videoRange);if(o.videoCodec!==d.videoCodec){const g=wh(o.videoCodec),m=wh(d.videoCodec);if(g!==m)return m-g}if(o.uri===d.uri&&o.codecSet!==d.codecSet){const g=Io(o.codecSet),m=Io(d.codecSet);if(g!==m)return m-g}return o.bitrate!==d.bitrate?o.bitrate-d.bitrate:0});let i=r[0];if(this.steering&&(p=this.steering.filterParsedLevels(p),p.length!==r.length)){for(let o=0;og&&g===C0.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=m)}break}const n=A&&!y,a={levels:p,audioTracks:l,subtitleTracks:c,sessionData:s.sessionData,sessionKeys:s.sessionKeys,firstLevel:this._firstLevel,stats:s.stats,audio:A,video:y,altAudio:!n&&l.some(o=>!!o.url)};this.hls.trigger(rt.MANIFEST_PARSED,a),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const s=this._levels;if(s.length===0)return;if(e<0||e>=s.length){const i=new Error("invalid level idx"),t=e<0;if(this.hls.trigger(rt.ERROR,{type:Wi.OTHER_ERROR,details:qt.LEVEL_SWITCH_ERROR,level:e,fatal:t,error:i,reason:i.message}),t)return;e=Math.min(e,s.length-1)}const u=this.currentLevelIndex,y=this.currentLevel,A=y?y.attrs["PATHWAY-ID"]:void 0,l=s[e],c=l.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=l,u===e&&l.details&&y&&A===c)return;this.log(`Switching to level ${e} (${l.height?l.height+"p ":""}${l.videoRange?l.videoRange+" ":""}${l.codecSet?l.codecSet+" ":""}@${l.bitrate})${c?" with Pathway "+c:""} from level ${u}${A?" with Pathway "+A:""}`);const p={level:e,attrs:l.attrs,details:l.details,bitrate:l.bitrate,averageBitrate:l.averageBitrate,maxBitrate:l.maxBitrate,realBitrate:l.realBitrate,width:l.width,height:l.height,codecSet:l.codecSet,audioCodec:l.audioCodec,videoCodec:l.videoCodec,audioGroups:l.audioGroups,subtitleGroups:l.subtitleGroups,loaded:l.loaded,loadError:l.loadError,fragmentError:l.fragmentError,name:l.name,id:l.id,uri:l.uri,url:l.url,urlId:0,audioGroupIds:l.audioGroupIds,textGroupIds:l.textGroupIds};this.hls.trigger(rt.LEVEL_SWITCHING,p);const r=l.details;if(!r||r.live){const i=this.switchParams(l.uri,y==null?void 0:y.details);this.loadPlaylist(i)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,s){s.fatal||!s.context||s.context.type===ln.LEVEL&&s.context.level===this.level&&this.checkRetry(s)}onFragBuffered(e,{frag:s}){if(s!==void 0&&s.type===Hi.MAIN){const u=s.elementaryStreams;if(!Object.keys(u).some(A=>!!u[A]))return;const y=this._levels[s.level];y!=null&&y.loadError&&(this.log(`Resetting level error count of ${y.loadError} on frag buffered`),y.loadError=0)}}onLevelLoaded(e,s){var u;const{level:y,details:A}=s,l=this._levels[y];if(!l){var c;this.warn(`Invalid level index ${y}`),(c=s.deliveryDirectives)!=null&&c.skip&&(A.deltaUpdateFailed=!0);return}y===this.currentLevelIndex?(l.fragmentError===0&&(l.loadError=0),this.playlistLoaded(y,s,l.details)):(u=s.deliveryDirectives)!=null&&u.skip&&(A.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const s=this.currentLevelIndex,u=this.currentLevel;if(u&&this.shouldLoadPlaylist(u)){let y=u.uri;if(e)try{y=e.addDirectives(y)}catch(l){this.warn(`Could not construct new URL with HLS Delivery Directives: ${l}`)}const A=u.attrs["PATHWAY-ID"];this.log(`Loading level index ${s}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${A?" Pathway "+A:""} ${y}`),this.clearTimer(),this.hls.trigger(rt.LEVEL_LOADING,{url:y,level:s,pathwayId:u.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var s;const u=this._levels.filter((y,A)=>A!==e?!0:(this.steering&&this.steering.removeLevel(y),y===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,y.details&&y.details.fragments.forEach(l=>l.level=-1)),!1));jp(u),this._levels=u,this.currentLevelIndex>-1&&(s=this.currentLevel)!=null&&s.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(rt.LEVELS_UPDATED,{levels:u})}onLevelsUpdated(e,{levels:s}){this._levels=s}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:s,maxHdcpLevel:u}=this.hls;this._maxAutoLevel!==s&&(this._maxAutoLevel=s,this.hls.trigger(rt.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:s,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:u}))}}function bf(_){const e={};_.forEach(s=>{const u=s.groupId||"";s.id=e[u]=e[u]||0,e[u]++})}class z8{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const u in this.keyUriToKeyInfo){const y=this.keyUriToKeyInfo[u].loader;if(y){var s;if(e&&e!==((s=y.context)==null?void 0:s.frag.type))return;y.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const s=this.keyUriToKeyInfo[e];(s.mediaKeySessionContext||s.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const s=this.keyUriToKeyInfo[e].loader;s&&s.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,s=qt.KEY_LOAD_ERROR,u,y,A){return new Qr({type:Wi.NETWORK_ERROR,details:s,fatal:!1,frag:e,response:A,error:u,networkDetails:y})}loadClear(e,s){if(this.emeController&&this.config.emeEnabled){const{sn:u,cc:y}=e;for(let A=0;A{l.setKeyFormat(c)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(s=>this.loadInternal(e,s)):this.loadInternal(e)}loadInternal(e,s){var u,y;s&&e.setKeyFormat(s);const A=e.decryptdata;if(!A){const r=new Error(s?`Expected frag.decryptdata to be defined after setting format ${s}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,qt.KEY_LOAD_ERROR,r))}const l=A.uri;if(!l)return Promise.reject(this.createKeyLoadError(e,qt.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${l}"`)));let c=this.keyUriToKeyInfo[l];if((u=c)!=null&&u.decryptdata.key)return A.key=c.decryptdata.key,Promise.resolve({frag:e,keyInfo:c});if((y=c)!=null&&y.keyLoadPromise){var p;switch((p=c.mediaKeySessionContext)==null?void 0:p.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return c.keyLoadPromise.then(r=>(A.key=r.keyInfo.decryptdata.key,{frag:e,keyInfo:c}))}}switch(c=this.keyUriToKeyInfo[l]={decryptdata:A,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},A.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return A.keyFormat==="identity"?this.loadKeyHTTP(c,e):this.loadKeyEME(c,e);case"AES-128":return this.loadKeyHTTP(c,e);default:return Promise.reject(this.createKeyLoadError(e,qt.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${A.method}"`)))}}loadKeyEME(e,s){const u={frag:s,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const y=this.emeController.loadKey(u);if(y)return(e.keyLoadPromise=y.then(A=>(e.mediaKeySessionContext=A,u))).catch(A=>{throw e.keyLoadPromise=null,A})}return Promise.resolve(u)}loadKeyHTTP(e,s){const u=this.config,y=u.loader,A=new y(u);return s.keyLoader=e.loader=A,e.keyLoadPromise=new Promise((l,c)=>{const p={keyInfo:e,frag:s,responseType:"arraybuffer",url:e.decryptdata.uri},r=u.keyLoadPolicy.default,i={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},t={onSuccess:(n,a,o,d)=>{const{frag:g,keyInfo:m,url:v}=o;if(!g.decryptdata||m!==this.keyUriToKeyInfo[v])return c(this.createKeyLoadError(g,qt.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),d));m.decryptdata.key=g.decryptdata.key=new Uint8Array(n.data),g.keyLoader=null,m.loader=null,l({frag:g,keyInfo:m})},onError:(n,a,o,d)=>{this.resetLoader(a),c(this.createKeyLoadError(s,qt.KEY_LOAD_ERROR,new Error(`HTTP Error ${n.code} loading key ${n.text}`),o,Dn({url:p.url,data:void 0},n)))},onTimeout:(n,a,o)=>{this.resetLoader(a),c(this.createKeyLoadError(s,qt.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),o))},onAbort:(n,a,o)=>{this.resetLoader(a),c(this.createKeyLoadError(s,qt.INTERNAL_ABORTED,new Error("key loading aborted"),o))}};A.load(p,i,t)})}resetLoader(e){const{frag:s,keyInfo:u,url:y}=e,A=u.loader;s.keyLoader===A&&(s.keyLoader=null,u.loader=null),delete this.keyUriToKeyInfo[y],A&&A.destroy()}}function x0(){return self.SourceBuffer||self.WebKitSourceBuffer}function k0(){if(!ua())return!1;const e=x0();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function W8(){if(!k0())return!1;const _=ua();return typeof(_==null?void 0:_.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>_.isTypeSupported(La(e,"video")))||["mp4a.40.2","fLaC"].some(e=>_.isTypeSupported(La(e,"audio"))))}function K8(){var _;const e=x0();return typeof(e==null||(_=e.prototype)==null?void 0:_.changeType)=="function"}const q8=250,bo=2,Y8=.1,J8=.05;class Q8{constructor(e,s,u,y){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=s,this.fragmentTracker=u,this.hls=y}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,s){const{config:u,media:y,stalled:A}=this;if(y===null)return;const{currentTime:l,seeking:c}=y,p=this.seeking&&!c,r=!this.seeking&&c;if(this.seeking=c,l!==e){if(this.moved=!0,c||(this.nudgeRetry=0),A!==null){if(this.stallReported){const g=self.performance.now()-A;Ft.warn(`playback not stuck anymore @${l}, after ${Math.round(g)}ms`),this.stallReported=!1}this.stalled=null}return}if(r||p){this.stalled=null;return}if(y.paused&&!c||y.ended||y.playbackRate===0||!mn.getBuffered(y).length){this.nudgeRetry=0;return}const i=mn.bufferInfo(y,l,0),t=i.nextStart||0;if(c){const g=i.len>bo,m=!t||s&&s.start<=l||t-l>bo&&!this.fragmentTracker.getPartialFragment(l);if(g||m)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var n;if(!(i.len>0)&&!t)return;const m=Math.max(t,i.start||0)-l,v=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,w=(v==null||(n=v.details)==null?void 0:n.live)?v.details.targetduration*2:bo,C=this.fragmentTracker.getPartialFragment(l);if(m>0&&(m<=w||C)){y.paused||this._trySkipBufferHole(C);return}}const a=self.performance.now();if(A===null){this.stalled=a;return}const o=a-A;if(!c&&o>=q8&&(this._reportStall(i),!this.media))return;const d=mn.bufferInfo(y,l,u.maxBufferHole);this._tryFixBufferStall(d,o)}_tryFixBufferStall(e,s){const{config:u,fragmentTracker:y,media:A}=this;if(A===null)return;const l=A.currentTime,c=y.getPartialFragment(l);c&&(this._trySkipBufferHole(c)||!this.media)||(e.len>u.maxBufferHole||e.nextStart&&e.nextStart-lu.highBufferWatchdogPeriod*1e3&&(Ft.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:s,media:u,stallReported:y}=this;if(!y&&u){this.stallReported=!0;const A=new Error(`Playback stalling at @${u.currentTime} due to low buffer (${JSON.stringify(e)})`);Ft.warn(A.message),s.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.BUFFER_STALLED_ERROR,fatal:!1,error:A,buffer:e.len})}}_trySkipBufferHole(e){const{config:s,hls:u,media:y}=this;if(y===null)return 0;const A=y.currentTime,l=mn.bufferInfo(y,A,0),c=A0&&l.len<1&&y.readyState<3,i=c-A;if(i>0&&(p||r)){if(i>s.maxBufferHole){const{fragmentTracker:n}=this;let a=!1;if(A===0){const o=n.getAppendedFrag(0,Hi.MAIN);o&&c1?(y=0,this.bitrateTest=!0):y=u.firstAutoLevel),this.level=u.nextLoadLevel=y,this.loadedmetadata=!1}s>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${s.toFixed(3)}`),e=s),this.state=ni.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=ni.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case ni.WAITING_LEVEL:{const{levels:s,level:u}=this,y=s==null?void 0:s[u],A=y==null?void 0:y.details;if(A&&(!A.live||this.levelLastLoaded===y)){if(this.waitForCdnTuneIn(A))break;this.state=ni.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=ni.IDLE;break}break}case ni.FRAG_LOADING_WAITING_RETRY:{var e;const s=self.performance.now(),u=this.retryDate;if(!u||s>=u||(e=this.media)!=null&&e.seeking){const{levels:y,level:A}=this,l=y==null?void 0:y[A];this.resetStartWhenNotLoaded(l||null),this.state=ni.IDLE}}break}this.state===ni.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:s,levels:u,media:y}=this,{config:A,nextLoadLevel:l}=e;if(s===null||!y&&(this.startFragRequested||!A.startFragPrefetch)||this.altAudio&&this.audioOnly||!(u!=null&&u[l]))return;const c=u[l],p=this.getMainFwdBufferInfo();if(p===null)return;const r=this.getLevelDetails();if(r&&this._streamEnded(p,r)){const g={};this.altAudio&&(g.type="video"),this.hls.trigger(rt.BUFFER_EOS,g),this.state=ni.ENDED;return}e.loadLevel!==l&&e.manualLevel===-1&&this.log(`Adapting to level ${l} from level ${this.level}`),this.level=e.nextLoadLevel=l;const i=c.details;if(!i||this.state===ni.WAITING_LEVEL||i.live&&this.levelLastLoaded!==c){this.level=l,this.state=ni.WAITING_LEVEL;return}const t=p.len,n=this.getMaxBufferLength(c.maxBitrate);if(t>=n)return;this.backtrackFragment&&this.backtrackFragment.start>p.end&&(this.backtrackFragment=null);const a=this.backtrackFragment?this.backtrackFragment.start:p.end;let o=this.getNextFragment(a,i);if(this.couldBacktrack&&!this.fragPrevious&&o&&o.sn!=="initSegment"&&this.fragmentTracker.getState(o)!==Fn.OK){var d;const m=((d=this.backtrackFragment)!=null?d:o).sn-i.startSN,v=i.fragments[m-1];v&&o.cc===v.cc&&(o=v,this.fragmentTracker.removeFragment(v))}else this.backtrackFragment&&p.len&&(this.backtrackFragment=null);if(o&&this.isLoopLoading(o,a)){if(!o.gap){const m=this.audioOnly&&!this.altAudio?fn.AUDIO:fn.VIDEO,v=(m===fn.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;v&&this.afterBufferFlushed(v,m,Hi.MAIN)}o=this.getNextFragmentLoopLoading(o,i,p,Hi.MAIN,n)}o&&(o.initSegment&&!o.initSegment.data&&!this.bitrateTest&&(o=o.initSegment),this.loadFragment(o,c,a))}loadFragment(e,s,u){const y=this.fragmentTracker.getState(e);this.fragCurrent=e,y===Fn.NOT_LOADED||y===Fn.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,s):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,s)):(this.startFragRequested=!0,super.loadFragment(e,s,u)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,Hi.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:s}=this;if(s!=null&&s.readyState){let u;const y=this.getAppendedFrag(s.currentTime);y&&y.start>1&&this.flushMainBuffer(0,y.start-1);const A=this.getLevelDetails();if(A!=null&&A.live){const c=this.getMainFwdBufferInfo();if(!c||c.len{const l=A.audioCodec;l&&(u=u||l.indexOf("mp4a.40.2")!==-1,y=y||l.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=u&&y&&!K8(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=s.levels,this.startFragRequested=!1}onLevelLoading(e,s){const{levels:u}=this;if(!u||this.state!==ni.IDLE)return;const y=u[s.level];(!y.details||y.details.live&&this.levelLastLoaded!==y||this.waitForCdnTuneIn(y.details))&&(this.state=ni.WAITING_LEVEL)}onLevelLoaded(e,s){var u;const{levels:y}=this,A=s.level,l=s.details,c=l.totalduration;if(!y){this.warn(`Levels were reset while loading level ${A}`);return}this.log(`Level ${A} loaded [${l.startSN},${l.endSN}]${l.lastPartSn?`[part-${l.lastPartSn}-${l.lastPartIndex}]`:""}, cc [${l.startCC}, ${l.endCC}] duration:${c}`);const p=y[A],r=this.fragCurrent;r&&(this.state===ni.FRAG_LOADING||this.state===ni.FRAG_LOADING_WAITING_RETRY)&&r.level!==s.level&&r.loader&&this.abortCurrentFrag();let i=0;if(l.live||(u=p.details)!=null&&u.live){var t;if(this.checkLiveUpdate(l),l.deltaUpdateFailed)return;i=this.alignPlaylists(l,p.details,(t=this.levelLastLoaded)==null?void 0:t.details)}if(p.details=l,this.levelLastLoaded=p,this.hls.trigger(rt.LEVEL_UPDATED,{details:l,level:A}),this.state===ni.WAITING_LEVEL){if(this.waitForCdnTuneIn(l))return;this.state=ni.IDLE}this.startFragRequested?l.live&&this.synchronizeToLiveEdge(l):this.setStartPosition(l,i),this.tick()}_handleFragmentLoadProgress(e){var s;const{frag:u,part:y,payload:A}=e,{levels:l}=this;if(!l){this.warn(`Levels were reset while fragment load was in progress. Fragment ${u.sn} of level ${u.level} will not be buffered`);return}const c=l[u.level],p=c.details;if(!p){this.warn(`Dropping fragment ${u.sn} of level ${u.level} after level details were reset`),this.fragmentTracker.removeFragment(u);return}const r=c.videoCodec,i=p.PTSKnown||!p.live,t=(s=u.initSegment)==null?void 0:s.data,n=this._getAudioCodec(c),a=this.transmuxer=this.transmuxer||new l0(this.hls,Hi.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),o=y?y.index:-1,d=o!==-1,g=new Td(u.level,u.sn,u.stats.chunkCount,A.byteLength,o,d),m=this.initPTS[u.cc];a.push(A,t,n,r,u,y,p.totalduration,i,g,m)}onAudioTrackSwitching(e,s){const u=this.altAudio;if(!!!s.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const l=this.fragCurrent;l&&(this.log("Switching to main audio track, cancel main fragment load"),l.abortRequests(),this.fragmentTracker.removeFragment(l)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const A=this.hls;u&&(A.trigger(rt.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),A.trigger(rt.AUDIO_TRACK_SWITCHED,s)}}onAudioTrackSwitched(e,s){const u=s.id,y=!!this.hls.audioTracks[u].url;if(y){const A=this.videoBuffer;A&&this.mediaBuffer!==A&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=A)}this.altAudio=y,this.tick()}onBufferCreated(e,s){const u=s.tracks;let y,A,l=!1;for(const c in u){const p=u[c];if(p.id==="main"){if(A=c,y=p,c==="video"){const r=u[c];r&&(this.videoBuffer=r.buffer)}}else l=!0}l&&y?(this.log(`Alternate track found, use ${A}.buffered to schedule main fragment loading`),this.mediaBuffer=y.buffer):this.mediaBuffer=this.media}onFragBuffered(e,s){const{frag:u,part:y}=s;if(u&&u.type!==Hi.MAIN)return;if(this.fragContextChanged(u)){this.warn(`Fragment ${u.sn}${y?" p: "+y.index:""} of level ${u.level} finished buffering, but was aborted. state: ${this.state}`),this.state===ni.PARSED&&(this.state=ni.IDLE);return}const A=y?y.stats:u.stats;this.fragLastKbps=Math.round(8*A.total/(A.buffering.end-A.loading.first)),u.sn!=="initSegment"&&(this.fragPrevious=u),this.fragBufferedComplete(u,y)}onError(e,s){var u;if(s.fatal){this.state=ni.ERROR;return}switch(s.details){case qt.FRAG_GAP:case qt.FRAG_PARSING_ERROR:case qt.FRAG_DECRYPT_ERROR:case qt.FRAG_LOAD_ERROR:case qt.FRAG_LOAD_TIMEOUT:case qt.KEY_LOAD_ERROR:case qt.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Hi.MAIN,s);break;case qt.LEVEL_LOAD_ERROR:case qt.LEVEL_LOAD_TIMEOUT:case qt.LEVEL_PARSING_ERROR:!s.levelRetry&&this.state===ni.WAITING_LEVEL&&((u=s.context)==null?void 0:u.type)===ln.LEVEL&&(this.state=ni.IDLE);break;case qt.BUFFER_APPEND_ERROR:case qt.BUFFER_FULL_ERROR:if(!s.parent||s.parent!=="main")return;if(s.details===qt.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(s)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case qt.INTERNAL_EXCEPTION:this.recoverWorkerError(s);break}}checkBuffer(){const{media:e,gapController:s}=this;if(!(!e||!s||!e.readyState)){if(this.loadedmetadata||!mn.getBuffered(e).length){const u=this.state!==ni.IDLE?this.fragCurrent:null;s.poll(this.lastCurrentTime,u)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=ni.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:s}){if(s!==fn.AUDIO||this.audioOnly&&!this.altAudio){const u=(s===fn.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(u,s,Hi.MAIN),this.tick()}}onLevelsUpdated(e,s){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=s.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const s=e.currentTime;let u=this.startPosition;if(u>=0&&s0&&(l{const{hls:y}=this;if(!u||this.fragContextChanged(e))return;s.fragmentError=0,this.state=ni.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const A=e.stats;A.parsing.start=A.parsing.end=A.buffering.start=A.buffering.end=self.performance.now(),y.trigger(rt.FRAG_LOADED,u),e.bitrateTest=!1})}_handleTransmuxComplete(e){var s;const u="main",{hls:y}=this,{remuxResult:A,chunkMeta:l}=e,c=this.getCurrentContext(l);if(!c){this.resetWhenMissingContext(l);return}const{frag:p,part:r,level:i}=c,{video:t,text:n,id3:a,initSegment:o}=A,{details:d}=i,g=this.altAudio?void 0:A.audio;if(this.fragContextChanged(p)){this.fragmentTracker.removeFragment(p);return}if(this.state=ni.PARSING,o){if(o!=null&&o.tracks){const b=p.initSegment||p;this._bufferInitSegment(i,o.tracks,b,l),y.trigger(rt.FRAG_PARSING_INIT_SEGMENT,{frag:b,id:u,tracks:o.tracks})}const m=o.initPTS,v=o.timescale;Ci(m)&&(this.initPTS[p.cc]={baseTime:m,timescale:v},y.trigger(rt.INIT_PTS_FOUND,{frag:p,id:u,initPTS:m,timescale:v}))}if(t&&d&&p.sn!=="initSegment"){const m=d.fragments[p.sn-1-d.startSN],v=p.sn===d.startSN,b=!m||p.cc>m.cc;if(A.independent!==!1){const{startPTS:w,endPTS:C,startDTS:D,endDTS:R}=t;if(r)r.elementaryStreams[t.type]={startPTS:w,endPTS:C,startDTS:D,endDTS:R};else if(t.firstKeyFrame&&t.independent&&l.id===1&&!b&&(this.couldBacktrack=!0),t.dropped&&t.independent){const T=this.getMainFwdBufferInfo(),P=(T?T.end:this.getLoadPosition())+this.config.maxBufferHole,L=t.firstKeyFramePTS?t.firstKeyFramePTS:w;if(!v&&Pbo&&(p.gap=!0);p.setElementaryStreamInfo(t.type,w,C,D,R),this.backtrackFragment&&(this.backtrackFragment=p),this.bufferFragmentData(t,p,r,l,v||b)}else if(v||b)p.gap=!0;else{this.backtrack(p);return}}if(g){const{startPTS:m,endPTS:v,startDTS:b,endDTS:w}=g;r&&(r.elementaryStreams[fn.AUDIO]={startPTS:m,endPTS:v,startDTS:b,endDTS:w}),p.setElementaryStreamInfo(fn.AUDIO,m,v,b,w),this.bufferFragmentData(g,p,r,l)}if(d&&a!=null&&(s=a.samples)!=null&&s.length){const m={id:u,frag:p,details:d,samples:a.samples};y.trigger(rt.FRAG_PARSING_METADATA,m)}if(d&&n){const m={id:u,frag:p,details:d,samples:n.samples};y.trigger(rt.FRAG_PARSING_USERDATA,m)}}_bufferInitSegment(e,s,u,y){if(this.state!==ni.PARSING)return;this.audioOnly=!!s.audio&&!s.video,this.altAudio&&!this.audioOnly&&delete s.audio;const{audio:A,video:l,audiovideo:c}=s;if(A){let p=e.audioCodec;const r=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(p&&(p.indexOf("mp4a.40.5")!==-1?p="mp4a.40.2":p="mp4a.40.5"),A.metadata.channelCount!==1&&r.indexOf("firefox")===-1&&(p="mp4a.40.5")),p&&p.indexOf("mp4a.40.5")!==-1&&r.indexOf("android")!==-1&&A.container!=="audio/mpeg"&&(p="mp4a.40.2",this.log(`Android: force audio codec to ${p}`)),e.audioCodec&&e.audioCodec!==p&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${p}"`),A.levelCodec=p,A.id="main",this.log(`Init audio buffer, container:${A.container}, codecs[selected/level/parsed]=[${p||""}/${e.audioCodec||""}/${A.codec}]`)}l&&(l.levelCodec=e.videoCodec,l.id="main",this.log(`Init video buffer, container:${l.container}, codecs[level/parsed]=[${e.videoCodec||""}/${l.codec}]`)),c&&this.log(`Init audiovideo buffer, container:${c.container}, codecs[level/parsed]=[${e.codecs}/${c.codec}]`),this.hls.trigger(rt.BUFFER_CODECS,s),Object.keys(s).forEach(p=>{const i=s[p].initSegment;i!=null&&i.byteLength&&this.hls.trigger(rt.BUFFER_APPENDING,{type:p,data:i,frag:u,part:null,chunkMeta:y,parent:u.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,Hi.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=ni.IDLE}checkFragmentChanged(){const e=this.media;let s=null;if(e&&e.readyState>1&&e.seeking===!1){const u=e.currentTime;if(mn.isBuffered(e,u)?s=this.getAppendedFrag(u):mn.isBuffered(e,u+.1)&&(s=this.getAppendedFrag(u+.1)),s){this.backtrackFragment=null;const y=this.fragPlaying,A=s.level;(!y||s.sn!==y.sn||y.level!==A)&&(this.fragPlaying=s,this.hls.trigger(rt.FRAG_CHANGED,{frag:s}),(!y||y.level!==A)&&this.hls.trigger(rt.LEVEL_SWITCHED,{level:A}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const s=e.currentTime,u=this.currentFrag;if(u&&Ci(s)&&Ci(u.programDateTime)){const y=u.programDateTime+(s-u.start)*1e3;return new Date(y)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class ls{static get version(){return"1.5.1-patch.1"}static isMSESupported(){return k0()}static isSupported(){return W8()}static getMediaSource(){return ua()}static get Events(){return rt}static get ErrorTypes(){return Wi}static get ErrorDetails(){return qt}static get DefaultConfig(){return ls.defaultConfig?ls.defaultConfig:C0}static set DefaultConfig(e){ls.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Dd,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,Kb(e.debug||!1,"Hls instance");const s=this.config=j8(ls.DefaultConfig,e);this.userConfig=e,s.progressive&&V8(s);const{abrController:u,bufferController:y,capLevelController:A,errorController:l,fpsController:c}=s,p=new l(this),r=this.abrController=new u(this),i=this.bufferController=new y(this),t=this.capLevelController=new A(this),n=new c(this),a=new U_(this),o=new z_(this),d=s.contentSteeringController,g=d?new d(this):null,m=this.levelController=new H8(this,g),v=new v5(this),b=new z8(this.config),w=this.streamController=new X8(this,v,b);t.setStreamController(w),n.setStreamController(w);const C=[a,m,w];g&&C.splice(1,0,g),this.networkControllers=C;const D=[r,i,t,n,o,v];this.audioTrackController=this.createController(s.audioTrackController,C);const R=s.audioStreamController;R&&C.push(new R(this,v,b)),this.subtitleTrackController=this.createController(s.subtitleTrackController,C);const T=s.subtitleStreamController;T&&C.push(new T(this,v,b)),this.createController(s.timelineController,D),b.emeController=this.emeController=this.createController(s.emeController,D),this.cmcdController=this.createController(s.cmcdController,D),this.latencyController=this.createController(W_,D),this.coreComponents=D,C.push(p);const P=p.onErrorOut;typeof P=="function"&&this.on(rt.ERROR,P,p)}createController(e,s){if(e){const u=new e(this);return s&&s.push(u),u}return null}on(e,s,u=this){this._emitter.on(e,s,u)}once(e,s,u=this){this._emitter.once(e,s,u)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,s,u=this,y){this._emitter.off(e,s,u,y)}listeners(e){return this._emitter.listeners(e)}emit(e,s,u){return this._emitter.emit(e,s,u)}trigger(e,s){if(this.config.debug)return this.emit(e,e,s);try{return this.emit(e,e,s)}catch(u){if(Ft.error("An internal error happened while handling event "+e+'. Error message: "'+u.message+'". Here is a stacktrace:',u),!this.triggeringException){this.triggeringException=!0;const y=e===rt.ERROR;this.trigger(rt.ERROR,{type:Wi.OTHER_ERROR,details:qt.INTERNAL_EXCEPTION,fatal:y,event:e,error:u}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){Ft.log("destroy"),this.trigger(rt.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(s=>s.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(s=>s.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){Ft.log("attachMedia"),this._media=e,this.trigger(rt.MEDIA_ATTACHING,{media:e})}detachMedia(){Ft.log("detachMedia"),this.trigger(rt.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const s=this.media,u=this.url,y=this.url=yd.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,Ft.log(`loadSource:${y}`),s&&u&&(u!==y||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(s)),this.trigger(rt.MANIFEST_LOADING,{url:e})}startLoad(e=-1){Ft.log(`startLoad(${e})`),this.started=!0,this.networkControllers.forEach(s=>{s.startLoad(e)})}stopLoad(){Ft.log("stopLoad"),this.started=!1,this.networkControllers.forEach(e=>{e.stopLoad()})}resumeBuffering(){this.started&&this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.startLoad(-1)})}pauseBuffering(){this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.stopLoad()})}swapAudioCodec(){Ft.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){Ft.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){Ft.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){Ft.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){Ft.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){Ft.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){Ft.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const s=!!e;s!==this.config.capLevelToPlayerSize&&(s?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=s)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(Ft.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){K_(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:s}}=this;if(!e)return 0;const u=e.length;for(let y=0;y=s)return y;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:s,maxHdcpLevel:u}=this;let y;if(s===-1&&e!=null&&e.length?y=e.length-1:y=s,u)for(let A=y;A--;){const l=e[A].attrs["HDCP-LEVEL"];if(l&&l<=u)return A}return y}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var s;return(s=this.audioTrackController)==null?void 0:s.setAudioOption(e)}setSubtitleOption(e){var s;return(s=this.subtitleTrackController)==null||s.setSubtitleOption(e),null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const s=this.audioTrackController;s&&(s.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const s=this.subtitleTrackController;s&&(s.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const s=this.subtitleTrackController;s&&(s.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}ls.defaultConfig=void 0;var R0={exports:{}};(function(_,e){(function(s,u){_.exports=u()})(window,function(){return function(s){var u={};function y(A){if(u[A])return u[A].exports;var l=u[A]={i:A,l:!1,exports:{}};return s[A].call(l.exports,l,l.exports,y),l.l=!0,l.exports}return y.m=s,y.c=u,y.d=function(A,l,c){y.o(A,l)||Object.defineProperty(A,l,{enumerable:!0,get:c})},y.r=function(A){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},y.t=function(A,l){if(1&l&&(A=y(A)),8&l||4&l&&typeof A=="object"&&A&&A.__esModule)return A;var c=Object.create(null);if(y.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:A}),2&l&&typeof A!="string")for(var p in A)y.d(c,p,(function(r){return A[r]}).bind(null,p));return c},y.n=function(A){var l=A&&A.__esModule?function(){return A.default}:function(){return A};return y.d(l,"a",l),l},y.o=function(A,l){return Object.prototype.hasOwnProperty.call(A,l)},y.p="",y(y.s=24)}([function(s,u,y){var A=y(9),l=y.n(A),c=function(){function p(){}return p.e=function(r,i){r&&!p.FORCE_GLOBAL_TAG||(r=p.GLOBAL_TAG);var t="[".concat(r,"] > ").concat(i);p.ENABLE_CALLBACK&&p.emitter.emit("log","error",t),p.ENABLE_ERROR&&(console.error?console.error(t):console.warn?console.warn(t):console.log(t))},p.i=function(r,i){r&&!p.FORCE_GLOBAL_TAG||(r=p.GLOBAL_TAG);var t="[".concat(r,"] > ").concat(i);p.ENABLE_CALLBACK&&p.emitter.emit("log","info",t),p.ENABLE_INFO&&(console.info?console.info(t):console.log(t))},p.w=function(r,i){r&&!p.FORCE_GLOBAL_TAG||(r=p.GLOBAL_TAG);var t="[".concat(r,"] > ").concat(i);p.ENABLE_CALLBACK&&p.emitter.emit("log","warn",t),p.ENABLE_WARN&&(console.warn?console.warn(t):console.log(t))},p.d=function(r,i){r&&!p.FORCE_GLOBAL_TAG||(r=p.GLOBAL_TAG);var t="[".concat(r,"] > ").concat(i);p.ENABLE_CALLBACK&&p.emitter.emit("log","debug",t),p.ENABLE_DEBUG&&(console.debug?console.debug(t):console.log(t))},p.v=function(r,i){r&&!p.FORCE_GLOBAL_TAG||(r=p.GLOBAL_TAG);var t="[".concat(r,"] > ").concat(i);p.ENABLE_CALLBACK&&p.emitter.emit("log","verbose",t),p.ENABLE_VERBOSE&&console.log(t)},p}();c.GLOBAL_TAG="mpegts.js",c.FORCE_GLOBAL_TAG=!1,c.ENABLE_ERROR=!0,c.ENABLE_INFO=!0,c.ENABLE_WARN=!0,c.ENABLE_DEBUG=!0,c.ENABLE_VERBOSE=!0,c.ENABLE_CALLBACK=!1,c.emitter=new l.a,u.a=c},function(s,u,y){var A;(function(l){l.IO_ERROR="io_error",l.DEMUX_ERROR="demux_error",l.INIT_SEGMENT="init_segment",l.MEDIA_SEGMENT="media_segment",l.LOADING_COMPLETE="loading_complete",l.RECOVERED_EARLY_EOF="recovered_early_eof",l.MEDIA_INFO="media_info",l.METADATA_ARRIVED="metadata_arrived",l.SCRIPTDATA_ARRIVED="scriptdata_arrived",l.TIMED_ID3_METADATA_ARRIVED="timed_id3_metadata_arrived",l.SYNCHRONOUS_KLV_METADATA_ARRIVED="synchronous_klv_metadata_arrived",l.ASYNCHRONOUS_KLV_METADATA_ARRIVED="asynchronous_klv_metadata_arrived",l.SMPTE2038_METADATA_ARRIVED="smpte2038_metadata_arrived",l.SCTE35_METADATA_ARRIVED="scte35_metadata_arrived",l.PES_PRIVATE_DATA_DESCRIPTOR="pes_private_data_descriptor",l.PES_PRIVATE_DATA_ARRIVED="pes_private_data_arrived",l.STATISTICS_INFO="statistics_info",l.RECOMMEND_SEEKPOINT="recommend_seekpoint"})(A||(A={})),u.a=A},function(s,u,y){y.d(u,"c",function(){return l}),y.d(u,"b",function(){return c}),y.d(u,"a",function(){return p});var A=y(3),l={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},c={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},p=function(){function r(i){this._type=i||"undefined",this._status=l.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return r.prototype.destroy=function(){this._status=l.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},r.prototype.isWorking=function(){return this._status===l.kConnecting||this._status===l.kBuffering},Object.defineProperty(r.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(i){this._onContentLengthKnown=i},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(i){this._onURLRedirect=i},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(i){this._onDataArrival=i},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onError",{get:function(){return this._onError},set:function(i){this._onError=i},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onComplete",{get:function(){return this._onComplete},set:function(i){this._onComplete=i},enumerable:!1,configurable:!0}),r.prototype.open=function(i,t){throw new A.c("Unimplemented abstract function!")},r.prototype.abort=function(){throw new A.c("Unimplemented abstract function!")},r}()},function(s,u,y){y.d(u,"d",function(){return c}),y.d(u,"a",function(){return p}),y.d(u,"b",function(){return r}),y.d(u,"c",function(){return i});var A,l=(A=function(t,n){return(A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,o){a.__proto__=o}||function(a,o){for(var d in o)Object.prototype.hasOwnProperty.call(o,d)&&(a[d]=o[d])})(t,n)},function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function a(){this.constructor=t}A(t,n),t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}),c=function(){function t(n){this._message=n}return Object.defineProperty(t.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return this.name+": "+this.message},t}(),p=function(t){function n(a){return t.call(this,a)||this}return l(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),n}(c),r=function(t){function n(a){return t.call(this,a)||this}return l(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),n}(c),i=function(t){function n(a){return t.call(this,a)||this}return l(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),n}(c)},function(s,u,y){var A;(function(l){l.ERROR="error",l.LOADING_COMPLETE="loading_complete",l.RECOVERED_EARLY_EOF="recovered_early_eof",l.MEDIA_INFO="media_info",l.METADATA_ARRIVED="metadata_arrived",l.SCRIPTDATA_ARRIVED="scriptdata_arrived",l.TIMED_ID3_METADATA_ARRIVED="timed_id3_metadata_arrived",l.SYNCHRONOUS_KLV_METADATA_ARRIVED="synchronous_klv_metadata_arrived",l.ASYNCHRONOUS_KLV_METADATA_ARRIVED="asynchronous_klv_metadata_arrived",l.SMPTE2038_METADATA_ARRIVED="smpte2038_metadata_arrived",l.SCTE35_METADATA_ARRIVED="scte35_metadata_arrived",l.PES_PRIVATE_DATA_DESCRIPTOR="pes_private_data_descriptor",l.PES_PRIVATE_DATA_ARRIVED="pes_private_data_arrived",l.STATISTICS_INFO="statistics_info",l.DESTROYING="destroying"})(A||(A={})),u.a=A},function(s,u,y){var A={};(function(){var l=self.navigator.userAgent.toLowerCase(),c=/(edge)\/([\w.]+)/.exec(l)||/(opr)[\/]([\w.]+)/.exec(l)||/(chrome)[ \/]([\w.]+)/.exec(l)||/(iemobile)[\/]([\w.]+)/.exec(l)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(l)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(l)||/(webkit)[ \/]([\w.]+)/.exec(l)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(l)||/(msie) ([\w.]+)/.exec(l)||l.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(l)||l.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(l)||[],p=/(ipad)/.exec(l)||/(ipod)/.exec(l)||/(windows phone)/.exec(l)||/(iphone)/.exec(l)||/(kindle)/.exec(l)||/(android)/.exec(l)||/(windows)/.exec(l)||/(mac)/.exec(l)||/(linux)/.exec(l)||/(cros)/.exec(l)||[],r={browser:c[5]||c[3]||c[1]||"",version:c[2]||c[4]||"0",majorVersion:c[4]||c[2]||"0",platform:p[0]||""},i={};if(r.browser){i[r.browser]=!0;var t=r.majorVersion.split(".");i.version={major:parseInt(r.majorVersion,10),string:r.version},t.length>1&&(i.version.minor=parseInt(t[1],10)),t.length>2&&(i.version.build=parseInt(t[2],10))}r.platform&&(i[r.platform]=!0),(i.chrome||i.opr||i.safari)&&(i.webkit=!0),(i.rv||i.iemobile)&&(i.rv&&delete i.rv,r.browser="msie",i.msie=!0),i.edge&&(delete i.edge,r.browser="msedge",i.msedge=!0),i.opr&&(r.browser="opera",i.opera=!0),i.safari&&i.android&&(r.browser="android",i.android=!0);for(var n in i.name=r.browser,i.platform=r.platform,A)A.hasOwnProperty(n)&&delete A[n];Object.assign(A,i)})(),u.a=A},function(s,u,y){u.a={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},function(s,u,y){var A;(function(l){l.ERROR="error",l.SOURCE_OPEN="source_open",l.UPDATE_END="update_end",l.BUFFER_FULL="buffer_full",l.START_STREAMING="start_streaming",l.END_STREAMING="end_streaming"})(A||(A={})),u.a=A},function(s,u,y){var A=y(9),l=y.n(A),c=y(0),p=function(){function r(){}return Object.defineProperty(r,"forceGlobalTag",{get:function(){return c.a.FORCE_GLOBAL_TAG},set:function(i){c.a.FORCE_GLOBAL_TAG=i,r._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"globalTag",{get:function(){return c.a.GLOBAL_TAG},set:function(i){c.a.GLOBAL_TAG=i,r._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"enableAll",{get:function(){return c.a.ENABLE_VERBOSE&&c.a.ENABLE_DEBUG&&c.a.ENABLE_INFO&&c.a.ENABLE_WARN&&c.a.ENABLE_ERROR},set:function(i){c.a.ENABLE_VERBOSE=i,c.a.ENABLE_DEBUG=i,c.a.ENABLE_INFO=i,c.a.ENABLE_WARN=i,c.a.ENABLE_ERROR=i,r._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"enableDebug",{get:function(){return c.a.ENABLE_DEBUG},set:function(i){c.a.ENABLE_DEBUG=i,r._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"enableVerbose",{get:function(){return c.a.ENABLE_VERBOSE},set:function(i){c.a.ENABLE_VERBOSE=i,r._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"enableInfo",{get:function(){return c.a.ENABLE_INFO},set:function(i){c.a.ENABLE_INFO=i,r._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"enableWarn",{get:function(){return c.a.ENABLE_WARN},set:function(i){c.a.ENABLE_WARN=i,r._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"enableError",{get:function(){return c.a.ENABLE_ERROR},set:function(i){c.a.ENABLE_ERROR=i,r._notifyChange()},enumerable:!1,configurable:!0}),r.getConfig=function(){return{globalTag:c.a.GLOBAL_TAG,forceGlobalTag:c.a.FORCE_GLOBAL_TAG,enableVerbose:c.a.ENABLE_VERBOSE,enableDebug:c.a.ENABLE_DEBUG,enableInfo:c.a.ENABLE_INFO,enableWarn:c.a.ENABLE_WARN,enableError:c.a.ENABLE_ERROR,enableCallback:c.a.ENABLE_CALLBACK}},r.applyConfig=function(i){c.a.GLOBAL_TAG=i.globalTag,c.a.FORCE_GLOBAL_TAG=i.forceGlobalTag,c.a.ENABLE_VERBOSE=i.enableVerbose,c.a.ENABLE_DEBUG=i.enableDebug,c.a.ENABLE_INFO=i.enableInfo,c.a.ENABLE_WARN=i.enableWarn,c.a.ENABLE_ERROR=i.enableError,c.a.ENABLE_CALLBACK=i.enableCallback},r._notifyChange=function(){var i=r.emitter;if(i.listenerCount("change")>0){var t=r.getConfig();i.emit("change",t)}},r.registerListener=function(i){r.emitter.addListener("change",i)},r.removeListener=function(i){r.emitter.removeListener("change",i)},r.addLogListener=function(i){c.a.emitter.addListener("log",i),c.a.emitter.listenerCount("log")>0&&(c.a.ENABLE_CALLBACK=!0,r._notifyChange())},r.removeLogListener=function(i){c.a.emitter.removeListener("log",i),c.a.emitter.listenerCount("log")===0&&(c.a.ENABLE_CALLBACK=!1,r._notifyChange())},r}();p.emitter=new l.a,u.a=p},function(s,u,y){var A,l=typeof Reflect=="object"?Reflect:null,c=l&&typeof l.apply=="function"?l.apply:function(w,C,D){return Function.prototype.apply.call(w,C,D)};A=l&&typeof l.ownKeys=="function"?l.ownKeys:Object.getOwnPropertySymbols?function(w){return Object.getOwnPropertyNames(w).concat(Object.getOwnPropertySymbols(w))}:function(w){return Object.getOwnPropertyNames(w)};var p=Number.isNaN||function(w){return w!=w};function r(){r.init.call(this)}s.exports=r,s.exports.once=function(w,C){return new Promise(function(D,R){function T(L){w.removeListener(C,P),R(L)}function P(){typeof w.removeListener=="function"&&w.removeListener("error",T),D([].slice.call(arguments))}b(w,C,P,{once:!0}),C!=="error"&&function(L,I,x){typeof L.on=="function"&&b(L,"error",I,x)}(w,T,{once:!0})})},r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var i=10;function t(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}function n(w){return w._maxListeners===void 0?r.defaultMaxListeners:w._maxListeners}function a(w,C,D,R){var T,P,L,I;if(t(D),(P=w._events)===void 0?(P=w._events=Object.create(null),w._eventsCount=0):(P.newListener!==void 0&&(w.emit("newListener",C,D.listener?D.listener:D),P=w._events),L=P[C]),L===void 0)L=P[C]=D,++w._eventsCount;else if(typeof L=="function"?L=P[C]=R?[D,L]:[L,D]:R?L.unshift(D):L.push(D),(T=n(w))>0&&L.length>T&&!L.warned){L.warned=!0;var x=new Error("Possible EventEmitter memory leak detected. "+L.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");x.name="MaxListenersExceededWarning",x.emitter=w,x.type=C,x.count=L.length,I=x,console&&console.warn&&console.warn(I)}return w}function o(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(w,C,D){var R={fired:!1,wrapFn:void 0,target:w,type:C,listener:D},T=o.bind(R);return T.listener=D,R.wrapFn=T,T}function g(w,C,D){var R=w._events;if(R===void 0)return[];var T=R[C];return T===void 0?[]:typeof T=="function"?D?[T.listener||T]:[T]:D?function(P){for(var L=new Array(P.length),I=0;I0&&(P=C[0]),P instanceof Error)throw P;var L=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw L.context=P,L}var I=T[w];if(I===void 0)return!1;if(typeof I=="function")c(I,this,C);else{var x=I.length,O=v(I,x);for(D=0;D=0;P--)if(D[P]===C||D[P].listener===C){L=D[P].listener,T=P;break}if(T<0)return this;T===0?D.shift():function(I,x){for(;x+1=0;R--)this.removeListener(w,C[R]);return this},r.prototype.listeners=function(w){return g(this,w,!0)},r.prototype.rawListeners=function(w){return g(this,w,!1)},r.listenerCount=function(w,C){return typeof w.listenerCount=="function"?w.listenerCount(C):m.call(w,C)},r.prototype.listenerCount=m,r.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]}},function(s,u,y){var A=y(3),l=function(){function c(p){this.TAG="ExpGolomb",this._buffer=p,this._buffer_index=0,this._total_bytes=p.byteLength,this._total_bits=8*p.byteLength,this._current_word=0,this._current_word_bits_left=0}return c.prototype.destroy=function(){this._buffer=null},c.prototype._fillCurrentWord=function(){var p=this._total_bytes-this._buffer_index;if(p<=0)throw new A.a("ExpGolomb: _fillCurrentWord() but no bytes available");var r=Math.min(4,p),i=new Uint8Array(4);i.set(this._buffer.subarray(this._buffer_index,this._buffer_index+r)),this._current_word=new DataView(i.buffer).getUint32(0,!1),this._buffer_index+=r,this._current_word_bits_left=8*r},c.prototype.readBits=function(p){if(p>32)throw new A.b("ExpGolomb: readBits() bits exceeded max 32bits!");if(p<=this._current_word_bits_left){var r=this._current_word>>>32-p;return this._current_word<<=p,this._current_word_bits_left-=p,r}var i=this._current_word_bits_left?this._current_word:0;i>>>=32-this._current_word_bits_left;var t=p-this._current_word_bits_left;this._fillCurrentWord();var n=Math.min(t,this._current_word_bits_left),a=this._current_word>>>32-n;return this._current_word<<=n,this._current_word_bits_left-=n,i=i<>>p)return this._current_word<<=p,this._current_word_bits_left-=p,p;return this._fillCurrentWord(),p+this._skipLeadingZero()},c.prototype.readUEG=function(){var p=this._skipLeadingZero();return this.readBits(p+1)-1},c.prototype.readSEG=function(){var p=this.readUEG();return 1&p?p+1>>>1:-1*(p>>>1)},c}();u.a=l},function(s,u,y){y.d(u,"b",function(){return c}),y.d(u,"a",function(){return p});var A=y(2),l=y(6),c={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},p={NETWORK_EXCEPTION:A.b.EXCEPTION,NETWORK_STATUS_CODE_INVALID:A.b.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:A.b.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:A.b.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:l.a.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:l.a.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:l.a.CODEC_UNSUPPORTED}},function(s,u,y){y.d(u,"d",function(){return A}),y.d(u,"b",function(){return l}),y.d(u,"a",function(){return c}),y.d(u,"c",function(){return p});var A=function(r,i,t,n,a){this.dts=r,this.pts=i,this.duration=t,this.originalDts=n,this.isSyncPoint=a,this.fileposition=null},l=function(){function r(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return r.prototype.appendSyncPoint=function(i){i.isSyncPoint=!0,this.syncPoints.push(i)},r}(),c=function(){function r(){this._list=[]}return r.prototype.clear=function(){this._list=[]},r.prototype.appendArray=function(i){var t=this._list;i.length!==0&&(t.length>0&&i[0].originalDts=t[o].dts&&it[a].lastSample.originalDts&&i=t[a].lastSample.originalDts&&(a===t.length-1||a0&&(o=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=o,this._list.splice(o,0,n)},r.prototype.getLastSegmentBefore=function(i){var t=this._searchNearestSegmentBefore(i);return t>=0?this._list[t]:null},r.prototype.getLastSampleBefore=function(i){var t=this.getLastSegmentBefore(i);return t!=null?t.lastSample:null},r.prototype.getLastSyncPointBefore=function(i){for(var t=this._searchNearestSegmentBefore(i),n=this._list[t].syncPoints;n.length===0&&t>0;)t--,n=this._list[t].syncPoints;return n.length>0?n[n.length-1]:null},r}()},function(s,u,y){var A=function(){function l(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return l.prototype.isComplete=function(){var c=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,p=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&c&&p},l.prototype.isSeekable=function(){return this.hasKeyframesIndex===!0},l.prototype.getNearestKeyframe=function(c){if(this.keyframesIndex==null)return null;var p=this.keyframesIndex,r=this._search(p.times,c);return{index:r,milliseconds:p.times[r],fileposition:p.filepositions[r]}},l.prototype._search=function(c,p){var r=0,i=c.length-1,t=0,n=0,a=i;for(p=c[t]&&p=Re.byteLength)return this.eof_flag_=!0,Re.byteLength;var ut=Re[De+0]<<24|Re[De+1]<<16|Re[De+2]<<8|Re[De+3],gt=Re[De+0]<<16|Re[De+1]<<8|Re[De+2];if(ut===1||gt===1)return De;De++}},Ue.prototype.readNextNaluPayload=function(){for(var Ve=this.data_,De=null;De==null&&!this.eof_flag_;){var Re=this.current_startcode_offset_,ut=31&Ve[Re+=(Ve[Re]<<24|Ve[Re+1]<<16|Ve[Re+2]<<8|Ve[Re+3])===1?4:3],gt=(128&Ve[Re])>>>7,Ce=this.findNextStartCodeOffset(Re);if(this.current_startcode_offset_=Ce,!(ut>=t.kReserved0)&>===0){var ze=Ve.subarray(Re,Ce);(De=new v).type=ut,De.data=ze}}return De},Ue}(),C=function(){function Ue(Ve,De,Re){var ut=8+Ve.byteLength+1+2+De.byteLength,gt=!1;Ve[3]!==66&&Ve[3]!==77&&Ve[3]!==88&&(gt=!0,ut+=4);var Ce=this.data=new Uint8Array(ut);Ce[0]=1,Ce[1]=Ve[1],Ce[2]=Ve[2],Ce[3]=Ve[3],Ce[4]=255,Ce[5]=225;var ze=Ve.byteLength;Ce[6]=ze>>>8,Ce[7]=255&ze;var At=8;Ce.set(Ve,8),Ce[At+=ze]=1;var Je=De.byteLength;Ce[At+1]=Je>>>8,Ce[At+2]=255&Je,Ce.set(De,At+3),At+=3+Je,gt&&(Ce[At]=252|Re.chroma_format_idc,Ce[At+1]=248|Re.bit_depth_luma-8,Ce[At+2]=248|Re.bit_depth_chroma-8,Ce[At+3]=0,At+=4)}return Ue.prototype.getData=function(){return this.data},Ue}(),D=y(22),R=y(10);(function(Ue){Ue[Ue.kNull=0]="kNull",Ue[Ue.kAACMain=1]="kAACMain",Ue[Ue.kAAC_LC=2]="kAAC_LC",Ue[Ue.kAAC_SSR=3]="kAAC_SSR",Ue[Ue.kAAC_LTP=4]="kAAC_LTP",Ue[Ue.kAAC_SBR=5]="kAAC_SBR",Ue[Ue.kAAC_Scalable=6]="kAAC_Scalable",Ue[Ue.kLayer1=32]="kLayer1",Ue[Ue.kLayer2=33]="kLayer2",Ue[Ue.kLayer3=34]="kLayer3"})(g||(g={})),function(Ue){Ue[Ue.k96000Hz=0]="k96000Hz",Ue[Ue.k88200Hz=1]="k88200Hz",Ue[Ue.k64000Hz=2]="k64000Hz",Ue[Ue.k48000Hz=3]="k48000Hz",Ue[Ue.k44100Hz=4]="k44100Hz",Ue[Ue.k32000Hz=5]="k32000Hz",Ue[Ue.k24000Hz=6]="k24000Hz",Ue[Ue.k22050Hz=7]="k22050Hz",Ue[Ue.k16000Hz=8]="k16000Hz",Ue[Ue.k12000Hz=9]="k12000Hz",Ue[Ue.k11025Hz=10]="k11025Hz",Ue[Ue.k8000Hz=11]="k8000Hz",Ue[Ue.k7350Hz=12]="k7350Hz"}(m||(m={}));var T,P,L=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],I=(T=function(Ue,Ve){return(T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(De,Re){De.__proto__=Re}||function(De,Re){for(var ut in Re)Object.prototype.hasOwnProperty.call(Re,ut)&&(De[ut]=Re[ut])})(Ue,Ve)},function(Ue,Ve){if(typeof Ve!="function"&&Ve!==null)throw new TypeError("Class extends value "+String(Ve)+" is not a constructor or null");function De(){this.constructor=Ue}T(Ue,Ve),Ue.prototype=Ve===null?Object.create(Ve):(De.prototype=Ve.prototype,new De)}),x=function(){},O=function(Ue){function Ve(){return Ue!==null&&Ue.apply(this,arguments)||this}return I(Ve,Ue),Ve}(x),G=function(){function Ue(Ve){this.TAG="AACADTSParser",this.data_=Ve,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&l.a.e(this.TAG,"Could not found ADTS syncword until payload end")}return Ue.prototype.findNextSyncwordOffset=function(Ve){for(var De=Ve,Re=this.data_;;){if(De+7>=Re.byteLength)return this.eof_flag_=!0,Re.byteLength;if((Re[De+0]<<8|Re[De+1])>>>4===4095)return De;De++}},Ue.prototype.readNextAACFrame=function(){for(var Ve=this.data_,De=null;De==null&&!this.eof_flag_;){var Re=this.current_syncword_offset_,ut=(8&Ve[Re+1])>>>3,gt=(6&Ve[Re+1])>>>1,Ce=1&Ve[Re+1],ze=(192&Ve[Re+2])>>>6,At=(60&Ve[Re+2])>>>2,Je=(1&Ve[Re+2])<<2|(192&Ve[Re+3])>>>6,$e=(3&Ve[Re+3])<<11|Ve[Re+4]<<3|(224&Ve[Re+5])>>>5;if(Ve[Re+6],Re+$e>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var Be=Ce===1?7:9,it=$e-Be;Re+=Be;var Ne=this.findNextSyncwordOffset(Re+it);if(this.current_syncword_offset_=Ne,(ut===0||ut===1)&>===0){var Qe=Ve.subarray(Re,Re+it);(De=new x).audio_object_type=ze+1,De.sampling_freq_index=At,De.sampling_frequency=L[At],De.channel_config=Je,De.data=Qe}}return De},Ue.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},Ue.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},Ue}(),J=function(){function Ue(Ve){this.TAG="AACLOASParser",this.data_=Ve,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&l.a.e(this.TAG,"Could not found LOAS syncword until payload end")}return Ue.prototype.findNextSyncwordOffset=function(Ve){for(var De=Ve,Re=this.data_;;){if(De+1>=Re.byteLength)return this.eof_flag_=!0,Re.byteLength;if((Re[De+0]<<3|Re[De+1]>>>5)===695)return De;De++}},Ue.prototype.getLATMValue=function(Ve){for(var De=Ve.readBits(2),Re=0,ut=0;ut<=De;ut++)Re<<=8,Re|=Ve.readByte();return Re},Ue.prototype.readNextAACFrame=function(Ve){for(var De=this.data_,Re=null;Re==null&&!this.eof_flag_;){var ut=this.current_syncword_offset_,gt=(31&De[ut+1])<<8|De[ut+2];if(ut+3+gt>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var Ce=new R.a(De.subarray(ut+3,ut+3+gt)),ze=null;if(Ce.readBool()){if(Ve==null){l.a.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(ut+3+gt),Ce.destroy();continue}ze=Ve}else{var At=Ce.readBool();if(At&&Ce.readBool()){l.a.e(this.TAG,"audioMuxVersionA is Not Supported"),Ce.destroy();break}if(At&&this.getLATMValue(Ce),!Ce.readBool()){l.a.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),Ce.destroy();break}if(Ce.readBits(6)!==0){l.a.e(this.TAG,"more than 2 numSubFrames Not Supported"),Ce.destroy();break}if(Ce.readBits(4)!==0){l.a.e(this.TAG,"more than 2 numProgram Not Supported"),Ce.destroy();break}if(Ce.readBits(3)!==0){l.a.e(this.TAG,"more than 2 numLayer Not Supported"),Ce.destroy();break}var Je=At?this.getLATMValue(Ce):0,$e=Ce.readBits(5);Je-=5;var Be=Ce.readBits(4);Je-=4;var it=Ce.readBits(4);Je-=4,Ce.readBits(3),(Je-=3)>0&&Ce.readBits(Je);var Ne=Ce.readBits(3);if(Ne!==0){l.a.e(this.TAG,"frameLengthType = ".concat(Ne,". Only frameLengthType = 0 Supported")),Ce.destroy();break}Ce.readByte();var Qe=Ce.readBool();if(Qe)if(At)this.getLATMValue(Ce);else{for(var Me=0;;){Me<<=8;var Se=Ce.readBool();if(Me+=Ce.readByte(),!Se)break}console.log(Me)}Ce.readBool()&&Ce.readByte(),(ze=new O).audio_object_type=$e,ze.sampling_freq_index=Be,ze.sampling_frequency=L[ze.sampling_freq_index],ze.channel_config=it,ze.other_data_present=Qe}for(var K=0;;){var xe=Ce.readByte();if(K+=xe,xe!==255)break}for(var be=new Uint8Array(K),Te=0;Te=6?(Re=5,Ve=new Array(4),Ce=ut-3):(Re=2,Ve=new Array(2),Ce=ut):ze.indexOf("android")!==-1?(Re=2,Ve=new Array(2),Ce=ut):(Re=5,Ce=ut,Ve=new Array(4),ut>=6?Ce=ut-3:gt===1&&(Re=2,Ve=new Array(2),Ce=ut)),Ve[0]=Re<<3,Ve[0]|=(15&ut)>>>1,Ve[1]=(15&ut)<<7,Ve[1]|=(15>)<<3,Re===5&&(Ve[1]|=(15&Ce)>>>1,Ve[2]=(1&Ce)<<7,Ve[2]|=8,Ve[3]=0),this.config=Ve,this.sampling_rate=L[ut],this.channel_count=gt,this.codec_mimetype="mp4a.40."+Re,this.original_codec_mimetype="mp4a.40."+De},le=function(){},ne=function(){};(function(Ue){Ue[Ue.kSpliceNull=0]="kSpliceNull",Ue[Ue.kSpliceSchedule=4]="kSpliceSchedule",Ue[Ue.kSpliceInsert=5]="kSpliceInsert",Ue[Ue.kTimeSignal=6]="kTimeSignal",Ue[Ue.kBandwidthReservation=7]="kBandwidthReservation",Ue[Ue.kPrivateCommand=255]="kPrivateCommand"})(P||(P={}));var ee,M=function(Ue){var Ve=Ue.readBool();return Ve?(Ue.readBits(6),{time_specified_flag:Ve,pts_time:4*Ue.readBits(31)+Ue.readBits(2)}):(Ue.readBits(7),{time_specified_flag:Ve})},Y=function(Ue){var Ve=Ue.readBool();return Ue.readBits(6),{auto_return:Ve,duration:4*Ue.readBits(31)+Ue.readBits(2)}},j=function(Ue,Ve){var De=Ve.readBits(8);return Ue?{component_tag:De}:{component_tag:De,splice_time:M(Ve)}},z=function(Ue){return{component_tag:Ue.readBits(8),utc_splice_time:Ue.readBits(32)}},q=function(Ue){var Ve=Ue.readBits(32),De=Ue.readBool();Ue.readBits(7);var Re={splice_event_id:Ve,splice_event_cancel_indicator:De};if(De)return Re;if(Re.out_of_network_indicator=Ue.readBool(),Re.program_splice_flag=Ue.readBool(),Re.duration_flag=Ue.readBool(),Ue.readBits(5),Re.program_splice_flag)Re.utc_splice_time=Ue.readBits(32);else{Re.component_count=Ue.readBits(8),Re.components=[];for(var ut=0;ut=Re.byteLength)return this.eof_flag_=!0,Re.byteLength;var ut=Re[De+0]<<24|Re[De+1]<<16|Re[De+2]<<8|Re[De+3],gt=Re[De+0]<<16|Re[De+1]<<8|Re[De+2];if(ut===1||gt===1)return De;De++}},Ue.prototype.readNextNaluPayload=function(){for(var Ve=this.data_,De=null;De==null&&!this.eof_flag_;){var Re=this.current_startcode_offset_,ut=Ve[Re+=(Ve[Re]<<24|Ve[Re+1]<<16|Ve[Re+2]<<8|Ve[Re+3])===1?4:3]>>1&63,gt=(128&Ve[Re])>>>7,Ce=this.findNextStartCodeOffset(Re);if(this.current_startcode_offset_=Ce,gt===0){var ze=Ve.subarray(Re,Ce);(De=new He).type=ut,De.data=ze}}return De},Ue}(),je=function(){function Ue(Ve,De,Re,ut){var gt=23+(5+Ve.byteLength)+(5+De.byteLength)+(5+Re.byteLength),Ce=this.data=new Uint8Array(gt);Ce[0]=1,Ce[1]=(3&ut.general_profile_space)<<6|(ut.general_tier_flag?1:0)<<5|31&ut.general_profile_idc,Ce[2]=ut.general_profile_compatibility_flags_1,Ce[3]=ut.general_profile_compatibility_flags_2,Ce[4]=ut.general_profile_compatibility_flags_3,Ce[5]=ut.general_profile_compatibility_flags_4,Ce[6]=ut.general_constraint_indicator_flags_1,Ce[7]=ut.general_constraint_indicator_flags_2,Ce[8]=ut.general_constraint_indicator_flags_3,Ce[9]=ut.general_constraint_indicator_flags_4,Ce[10]=ut.general_constraint_indicator_flags_5,Ce[11]=ut.general_constraint_indicator_flags_6,Ce[12]=ut.general_level_idc,Ce[13]=240|(3840&ut.min_spatial_segmentation_idc)>>8,Ce[14]=255&ut.min_spatial_segmentation_idc,Ce[15]=252|3&ut.parallelismType,Ce[16]=252|3&ut.chroma_format_idc,Ce[17]=248|7&ut.bit_depth_luma_minus8,Ce[18]=248|7&ut.bit_depth_chroma_minus8,Ce[19]=0,Ce[20]=0,Ce[21]=(3&ut.constant_frame_rate)<<6|(7&ut.num_temporal_layers)<<3|(ut.temporal_id_nested?1:0)<<2|3,Ce[22]=3,Ce[23]=128|ee.kSliceVPS,Ce[24]=0,Ce[25]=1,Ce[26]=(65280&Ve.byteLength)>>8,Ce[27]=(255&Ve.byteLength)>>0,Ce.set(Ve,28),Ce[23+(5+Ve.byteLength)+0]=128|ee.kSliceSPS,Ce[23+(5+Ve.byteLength)+1]=0,Ce[23+(5+Ve.byteLength)+2]=1,Ce[23+(5+Ve.byteLength)+3]=(65280&De.byteLength)>>8,Ce[23+(5+Ve.byteLength)+4]=(255&De.byteLength)>>0,Ce.set(De,23+(5+Ve.byteLength)+5),Ce[23+(5+Ve.byteLength+5+De.byteLength)+0]=128|ee.kSlicePPS,Ce[23+(5+Ve.byteLength+5+De.byteLength)+1]=0,Ce[23+(5+Ve.byteLength+5+De.byteLength)+2]=1,Ce[23+(5+Ve.byteLength+5+De.byteLength)+3]=(65280&Re.byteLength)>>8,Ce[23+(5+Ve.byteLength+5+De.byteLength)+4]=(255&Re.byteLength)>>0,Ce.set(Re,23+(5+Ve.byteLength+5+De.byteLength)+5)}return Ue.prototype.getData=function(){return this.data},Ue}(),ht=y(15),_e=function(){},Oe=function(){},pt=function(){},vt=[[64,64,80,80,96,96,112,112,128,128,160,160,192,192,224,224,256,256,320,320,384,384,448,448,512,512,640,640,768,768,896,896,1024,1024,1152,1152,1280,1280],[69,70,87,88,104,105,121,122,139,140,174,175,208,209,243,244,278,279,348,349,417,418,487,488,557,558,696,697,835,836,975,976,1114,1115,1253,1254,1393,1394],[96,96,120,120,144,144,168,168,192,192,240,240,288,288,336,336,384,384,480,480,576,576,672,672,768,768,960,960,1152,1152,1344,1344,1536,1536,1728,1728,1920,1920]],tt=function(){function Ue(Ve){this.TAG="AC3Parser",this.data_=Ve,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&l.a.e(this.TAG,"Could not found AC3 syncword until payload end")}return Ue.prototype.findNextSyncwordOffset=function(Ve){for(var De=Ve,Re=this.data_;;){if(De+7>=Re.byteLength)return this.eof_flag_=!0,Re.byteLength;if((Re[De+0]<<8|Re[De+1]<<0)===2935)return De;De++}},Ue.prototype.readNextAC3Frame=function(){for(var Ve=this.data_,De=null;De==null&&!this.eof_flag_;){var Re=this.current_syncword_offset_,ut=Ve[Re+4]>>6,gt=[48e3,44200,33e3][ut],Ce=63&Ve[Re+4],ze=2*vt[ut][Ce];if(isNaN(ze)||Re+ze>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var At=this.findNextSyncwordOffset(Re+ze);this.current_syncword_offset_=At;var Je=Ve[Re+5]>>3,$e=7&Ve[Re+5],Be=Ve[Re+6]>>5,it=0;1&Be&&Be!==1&&(it+=2),4&Be&&(it+=2),Be===2&&(it+=2);var Ne=(Ve[Re+6]<<8|Ve[Re+7]<<0)>>12-it&1,Qe=[2,1,2,3,3,4,4,5][Be]+Ne;(De=new pt).sampling_frequency=gt,De.channel_count=Qe,De.channel_mode=Be,De.bit_stream_identification=Je,De.low_frequency_effects_channel_on=Ne,De.bit_stream_mode=$e,De.frame_size_code=Ce,De.data=Ve.subarray(Re,Re+ze)}return De},Ue.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},Ue.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},Ue}(),pe=function(Ue){var Ve;Ve=[Ue.sampling_rate_code<<6|Ue.bit_stream_identification<<1|Ue.bit_stream_mode>>2,(3&Ue.bit_stream_mode)<<6|Ue.channel_mode<<3|Ue.low_frequency_effects_channel_on<<2|Ue.frame_size_code>>4,Ue.frame_size_code<<4&224],this.config=Ve,this.sampling_rate=Ue.sampling_frequency,this.bit_stream_identification=Ue.bit_stream_identification,this.bit_stream_mode=Ue.bit_stream_mode,this.low_frequency_effects_channel_on=Ue.low_frequency_effects_channel_on,this.channel_count=Ue.channel_count,this.channel_mode=Ue.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},ue=function(){},W=function(){function Ue(Ve){this.TAG="EAC3Parser",this.data_=Ve,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&l.a.e(this.TAG,"Could not found AC3 syncword until payload end")}return Ue.prototype.findNextSyncwordOffset=function(Ve){for(var De=Ve,Re=this.data_;;){if(De+7>=Re.byteLength)return this.eof_flag_=!0,Re.byteLength;if((Re[De+0]<<8|Re[De+1]<<0)===2935)return De;De++}},Ue.prototype.readNextEAC3Frame=function(){for(var Ve=this.data_,De=null;De==null&&!this.eof_flag_;){var Re=this.current_syncword_offset_,ut=new R.a(Ve.subarray(Re+2)),gt=(ut.readBits(2),ut.readBits(3),ut.readBits(11)+1<<1),Ce=ut.readBits(2),ze=null,At=null;Ce===3?(ze=[24e3,22060,16e3][Ce=ut.readBits(2)],At=3):(ze=[48e3,44100,32e3][Ce],At=ut.readBits(2));var Je=ut.readBits(3),$e=ut.readBits(1),Be=ut.readBits(5);if(Re+gt>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var it=this.findNextSyncwordOffset(Re+gt);this.current_syncword_offset_=it;var Ne=[2,1,2,3,3,4,4,5][Je]+$e;ut.destroy(),(De=new ue).sampling_frequency=ze,De.channel_count=Ne,De.channel_mode=Je,De.bit_stream_identification=Be,De.low_frequency_effects_channel_on=$e,De.frame_size=gt,De.num_blks=[1,2,3,6][At],De.data=Ve.subarray(Re,Re+gt)}return De},Ue.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},Ue.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},Ue}(),ke=function(Ue){var Ve,De=Math.floor(Ue.frame_size*Ue.sampling_frequency/(16*Ue.num_blks));Ve=[255&De,248&De,Ue.sampling_rate_code<<6|Ue.bit_stream_identification<<1|0,0|Ue.channel_mode<<1|Ue.low_frequency_effects_channel_on<<0,0],this.config=Ve,this.sampling_rate=Ue.sampling_frequency,this.bit_stream_identification=Ue.bit_stream_identification,this.num_blks=Ue.num_blks,this.low_frequency_effects_channel_on=Ue.low_frequency_effects_channel_on,this.channel_count=Ue.channel_count,this.channel_mode=Ue.channel_mode,this.codec_mimetype="ec-3",this.original_codec_mimetype="ec-3"},Ae=function(){},Ye=function(){var Ue=function(Ve,De){return(Ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Re,ut){Re.__proto__=ut}||function(Re,ut){for(var gt in ut)Object.prototype.hasOwnProperty.call(ut,gt)&&(Re[gt]=ut[gt])})(Ve,De)};return function(Ve,De){if(typeof De!="function"&&De!==null)throw new TypeError("Class extends value "+String(De)+" is not a constructor or null");function Re(){this.constructor=Ve}Ue(Ve,De),Ve.prototype=De===null?Object.create(De):(Re.prototype=De.prototype,new Re)}}(),lt=function(){return(lt=Object.assign||function(Ue){for(var Ve,De=1,Re=arguments.length;De=4?(l.a.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),ut-=4):gt===204&&l.a.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:gt,sync_offset:ut})},Ve.prototype.bindDataSource=function(De){return De.onDataArrival=this.parseChunks.bind(this),this},Ve.prototype.resetMediaInfo=function(){this.media_info_=new c.a},Ve.prototype.parseChunks=function(De,Re){if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new p.a("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var ut=0;for(this.first_parse_&&(this.first_parse_=!1,ut=this.sync_offset_);ut+this.ts_packet_size_<=De.byteLength;){var gt=Re+ut;this.ts_packet_size_===192&&(ut+=4);var Ce=new Uint8Array(De,ut,188),ze=Ce[0];if(ze!==71){l.a.e(this.TAG,"sync_byte = ".concat(ze,", not 0x47"));break}var At=(64&Ce[1])>>>6,Je=(Ce[1],(31&Ce[1])<<8|Ce[2]),$e=(48&Ce[3])>>>4,Be=15&Ce[3],it=!(!this.pmt_||this.pmt_.pcr_pid!==Je),Ne={},Qe=4;if($e==2||$e==3){var Me=Ce[4];if(Me>0&&(it||$e==3)&&(Ne.discontinuity_indicator=(128&Ce[5])>>>7,Ne.random_access_indicator=(64&Ce[5])>>>6,Ne.elementary_stream_priority_indicator=(32&Ce[5])>>>5,(16&Ce[5])>>>4)){var Se=300*this.getPcrBase(Ce)+((1&Ce[10])<<8|Ce[11]);this.last_pcr_=Se}if($e==2||5+Me===188){ut+=188,this.ts_packet_size_===204&&(ut+=16);continue}Qe=5+Me}if($e==1||$e==3){if(Je===0||Je===this.current_pmt_pid_||this.pmt_!=null&&this.pmt_.pid_stream_type[Je]===A.kSCTE35){var K=188-Qe;this.handleSectionSlice(De,ut+Qe,K,{pid:Je,file_position:gt,payload_unit_start_indicator:At,continuity_conunter:Be,random_access_indicator:Ne.random_access_indicator})}else if(this.pmt_!=null&&this.pmt_.pid_stream_type[Je]!=null){K=188-Qe;var xe=this.pmt_.pid_stream_type[Je];Je!==this.pmt_.common_pids.h264&&Je!==this.pmt_.common_pids.h265&&Je!==this.pmt_.common_pids.adts_aac&&Je!==this.pmt_.common_pids.loas_aac&&Je!==this.pmt_.common_pids.ac3&&Je!==this.pmt_.common_pids.eac3&&Je!==this.pmt_.common_pids.opus&&Je!==this.pmt_.common_pids.mp3&&this.pmt_.pes_private_data_pids[Je]!==!0&&this.pmt_.timed_id3_pids[Je]!==!0&&this.pmt_.synchronous_klv_pids[Je]!==!0&&this.pmt_.asynchronous_klv_pids[Je]!==!0||this.handlePESSlice(De,ut+Qe,K,{pid:Je,stream_type:xe,file_position:gt,payload_unit_start_indicator:At,continuity_conunter:Be,random_access_indicator:Ne.random_access_indicator})}}ut+=188,this.ts_packet_size_===204&&(ut+=16)}return this.dispatchAudioVideoMediaSegment(),ut},Ve.prototype.handleSectionSlice=function(De,Re,ut,gt){var Ce=new Uint8Array(De,Re,ut),ze=this.section_slice_queues_[gt.pid];if(gt.payload_unit_start_indicator){var At=Ce[0];if(ze!=null&&ze.total_length!==0){var Je=new Uint8Array(De,Re+1,Math.min(ut,At));ze.slices.push(Je),ze.total_length+=Je.byteLength,ze.total_length===ze.expected_length?this.emitSectionSlices(ze,gt):this.clearSlices(ze,gt)}for(var $e=1+At;$e=ze.expected_length&&this.clearSlices(ze,gt),$e+=Je.byteLength}}else ze!=null&&ze.total_length!==0&&(Je=new Uint8Array(De,Re,Math.min(ut,ze.expected_length-ze.total_length)),ze.slices.push(Je),ze.total_length+=Je.byteLength,ze.total_length===ze.expected_length?this.emitSectionSlices(ze,gt):ze.total_length>=ze.expected_length&&this.clearSlices(ze,gt))},Ve.prototype.handlePESSlice=function(De,Re,ut,gt){var Ce=new Uint8Array(De,Re,ut),ze=Ce[0]<<16|Ce[1]<<8|Ce[2],At=(Ce[3],Ce[4]<<8|Ce[5]);if(gt.payload_unit_start_indicator){if(ze!==1)return void l.a.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(ze));var Je=this.pes_slice_queues_[gt.pid];Je&&(Je.expected_length===0||Je.expected_length===Je.total_length?this.emitPESSlices(Je,gt):this.clearSlices(Je,gt)),this.pes_slice_queues_[gt.pid]=new d,this.pes_slice_queues_[gt.pid].file_position=gt.file_position,this.pes_slice_queues_[gt.pid].random_access_indicator=gt.random_access_indicator}if(this.pes_slice_queues_[gt.pid]!=null){var $e=this.pes_slice_queues_[gt.pid];$e.slices.push(Ce),gt.payload_unit_start_indicator&&($e.expected_length=At===0?0:At+6),$e.total_length+=Ce.byteLength,$e.expected_length>0&&$e.expected_length===$e.total_length?this.emitPESSlices($e,gt):$e.expected_length>0&&$e.expected_length<$e.total_length&&this.clearSlices($e,gt)}},Ve.prototype.emitSectionSlices=function(De,Re){for(var ut=new Uint8Array(De.total_length),gt=0,Ce=0;gt>>6,At=Re[8],Je=void 0,$e=void 0;ze!==2&&ze!==3||(Je=this.getTimestamp(Re,9),$e=ze===3?this.getTimestamp(Re,14):Je);var Be=9+At,it=void 0;if(Ce!==0){if(Ce<3+At)return void l.a.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");it=Ce-3-At}else it=Re.byteLength-Be;var Ne=Re.subarray(Be,Be+it);switch(De.stream_type){case A.kMPEG1Audio:case A.kMPEG2Audio:this.parseMP3Payload(Ne,Je);break;case A.kPESPrivateData:this.pmt_.common_pids.opus===De.pid?this.parseOpusPayload(Ne,Je):this.pmt_.common_pids.ac3===De.pid?this.parseAC3Payload(Ne,Je):this.pmt_.common_pids.eac3===De.pid?this.parseEAC3Payload(Ne,Je):this.pmt_.asynchronous_klv_pids[De.pid]?this.parseAsynchronousKLVMetadataPayload(Ne,De.pid,gt):this.pmt_.smpte2038_pids[De.pid]?this.parseSMPTE2038MetadataPayload(Ne,Je,$e,De.pid,gt):this.parsePESPrivateDataPayload(Ne,Je,$e,De.pid,gt);break;case A.kADTSAAC:this.parseADTSAACPayload(Ne,Je);break;case A.kLOASAAC:this.parseLOASAACPayload(Ne,Je);break;case A.kAC3:this.parseAC3Payload(Ne,Je);break;case A.kEAC3:this.parseEAC3Payload(Ne,Je);break;case A.kMetadata:this.pmt_.timed_id3_pids[De.pid]?this.parseTimedID3MetadataPayload(Ne,Je,$e,De.pid,gt):this.pmt_.synchronous_klv_pids[De.pid]&&this.parseSynchronousKLVMetadataPayload(Ne,Je,$e,De.pid,gt);break;case A.kH264:this.parseH264Payload(Ne,Je,$e,De.file_position,De.random_access_indicator);break;case A.kH265:this.parseH265Payload(Ne,Je,$e,De.file_position,De.random_access_indicator)}}else(gt===188||gt===191||gt===240||gt===241||gt===255||gt===242||gt===248)&&De.stream_type===A.kPESPrivateData&&(Be=6,it=void 0,it=Ce!==0?Ce:Re.byteLength-Be,Ne=Re.subarray(Be,Be+it),this.parsePESPrivateDataPayload(Ne,void 0,void 0,De.pid,gt));else l.a.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(ut))},Ve.prototype.parsePAT=function(De){var Re=De[0];if(Re===0){var ut=(15&De[1])<<8|De[2],gt=(De[3],De[4],(62&De[5])>>>1),Ce=1&De[5],ze=De[6],At=(De[7],null);if(Ce===1&&ze===0)(At=new i).version_number=gt;else if((At=this.pat_)==null)return;for(var Je=ut-5-4,$e=-1,Be=-1,it=8;it<8+Je;it+=4){var Ne=De[it]<<8|De[it+1],Qe=(31&De[it+2])<<8|De[it+3];Ne===0?At.network_pid=Qe:(At.program_pmt_pid[Ne]=Qe,$e===-1&&($e=Ne),Be===-1&&(Be=Qe))}Ce===1&&ze===0&&(this.pat_==null&&l.a.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(At))),this.pat_=At,this.current_program_=$e,this.current_pmt_pid_=Be)}else l.a.e(this.TAG,"parsePAT: table_id ".concat(Re," is not corresponded to PAT!"))},Ve.prototype.parsePMT=function(De){var Re=De[0];if(Re===2){var ut=(15&De[1])<<8|De[2],gt=De[3]<<8|De[4],Ce=(62&De[5])>>>1,ze=1&De[5],At=De[6],Je=(De[7],null);if(ze===1&&At===0)(Je=new n).program_number=gt,Je.version_number=Ce,this.program_pmt_map_[gt]=Je;else if((Je=this.program_pmt_map_[gt])==null)return;Je.pcr_pid=(31&De[8])<<8|De[9];for(var $e=(15&De[10])<<8|De[11],Be=12+$e,it=ut-9-$e-4,Ne=Be;Ne0){for(var be=Ne+5;be0)for(be=Ne+5;be1&&(l.a.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(ze,"ms, PES pts: ").concat(Ce,"ms")),Ce=ze)}}for(var At,Je=new G(De),$e=null,Be=Ce;($e=Je.readNextAACFrame())!=null;){gt=1024/$e.sampling_frequency*1e3;var it={codec:"aac",data:$e};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"aac",audio_object_type:$e.audio_object_type,sampling_freq_index:$e.sampling_freq_index,sampling_frequency:$e.sampling_frequency,channel_config:$e.channel_config},this.dispatchAudioInitSegment(it)):this.detectAudioMetadataChange(it)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(it)),At=Be;var Ne=Math.floor(Be),Qe={unit:$e.data,length:$e.data.byteLength,pts:Ne,dts:Ne};this.audio_track_.samples.push(Qe),this.audio_track_.length+=$e.data.byteLength,Be+=gt}Je.hasIncompleteData()&&(this.aac_last_incomplete_data_=Je.getIncompleteData()),At&&(this.audio_last_sample_pts_=At)}},Ve.prototype.parseLOASAACPayload=function(De,Re){var ut;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var gt=new Uint8Array(De.byteLength+this.aac_last_incomplete_data_.byteLength);gt.set(this.aac_last_incomplete_data_,0),gt.set(De,this.aac_last_incomplete_data_.byteLength),De=gt}var Ce,ze;if(Re!=null&&(ze=Re/this.timescale_),this.audio_metadata_.codec==="aac"){if(Re==null&&this.audio_last_sample_pts_!=null)Ce=1024/this.audio_metadata_.sampling_frequency*1e3,ze=this.audio_last_sample_pts_+Ce;else if(Re==null)return void l.a.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.audio_last_sample_pts_){Ce=1024/this.audio_metadata_.sampling_frequency*1e3;var At=this.audio_last_sample_pts_+Ce;Math.abs(At-ze)>1&&(l.a.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(At,"ms, PES pts: ").concat(ze,"ms")),ze=At)}}for(var Je,$e=new J(De),Be=null,it=ze;(Be=$e.readNextAACFrame((ut=this.loas_previous_frame)!==null&&ut!==void 0?ut:void 0))!=null;){this.loas_previous_frame=Be,Ce=1024/Be.sampling_frequency*1e3;var Ne={codec:"aac",data:Be};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"aac",audio_object_type:Be.audio_object_type,sampling_freq_index:Be.sampling_freq_index,sampling_frequency:Be.sampling_frequency,channel_config:Be.channel_config},this.dispatchAudioInitSegment(Ne)):this.detectAudioMetadataChange(Ne)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(Ne)),Je=it;var Qe=Math.floor(it),Me={unit:Be.data,length:Be.data.byteLength,pts:Qe,dts:Qe};this.audio_track_.samples.push(Me),this.audio_track_.length+=Be.data.byteLength,it+=Ce}$e.hasIncompleteData()&&(this.aac_last_incomplete_data_=$e.getIncompleteData()),Je&&(this.audio_last_sample_pts_=Je)}},Ve.prototype.parseAC3Payload=function(De,Re){if(!this.has_video_||this.video_init_segment_dispatched_){var ut,gt;if(Re!=null&&(gt=Re/this.timescale_),this.audio_metadata_.codec==="ac-3"){if(Re==null&&this.audio_last_sample_pts_!=null)ut=1536/this.audio_metadata_.sampling_frequency*1e3,gt=this.audio_last_sample_pts_+ut;else if(Re==null)return void l.a.w(this.TAG,"AC3: Unknown pts")}for(var Ce,ze=new tt(De),At=null,Je=gt;(At=ze.readNextAC3Frame())!=null;){ut=1536/At.sampling_frequency*1e3;var $e={codec:"ac-3",data:At};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"ac-3",sampling_frequency:At.sampling_frequency,bit_stream_identification:At.bit_stream_identification,bit_stream_mode:At.bit_stream_mode,low_frequency_effects_channel_on:At.low_frequency_effects_channel_on,channel_mode:At.channel_mode},this.dispatchAudioInitSegment($e)):this.detectAudioMetadataChange($e)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment($e)),Ce=Je;var Be=Math.floor(Je),it={unit:At.data,length:At.data.byteLength,pts:Be,dts:Be};this.audio_track_.samples.push(it),this.audio_track_.length+=At.data.byteLength,Je+=ut}Ce&&(this.audio_last_sample_pts_=Ce)}},Ve.prototype.parseEAC3Payload=function(De,Re){if(!this.has_video_||this.video_init_segment_dispatched_){var ut,gt;if(Re!=null&&(gt=Re/this.timescale_),this.audio_metadata_.codec==="ec-3"){if(Re==null&&this.audio_last_sample_pts_!=null)ut=256*this.audio_metadata_.num_blks/this.audio_metadata_.sampling_frequency*1e3,gt=this.audio_last_sample_pts_+ut;else if(Re==null)return void l.a.w(this.TAG,"EAC3: Unknown pts")}for(var Ce,ze=new W(De),At=null,Je=gt;(At=ze.readNextEAC3Frame())!=null;){ut=1536/At.sampling_frequency*1e3;var $e={codec:"ec-3",data:At};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"ec-3",sampling_frequency:At.sampling_frequency,bit_stream_identification:At.bit_stream_identification,low_frequency_effects_channel_on:At.low_frequency_effects_channel_on,num_blks:At.num_blks,channel_mode:At.channel_mode},this.dispatchAudioInitSegment($e)):this.detectAudioMetadataChange($e)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment($e)),Ce=Je;var Be=Math.floor(Je),it={unit:At.data,length:At.data.byteLength,pts:Be,dts:Be};this.audio_track_.samples.push(it),this.audio_track_.length+=At.data.byteLength,Je+=ut}Ce&&(this.audio_last_sample_pts_=Ce)}},Ve.prototype.parseOpusPayload=function(De,Re){if(!this.has_video_||this.video_init_segment_dispatched_){var ut,gt;if(Re!=null&&(gt=Re/this.timescale_),this.audio_metadata_.codec==="opus"){if(Re==null&&this.audio_last_sample_pts_!=null)ut=20,gt=this.audio_last_sample_pts_+ut;else if(Re==null)return void l.a.w(this.TAG,"Opus: Unknown pts")}for(var Ce,ze=gt,At=0;At>>3&3,At=(6&De[1])>>1,Je=(240&De[2])>>>4,$e=(12&De[2])>>>2,Be=(De[3]>>>6&3)!==3?2:1,it=0,Ne=34;switch(ze){case 0:it=[11025,12e3,8e3,0][$e];break;case 2:it=[22050,24e3,16e3,0][$e];break;case 3:it=[44100,48e3,32e3,0][$e]}switch(At){case 1:Ne=34,Je=2&&r[a]===3&&r[a-1]===0&&r[a-2]===0||(t[n]=r[a],n++);return new Uint8Array(t.buffer,0,n)},c.parseVPS=function(p){var r=c._ebsp2rbsp(p),i=new A.a(r);return i.readByte(),i.readByte(),i.readBits(4),i.readBits(2),i.readBits(6),{num_temporal_layers:i.readBits(3)+1,temporal_id_nested:i.readBool()}},c.parseSPS=function(p){var r=c._ebsp2rbsp(p),i=new A.a(r);i.readByte(),i.readByte();for(var t=0,n=0,a=0,o=0,d=(i.readBits(4),i.readBits(3)),g=(i.readBool(),i.readBits(2)),m=i.readBool(),v=i.readBits(5),b=i.readByte(),w=i.readByte(),C=i.readByte(),D=i.readByte(),R=i.readByte(),T=i.readByte(),P=i.readByte(),L=i.readByte(),I=i.readByte(),x=i.readByte(),O=i.readByte(),G=[],J=[],te=0;te0)for(te=d;te<8;te++)i.readBits(2);for(te=0;te1&&i.readSEG(),te=0;te0&&tt<=16?(ht=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][tt-1],_e=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][tt-1]):tt===255&&(ht=i.readBits(16),_e=i.readBits(16))}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(3),i.readBool(),i.readBool()&&(i.readByte(),i.readByte(),i.readByte())),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool(),i.readBool(),i.readBool(),i.readBool()&&(i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG()),i.readBool()&&(pt=i.readBits(32),vt=i.readBits(32),i.readBool()&&i.readUEG(),i.readBool())){var pe=!1,ue=!1,W=!1;for(pe=i.readBool(),ue=i.readBool(),(pe||ue)&&((W=i.readBool())&&(i.readByte(),i.readBits(5),i.readBool(),i.readBits(5)),i.readBits(4),i.readBits(4),W&&i.readBits(4),i.readBits(5),i.readBits(5),i.readBits(5)),te=0;te<=d;te++){var ke=i.readBool();Oe=ke;var Ae=!0,Ye=1;ke||(Ae=i.readBool());var lt=!1;if(Ae?i.readUEG():lt=i.readBool(),lt||(Ye=i.readUEG()+1),pe){for(fe=0;fe=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"averageKBps",{get:function(){var T=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/T/1024},enumerable:!1,configurable:!0}),R}(),p=y(2),r=y(5),i=y(3),t=(A=function(R,T){return(A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(P,L){P.__proto__=L}||function(P,L){for(var I in L)Object.prototype.hasOwnProperty.call(L,I)&&(P[I]=L[I])})(R,T)},function(R,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");function P(){this.constructor=R}A(R,T),R.prototype=T===null?Object.create(T):(P.prototype=T.prototype,new P)}),n=function(R){function T(P,L){var I=R.call(this,"fetch-stream-loader")||this;return I.TAG="FetchStreamLoader",I._seekHandler=P,I._config=L,I._needStash=!0,I._requestAbort=!1,I._abortController=null,I._contentLength=null,I._receivedLength=0,I}return t(T,R),T.isSupported=function(){try{var P=r.a.msedge&&r.a.version.minor>=15048,L=!r.a.msedge||P;return self.fetch&&self.ReadableStream&&L}catch{return!1}},T.prototype.destroy=function(){this.isWorking()&&this.abort(),R.prototype.destroy.call(this)},T.prototype.open=function(P,L){var I=this;this._dataSource=P,this._range=L;var x=P.url;this._config.reuseRedirectedURL&&P.redirectedURL!=null&&(x=P.redirectedURL);var O=this._seekHandler.getConfig(x,L),G=new self.Headers;if(typeof O.headers=="object"){var J=O.headers;for(var te in J)J.hasOwnProperty(te)&&G.append(te,J[te])}var le={method:"GET",headers:G,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var te in this._config.headers)G.append(te,this._config.headers[te]);P.cors===!1&&(le.mode="same-origin"),P.withCredentials&&(le.credentials="include"),P.referrerPolicy&&(le.referrerPolicy=P.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,le.signal=this._abortController.signal),this._status=p.c.kConnecting,self.fetch(O.url,le).then(function(ne){if(I._requestAbort)return I._status=p.c.kIdle,void ne.body.cancel();if(ne.ok&&ne.status>=200&&ne.status<=299){if(ne.url!==O.url&&I._onURLRedirect){var ee=I._seekHandler.removeURLParameters(ne.url);I._onURLRedirect(ee)}var M=ne.headers.get("Content-Length");return M!=null&&(I._contentLength=parseInt(M),I._contentLength!==0&&I._onContentLengthKnown&&I._onContentLengthKnown(I._contentLength)),I._pump.call(I,ne.body.getReader())}if(I._status=p.c.kError,!I._onError)throw new i.d("FetchStreamLoader: Http code invalid, "+ne.status+" "+ne.statusText);I._onError(p.b.HTTP_STATUS_CODE_INVALID,{code:ne.status,msg:ne.statusText})}).catch(function(ne){if(!I._abortController||!I._abortController.signal.aborted){if(I._status=p.c.kError,!I._onError)throw ne;I._onError(p.b.EXCEPTION,{code:-1,msg:ne.message})}})},T.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==p.c.kBuffering||!r.a.chrome)&&this._abortController)try{this._abortController.abort()}catch{}},T.prototype._pump=function(P){var L=this;return P.read().then(function(I){if(I.done)if(L._contentLength!==null&&L._receivedLength299)){if(this._status=p.c.kError,!this._onError)throw new i.d("MozChunkedLoader: Http code invalid, "+L.status+" "+L.statusText);this._onError(p.b.HTTP_STATUS_CODE_INVALID,{code:L.status,msg:L.statusText})}else this._status=p.c.kBuffering}},T.prototype._onProgress=function(P){if(this._status!==p.c.kError){this._contentLength===null&&P.total!==null&&P.total!==0&&(this._contentLength=P.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var L=P.target.response,I=this._range.from+this._receivedLength;this._receivedLength+=L.byteLength,this._onDataArrival&&this._onDataArrival(L,I,this._receivedLength)}},T.prototype._onLoadEnd=function(P){this._requestAbort!==!0?this._status!==p.c.kError&&(this._status=p.c.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1},T.prototype._onXhrError=function(P){this._status=p.c.kError;var L=0,I=null;if(this._contentLength&&P.loaded=200&&L.status<=299){if(this._status=p.c.kBuffering,L.responseURL!=null){var I=this._seekHandler.removeURLParameters(L.responseURL);L.responseURL!==this._currentRequestURL&&I!==this._currentRedirectedURL&&(this._currentRedirectedURL=I,this._onURLRedirect&&this._onURLRedirect(I))}var x=L.getResponseHeader("Content-Length");if(x!=null&&this._contentLength==null){var O=parseInt(x);O>0&&(this._contentLength=O,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else{if(this._status=p.c.kError,!this._onError)throw new i.d("MSStreamLoader: Http code invalid, "+L.status+" "+L.statusText);this._onError(p.b.HTTP_STATUS_CODE_INVALID,{code:L.status,msg:L.statusText})}else if(L.readyState===3&&L.status>=200&&L.status<=299){this._status=p.c.kBuffering;var G=L.response;this._reader.readAsArrayBuffer(G)}},T.prototype._xhrOnError=function(P){this._status=p.c.kError;var L=p.b.EXCEPTION,I={code:-1,msg:P.constructor.name+" "+P.type};if(!this._onError)throw new i.d(I.msg);this._onError(L,I)},T.prototype._msrOnProgress=function(P){var L=P.target.result;if(L!=null){var I=L.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=L.byteLength;var x=this._totalRange.from+this._receivedLength;this._receivedLength+=I.byteLength,this._onDataArrival&&this._onDataArrival(I,x,this._receivedLength),L.byteLength>=this._bufferLimit&&(l.a.v(this.TAG,"MSStream buffer exceeded max size near ".concat(x+I.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}else this._doReconnectIfNeeded()},T.prototype._doReconnectIfNeeded=function(){if(this._contentLength==null||this._receivedLength=this._contentLength&&(I=this._range.from+this._contentLength-1),this._currentRequestRange={from:L,to:I},this._internalOpen(this._dataSource,this._currentRequestRange)},T.prototype._internalOpen=function(P,L){this._lastTimeLoaded=0;var I=P.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?I=this._currentRedirectedURL:P.redirectedURL!=null&&(I=P.redirectedURL));var x=this._seekHandler.getConfig(I,L);this._currentRequestURL=x.url;var O=this._xhr=new XMLHttpRequest;if(O.open("GET",x.url,!0),O.responseType="arraybuffer",O.onreadystatechange=this._onReadyStateChange.bind(this),O.onprogress=this._onProgress.bind(this),O.onload=this._onLoad.bind(this),O.onerror=this._onXhrError.bind(this),P.withCredentials&&(O.withCredentials=!0),typeof x.headers=="object"){var G=x.headers;for(var J in G)G.hasOwnProperty(J)&&O.setRequestHeader(J,G[J])}if(typeof this._config.headers=="object"){G=this._config.headers;for(var J in G)G.hasOwnProperty(J)&&O.setRequestHeader(J,G[J])}O.send()},T.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=p.c.kComplete},T.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},T.prototype._onReadyStateChange=function(P){var L=P.target;if(L.readyState===2){if(L.responseURL!=null){var I=this._seekHandler.removeURLParameters(L.responseURL);L.responseURL!==this._currentRequestURL&&I!==this._currentRedirectedURL&&(this._currentRedirectedURL=I,this._onURLRedirect&&this._onURLRedirect(I))}if(L.status>=200&&L.status<=299){if(this._waitForTotalLength)return;this._status=p.c.kBuffering}else{if(this._status=p.c.kError,!this._onError)throw new i.d("RangeLoader: Http code invalid, "+L.status+" "+L.statusText);this._onError(p.b.HTTP_STATUS_CODE_INVALID,{code:L.status,msg:L.statusText})}}},T.prototype._onProgress=function(P){if(this._status!==p.c.kError){if(this._contentLength===null){var L=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,L=!0;var I=P.total;this._internalAbort(),I!=null&I!==0&&(this._totalLength=I)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,L)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var x=P.loaded-this._lastTimeLoaded;this._lastTimeLoaded=P.loaded,this._speedSampler.addBytes(x)}},T.prototype._normalizeSpeed=function(P){var L=this._chunkSizeKBList,I=L.length-1,x=0,O=0,G=I;if(P=L[x]&&P=3&&(L=this._speedSampler.currentKBps)),L!==0){var I=this._normalizeSpeed(L);this._currentSpeedNormalized!==I&&(this._currentSpeedNormalized=I,this._currentChunkSizeKB=I)}var x=P.target.response,O=this._range.from+this._receivedLength;this._receivedLength+=x.byteLength;var G=!1;this._contentLength!=null&&this._receivedLength0&&this._receivedLength0)for(var O=L.split("&"),G=0;G0;J[0]!==this._startName&&J[0]!==this._endName&&(te&&(x+="&"),x+=O[G])}return x.length===0?P:P+"?"+x},R}(),D=function(){function R(T,P,L){this.TAG="IOController",this._config=P,this._extraData=L,this._stashInitialSize=65536,P.stashInitialSize!=null&&P.stashInitialSize>0&&(this._stashInitialSize=P.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=Math.max(this._stashSize,3145728),this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,P.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=T,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(T.url),this._refTotalLength=T.filesize?T.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new c,this._speedNormalizeList=[32,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return R.prototype.destroy=function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},R.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},R.prototype.isPaused=function(){return this._paused},Object.defineProperty(R.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"extraData",{get:function(){return this._extraData},set:function(T){this._extraData=T},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(T){this._onDataArrival=T},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(T){this._onSeeked=T},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onError",{get:function(){return this._onError},set:function(T){this._onError=T},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onComplete",{get:function(){return this._onComplete},set:function(T){this._onComplete=T},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(T){this._onRedirect=T},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(T){this._onRecoveredEarlyEof=T},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"hasRedirect",{get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"currentSpeed",{get:function(){return this._loaderClass===m?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),R.prototype._selectSeekHandler=function(){var T=this._config;if(T.seekType==="range")this._seekHandler=new w(this._config.rangeLoadZeroStart);else if(T.seekType==="param"){var P=T.seekParamStart||"bstart",L=T.seekParamEnd||"bend";this._seekHandler=new C(P,L)}else{if(T.seekType!=="custom")throw new i.b("Invalid seekType in config: ".concat(T.seekType));if(typeof T.customSeekHandler!="function")throw new i.b("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new T.customSeekHandler}},R.prototype._selectLoader=function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=b;else if(n.isSupported())this._loaderClass=n;else if(o.isSupported())this._loaderClass=o;else{if(!m.isSupported())throw new i.d("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=m}},R.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)},R.prototype.open=function(T){this._currentRange={from:0,to:-1},T&&(this._currentRange.from=T),this._speedSampler.reset(),T||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},R.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},R.prototype.pause=function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},R.prototype.resume=function(){if(this._paused){this._paused=!1;var T=this._resumeFrom;this._resumeFrom=0,this._internalSeek(T,!0)}},R.prototype.seek=function(T){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(T,!0)},R.prototype._internalSeek=function(T,P){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(P),this._loader.destroy(),this._loader=null;var L={from:T,to:-1};this._currentRange={from:L.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,L),this._onSeeked&&this._onSeeked()},R.prototype.updateUrl=function(T){if(!T||typeof T!="string"||T.length===0)throw new i.b("Url must be a non-empty string!");this._dataSource.url=T},R.prototype._expandBuffer=function(T){for(var P=this._stashSize;P+10485760){var I=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(L,0,P).set(I,0)}this._stashBuffer=L,this._bufferSize=P}},R.prototype._normalizeSpeed=function(T){var P=this._speedNormalizeList,L=P.length-1,I=0,x=0,O=L;if(T=P[I]&&T=512&&T<=1024?Math.floor(1.5*T):2*T)>8192&&(P=8192);var L=1024*P+1048576;this._bufferSize0){var O=this._stashBuffer.slice(0,this._stashUsed);(te=this._dispatchChunks(O,this._stashByteStart))0&&(le=new Uint8Array(O,te),J.set(le,0),this._stashUsed=le.byteLength,this._stashByteStart+=te):(this._stashUsed=0,this._stashByteStart+=te),this._stashUsed+T.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+T.byteLength),J=new Uint8Array(this._stashBuffer,0,this._bufferSize)),J.set(new Uint8Array(T),this._stashUsed),this._stashUsed+=T.byteLength}else(te=this._dispatchChunks(T,P))this._bufferSize&&(this._expandBuffer(G),J=new Uint8Array(this._stashBuffer,0,this._bufferSize)),J.set(new Uint8Array(T,te),0),this._stashUsed+=G,this._stashByteStart=P+te);else if(this._stashUsed===0){var G;(te=this._dispatchChunks(T,P))this._bufferSize&&this._expandBuffer(G),(J=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(T,te),0),this._stashUsed+=G,this._stashByteStart=P+te)}else{var J,te;if(this._stashUsed+T.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+T.byteLength),(J=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(T),this._stashUsed),this._stashUsed+=T.byteLength,(te=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))0){var le=new Uint8Array(this._stashBuffer,te);J.set(le,0)}this._stashUsed-=te,this._stashByteStart+=te}}},R.prototype._flushStashBuffer=function(T){if(this._stashUsed>0){var P=this._stashBuffer.slice(0,this._stashUsed),L=this._dispatchChunks(P,this._stashByteStart),I=P.byteLength-L;if(L0){var x=new Uint8Array(this._stashBuffer,0,this._bufferSize),O=new Uint8Array(P,L);x.set(O,0),this._stashUsed=O.byteLength,this._stashByteStart+=L}return 0}l.a.w(this.TAG,"".concat(I," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,I}return 0},R.prototype._onLoaderComplete=function(T,P){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},R.prototype._onLoaderError=function(T,P){switch(l.a.e(this.TAG,"Loader error, code = ".concat(P.code,", msg = ").concat(P.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,T=p.b.UNRECOVERABLE_EARLY_EOF),T){case p.b.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var L=this._currentRange.to+1;return void(L=128){Y.push(String.fromCharCode(65535&Z)),z+=2;continue}}else if(j[z]<240){if(i(j,z,2)&&(Z=(15&j[z])<<12|(63&j[z+1])<<6|63&j[z+2])>=2048&&(63488&Z)!=55296){Y.push(String.fromCharCode(65535&Z)),z+=3;continue}}else if(j[z]<248){var Z;if(i(j,z,3)&&(Z=(7&j[z])<<18|(63&j[z+1])<<12|(63&j[z+2])<<6|63&j[z+3])>65536&&Z<1114112){Z-=65536,Y.push(String.fromCharCode(Z>>>10|55296)),Y.push(String.fromCharCode(1023&Z|56320)),z+=4;continue}}}Y.push("�"),++z}return Y.join("")},a=y(3),o=(t=new ArrayBuffer(2),new DataView(t).setInt16(0,256,!0),new Int16Array(t)[0]===256),d=function(){function M(){}return M.parseScriptData=function(Y,j,z){var q={};try{var Z=M.parseValue(Y,j,z),X=M.parseValue(Y,j+Z.size,z-Z.size);q[Z.data]=X.data}catch(oe){c.a.e("AMF",oe.toString())}return q},M.parseObject=function(Y,j,z){if(z<3)throw new a.a("Data not enough when parse ScriptDataObject");var q=M.parseString(Y,j,z),Z=M.parseValue(Y,j+q.size,z-q.size),X=Z.objectEnd;return{data:{name:q.data,value:Z.data},size:q.size+Z.size,objectEnd:X}},M.parseVariable=function(Y,j,z){return M.parseObject(Y,j,z)},M.parseString=function(Y,j,z){if(z<2)throw new a.a("Data not enough when parse String");var q=new DataView(Y,j,z).getUint16(0,!o);return{data:q>0?n(new Uint8Array(Y,j+2,q)):"",size:2+q}},M.parseLongString=function(Y,j,z){if(z<4)throw new a.a("Data not enough when parse LongString");var q=new DataView(Y,j,z).getUint32(0,!o);return{data:q>0?n(new Uint8Array(Y,j+4,q)):"",size:4+q}},M.parseDate=function(Y,j,z){if(z<10)throw new a.a("Data size invalid when parse Date");var q=new DataView(Y,j,z),Z=q.getFloat64(0,!o),X=q.getInt16(8,!o);return{data:new Date(Z+=60*X*1e3),size:10}},M.parseValue=function(Y,j,z){if(z<1)throw new a.a("Data not enough when parse Value");var q,Z=new DataView(Y,j,z),X=1,oe=Z.getUint8(0),he=!1;try{switch(oe){case 0:q=Z.getFloat64(1,!o),X+=8;break;case 1:q=!!Z.getUint8(1),X+=1;break;case 2:var ie=M.parseString(Y,j+1,z-1);q=ie.data,X+=ie.size;break;case 3:q={};var fe=0;for((16777215&Z.getUint32(z-4,!o))==9&&(fe=3);X>3,Z=(4&Y[z])!=0,X=(2&Y[z])!=0;Y[z],z+=1,Z&&(z+=1);var oe=Number.POSITIVE_INFINITY;if(X){oe=0;for(var he=0;oe|=(127&Y[z])<<7*he,(128&Y[z+=1])!=0;he++);}q===1&&(j=M.parseSeuqneceHeader(Y.subarray(z,z+oe))),z+=oe}return j},M.parseSeuqneceHeader=function(Y){var j=new R.a(Y),z=j.readBits(3),q=(j.readBool(),j.readBool()),Z=!0,X=0,oe=0,he=[];if(q)he.push({operating_point_idc:0,level:j.readBits(5),tier:0});else{if(j.readBool()){var ie=j.readBits(32),fe=j.readBits(32),se=j.readBool();if(se){for(var Ee=0;j.readBits(1)===0;)Ee+=1;Ee>=32||(1<7?j.readBits(1):0;he.push({operating_point_idc:je,level:ht,tier:_e}),He&&j.readBool()&&j.readBits(4)}}var Oe=he[0],pt=Oe.level,vt=Oe.tier,tt=j.readBits(4),pe=j.readBits(4),ue=j.readBits(tt+1)+1,W=j.readBits(pe+1)+1,ke=!1;q||(ke=j.readBool()),ke&&(j.readBits(4),j.readBits(4)),j.readBool(),j.readBool(),j.readBool();var Ae=!1;q||(j.readBool(),j.readBool(),j.readBool(),j.readBool(),(Ae=j.readBool())&&(j.readBool(),j.readBool()),(j.readBool()||j.readBits(1))&&(j.readBool()||j.readBits(1)),Ae&&j.readBits(3)+1),j.readBool(),j.readBool(),j.readBool();var Ye=j.readBool(),lt=8;z===2&&Ye?lt=j.readBool()?12:10:lt=Ye?10:8;var mt=!1;z!==1&&(mt=j.readBool()),j.readBool()&&(j.readBits(8),j.readBits(8),j.readBits(8));var Ue=1,Ve=1;return mt?(j.readBits(1),Ue=1,Ve=1):(j.readBits(1),z==0?(Ue=1,Ve=1):z==1?(Ue=0,Ve=0):lt==12?j.readBits(1)&&j.readBits(1):(Ue=1,Ve=0),Ue&&Ve&&j.readBits(2),j.readBits(1)),j.readBool(),j.destroy(),j=null,{codec_mimetype:"av01.".concat(z,".").concat(M.getLevelString(pt,vt),".").concat(lt.toString(10).padStart(2,"0")),level:pt,tier:vt,level_string:M.getLevelString(pt,vt),profile_idc:z,profile_string:"".concat(z),bit_depth:lt,ref_frames:1,chroma_format:M.getChromaFormat(mt,Ue,Ve),chroma_format_string:M.getChromaFormatString(mt,Ue,Ve),frame_rate:{fixed:Z,fps:X/oe,fps_den:oe,fps_num:X},sar_ratio:{width:1,height:1},codec_size:{width:ue,height:W},present_size:{width:1*ue,height:W}}},M.getLevelString=function(Y,j){return"".concat(Y.toString(10).padStart(2,"0")).concat(j===0?"M":"H")},M.getChromaFormat=function(Y,j,z){return Y?0:j===0&&z===0?3:j===1&&z===0?2:j===1&&z===1?1:Number.NaN},M.getChromaFormatString=function(Y,j,z){return Y?"4:0:0":j===0&&z===0?"4:4:4":j===1&&z===0?"4:2:2":j===1&&z===1?"4:2:0":"Unknown"},M}(),P=function(){function M(Y,j){this.TAG="FLVDemuxer",this._config=j,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=Y.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=Y.hasAudioTrack,this._hasVideo=Y.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new r.a,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var z=new ArrayBuffer(2);return new DataView(z).setInt16(0,256,!0),new Int16Array(z)[0]===256}()}return M.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},M.probe=function(Y){var j=new Uint8Array(Y);if(j.byteLength<9)return{needMoreData:!0};var z={match:!1};if(j[0]!==70||j[1]!==76||j[2]!==86||j[3]!==1)return z;var q,Z,X=(4&j[4])>>>2!=0,oe=(1&j[4])!=0,he=(q=j)[Z=5]<<24|q[Z+1]<<16|q[Z+2]<<8|q[Z+3];return he<9?z:{match:!0,consumed:he,dataOffset:he,hasAudioTrack:X,hasVideoTrack:oe}},M.prototype.bindDataSource=function(Y){return Y.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(M.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(Y){this._onTrackMetadata=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(Y){this._onMediaInfo=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(Y){this._onMetaDataArrived=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(Y){this._onScriptDataArrived=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"onError",{get:function(){return this._onError},set:function(Y){this._onError=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(Y){this._onDataAvailable=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(Y){this._timestampBase=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"overridedDuration",{get:function(){return this._duration},set:function(Y){this._durationOverrided=!0,this._duration=Y,this._mediaInfo.duration=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"overridedHasAudio",{set:function(Y){this._hasAudioFlagOverrided=!0,this._hasAudio=Y,this._mediaInfo.hasAudio=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"overridedHasVideo",{set:function(Y){this._hasVideoFlagOverrided=!0,this._hasVideo=Y,this._mediaInfo.hasVideo=Y},enumerable:!1,configurable:!0}),M.prototype.resetMediaInfo=function(){this._mediaInfo=new r.a},M.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},M.prototype.parseChunks=function(Y,j){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new a.a("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var z=0,q=this._littleEndian;if(j===0){if(!(Y.byteLength>13))return 0;z=M.probe(Y).dataOffset}for(this._firstParse&&(this._firstParse=!1,j+z!==this._dataOffset&&c.a.w(this.TAG,"First time parsing but chunk byteStart invalid!"),(Z=new DataView(Y,z)).getUint32(0,!q)!==0&&c.a.w(this.TAG,"PrevTagSize0 !== 0 !!!"),z+=4);zY.byteLength)break;var X=Z.getUint8(0),oe=16777215&Z.getUint32(0,!q);if(z+11+oe+4>Y.byteLength)break;if(X===8||X===9||X===18){var he=Z.getUint8(4),ie=Z.getUint8(5),fe=Z.getUint8(6)|ie<<8|he<<16|Z.getUint8(7)<<24;16777215&Z.getUint32(7,!q)&&c.a.w(this.TAG,"Meet tag which has StreamID != 0!");var se=z+11;switch(X){case 8:this._parseAudioData(Y,se,oe,fe);break;case 9:this._parseVideoData(Y,se,oe,fe,j+z);break;case 18:this._parseScriptData(Y,se,oe)}var Ee=Z.getUint32(11+oe,!q);Ee!==11+oe&&c.a.w(this.TAG,"Invalid PrevTagSize ".concat(Ee)),z+=11+oe+4}else c.a.w(this.TAG,"Unsupported tag type ".concat(X,", skipped")),z+=11+oe+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),z},M.prototype._parseScriptData=function(Y,j,z){var q=d.parseScriptData(Y,j,z);if(q.hasOwnProperty("onMetaData")){if(q.onMetaData==null||typeof q.onMetaData!="object")return void c.a.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&c.a.w(this.TAG,"Found another onMetaData tag!"),this._metadata=q;var Z=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},Z)),typeof Z.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=Z.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof Z.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=Z.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof Z.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=Z.audiodatarate),typeof Z.videodatarate=="number"&&(this._mediaInfo.videoDataRate=Z.videodatarate),typeof Z.width=="number"&&(this._mediaInfo.width=Z.width),typeof Z.height=="number"&&(this._mediaInfo.height=Z.height),typeof Z.duration=="number"){if(!this._durationOverrided){var X=Math.floor(Z.duration*this._timescale);this._duration=X,this._mediaInfo.duration=X}}else this._mediaInfo.duration=0;if(typeof Z.framerate=="number"){var oe=Math.floor(1e3*Z.framerate);if(oe>0){var he=oe/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=he,this._referenceFrameRate.fps_num=oe,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=he}}if(typeof Z.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var ie=Z.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(ie),Z.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=Z,c.a.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(q).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},q))},M.prototype._parseKeyframesIndex=function(Y){for(var j=[],z=[],q=1;q>>4;if(X===2||X===10){var oe=0,he=(12&Z)>>>2;if(he>=0&&he<=4){oe=this._flvSoundRateTable[he];var ie=1&Z,fe=this._audioMetadata,se=this._audioTrack;if(fe||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(fe=this._audioMetadata={}).type="audio",fe.id=se.id,fe.timescale=this._timescale,fe.duration=this._duration,fe.audioSampleRate=oe,fe.channelCount=ie===0?1:2),X===10){var Ee=this._parseAACAudioData(Y,j+1,z-1);if(Ee==null)return;if(Ee.packetType===0){if(fe.config){if(D(Ee.data.config,fe.config))return;c.a.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var He=Ee.data;fe.audioSampleRate=He.samplingRate,fe.channelCount=He.channelCount,fe.codec=He.codec,fe.originalCodec=He.originalCodec,fe.config=He.config,fe.refSampleDuration=1024/fe.audioSampleRate*fe.timescale,c.a.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",fe),(je=this._mediaInfo).audioCodec=fe.originalCodec,je.audioSampleRate=fe.audioSampleRate,je.audioChannelCount=fe.channelCount,je.hasVideo?je.videoCodec!=null&&(je.mimeType='video/x-flv; codecs="'+je.videoCodec+","+je.audioCodec+'"'):je.mimeType='video/x-flv; codecs="'+je.audioCodec+'"',je.isComplete()&&this._onMediaInfo(je)}else if(Ee.packetType===1){var Ie=this._timestampBase+q,at={unit:Ee.data,length:Ee.data.byteLength,dts:Ie,pts:Ie};se.samples.push(at),se.length+=Ee.data.length}else c.a.e(this.TAG,"Flv: Unsupported AAC data type ".concat(Ee.packetType))}else if(X===2){if(!fe.codec){var je;if((He=this._parseMP3AudioData(Y,j+1,z-1,!0))==null)return;fe.audioSampleRate=He.samplingRate,fe.channelCount=He.channelCount,fe.codec=He.codec,fe.originalCodec=He.originalCodec,fe.refSampleDuration=1152/fe.audioSampleRate*fe.timescale,c.a.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",fe),(je=this._mediaInfo).audioCodec=fe.codec,je.audioSampleRate=fe.audioSampleRate,je.audioChannelCount=fe.channelCount,je.audioDataRate=He.bitRate,je.hasVideo?je.videoCodec!=null&&(je.mimeType='video/x-flv; codecs="'+je.videoCodec+","+je.audioCodec+'"'):je.mimeType='video/x-flv; codecs="'+je.audioCodec+'"',je.isComplete()&&this._onMediaInfo(je)}var ht=this._parseMP3AudioData(Y,j+1,z-1,!1);if(ht==null)return;Ie=this._timestampBase+q;var _e={unit:ht,length:ht.byteLength,dts:Ie,pts:Ie};se.samples.push(_e),se.length+=ht.length}}else this._onError(m.a.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+he)}else this._onError(m.a.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+X)}},M.prototype._parseAACAudioData=function(Y,j,z){if(!(z<=1)){var q={},Z=new Uint8Array(Y,j,z);return q.packetType=Z[0],Z[0]===0?q.data=this._parseAACAudioSpecificConfig(Y,j+1,z-1):q.data=Z.subarray(1),q}c.a.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},M.prototype._parseAACAudioSpecificConfig=function(Y,j,z){var q,Z,X=new Uint8Array(Y,j,z),oe=null,he=0,ie=null;if(he=q=X[0]>>>3,(Z=(7&X[0])<<1|X[1]>>>7)<0||Z>=this._mpegSamplingRates.length)this._onError(m.a.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var fe=this._mpegSamplingRates[Z],se=(120&X[1])>>>3;if(!(se<0||se>=8)){he===5&&(ie=(7&X[1])<<1|X[2]>>>7,(124&X[2])>>>2);var Ee=self.navigator.userAgent.toLowerCase();return Ee.indexOf("firefox")!==-1?Z>=6?(he=5,oe=new Array(4),ie=Z-3):(he=2,oe=new Array(2),ie=Z):Ee.indexOf("android")!==-1?(he=2,oe=new Array(2),ie=Z):(he=5,ie=Z,oe=new Array(4),Z>=6?ie=Z-3:se===1&&(he=2,oe=new Array(2),ie=Z)),oe[0]=he<<3,oe[0]|=(15&Z)>>>1,oe[1]=(15&Z)<<7,oe[1]|=(15&se)<<3,he===5&&(oe[1]|=(15&ie)>>>1,oe[2]=(1&ie)<<7,oe[2]|=8,oe[3]=0),{config:oe,samplingRate:fe,channelCount:se,codec:"mp4a.40."+he,originalCodec:"mp4a.40."+q}}this._onError(m.a.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},M.prototype._parseMP3AudioData=function(Y,j,z,q){if(!(z<4)){this._littleEndian;var Z=new Uint8Array(Y,j,z),X=null;if(q){if(Z[0]!==255)return;var oe=Z[1]>>>3&3,he=(6&Z[1])>>1,ie=(240&Z[2])>>>4,fe=(12&Z[2])>>>2,se=(Z[3]>>>6&3)!==3?2:1,Ee=0,He=0;switch(oe){case 0:Ee=this._mpegAudioV25SampleRateTable[fe];break;case 2:Ee=this._mpegAudioV20SampleRateTable[fe];break;case 3:Ee=this._mpegAudioV10SampleRateTable[fe]}switch(he){case 1:ie>>4;if(128&X){var he=15&X,ie=String.fromCharCode.apply(String,new Uint8Array(Y,j,z).slice(1,5));if(ie==="hvc1")this._parseEnhancedHEVCVideoPacket(Y,j+5,z-5,q,Z,oe,he);else{if(ie!=="av01")return void this._onError(m.a.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(ie));this._parseEnhancedAV1VideoPacket(Y,j+5,z-5,q,Z,oe,he)}}else{var fe=15&X;if(fe===7)this._parseAVCVideoPacket(Y,j+1,z-1,q,Z,oe);else{if(fe!==12)return void this._onError(m.a.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(fe));this._parseHEVCVideoPacket(Y,j+1,z-1,q,Z,oe)}}}},M.prototype._parseAVCVideoPacket=function(Y,j,z,q,Z,X){if(z<4)c.a.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var oe=this._littleEndian,he=new DataView(Y,j,z),ie=he.getUint8(0),fe=(16777215&he.getUint32(0,!oe))<<8>>8;if(ie===0)this._parseAVCDecoderConfigurationRecord(Y,j+4,z-4);else if(ie===1)this._parseAVCVideoData(Y,j+4,z-4,q,Z,X,fe);else if(ie!==2)return void this._onError(m.a.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(ie))}},M.prototype._parseHEVCVideoPacket=function(Y,j,z,q,Z,X){if(z<4)c.a.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var oe=this._littleEndian,he=new DataView(Y,j,z),ie=he.getUint8(0),fe=(16777215&he.getUint32(0,!oe))<<8>>8;if(ie===0)this._parseHEVCDecoderConfigurationRecord(Y,j+4,z-4);else if(ie===1)this._parseHEVCVideoData(Y,j+4,z-4,q,Z,X,fe);else if(ie!==2)return void this._onError(m.a.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(ie))}},M.prototype._parseEnhancedHEVCVideoPacket=function(Y,j,z,q,Z,X,oe){var he=this._littleEndian,ie=new DataView(Y,j,z);if(oe===0)this._parseHEVCDecoderConfigurationRecord(Y,j,z);else if(oe===1){var fe=(4294967040&ie.getUint32(0,!he))>>8;this._parseHEVCVideoData(Y,j+3,z-3,q,Z,X,fe)}else if(oe===3)this._parseHEVCVideoData(Y,j,z,q,Z,X,0);else if(oe!==2)return void this._onError(m.a.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(oe))},M.prototype._parseEnhancedAV1VideoPacket=function(Y,j,z,q,Z,X,oe){if(this._littleEndian,oe===0)this._parseAV1CodecConfigurationRecord(Y,j,z);else if(oe===1)this._parseAV1VideoData(Y,j,z,q,Z,X,0);else{if(oe===5)return void this._onError(m.a.FORMAT_ERROR,"Flv: Not Supported MP2T AV1 video packet type ".concat(oe));if(oe!==2)return void this._onError(m.a.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(oe))}},M.prototype._parseAVCDecoderConfigurationRecord=function(Y,j,z){if(z<7)c.a.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var q=this._videoMetadata,Z=this._videoTrack,X=this._littleEndian,oe=new DataView(Y,j,z);if(q){if(q.avcc!==void 0){var he=new Uint8Array(Y,j,z);if(D(he,q.avcc))return;c.a.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(q=this._videoMetadata={}).type="video",q.id=Z.id,q.timescale=this._timescale,q.duration=this._duration;var ie=oe.getUint8(0),fe=oe.getUint8(1);if(oe.getUint8(2),oe.getUint8(3),ie===1&&fe!==0)if(this._naluLengthSize=1+(3&oe.getUint8(4)),this._naluLengthSize===3||this._naluLengthSize===4){var se=31&oe.getUint8(5);if(se!==0){se>1&&c.a.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(se));for(var Ee=6,He=0;He1&&c.a.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(ue)),Ee++,He=0;He=z){c.a.w(this.TAG,"Malformed Nalu near timestamp ".concat(Ie,", offset = ").concat(Ee,", dataSize = ").concat(z));break}var je=ie.getUint32(Ee,!he);if(He===3&&(je>>>=8),je>z-He)return void c.a.w(this.TAG,"Malformed Nalus near timestamp ".concat(Ie,", NaluSize > DataSize!"));var ht=31&ie.getUint8(Ee+He);ht===5&&(at=!0);var _e=new Uint8Array(Y,j+Ee,He+je),Oe={type:ht,data:_e};fe.push(Oe),se+=_e.byteLength,Ee+=He+je}if(fe.length){var pt=this._videoTrack,vt={units:fe,length:se,isKeyframe:at,dts:Ie,cts:oe,pts:Ie+oe};at&&(vt.fileposition=Z),pt.samples.push(vt),pt.length+=se}},M.prototype._parseHEVCVideoData=function(Y,j,z,q,Z,X,oe){for(var he=this._littleEndian,ie=new DataView(Y,j,z),fe=[],se=0,Ee=0,He=this._naluLengthSize,Ie=this._timestampBase+q,at=X===1;Ee=z){c.a.w(this.TAG,"Malformed Nalu near timestamp ".concat(Ie,", offset = ").concat(Ee,", dataSize = ").concat(z));break}var je=ie.getUint32(Ee,!he);if(He===3&&(je>>>=8),je>z-He)return void c.a.w(this.TAG,"Malformed Nalus near timestamp ".concat(Ie,", NaluSize > DataSize!"));var ht=ie.getUint8(Ee+He)>>1&63;ht!==19&&ht!==20&&ht!==21||(at=!0);var _e=new Uint8Array(Y,j+Ee,He+je),Oe={type:ht,data:_e};fe.push(Oe),se+=_e.byteLength,Ee+=He+je}if(fe.length){var pt=this._videoTrack,vt={units:fe,length:se,isKeyframe:at,dts:Ie,cts:oe,pts:Ie+oe};at&&(vt.fileposition=Z),pt.samples.push(vt),pt.length+=se}},M.prototype._parseAV1VideoData=function(Y,j,z,q,Z,X,oe){this._littleEndian;var he,ie=[],fe=this._timestampBase+q,se=X===1;if(he=z,ie.push({unitType:0,data:new Uint8Array(Y,j+0,z)}),ie.length){var Ee=this._videoTrack,He={units:ie,length:he,isKeyframe:se,dts:fe,cts:oe,pts:fe+oe};se&&(He.fileposition=Z),Ee.samples.push(He),Ee.length+=he}},M}(),L=y(14),I=function(M,Y,j){for(var z,q=0,Z=Y.length;q>>24&255,z[1]=j>>>16&255,z[2]=j>>>8&255,z[3]=255&j,z.set(Y,4);var oe=8;for(X=0;X>>24&255,Y>>>16&255,Y>>>8&255,255&Y,j>>>24&255,j>>>16&255,j>>>8&255,255&j,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]))},M.trak=function(Y){return M.box(M.types.trak,M.tkhd(Y),M.mdia(Y))},M.tkhd=function(Y){var j=Y.id,z=Y.duration,q=Y.presentWidth,Z=Y.presentHeight;return M.box(M.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,j>>>24&255,j>>>16&255,j>>>8&255,255&j,0,0,0,0,z>>>24&255,z>>>16&255,z>>>8&255,255&z,0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,q>>>8&255,255&q,0,0,Z>>>8&255,255&Z,0,0]))},M.mdia=function(Y){return M.box(M.types.mdia,M.mdhd(Y),M.hdlr(Y),M.minf(Y))},M.mdhd=function(Y){var j=Y.timescale,z=Y.duration;return M.box(M.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,j>>>24&255,j>>>16&255,j>>>8&255,255&j,z>>>24&255,z>>>16&255,z>>>8&255,255&z,85,196,0,0]))},M.hdlr=function(Y){var j=null;return j=Y.type==="audio"?M.constants.HDLR_AUDIO:M.constants.HDLR_VIDEO,M.box(M.types.hdlr,j)},M.minf=function(Y){var j=null;return j=Y.type==="audio"?M.box(M.types.smhd,M.constants.SMHD):M.box(M.types.vmhd,M.constants.VMHD),M.box(M.types.minf,j,M.dinf(),M.stbl(Y))},M.dinf=function(){return M.box(M.types.dinf,M.box(M.types.dref,M.constants.DREF))},M.stbl=function(Y){return M.box(M.types.stbl,M.stsd(Y),M.box(M.types.stts,M.constants.STTS),M.box(M.types.stsc,M.constants.STSC),M.box(M.types.stsz,M.constants.STSZ),M.box(M.types.stco,M.constants.STCO))},M.stsd=function(Y){return Y.type==="audio"?Y.codec==="mp3"?M.box(M.types.stsd,M.constants.STSD_PREFIX,M.mp3(Y)):Y.codec==="ac-3"?M.box(M.types.stsd,M.constants.STSD_PREFIX,M.ac3(Y)):Y.codec==="ec-3"?M.box(M.types.stsd,M.constants.STSD_PREFIX,M.ec3(Y)):Y.codec==="opus"?M.box(M.types.stsd,M.constants.STSD_PREFIX,M.Opus(Y)):M.box(M.types.stsd,M.constants.STSD_PREFIX,M.mp4a(Y)):Y.type==="video"&&Y.codec.startsWith("hvc1")?M.box(M.types.stsd,M.constants.STSD_PREFIX,M.hvc1(Y)):Y.type==="video"&&Y.codec.startsWith("av01")?M.box(M.types.stsd,M.constants.STSD_PREFIX,M.av01(Y)):M.box(M.types.stsd,M.constants.STSD_PREFIX,M.avc1(Y))},M.mp3=function(Y){var j=Y.channelCount,z=Y.audioSampleRate,q=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j,0,16,0,0,0,0,z>>>8&255,255&z,0,0]);return M.box(M.types[".mp3"],q)},M.mp4a=function(Y){var j=Y.channelCount,z=Y.audioSampleRate,q=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j,0,16,0,0,0,0,z>>>8&255,255&z,0,0]);return M.box(M.types.mp4a,q,M.esds(Y))},M.ac3=function(Y){var j=Y.channelCount,z=Y.audioSampleRate,q=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j,0,16,0,0,0,0,z>>>8&255,255&z,0,0]);return M.box(M.types["ac-3"],q,M.box(M.types.dac3,new Uint8Array(Y.config)))},M.ec3=function(Y){var j=Y.channelCount,z=Y.audioSampleRate,q=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j,0,16,0,0,0,0,z>>>8&255,255&z,0,0]);return M.box(M.types["ec-3"],q,M.box(M.types.dec3,new Uint8Array(Y.config)))},M.esds=function(Y){var j=Y.config||[],z=j.length,q=new Uint8Array([0,0,0,0,3,23+z,0,1,0,4,15+z,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([z]).concat(j).concat([6,1,2]));return M.box(M.types.esds,q)},M.Opus=function(Y){var j=Y.channelCount,z=Y.audioSampleRate,q=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j,0,16,0,0,0,0,z>>>8&255,255&z,0,0]);return M.box(M.types.Opus,q,M.dOps(Y))},M.dOps=function(Y){var j=Y.channelCount,z=Y.channelConfigCode,q=Y.audioSampleRate;if(Y.config)return M.box(M.types.dOps,X);var Z=[];switch(z){case 1:case 2:Z=[0];break;case 0:Z=[255,1,1,0,1];break;case 128:Z=[255,2,0,0,1];break;case 3:Z=[1,2,1,0,2,1];break;case 4:Z=[1,2,2,0,1,2,3];break;case 5:Z=[1,3,2,0,4,1,2,3];break;case 6:Z=[1,4,2,0,4,1,2,3,5];break;case 7:Z=[1,4,2,0,4,1,2,3,5,6];break;case 8:Z=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:Z=[1,1,2,0,1];break;case 131:Z=[1,1,3,0,1,2];break;case 132:Z=[1,1,4,0,1,2,3];break;case 133:Z=[1,1,5,0,1,2,3,4];break;case 134:Z=[1,1,6,0,1,2,3,4,5];break;case 135:Z=[1,1,7,0,1,2,3,4,5,6];break;case 136:Z=[1,1,8,0,1,2,3,4,5,6,7]}var X=new Uint8Array(I([0,j,0,0,q>>>24&255,q>>>17&255,q>>>8&255,q>>>0&255,0,0],Z));return M.box(M.types.dOps,X)},M.avc1=function(Y){var j=Y.avcc,z=Y.codecWidth,q=Y.codecHeight,Z=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,z>>>8&255,255&z,q>>>8&255,255&q,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return M.box(M.types.avc1,Z,M.box(M.types.avcC,j))},M.hvc1=function(Y){var j=Y.hvcc,z=Y.codecWidth,q=Y.codecHeight,Z=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,z>>>8&255,255&z,q>>>8&255,255&q,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return M.box(M.types.hvc1,Z,M.box(M.types.hvcC,j))},M.av01=function(Y){var j=Y.av1c,z=Y.codecWidth||192,q=Y.codecHeight||108,Z=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,z>>>8&255,255&z,q>>>8&255,255&q,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return M.box(M.types.av01,Z,M.box(M.types.av1C,j))},M.mvex=function(Y){return M.box(M.types.mvex,M.trex(Y))},M.trex=function(Y){var j=Y.id,z=new Uint8Array([0,0,0,0,j>>>24&255,j>>>16&255,j>>>8&255,255&j,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return M.box(M.types.trex,z)},M.moof=function(Y,j){return M.box(M.types.moof,M.mfhd(Y.sequenceNumber),M.traf(Y,j))},M.mfhd=function(Y){var j=new Uint8Array([0,0,0,0,Y>>>24&255,Y>>>16&255,Y>>>8&255,255&Y]);return M.box(M.types.mfhd,j)},M.traf=function(Y,j){var z=Y.id,q=M.box(M.types.tfhd,new Uint8Array([0,0,0,0,z>>>24&255,z>>>16&255,z>>>8&255,255&z])),Z=M.box(M.types.tfdt,new Uint8Array([0,0,0,0,j>>>24&255,j>>>16&255,j>>>8&255,255&j])),X=M.sdtp(Y),oe=M.trun(Y,X.byteLength+16+16+8+16+8+8);return M.box(M.types.traf,q,Z,oe,X)},M.sdtp=function(Y){for(var j=Y.samples||[],z=j.length,q=new Uint8Array(4+z),Z=0;Z>>24&255,q>>>16&255,q>>>8&255,255&q,j>>>24&255,j>>>16&255,j>>>8&255,255&j],0);for(var oe=0;oe>>24&255,he>>>16&255,he>>>8&255,255&he,ie>>>24&255,ie>>>16&255,ie>>>8&255,255&ie,fe.isLeading<<2|fe.dependsOn,fe.isDependedOn<<6|fe.hasRedundancy<<4|fe.isNonSync,0,0,se>>>24&255,se>>>16&255,se>>>8&255,255&se],12+16*oe)}return M.box(M.types.trun,X)},M.mdat=function(Y){return M.box(M.types.mdat,Y)},M}();x.init();var O=x,G=function(){function M(){}return M.getSilentFrame=function(Y,j){if(Y==="mp4a.40.2"){if(j===1)return new Uint8Array([0,200,0,128,35,128]);if(j===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(j===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(j===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(j===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(j===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(j===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(j===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(j===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},M}(),J=y(12),te=function(){function M(Y){this.TAG="MP4Remuxer",this._config=Y,this._isLive=Y.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new J.c("audio"),this._videoSegmentInfoList=new J.c("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!p.a.chrome||!(p.a.version.major<50||p.a.version.major===50&&p.a.version.build<2661)),this._fillSilentAfterSeek=p.a.msedge||p.a.msie,this._mp3UseMpegAudio=!p.a.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return M.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},M.prototype.bindDataSource=function(Y){return Y.onDataAvailable=this.remux.bind(this),Y.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(M.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(Y){this._onInitSegment=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(Y){this._onMediaSegment=Y},enumerable:!1,configurable:!0}),M.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},M.prototype.seek=function(Y){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},M.prototype.remux=function(Y,j){if(!this._onMediaSegment)throw new a.a("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(Y,j),j&&this._remuxVideo(j),Y&&this._remuxAudio(Y)},M.prototype._onTrackMetadataReceived=function(Y,j){var z=null,q="mp4",Z=j.codec;if(Y==="audio")this._audioMeta=j,j.codec==="mp3"&&this._mp3UseMpegAudio?(q="mpeg",Z="",z=new Uint8Array):z=O.generateInitSegment(j);else{if(Y!=="video")return;this._videoMeta=j,z=O.generateInitSegment(j)}if(!this._onInitSegment)throw new a.a("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(Y,{type:Y,data:z.buffer,codec:Z,container:"".concat(Y,"/").concat(q),mediaDuration:j.duration})},M.prototype._calculateDtsBase=function(Y,j){this._dtsBaseInited||(Y&&Y.samples&&Y.samples.length&&(this._audioDtsBase=Y.samples[0].dts),j&&j.samples&&j.samples.length&&(this._videoDtsBase=j.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},M.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},M.prototype.flushStashedSamples=function(){var Y=this._videoStashedLastSample,j=this._audioStashedLastSample,z={type:"video",id:1,sequenceNumber:0,samples:[],length:0};Y!=null&&(z.samples.push(Y),z.length=Y.length);var q={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};j!=null&&(q.samples.push(j),q.length=j.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(z,!0),this._remuxAudio(q,!0)},M.prototype._remuxAudio=function(Y,j){if(this._audioMeta!=null){var z,q=Y,Z=q.samples,X=void 0,oe=-1,he=this._audioMeta.refSampleDuration,ie=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,fe=this._dtsBaseInited&&this._audioNextDts===void 0,se=!1;if(Z&&Z.length!==0&&(Z.length!==1||j)){var Ee=0,He=null,Ie=0;ie?(Ee=0,Ie=q.length):(Ee=8,Ie=8+q.length);var at=null;if(Z.length>1&&(Ie-=(at=Z.pop()).length),this._audioStashedLastSample!=null){var je=this._audioStashedLastSample;this._audioStashedLastSample=null,Z.unshift(je),Ie+=je.length}at!=null&&(this._audioStashedLastSample=at);var ht=Z[0].dts-this._dtsBase;if(this._audioNextDts)X=ht-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())X=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(se=!0);else{var _e=this._audioSegmentInfoList.getLastSampleBefore(ht);if(_e!=null){var Oe=ht-(_e.originalDts+_e.duration);Oe<=3&&(Oe=0),X=ht-(_e.dts+_e.duration+Oe)}else X=0}if(se){var pt=ht-X,vt=this._videoSegmentInfoList.getLastSegmentBefore(ht);if(vt!=null&&vt.beginDts=3*he&&this._fillAudioTimestampGap&&!p.a.safari){Ye=!0;var Ve,De=Math.floor(X/he);c.a.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync. -`+"originalDts: ".concat(Ae," ms, curRefDts: ").concat(Ue," ms, ")+"dtsCorrection: ".concat(Math.round(X)," ms, generate: ").concat(De," frames")),tt=Math.floor(Ue),mt=Math.floor(Ue+he)-tt,(Ve=G.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount))==null&&(c.a.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),Ve=ke),lt=[];for(var Re=0;Re=1?ue[ue.length-1].duration:Math.floor(he),this._audioNextDts=tt+mt;oe===-1&&(oe=tt),ue.push({dts:tt,pts:tt,cts:0,unit:je.unit,size:je.unit.byteLength,duration:mt,originalDts:Ae,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),Ye&&ue.push.apply(ue,lt)}}if(ue.length===0)return q.samples=[],void(q.length=0);for(ie?He=new Uint8Array(Ie):((He=new Uint8Array(Ie))[0]=Ie>>>24&255,He[1]=Ie>>>16&255,He[2]=Ie>>>8&255,He[3]=255&Ie,He.set(O.types.mdat,4)),W=0;W1&&(Ee-=(He=X.pop()).length),this._videoStashedLastSample!=null){var Ie=this._videoStashedLastSample;this._videoStashedLastSample=null,X.unshift(Ie),Ee+=Ie.length}He!=null&&(this._videoStashedLastSample=He);var at=X[0].dts-this._dtsBase;if(this._videoNextDts)oe=at-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())oe=0;else{var je=this._videoSegmentInfoList.getLastSampleBefore(at);if(je!=null){var ht=at-(je.originalDts+je.duration);ht<=3&&(ht=0),oe=at-(je.dts+je.duration+ht)}else oe=0}for(var _e=new J.b,Oe=[],pt=0;pt=1?Oe[Oe.length-1].duration:Math.floor(this._videoMeta.refSampleDuration),tt){var Ae=new J.d(pe,W,ke,Ie.dts,!0);Ae.fileposition=Ie.fileposition,_e.appendSyncPoint(Ae)}Oe.push({dts:pe,pts:W,cts:ue,units:Ie.units,size:Ie.length,isKeyframe:tt,duration:ke,originalDts:vt,flags:{isLeading:0,dependsOn:tt?2:1,isDependedOn:tt?1:0,hasRedundancy:0,isNonSync:tt?0:1}})}for((se=new Uint8Array(Ee))[0]=Ee>>>24&255,se[1]=Ee>>>16&255,se[2]=Ee>>>8&255,se[3]=255&Ee,se.set(O.types.mdat,4),pt=0;pt0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,q=this._demuxer.parseChunks(Y,j);else{var Z=null;(Z=P.probe(Y)).match&&(this._setupFLVDemuxerRemuxer(Z),q=this._demuxer.parseChunks(Y,j)),Z.match||Z.needMoreData||(Z=L.a.probe(Y)).match&&(this._setupTSDemuxerRemuxer(Z),q=this._demuxer.parseChunks(Y,j)),Z.match||Z.needMoreData||(Z=null,c.a.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then(function(){z._internalAbort()}),this._emitter.emit(ne.a.DEMUX_ERROR,m.a.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return q},M.prototype._setupFLVDemuxerRemuxer=function(Y){this._demuxer=new P(Y,this._config),this._remuxer||(this._remuxer=new te(this._config));var j=this._mediaDataSource;j.duration==null||isNaN(j.duration)||(this._demuxer.overridedDuration=j.duration),typeof j.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=j.hasAudio),typeof j.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=j.hasVideo),this._demuxer.timestampBase=j.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},M.prototype._setupTSDemuxerRemuxer=function(Y){var j=this._demuxer=new L.a(Y,this._config);this._remuxer||(this._remuxer=new te(this._config)),j.onError=this._onDemuxException.bind(this),j.onMediaInfo=this._onMediaInfo.bind(this),j.onMetaDataArrived=this._onMetaDataArrived.bind(this),j.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),j.onSynchronousKLVMetadata=this._onSynchronousKLVMetadata.bind(this),j.onAsynchronousKLVMetadata=this._onAsynchronousKLVMetadata.bind(this),j.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),j.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),j.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),j.onPESPrivateData=this._onPESPrivateData.bind(this),this._remuxer.bindDataSource(this._demuxer),this._demuxer.bindDataSource(this._ioctl),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},M.prototype._onMediaInfo=function(Y){var j=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},Y),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,r.a.prototype));var z=Object.assign({},Y);Object.setPrototypeOf(z,r.a.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=z,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var q=j._pendingSeekTime;j._pendingSeekTime=null,j.seek(q)})},M.prototype._onMetaDataArrived=function(Y){this._emitter.emit(ne.a.METADATA_ARRIVED,Y)},M.prototype._onScriptDataArrived=function(Y){this._emitter.emit(ne.a.SCRIPTDATA_ARRIVED,Y)},M.prototype._onTimedID3Metadata=function(Y){var j=this._remuxer.getTimestampBase();j!=null&&(Y.pts!=null&&(Y.pts-=j),Y.dts!=null&&(Y.dts-=j),this._emitter.emit(ne.a.TIMED_ID3_METADATA_ARRIVED,Y))},M.prototype._onSynchronousKLVMetadata=function(Y){var j=this._remuxer.getTimestampBase();j!=null&&(Y.pts!=null&&(Y.pts-=j),Y.dts!=null&&(Y.dts-=j),this._emitter.emit(ne.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,Y))},M.prototype._onAsynchronousKLVMetadata=function(Y){this._emitter.emit(ne.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,Y)},M.prototype._onSMPTE2038Metadata=function(Y){var j=this._remuxer.getTimestampBase();j!=null&&(Y.pts!=null&&(Y.pts-=j),Y.dts!=null&&(Y.dts-=j),Y.nearest_pts!=null&&(Y.nearest_pts-=j),this._emitter.emit(ne.a.SMPTE2038_METADATA_ARRIVED,Y))},M.prototype._onSCTE35Metadata=function(Y){var j=this._remuxer.getTimestampBase();j!=null&&(Y.pts!=null&&(Y.pts-=j),Y.nearest_pts!=null&&(Y.nearest_pts-=j),this._emitter.emit(ne.a.SCTE35_METADATA_ARRIVED,Y))},M.prototype._onPESPrivateDataDescriptor=function(Y){this._emitter.emit(ne.a.PES_PRIVATE_DATA_DESCRIPTOR,Y)},M.prototype._onPESPrivateData=function(Y){var j=this._remuxer.getTimestampBase();j!=null&&(Y.pts!=null&&(Y.pts-=j),Y.nearest_pts!=null&&(Y.nearest_pts-=j),Y.dts!=null&&(Y.dts-=j),this._emitter.emit(ne.a.PES_PRIVATE_DATA_ARRIVED,Y))},M.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},M.prototype._onIOComplete=function(Y){var j=Y+1;j0&&z[0].originalDts===q&&(q=z[0].pts),this._emitter.emit(ne.a.RECOMMEND_SEEKPOINT,q)}},M.prototype._enableStatisticsReporter=function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},M.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},M.prototype._reportSegmentMediaInfo=function(Y){var j=this._mediaInfo.segments[Y],z=Object.assign({},j);z.duration=this._mediaInfo.duration,z.segmentCount=this._mediaInfo.segmentCount,delete z.segments,delete z.keyframesIndex,this._emitter.emit(ne.a.MEDIA_INFO,z)},M.prototype._reportStatisticsInfo=function(){var Y={};Y.url=this._ioctl.currentURL,Y.hasRedirect=this._ioctl.hasRedirect,Y.hasRedirect&&(Y.redirectedURL=this._ioctl.currentRedirectedURL),Y.speed=this._ioctl.currentSpeed,Y.loaderType=this._ioctl.loaderType,Y.currentSegmentIndex=this._currentSegmentIndex,Y.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(ne.a.STATISTICS_INFO,Y)},M}());u.a=ee},function(s,u,y){var A=function(){function l(){}return l.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(c,p){return c.__proto__=p,c},Object.assign=Object.assign||function(c){if(c==null)throw new TypeError("Cannot convert undefined or null to object");for(var p=Object(c),r=1;r0?0|p:0;return this.substring(r,r+c.length)===c}}),typeof self.Promise!="function"&&y(25).polyfill()},l}();A.install(),u.a=A},function(s,u,y){var A=y(9),l=y.n(A),c=y(0),p=y(5),r=y(7),i=y(3),t=function(){function n(a){this.TAG="MSEController",this._config=a,this._emitter=new l.a,this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onStartStreaming:this._onStartStreaming.bind(this),onEndStreaming:this._onEndStreaming.bind(this),onQualityChange:this._onQualityChange.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._useManagedMediaSource="ManagedMediaSource"in self&&!("MediaSource"in self),this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElementProxy=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]}}return n.prototype.destroy=function(){this._mediaSource&&this.shutdown(),this._mediaSourceObjectURL&&this.revokeObjectURL(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},n.prototype.on=function(a,o){this._emitter.addListener(a,o)},n.prototype.off=function(a,o){this._emitter.removeListener(a,o)},n.prototype.initialize=function(a){if(this._mediaSource)throw new i.a("MediaSource has been attached to an HTMLMediaElement!");this._useManagedMediaSource&&c.a.v(this.TAG,"Using ManagedMediaSource");var o=this._mediaSource=this._useManagedMediaSource?new self.ManagedMediaSource:new self.MediaSource;o.addEventListener("sourceopen",this.e.onSourceOpen),o.addEventListener("sourceended",this.e.onSourceEnded),o.addEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(o.addEventListener("startstreaming",this.e.onStartStreaming),o.addEventListener("endstreaming",this.e.onEndStreaming),o.addEventListener("qualitychange",this.e.onQualityChange)),this._mediaElementProxy=a},n.prototype.shutdown=function(){if(this._mediaSource){var a=this._mediaSource;for(var o in this._sourceBuffers){var d=this._pendingSegments[o];d.splice(0,d.length),this._pendingSegments[o]=null,this._pendingRemoveRanges[o]=null,this._lastInitSegments[o]=null;var g=this._sourceBuffers[o];if(g){if(a.readyState!=="closed"){try{a.removeSourceBuffer(g)}catch(m){c.a.e(this.TAG,m.message)}g.removeEventListener("error",this.e.onSourceBufferError),g.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[o]=null,this._sourceBuffers[o]=null}}if(a.readyState==="open")try{a.endOfStream()}catch(m){c.a.e(this.TAG,m.message)}this._mediaElementProxy=null,a.removeEventListener("sourceopen",this.e.onSourceOpen),a.removeEventListener("sourceended",this.e.onSourceEnded),a.removeEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(a.removeEventListener("startstraming",this.e.onStartStreaming),a.removeEventListener("endstreaming",this.e.onEndStreaming),a.removeEventListener("qualitychange",this.e.onQualityChange)),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._mediaSource=null}},n.prototype.isManagedMediaSource=function(){return this._useManagedMediaSource},n.prototype.getObject=function(){if(!this._mediaSource)throw new i.a("MediaSource has not been initialized yet!");return this._mediaSource},n.prototype.getHandle=function(){if(!this._mediaSource)throw new i.a("MediaSource has not been initialized yet!");return this._mediaSource.handle},n.prototype.getObjectURL=function(){if(!this._mediaSource)throw new i.a("MediaSource has not been initialized yet!");return this._mediaSourceObjectURL==null&&(this._mediaSourceObjectURL=URL.createObjectURL(this._mediaSource)),this._mediaSourceObjectURL},n.prototype.revokeObjectURL=function(){this._mediaSourceObjectURL&&(URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},n.prototype.appendInitSegment=function(a,o){if(o===void 0&&(o=void 0),!this._mediaSource||this._mediaSource.readyState!=="open"||this._mediaSource.streaming===!1)return this._pendingSourceBufferInit.push(a),void this._pendingSegments[a.type].push(a);var d=a,g="".concat(d.container);d.codec&&d.codec.length>0&&(g+=";codecs=".concat(d.codec));var m=!1;if(c.a.v(this.TAG,"Received Initialization Segment, mimeType: "+g),this._lastInitSegments[d.type]=d,g!==this._mimeTypes[d.type]){if(this._mimeTypes[d.type])c.a.v(this.TAG,"Notice: ".concat(d.type," mimeType changed, origin: ").concat(this._mimeTypes[d.type],", target: ").concat(g));else{m=!0;try{var v=this._sourceBuffers[d.type]=this._mediaSource.addSourceBuffer(g);v.addEventListener("error",this.e.onSourceBufferError),v.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(b){return c.a.e(this.TAG,b.message),void this._emitter.emit(r.a.ERROR,{code:b.code,msg:b.message})}}this._mimeTypes[d.type]=g}o||this._pendingSegments[d.type].push(d),m||this._sourceBuffers[d.type]&&!this._sourceBuffers[d.type].updating&&this._doAppendSegments(),p.a.safari&&d.container==="audio/mpeg"&&d.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=d.mediaDuration/1e3,this._updateMediaSourceDuration())},n.prototype.appendMediaSegment=function(a){var o=a;this._pendingSegments[o.type].push(o),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var d=this._sourceBuffers[o.type];!d||d.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},n.prototype.flush=function(){for(var a in this._sourceBuffers)if(this._sourceBuffers[a]){var o=this._sourceBuffers[a];if(this._mediaSource.readyState==="open")try{o.abort()}catch(w){c.a.e(this.TAG,w.message)}var d=this._pendingSegments[a];if(d.splice(0,d.length),this._mediaSource.readyState!=="closed"){for(var g=0;g=1&&a-g.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},n.prototype._doCleanupSourceBuffer=function(){var a=this._mediaElementProxy.getCurrentTime();for(var o in this._sourceBuffers){var d=this._sourceBuffers[o];if(d){for(var g=d.buffered,m=!1,v=0;v=this._config.autoCleanupMaxBackwardDuration){m=!0;var C=a-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[o].push({start:b,end:C})}}else w0&&(isNaN(o)||d>o)&&(c.a.v(this.TAG,"Update MediaSource duration from ".concat(o," to ").concat(d)),this._mediaSource.duration=d),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},n.prototype._doRemoveRanges=function(){for(var a in this._pendingRemoveRanges)if(this._sourceBuffers[a]&&!this._sourceBuffers[a].updating)for(var o=this._sourceBuffers[a],d=this._pendingRemoveRanges[a];d.length&&!o.updating;){var g=d.shift();o.remove(g.start,g.end)}},n.prototype._doAppendSegments=function(){var a=this._pendingSegments;for(var o in a)if(this._sourceBuffers[o]&&!this._sourceBuffers[o].updating&&this._mediaSource.streaming!==!1&&a[o].length>0){var d=a[o].shift();if(typeof d.timestampOffset=="number"&&isFinite(d.timestampOffset)){var g=this._sourceBuffers[o].timestampOffset,m=d.timestampOffset/1e3;Math.abs(g-m)>.1&&(c.a.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(g," to ").concat(m)),this._sourceBuffers[o].timestampOffset=m),delete d.timestampOffset}if(!d.data||d.data.byteLength===0)continue;try{this._sourceBuffers[o].appendBuffer(d.data),this._isBufferFull=!1}catch(v){this._pendingSegments[o].unshift(d),v.code===22?(this._isBufferFull||this._emitter.emit(r.a.BUFFER_FULL),this._isBufferFull=!0):(c.a.e(this.TAG,v.message),this._emitter.emit(r.a.ERROR,{code:v.code,msg:v.message}))}}},n.prototype._onSourceOpen=function(){if(c.a.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var a=this._pendingSourceBufferInit;a.length;){var o=a.shift();this.appendInitSegment(o,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(r.a.SOURCE_OPEN)},n.prototype._onStartStreaming=function(){c.a.v(this.TAG,"ManagedMediaSource onStartStreaming"),this._emitter.emit(r.a.START_STREAMING)},n.prototype._onEndStreaming=function(){c.a.v(this.TAG,"ManagedMediaSource onEndStreaming"),this._emitter.emit(r.a.END_STREAMING)},n.prototype._onQualityChange=function(){c.a.v(this.TAG,"ManagedMediaSource onQualityChange")},n.prototype._onSourceEnded=function(){c.a.v(this.TAG,"MediaSource onSourceEnded")},n.prototype._onSourceClose=function(){c.a.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(this._mediaSource.removeEventListener("startstraming",this.e.onStartStreaming),this._mediaSource.removeEventListener("endstreaming",this.e.onEndStreaming),this._mediaSource.removeEventListener("qualitychange",this.e.onQualityChange)))},n.prototype._hasPendingSegments=function(){var a=this._pendingSegments;return a.video.length>0||a.audio.length>0},n.prototype._hasPendingRemoveRanges=function(){var a=this._pendingRemoveRanges;return a.video.length>0||a.audio.length>0},n.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(r.a.UPDATE_END)},n.prototype._onSourceBufferError=function(a){c.a.e(this.TAG,"SourceBuffer Error: ".concat(a))},n}();u.a=t},function(s,u,y){var A=y(9),l=y.n(A),c=y(21),p=y.n(c),r=y(0),i=y(8),t=y(17),n=y(1),a=(y(23),y(13)),o=y(14),d=function(){function g(m,v){if(this.TAG="Transmuxer",this._emitter=new l.a,v.enableWorker&&typeof Worker<"u")try{this._worker=p()(23),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[m,v]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},i.a.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:i.a.getConfig()})}catch{r.a.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new t.a(m,v)}else this._controller=new t.a(m,v);if(this._controller){var b=this._controller;b.on(n.a.IO_ERROR,this._onIOError.bind(this)),b.on(n.a.DEMUX_ERROR,this._onDemuxError.bind(this)),b.on(n.a.INIT_SEGMENT,this._onInitSegment.bind(this)),b.on(n.a.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),b.on(n.a.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),b.on(n.a.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),b.on(n.a.MEDIA_INFO,this._onMediaInfo.bind(this)),b.on(n.a.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),b.on(n.a.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),b.on(n.a.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),b.on(n.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,this._onSynchronousKLVMetadataArrived.bind(this)),b.on(n.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,this._onAsynchronousKLVMetadataArrived.bind(this)),b.on(n.a.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),b.on(n.a.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),b.on(n.a.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),b.on(n.a.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),b.on(n.a.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),b.on(n.a.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return g.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),i.a.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},g.prototype.on=function(m,v){this._emitter.addListener(m,v)},g.prototype.off=function(m,v){this._emitter.removeListener(m,v)},g.prototype.hasWorker=function(){return this._worker!=null},g.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},g.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},g.prototype.seek=function(m){this._worker?this._worker.postMessage({cmd:"seek",param:m}):this._controller.seek(m)},g.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},g.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},g.prototype.switchPrimaryAudio=function(){this._worker?this._worker.postMessage({cmd:"switch_audio",param:"primary"}):this._controller._demuxer instanceof o.a&&(this._controller._demuxer.preferred_secondary_audio=!1)},g.prototype.switchSecondaryAudio=function(){this._worker?this._worker.postMessage({cmd:"switch_audio",param:"secondary"}):this._controller._demuxer instanceof o.a&&(this._controller._demuxer.preferred_secondary_audio=!0)},g.prototype._onInitSegment=function(m,v){var b=this;Promise.resolve().then(function(){b._emitter.emit(n.a.INIT_SEGMENT,m,v)})},g.prototype._onMediaSegment=function(m,v){var b=this;Promise.resolve().then(function(){b._emitter.emit(n.a.MEDIA_SEGMENT,m,v)})},g.prototype._onLoadingComplete=function(){var m=this;Promise.resolve().then(function(){m._emitter.emit(n.a.LOADING_COMPLETE)})},g.prototype._onRecoveredEarlyEof=function(){var m=this;Promise.resolve().then(function(){m._emitter.emit(n.a.RECOVERED_EARLY_EOF)})},g.prototype._onMediaInfo=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.MEDIA_INFO,m)})},g.prototype._onMetaDataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.METADATA_ARRIVED,m)})},g.prototype._onScriptDataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.SCRIPTDATA_ARRIVED,m)})},g.prototype._onTimedID3MetadataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.TIMED_ID3_METADATA_ARRIVED,m)})},g.prototype._onSynchronousKLVMetadataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,m)})},g.prototype._onAsynchronousKLVMetadataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,m)})},g.prototype._onSMPTE2038MetadataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.SMPTE2038_METADATA_ARRIVED,m)})},g.prototype._onSCTE35MetadataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.SCTE35_METADATA_ARRIVED,m)})},g.prototype._onPESPrivateDataDescriptor=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.PES_PRIVATE_DATA_DESCRIPTOR,m)})},g.prototype._onPESPrivateDataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.PES_PRIVATE_DATA_ARRIVED,m)})},g.prototype._onStatisticsInfo=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.STATISTICS_INFO,m)})},g.prototype._onIOError=function(m,v){var b=this;Promise.resolve().then(function(){b._emitter.emit(n.a.IO_ERROR,m,v)})},g.prototype._onDemuxError=function(m,v){var b=this;Promise.resolve().then(function(){b._emitter.emit(n.a.DEMUX_ERROR,m,v)})},g.prototype._onRecommendSeekpoint=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.RECOMMEND_SEEKPOINT,m)})},g.prototype._onLoggingConfigChanged=function(m){this._worker&&this._worker.postMessage({cmd:"logging_config",param:m})},g.prototype._onWorkerMessage=function(m){var v=m.data,b=v.data;if(v.msg==="destroyed"||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(v.msg){case n.a.INIT_SEGMENT:case n.a.MEDIA_SEGMENT:this._emitter.emit(v.msg,b.type,b.data);break;case n.a.LOADING_COMPLETE:case n.a.RECOVERED_EARLY_EOF:this._emitter.emit(v.msg);break;case n.a.MEDIA_INFO:Object.setPrototypeOf(b,a.a.prototype),this._emitter.emit(v.msg,b);break;case n.a.METADATA_ARRIVED:case n.a.SCRIPTDATA_ARRIVED:case n.a.TIMED_ID3_METADATA_ARRIVED:case n.a.SYNCHRONOUS_KLV_METADATA_ARRIVED:case n.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED:case n.a.SMPTE2038_METADATA_ARRIVED:case n.a.SCTE35_METADATA_ARRIVED:case n.a.PES_PRIVATE_DATA_DESCRIPTOR:case n.a.PES_PRIVATE_DATA_ARRIVED:case n.a.STATISTICS_INFO:this._emitter.emit(v.msg,b);break;case n.a.IO_ERROR:case n.a.DEMUX_ERROR:this._emitter.emit(v.msg,b.type,b.info);break;case n.a.RECOMMEND_SEEKPOINT:this._emitter.emit(v.msg,b);break;case"logcat_callback":r.a.emitter.emit("log",b.type,b.logcat)}},g}();u.a=d},function(s,u,y){function A(r){var i={};function t(a){if(i[a])return i[a].exports;var o=i[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=r,t.c=i,t.i=function(a){return a},t.d=function(a,o,d){t.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:d})},t.r=function(a){Object.defineProperty(a,"__esModule",{value:!0})},t.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return t.d(o,"a",o),o},t.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},t.p="/",t.oe=function(a){throw console.error(a),a};var n=t(t.s=ENTRY_MODULE);return n.default||n}function l(r){return(r+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function c(r,i,t){var n={};n[t]=[];var a=i.toString(),o=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return n;for(var d,g=o[1],m=new RegExp("(\\\\n|\\W)"+l(g)+"\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)","g");d=m.exec(a);)d[3]!=="dll-reference"&&n[t].push(d[3]);for(m=new RegExp("\\("+l(g)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)',"g");d=m.exec(a);)r[d[2]]||(n[t].push(d[1]),r[d[2]]=y(d[1]).m),n[d[2]]=n[d[2]]||[],n[d[2]].push(d[4]);for(var v,b=Object.keys(n),w=0;w0},!1)}s.exports=function(r,i){i=i||{};var t={main:y.m},n=i.all?{main:Object.keys(t.main)}:function(m,v){for(var b={main:[v]},w={main:[]},C={main:{}};p(b);)for(var D=Object.keys(b),R=0;R=2&&r[a]===3&&r[a-1]===0&&r[a-2]===0||(t[n]=r[a],n++);return new Uint8Array(t.buffer,0,n)},c.parseSPS=function(p){for(var r=p.subarray(1,4),i="avc1.",t=0;t<3;t++){var n=r[t].toString(16);n.length<2&&(n="0"+n),i+=n}var a=c._ebsp2rbsp(p),o=new A.a(a);o.readByte();var d=o.readByte();o.readByte();var g=o.readByte();o.readUEG();var m=c.getProfileString(d),v=c.getLevelString(g),b=1,w=420,C=8,D=8;if((d===100||d===110||d===122||d===244||d===44||d===83||d===86||d===118||d===128||d===138||d===144)&&((b=o.readUEG())===3&&o.readBits(1),b<=3&&(w=[0,420,422,444][b]),C=o.readUEG()+8,D=o.readUEG()+8,o.readBits(1),o.readBool()))for(var R=b!==3?8:12,T=0;T0&&Z<16?(ee=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][Z-1],M=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][Z-1]):Z===255&&(ee=o.readByte()<<8|o.readByte(),M=o.readByte()<<8|o.readByte())}if(o.readBool()&&o.readBool(),o.readBool()&&(o.readBits(4),o.readBool()&&o.readBits(24)),o.readBool()&&(o.readUEG(),o.readUEG()),o.readBool()){var X=o.readBits(32),oe=o.readBits(32);j=o.readBool(),Y=(z=oe)/(q=2*X)}}var he=1;ee===1&&M===1||(he=ee/M);var ie=0,fe=0;b===0?(ie=1,fe=2-G):(ie=b===3?1:2,fe=(b===1?2:1)*(2-G));var se=16*(x+1),Ee=16*(O+1)*(2-G);se-=(J+te)*ie,Ee-=(le+ne)*fe;var He=Math.ceil(se*he);return o.destroy(),o=null,{codec_mimetype:i,profile_idc:d,level_idc:g,profile_string:m,level_string:v,chroma_format_idc:b,bit_depth:C,bit_depth_luma:C,bit_depth_chroma:D,ref_frames:I,chroma_format:w,chroma_format_string:c.getChromaFormatString(w),frame_rate:{fixed:j,fps:Y,fps_den:q,fps_num:z},sar_ratio:{width:ee,height:M},codec_size:{width:se,height:Ee},present_size:{width:He,height:Ee}}},c._skipScalingList=function(p,r){for(var i=8,t=8,n=0;n0&&r.push(g)},c.onparsingerror=function(g){o=g},c.onflush=function(){if(o){l(o);return}y(r)},p.forEach(g=>{if(d)if(bc(g,"X-TIMESTAMP-MAP=")){d=!1,g.slice(16).split(",").forEach(m=>{bc(m,"LOCAL:")?t=m.slice(6):bc(m,"MPEGTS:")&&(n=parseInt(m.slice(7)))});try{a=P4(t)/1e3}catch(m){o=m}return}else g===""&&(d=!1);c.parse(g+` +`)}),c.flush()}const Ec="stpp.ttml.im1t",m0=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,g0=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,F4={left:"start",center:"center",right:"end",start:"start",end:"end"};function df(_,e,s,u){const A=Zi(new Uint8Array(_),["mdat"]);if(A.length===0){u(new Error("Could not parse IMSC1 mdat"));return}const y=A.map(c=>Vr(c)),l=i4(e.baseTime,1,e.timescale);try{y.forEach(c=>s(U4(c,l)))}catch(c){u(c)}}function U4(_,e){const A=new DOMParser().parseFromString(_,"text/xml").getElementsByTagName("tt")[0];if(!A)throw new Error("Invalid ttml");const y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},l=Object.keys(y).reduce((t,n)=>(t[n]=A.getAttribute(`ttp:${n}`)||y[n],t),{}),c=A.getAttribute("xml:space")!=="preserve",p=uf(wc(A,"styling","style")),r=uf(wc(A,"layout","region")),i=wc(A,"body","[begin]");return[].map.call(i,t=>{const n=A0(t,c);if(!n||!t.hasAttribute("begin"))return null;const a=Tc(t.getAttribute("begin"),l),o=Tc(t.getAttribute("dur"),l);let d=Tc(t.getAttribute("end"),l);if(a===null)throw hf(t);if(d===null){if(o===null)throw hf(t);d=a+o}const g=new Od(a-e,d-e,n);g.id=Md(g.startTime,g.endTime,g.text);const m=r[t.getAttribute("region")],v=p[t.getAttribute("style")],b=G4(m,v,p),{textAlign:w}=b;if(w){const C=F4[w];C&&(g.lineAlign=C),g.align=w}return xn(g,b),g}).filter(t=>t!==null)}function wc(_,e,s){const u=_.getElementsByTagName(e)[0];return u?[].slice.call(u.querySelectorAll(s)):[]}function uf(_){return _.reduce((e,s)=>{const u=s.getAttribute("xml:id");return u&&(e[u]=s),e},{})}function A0(_,e){return[].slice.call(_.childNodes).reduce((s,u,A)=>{var y;return u.nodeName==="br"&&A?s+` +`:(y=u.childNodes)!=null&&y.length?A0(u,e):e?s+u.textContent.trim().replace(/\s+/g," "):s+u.textContent},"")}function G4(_,e,s){const u="http://www.w3.org/ns/ttml#styling";let A=null;const y=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],l=_!=null&&_.hasAttribute("style")?_.getAttribute("style"):null;return l&&s.hasOwnProperty(l)&&(A=s[l]),y.reduce((c,p)=>{const r=Sc(e,u,p)||Sc(_,u,p)||Sc(A,u,p);return r&&(c[p]=r),c},{})}function Sc(_,e,s){return _&&_.hasAttributeNS(e,s)?_.getAttributeNS(e,s):null}function hf(_){return new Error(`Could not parse ttml timestamp ${_}`)}function Tc(_,e){if(!_)return null;let s=h0(_);return s===null&&(m0.test(_)?s=j4(_,e):g0.test(_)&&(s=V4(_,e))),s}function j4(_,e){const s=m0.exec(_),u=(s[4]|0)+(s[5]|0)/e.subFrameRate;return(s[1]|0)*3600+(s[2]|0)*60+(s[3]|0)+u/e.frameRate}function V4(_,e){const s=g0.exec(_),u=Number(s[1]);switch(s[2]){case"h":return u*3600;case"m":return u*60;case"ms":return u*1e3;case"f":return u/e.frameRate;case"t":return u/e.tickRate}return u}class H4{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=pf(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(rt.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(rt.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(rt.FRAG_LOADING,this.onFragLoading,this),e.on(rt.FRAG_LOADED,this.onFragLoaded,this),e.on(rt.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(rt.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(rt.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(rt.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(rt.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(rt.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(rt.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(rt.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(rt.FRAG_LOADING,this.onFragLoading,this),e.off(rt.FRAG_LOADED,this.onFragLoaded,this),e.off(rt.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(rt.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(rt.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(rt.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(rt.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new no(this,"textTrack1"),s=new no(this,"textTrack2"),u=new no(this,"textTrack3"),A=new no(this,"textTrack4");this.cea608Parser1=new of(1,e,s),this.cea608Parser2=new of(3,u,A)}}addCues(e,s,u,A,y){let l=!1;for(let c=y.length;c--;){const p=y[c],r=z4(p[0],p[1],s,u);if(r>=0&&(p[0]=Math.min(p[0],s),p[1]=Math.max(p[1],u),l=!0,r/(u-s)>.5))return}if(l||y.push([s,u]),this.config.renderTextTracksNatively){const c=this.captionsTracks[e];this.Cues.newCue(c,s,u,A)}else{const c=this.Cues.newCue(null,s,u,A);this.hls.trigger(rt.CUES_PARSED,{type:"captions",cues:c,track:e})}}onInitPtsFound(e,{frag:s,id:u,initPTS:A,timescale:y}){const{unparsedVttFrags:l}=this;u==="main"&&(this.initPTS[s.cc]={baseTime:A,timescale:y}),l.length&&(this.unparsedVttFrags=[],l.forEach(c=>{this.onFragLoaded(rt.FRAG_LOADED,c)}))}getExistingTrack(e,s){const{media:u}=this;if(u)for(let A=0;A{Zs(e[s]),delete e[s]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=pf(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const s=e.textTracks;if(s)for(let u=0;uy.textCodec===Ec);if(this.config.enableWebVTT||A&&this.config.enableIMSC1){if(c0(this.tracks,u)){this.tracks=u;return}if(this.textTracks=[],this.tracks=u,this.config.renderTextTracksNatively){const l=this.media,c=l?po(l.textTracks):null;if(this.tracks.forEach((p,r)=>{let i;if(c){let t=null;for(let n=0;nr!==null).map(r=>r.label);p.length&&Ft.warn(`Media element contains unused subtitle tracks: ${p.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const l=this.tracks.map(c=>({label:c.name,kind:c.type.toLowerCase(),default:c.default,subtitleTrack:c}));this.hls.trigger(rt.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:l})}}}onManifestLoaded(e,s){this.config.enableCEA708Captions&&s.captions&&s.captions.forEach(u=>{const A=/(?:CC|SERVICE)([1-4])/.exec(u.instreamId);if(!A)return;const y=`textTrack${A[1]}`,l=this.captionsProperties[y];l&&(l.label=u.name,u.lang&&(l.languageCode=u.lang),l.media=u)})}closedCaptionsForLevel(e){const s=this.hls.levels[e.level];return s==null?void 0:s.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,s){this.initCea608Parsers();const{cea608Parser1:u,cea608Parser2:A,lastCc:y,lastSn:l,lastPartIndex:c}=this;if(!(!this.enabled||!u||!A)&&s.frag.type===Hi.MAIN){var p,r;const{cc:i,sn:t}=s.frag,n=(p=s==null||(r=s.part)==null?void 0:r.index)!=null?p:-1;t===l+1||t===l&&n===c+1||i===y||(u.reset(),A.reset()),this.lastCc=i,this.lastSn=t,this.lastPartIndex=n}}onFragLoaded(e,s){const{frag:u,payload:A}=s;if(u.type===Hi.SUBTITLE)if(A.byteLength){const y=u.decryptdata,l="stats"in s;if(y==null||!y.encrypted||l){const c=this.tracks[u.level],p=this.vttCCs;p[u.cc]||(p[u.cc]={start:u.start,prevCC:this.prevCC,new:!0},this.prevCC=u.cc),c&&c.textCodec===Ec?this._parseIMSC1(u,A):this._parseVTTs(s)}}else this.hls.trigger(rt.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,s){const u=this.hls;df(s,this.initPTS[e.cc],A=>{this._appendCues(A,e.level),u.trigger(rt.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},A=>{Ft.log(`Failed to parse IMSC1: ${A}`),u.trigger(rt.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:A})})}_parseVTTs(e){var s;const{frag:u,payload:A}=e,{initPTS:y,unparsedVttFrags:l}=this,c=y.length-1;if(!y[u.cc]&&c===-1){l.push(e);return}const p=this.hls,r=(s=u.initSegment)!=null&&s.data?Ar(u.initSegment.data,new Uint8Array(A)):A;N4(r,this.initPTS[u.cc],this.vttCCs,u.cc,u.start,i=>{this._appendCues(i,u.level),p.trigger(rt.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},i=>{const t=i.message==="Missing initPTS for VTT MPEGTS";t?l.push(e):this._fallbackToIMSC1(u,A),Ft.log(`Failed to parse VTT cue: ${i}`),!(t&&c>u.cc)&&p.trigger(rt.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:i})})}_fallbackToIMSC1(e,s){const u=this.tracks[e.level];u.textCodec||df(s,this.initPTS[e.cc],()=>{u.textCodec=Ec,this._parseIMSC1(e,s)},()=>{u.textCodec="wvtt"})}_appendCues(e,s){const u=this.hls;if(this.config.renderTextTracksNatively){const A=this.textTracks[s];if(!A||A.mode==="disabled")return;e.forEach(y=>Np(A,y))}else{const A=this.tracks[s];if(!A)return;const y=A.default?"default":"subtitles"+s;u.trigger(rt.CUES_PARSED,{type:"subtitles",cues:e,track:y})}}onFragDecrypted(e,s){const{frag:u}=s;u.type===Hi.SUBTITLE&&this.onFragLoaded(rt.FRAG_LOADED,s)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,s){this.initCea608Parsers();const{cea608Parser1:u,cea608Parser2:A}=this;if(!this.enabled||!u||!A)return;const{frag:y,samples:l}=s;if(!(y.type===Hi.MAIN&&this.closedCaptionsForLevel(y)==="NONE"))for(let c=0;cVc(c[p],s,u))}if(this.config.renderTextTracksNatively&&s===0&&A!==void 0){const{textTracks:c}=this;Object.keys(c).forEach(p=>Vc(c[p],s,A))}}}extractCea608Data(e){const s=[[],[]],u=e[0]&31;let A=2;for(let y=0;ythis.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=s.autoLevelCapping}}}getMaxLevel(e){const s=this.hls.levels;if(!s.length)return-1;const u=s.filter((A,y)=>this.isLevelAllowed(A)&&y<=e);return this.clientRect=null,Pd.getMaxLevelByMediaSize(u,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,s={width:0,height:0};if(e){const u=e.getBoundingClientRect();s.width=u.width,s.height=u.height,!s.width&&!s.height&&(s.width=u.right-u.left||e.width||0,s.height=u.bottom-u.top||e.height||0)}return this.clientRect=s,s}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return e}isLevelAllowed(e){return!this.restrictedLevels.some(u=>e.bitrate===u.bitrate&&e.width===u.width&&e.height===u.height)}static getMaxLevelByMediaSize(e,s,u){if(!(e!=null&&e.length))return-1;const A=(c,p)=>p?c.width!==p.width||c.height!==p.height:!0;let y=e.length-1;const l=Math.max(s,u);for(let c=0;c=l||p.height>=l)&&A(p,e[c+1])){y=c;break}}return y}}class W4{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(rt.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(rt.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,s){const u=this.hls.config;if(u.capLevelOnFPSDrop){const A=s.media instanceof self.HTMLVideoElement?s.media:null;this.media=A,A&&typeof A.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),u.fpsDroppedMonitoringPeriod)}}checkFPS(e,s,u){const A=performance.now();if(s){if(this.lastTime){const y=A-this.lastTime,l=u-this.lastDroppedFrames,c=s-this.lastDecodedFrames,p=1e3*l/y,r=this.hls;if(r.trigger(rt.FPS_DROP,{currentDropped:l,currentDecoded:c,totalDroppedFrames:u}),p>0&&l>r.config.fpsDroppedMonitoringThreshold*c){let i=r.currentLevel;Ft.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=i)&&(i=i-1,r.trigger(rt.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:r.currentLevel}),r.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=A,this.lastDroppedFrames=u,this.lastDecodedFrames=s}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const s=e.getVideoPlaybackQuality();this.checkFPS(e,s.totalVideoFrames,s.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const so="[eme]";class ra{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=ra.CDMCleanupPromise?[ra.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=Ft.debug.bind(Ft,so),this.log=Ft.log.bind(Ft,so),this.warn=Ft.warn.bind(Ft,so),this.error=Ft.error.bind(Ft,so),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(rt.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(rt.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(rt.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(rt.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(rt.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(rt.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:s,widevineLicenseUrl:u}=this.config,A=s[e];if(A)return A.licenseUrl;if(e===vn.WIDEVINE&&u)return u;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:s}=this.config,u=s[e];if(u)return u.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const s=this.hls.levels,u=(l,c,p)=>!!l&&p.indexOf(l)===c,A=s.map(l=>l.audioCodec).filter(u),y=s.map(l=>l.videoCodec).filter(u);return A.length+y.length===0&&y.push("avc1.42e01e"),new Promise((l,c)=>{const p=r=>{const i=r.shift();this.getMediaKeysPromise(i,A,y).then(t=>l({keySystem:i,mediaKeys:t})).catch(t=>{r.length?p(r):t instanceof mr?c(t):c(new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))})};p(e)})}requestMediaKeySystemAccess(e,s){const{requestMediaKeySystemAccessFunc:u}=this.config;if(typeof u!="function"){let A=`Configured requestMediaKeySystemAccess is not a function ${u}`;return Sp===null&&self.location.protocol==="http:"&&(A=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(A))}return u(e,s)}getMediaKeysPromise(e,s,u){const A=r_(e,s,u,this.config.drmSystemOptions),y=this.keySystemAccessPromises[e];let l=y==null?void 0:y.keySystemAccess;if(!l){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(A)}`),l=this.requestMediaKeySystemAccess(e,A);const c=this.keySystemAccessPromises[e]={keySystemAccess:l};return l.catch(p=>{this.log(`Failed to obtain access to key-system "${e}": ${p}`)}),l.then(p=>{this.log(`Access for key-system "${p.keySystem}" obtained`);const r=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),c.mediaKeys=p.createMediaKeys().then(i=>(this.log(`Media-keys created for "${e}"`),r.then(t=>t?this.setMediaKeysServerCertificate(i,e,t):i))),c.mediaKeys.catch(i=>{this.error(`Failed to create media-keys for "${e}"}: ${i}`)}),c.mediaKeys})}return l.then(()=>y.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:s,mediaKeys:u}){this.log(`Creating key-system session "${s}" keyId: ${Fr.hexDump(e.keyId||[])}`);const A=u.createSession(),y={decryptdata:e,keySystem:s,mediaKeys:u,mediaKeysSession:A,keyStatus:"status-pending"};return this.mediaKeySessions.push(y),y}renewKeySession(e){const s=e.decryptdata;if(s.pssh){const u=this.createMediaKeySessionContext(e),A=this.getKeyIdString(s),y="cenc";this.keyIdToKeySessionPromise[A]=this.generateRequestWithPreferredKeySession(u,y,s.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Fr.hexDump(e.keyId)}updateKeySession(e,s){var u;const A=e.mediaKeysSession;return this.log(`Updating key-session "${A.sessionId}" for keyID ${Fr.hexDump(((u=e.decryptdata)==null?void 0:u.keyId)||[])} + } (data length: ${s&&s.byteLength})`),A.update(s)}selectKeySystemFormat(e){const s=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${s.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(s)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((s,u)=>{const A=oc(this.config),y=e.map(yh).filter(l=>!!l&&A.indexOf(l)!==-1);return this.getKeySystemSelectionPromise(y).then(({keySystem:l})=>{const c=vh(l);c?s(c):u(new Error(`Unable to find format for key-system "${l}"`))}).catch(u)})}loadKey(e){const s=e.keyInfo.decryptdata,u=this.getKeyIdString(s),A=`(keyId: ${u} format: "${s.keyFormat}" method: ${s.method} uri: ${s.uri})`;this.log(`Starting session for key ${A}`);let y=this.keyIdToKeySessionPromise[u];return y||(y=this.keyIdToKeySessionPromise[u]=this.getKeySystemForKeyPromise(s).then(({keySystem:l,mediaKeys:c})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${A}`),this.attemptSetMediaKeys(l,c).then(()=>{this.throwIfDestroyed();const p=this.createMediaKeySessionContext({keySystem:l,mediaKeys:c,decryptdata:s});return this.generateRequestWithPreferredKeySession(p,"cenc",s.pssh,"playlist-key")}))),y.catch(l=>this.handleError(l))),y}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof mr?this.hls.trigger(rt.ERROR,e.data):this.hls.trigger(rt.ERROR,{type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const s=this.getKeyIdString(e),u=this.keyIdToKeySessionPromise[s];if(!u){const A=yh(e.keyFormat),y=A?[A]:oc(this.config);return this.attemptKeySystemAccess(y)}return u}getKeySystemSelectionPromise(e){if(e.length||(e=oc(this.config)),e.length===0)throw new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:s,initData:u}=e;if(this.debug(`"${e.type}" event: init data type: "${s}"`),u===null)return;let A,y;if(s==="sinf"&&this.config.drmSystems[vn.FAIRPLAY]){const i=In(new Uint8Array(u));try{const t=vd(JSON.parse(i).sinf),n=Dp(new Uint8Array(t));if(!n)return;A=n.subarray(8,24),y=vn.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const i=R_(u);if(i===null)return;i.version===0&&i.systemId===wp.WIDEVINE&&i.data&&(A=i.data.subarray(8,24)),y=n_(i.systemId)}if(!y||!A)return;const l=Fr.hexDump(A),{keyIdToKeySessionPromise:c,mediaKeySessions:p}=this;let r=c[l];for(let i=0;ithis.generateRequestWithPreferredKeySession(t,s,u,"encrypted-event-key-match"));break}}r||(r=c[l]=this.getKeySystemSelectionPromise([y]).then(({keySystem:i,mediaKeys:t})=>{var n;this.throwIfDestroyed();const a=new Ia("ISO-23001-7",l,(n=vh(i))!=null?n:"");return a.pssh=new Uint8Array(u),a.keyId=A,this.attemptSetMediaKeys(i,t).then(()=>{this.throwIfDestroyed();const o=this.createMediaKeySessionContext({decryptdata:a,keySystem:i,mediaKeys:t});return this.generateRequestWithPreferredKeySession(o,s,u,"encrypted-event-no-match")})})),r.catch(i=>this.handleError(i))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,s){const u=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const A=Promise.all(u).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(s)});return this.setMediaKeysQueue.push(A),A.then(()=>{this.log(`Media-keys set for "${e}"`),u.push(A),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(y=>u.indexOf(y)===-1)})}generateRequestWithPreferredKeySession(e,s,u,A){var y,l;const c=(y=this.config.drmSystems)==null||(l=y[e.keySystem])==null?void 0:l.generateRequest;if(c)try{const o=c.call(this.hls,s,u,e);if(!o)throw new Error("Invalid response from configured generateRequest filter");s=o.initDataType,u=e.decryptdata.pssh=o.initData?new Uint8Array(o.initData):null}catch(o){var p;if(this.warn(o.message),(p=this.hls)!=null&&p.config.debug)throw o}if(u===null)return this.log(`Skipping key-session request for "${A}" (no initData)`),Promise.resolve(e);const r=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${A}": ${r} (init data type: ${s} length: ${u?u.byteLength:null})`);const i=new Dd,t=e._onmessage=o=>{const d=e.mediaKeysSession;if(!d){i.emit("error",new Error("invalid state"));return}const{messageType:g,message:m}=o;this.log(`"${g}" message event for session "${d.sessionId}" message size: ${m.byteLength}`),g==="license-request"||g==="license-renewal"?this.renewLicense(e,m).catch(v=>{this.handleError(v),i.emit("error",v)}):g==="license-release"?e.keySystem===vn.FAIRPLAY&&(this.updateKeySession(e,Gc("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${g}"`)},n=e._onkeystatuseschange=o=>{if(!e.mediaKeysSession){i.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const g=e.keyStatus;i.emit("keyStatus",g),g==="expired"&&(this.warn(`${e.keySystem} expired for key ${r}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",t),e.mediaKeysSession.addEventListener("keystatuseschange",n);const a=new Promise((o,d)=>{i.on("error",d),i.on("keyStatus",g=>{g.startsWith("usable")?o():g==="output-restricted"?d(new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):g==="internal-error"?d(new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${g}"`)):g==="expired"?d(new Error("key expired while generating request")):this.warn(`unhandled key status change "${g}"`)})});return e.mediaKeysSession.generateRequest(s,u).then(()=>{var o;this.log(`Request generated for key-session "${(o=e.mediaKeysSession)==null?void 0:o.sessionId}" keyId: ${r}`)}).catch(o=>{throw new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_NO_SESSION,error:o,fatal:!1},`Error generating key-session request: ${o}`)}).then(()=>a).catch(o=>{throw i.removeAllListeners(),this.removeSession(e),o}).then(()=>(i.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((s,u)=>{this.log(`key status change "${s}" for keyStatuses keyId: ${Fr.hexDump("buffer"in u?new Uint8Array(u.buffer,u.byteOffset,u.byteLength):new Uint8Array(u))} session keyId: ${Fr.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=s})}fetchServerCertificate(e){const s=this.config,u=s.loader,A=new u(s),y=this.getServerCertificateUrl(e);return y?(this.log(`Fetching server certificate for "${e}"`),new Promise((l,c)=>{const p={responseType:"arraybuffer",url:y},r=s.certLoadPolicy.default,i={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},t={onSuccess:(n,a,o,d)=>{l(n.data)},onError:(n,a,o,d)=>{c(new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:Dn({url:p.url,data:void 0},n)},`"${e}" certificate request failed (${y}). Status: ${n.code} (${n.text})`))},onTimeout:(n,a,o)=>{c(new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:p.url,data:void 0}},`"${e}" certificate request timed out (${y})`))},onAbort:(n,a,o)=>{c(new Error("aborted"))}};A.load(p,i,t)})):Promise.resolve()}setMediaKeysServerCertificate(e,s,u){return new Promise((A,y)=>{e.setServerCertificate(u).then(l=>{this.log(`setServerCertificate ${l?"success":"not supported by CDM"} (${u==null?void 0:u.byteLength}) on "${s}"`),A(e)}).catch(l=>{y(new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:l,fatal:!0},l.message))})})}renewLicense(e,s){return this.requestLicense(e,new Uint8Array(s)).then(u=>this.updateKeySession(e,new Uint8Array(u)).catch(A=>{throw new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:A,fatal:!0},A.message)}))}unpackPlayReadyKeyMessage(e,s){const u=String.fromCharCode.apply(null,new Uint16Array(s.buffer));if(!u.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),s;const A=new DOMParser().parseFromString(u,"application/xml"),y=A.querySelectorAll("HttpHeader");if(y.length>0){let i;for(let t=0,n=y.length;t in key message");return Gc(atob(r))}setupLicenseXHR(e,s,u,A){const y=this.config.licenseXhrSetup;return y?Promise.resolve().then(()=>{if(!u.decryptdata)throw new Error("Key removed");return y.call(this.hls,e,s,u,A)}).catch(l=>{if(!u.decryptdata)throw l;return e.open("POST",s,!0),y.call(this.hls,e,s,u,A)}).then(l=>(e.readyState||e.open("POST",s,!0),{xhr:e,licenseChallenge:l||A})):(e.open("POST",s,!0),Promise.resolve({xhr:e,licenseChallenge:A}))}requestLicense(e,s){const u=this.config.keyLoadPolicy.default;return new Promise((A,y)=>{const l=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${l}`);const c=new XMLHttpRequest;c.responseType="arraybuffer",c.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return y(new Error("invalid state"));if(c.readyState===4)if(c.status===200){this._requestLicenseFailureCount=0;let p=c.response;this.log(`License received ${p instanceof ArrayBuffer?p.byteLength:p}`);const r=this.config.licenseResponseCallback;if(r)try{p=r.call(this.hls,c,l,e)}catch(i){this.error(i)}A(p)}else{const p=u.errorRetry,r=p?p.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>r||c.status>=400&&c.status<500)y(new mr({type:Wi.KEY_SYSTEM_ERROR,details:qt.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:c,response:{url:l,data:void 0,code:c.status,text:c.statusText}},`License Request XHR failed (${l}). Status: ${c.status} (${c.statusText})`));else{const i=r-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${i} attempts left`),this.requestLicense(e,s).then(A,y)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=c,this.setupLicenseXHR(c,l,e,s).then(({xhr:p,licenseChallenge:r})=>{e.keySystem==vn.PLAYREADY&&(r=this.unpackPlayReadyKeyMessage(p,r)),p.send(r)})})}onMediaAttached(e,s){if(!this.config.emeEnabled)return;const u=s.media;this.media=u,u.addEventListener("encrypted",this.onMediaEncrypted),u.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,s=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Ia.clearKeyUriToKeyIdMap();const u=s.length;ra.CDMCleanupPromise=Promise.all(s.map(A=>this.removeSession(A)).concat(e==null?void 0:e.setMediaKeys(null).catch(A=>{this.log(`Could not clear media keys: ${A}`)}))).then(()=>{u&&(this.log("finished closing key sessions and clearing media keys"),s.length=0)}).catch(A=>{this.log(`Could not close sessions and clear media keys: ${A}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:s}){if(!(!s||!this.config.emeEnabled)&&!this.keyFormatPromise){const u=s.reduce((A,y)=>(A.indexOf(y.keyFormat)===-1&&A.push(y.keyFormat),A),[]);this.log(`Selecting key-system from session-keys ${u.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(u)}}removeSession(e){const{mediaKeysSession:s,licenseXhr:u}=e;if(s){this.log(`Remove licenses and keys and close session ${s.sessionId}`),e._onmessage&&(s.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(s.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),u&&u.readyState!==XMLHttpRequest.DONE&&u.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const A=this.mediaKeySessions.indexOf(e);return A>-1&&this.mediaKeySessions.splice(A,1),s.remove().catch(y=>{this.log(`Could not remove session: ${y}`)}).then(()=>s.close()).catch(y=>{this.log(`Could not close session: ${y}`)})}}}ra.CDMCleanupPromise=void 0;class mr extends Error{constructor(e,s){super(s),this.data=void 0,e.error||(e.error=new Error(s)),this.data=e,e.err=e.error}}var zn;(function(_){_.MANIFEST="m",_.AUDIO="a",_.VIDEO="v",_.MUXED="av",_.INIT="i",_.CAPTION="c",_.TIMED_TEXT="tt",_.KEY="k",_.OTHER="o"})(zn||(zn={}));var Qc;(function(_){_.DASH="d",_.HLS="h",_.SMOOTH="s",_.OTHER="o"})(Qc||(Qc={}));var _s;(function(_){_.OBJECT="CMCD-Object",_.REQUEST="CMCD-Request",_.SESSION="CMCD-Session",_.STATUS="CMCD-Status"})(_s||(_s={}));const K4={[_s.OBJECT]:["br","d","ot","tb"],[_s.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[_s.SESSION]:["cid","pr","sf","sid","st","v"],[_s.STATUS]:["bs","rtp"]};class da{constructor(e,s){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(u=>u instanceof da?u:new da(u))),this.value=e,this.params=s}}class v0{constructor(e){this.description=void 0,this.description=e}}const q4="Dict";function Y4(_){return Array.isArray(_)?JSON.stringify(_):_ instanceof Map?"Map{}":_ instanceof Set?"Set{}":typeof _=="object"?JSON.stringify(_):String(_)}function J4(_,e,s,u){return new Error(`failed to ${_} "${Y4(e)}" as ${s}`,{cause:u})}const mf="Bare Item",Q4="Boolean",Z4="Byte Sequence",X4="Decimal",$4="Integer";function e8(_){return _<-999999999999999||999999999999999<_}const t8=/[\x00-\x1f\x7f]+/,i8="Token",n8="Key";function Hr(_,e,s){return J4("serialize",_,e,s)}function r8(_){if(typeof _!="boolean")throw Hr(_,Q4);return _?"?1":"?0"}function s8(_){return btoa(String.fromCharCode(..._))}function a8(_){if(ArrayBuffer.isView(_)===!1)throw Hr(_,Z4);return`:${s8(_)}:`}function b0(_){if(e8(_))throw Hr(_,$4);return _.toString()}function o8(_){return`@${b0(_.getTime()/1e3)}`}function _0(_,e){if(_<0)return-_0(-_,e);const s=Math.pow(10,e);if(Math.abs(_*s%1-.5)12)throw Hr(_,X4);const s=e.toString();return s.includes(".")?s:`${s}.0`}const c8="String";function d8(_){if(t8.test(_))throw Hr(_,c8);return`"${_.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function u8(_){return _.description||_.toString().slice(7,-1)}function gf(_){const e=u8(_);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Hr(e,i8);return e}function Zc(_){switch(typeof _){case"number":if(!Ci(_))throw Hr(_,mf);return Number.isInteger(_)?b0(_):l8(_);case"string":return d8(_);case"symbol":return gf(_);case"boolean":return r8(_);case"object":if(_ instanceof Date)return o8(_);if(_ instanceof Uint8Array)return a8(_);if(_ instanceof v0)return gf(_);default:throw Hr(_,mf)}}function Xc(_){if(/^[a-z*][a-z0-9\-_.*]*$/.test(_)===!1)throw Hr(_,n8);return _}function Bd(_){return _==null?"":Object.entries(_).map(([e,s])=>s===!0?`;${Xc(e)}`:`;${Xc(e)}=${Zc(s)}`).join("")}function E0(_){return _ instanceof da?`${Zc(_.value)}${Bd(_.params)}`:Zc(_)}function h8(_){return`(${_.value.map(E0).join(" ")})${Bd(_.params)}`}function f8(_,e={whitespace:!0}){if(typeof _!="object")throw Hr(_,q4);const s=_ instanceof Map?_.entries():Object.entries(_),u=e!=null&&e.whitespace?" ":"";return Array.from(s).map(([A,y])=>{y instanceof da||(y=new da(y));let l=Xc(A);return y.value===!0?l+=Bd(y.params):(l+="=",Array.isArray(y.value)?l+=h8(y):l+=E0(y)),l}).join(`,${u}`)}function p8(_,e){return f8(_,e)}const m8=_=>_==="ot"||_==="sf"||_==="st",g8=_=>typeof _=="number"?Ci(_):_!=null&&_!==""&&_!==!1;function A8(_,e){const s=new URL(_),u=new URL(e);if(s.origin!==u.origin)return _;const A=s.pathname.split("/").slice(1),y=u.pathname.split("/").slice(1,-1);for(;A[0]===y[0];)A.shift(),y.shift();for(;y.length;)y.shift(),A.unshift("..");return A.join("/")}function y8(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),s=e.toString();return URL.revokeObjectURL(e),s.slice(s.lastIndexOf("/")+1)}catch{let s=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,A=>{const y=(s+Math.random()*16)%16|0;return s=Math.floor(s/16),(A=="x"?y:y&3|8).toString(16)})}}}const vo=_=>Math.round(_),v8=(_,e)=>(e!=null&&e.baseUrl&&(_=A8(_,e.baseUrl)),encodeURIComponent(_)),ao=_=>vo(_/100)*100,b8={br:vo,d:vo,bl:ao,dl:ao,mtp:ao,nor:v8,rtp:ao,tb:vo};function _8(_,e){const s={};if(_==null||typeof _!="object")return s;const u=Object.keys(_).sort(),A=xn({},b8,e==null?void 0:e.formatters),y=e==null?void 0:e.filter;return u.forEach(l=>{if(y!=null&&y(l))return;let c=_[l];const p=A[l];p&&(c=p(c,e)),!(l==="v"&&c===1)&&(l=="pr"&&c===1||g8(c)&&(m8(l)&&typeof c=="string"&&(c=new v0(c)),s[l]=c))}),s}function w0(_,e={}){return _?p8(_8(_,e),xn({whitespace:!1},e)):""}function E8(_,e={}){if(!_)return{};const s=Object.entries(_),u=Object.entries(K4).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),A=s.reduce((y,l)=>{var c,p;const[r,i]=l,t=((c=u.find(n=>n[1].includes(r)))==null?void 0:c[0])||_s.REQUEST;return(p=y[t])!=null||(y[t]={}),y[t][r]=i,y},{});return Object.entries(A).reduce((y,[l,c])=>(y[l]=w0(c,e),y),{})}function w8(_,e,s){return xn(_,E8(e,s))}const S8="CMCD";function T8(_,e={}){if(!_)return"";const s=w0(_,e);return`${S8}=${encodeURIComponent(s)}`}const Af=/CMCD=[^&#]+/;function C8(_,e,s){const u=T8(e,s);if(!u)return _;if(Af.test(_))return _.replace(Af,u);const A=_.includes("?")?"&":"?";return`${_}${A}${u}`}class x8{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=A=>{try{this.apply(A,{ot:zn.MANIFEST,su:!this.initialized})}catch(y){Ft.warn("Could not generate manifest CMCD data.",y)}},this.applyFragmentData=A=>{try{const y=A.frag,l=this.hls.levels[y.level],c=this.getObjectType(y),p={d:y.duration*1e3,ot:c};(c===zn.VIDEO||c===zn.AUDIO||c==zn.MUXED)&&(p.br=l.bitrate/1e3,p.tb=this.getTopBandwidth(c)/1e3,p.bl=this.getBufferLength(c)),this.apply(A,p)}catch(y){Ft.warn("Could not generate segment CMCD data.",y)}},this.hls=e;const s=this.config=e.config,{cmcd:u}=s;u!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=u.sessionId||y8(),this.cid=u.contentId,this.useHeaders=u.useHeaders===!0,this.includeKeys=u.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(rt.MEDIA_DETACHED,this.onMediaDetached,this),e.on(rt.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(rt.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(rt.MEDIA_DETACHED,this.onMediaDetached,this),e.off(rt.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,s){var u,A;this.audioBuffer=(u=s.tracks.audio)==null?void 0:u.buffer,this.videoBuffer=(A=s.tracks.video)==null?void 0:A.buffer}createData(){var e;return{v:1,sf:Qc.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,s={}){xn(s,this.createData());const u=s.ot===zn.INIT||s.ot===zn.VIDEO||s.ot===zn.MUXED;this.starved&&u&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering);const{includeKeys:A}=this;A&&(s=Object.keys(s).reduce((y,l)=>(A.includes(l)&&(y[l]=s[l]),y),{})),this.useHeaders?(e.headers||(e.headers={}),w8(e.headers,s)):e.url=C8(e.url,s)}getObjectType(e){const{type:s}=e;if(s==="subtitle")return zn.TIMED_TEXT;if(e.sn==="initSegment")return zn.INIT;if(s==="audio")return zn.AUDIO;if(s==="main")return this.hls.audioTracks.length?zn.VIDEO:zn.MUXED}getTopBandwidth(e){let s=0,u;const A=this.hls;if(e===zn.AUDIO)u=A.audioTracks;else{const y=A.maxAutoLevel,l=y>-1?y+1:A.levels.length;u=A.levels.slice(0,l)}for(const y of u)y.bitrate>s&&(s=y.bitrate);return s>0?s:NaN}getBufferLength(e){const s=this.hls.media,u=e===zn.AUDIO?this.audioBuffer:this.videoBuffer;return!u||!s?NaN:mn.bufferInfo(u,s.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,s=this.applyPlaylistData,u=e||this.config.loader;return class{constructor(y){this.loader=void 0,this.loader=new u(y)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(y,l,c){s(y),this.loader.load(y,l,c)}}}createFragmentLoader(){const{fLoader:e}=this.config,s=this.applyFragmentData,u=e||this.config.loader;return class{constructor(y){this.loader=void 0,this.loader=new u(y)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(y,l,c){s(y),this.loader.load(y,l,c)}}}}const k8=3e5;class R8{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=Ft.log.bind(Ft,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.on(rt.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(rt.MANIFEST_PARSED,this.onManifestParsed,this),e.off(rt.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const s=this.levels;s&&(this.levels=s.filter(u=>u!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,s){const{contentSteering:u}=s;u!==null&&(this.pathwayId=u.pathwayId,this.uri=u.uri,this.started&&this.startLoad())}onManifestParsed(e,s){this.audioTracks=s.audioTracks,this.subtitleTracks=s.subtitleTracks}onError(e,s){const{errorAction:u}=s;if((u==null?void 0:u.action)===Vn.SendAlternateToPenaltyBox&&u.flags===Tr.MoveAllAlternatesMatchingHost){const A=this.levels;let y=this.pathwayPriority,l=this.pathwayId;if(s.context){const{groupId:c,pathwayId:p,type:r}=s.context;c&&A?l=this.getPathwayForGroupId(c,r,l):p&&(l=p)}l in this.penalizedPathways||(this.penalizedPathways[l]=performance.now()),!y&&A&&(y=A.reduce((c,p)=>(c.indexOf(p.pathwayId)===-1&&c.push(p.pathwayId),c),[])),y&&y.length>1&&(this.updatePathwayPriority(y),u.resolved=this.pathwayId!==l),u.resolved||Ft.warn(`Could not resolve ${s.details} ("${s.error.message}") with content-steering for Pathway: ${l} levels: ${A&&A.length} priorities: ${JSON.stringify(y)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let s=this.getLevelsForPathway(this.pathwayId);if(s.length===0){const u=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${u}"`),s=this.getLevelsForPathway(u),this.pathwayId=u}return s.length!==e.length?(this.log(`Found ${s.length}/${e.length} levels in Pathway "${this.pathwayId}"`),s):e}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(s=>e===s.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let s;const u=this.penalizedPathways,A=performance.now();Object.keys(u).forEach(y=>{A-u[y]>k8&&delete u[y]});for(let y=0;y0){this.log(`Setting Pathway to "${l}"`),this.pathwayId=l,jp(s),this.hls.trigger(rt.LEVELS_UPDATED,{levels:s});const r=this.hls.levels[c];p&&r&&this.levels&&(r.attrs["STABLE-VARIANT-ID"]!==p.attrs["STABLE-VARIANT-ID"]&&r.bitrate!==p.bitrate&&this.log(`Unstable Pathways change from bitrate ${p.bitrate} to ${r.bitrate}`),this.hls.nextLoadLevel=c);break}}}getPathwayForGroupId(e,s,u){const A=this.getLevelsForPathway(u).concat(this.levels||[]);for(let y=0;y{const{ID:l,"BASE-ID":c,"URI-REPLACEMENT":p}=y;if(s.some(i=>i.pathwayId===l))return;const r=this.getLevelsForPathway(c).map(i=>{const t=new bn(i.attrs);t["PATHWAY-ID"]=l;const n=t.AUDIO&&`${t.AUDIO}_clone_${l}`,a=t.SUBTITLES&&`${t.SUBTITLES}_clone_${l}`;n&&(u[t.AUDIO]=n,t.AUDIO=n),a&&(A[t.SUBTITLES]=a,t.SUBTITLES=a);const o=S0(i.uri,t["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",p),d=new la({attrs:t,audioCodec:i.audioCodec,bitrate:i.bitrate,height:i.height,name:i.name,url:o,videoCodec:i.videoCodec,width:i.width});if(i.audioGroups)for(let g=1;g{this.log(`Loaded steering manifest: "${A}"`);const o=i.data;if(o.VERSION!==1){this.log(`Steering VERSION ${o.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=o.TTL;const{"RELOAD-URI":d,"PATHWAY-CLONES":g,"PATHWAY-PRIORITY":m}=o;if(d)try{this.uri=new self.URL(d,A).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${d}`);return}this.scheduleRefresh(this.uri||n.url),g&&this.clonePathways(g);const v={steeringManifest:o,url:A.toString()};this.hls.trigger(rt.STEERING_MANIFEST_LOADED,v),m&&this.updatePathwayPriority(m)},onError:(i,t,n,a)=>{if(this.log(`Error loading steering manifest: ${i.code} ${i.text} (${t.url})`),this.stopLoad(),i.code===410){this.enabled=!1,this.log(`Steering manifest ${t.url} no longer available`);return}let o=this.timeToLoad*1e3;if(i.code===429){const d=this.loader;if(typeof(d==null?void 0:d.getResponseHeader)=="function"){const g=d.getResponseHeader("Retry-After");g&&(o=parseFloat(g)*1e3)}this.log(`Steering manifest ${t.url} rate limited`);return}this.scheduleRefresh(this.uri||t.url,o)},onTimeout:(i,t,n)=>{this.log(`Timeout loading steering manifest (${t.url})`),this.scheduleRefresh(this.uri||t.url)}};this.log(`Requesting steering manifest: ${A}`),this.loader.load(y,p,r)}scheduleRefresh(e,s=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var u;const A=(u=this.hls)==null?void 0:u.media;if(A&&!A.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},s)}}function yf(_,e,s,u){_&&Object.keys(e).forEach(A=>{const y=_.filter(l=>l.groupId===A).map(l=>{const c=xn({},l);return c.details=void 0,c.attrs=new bn(c.attrs),c.url=c.attrs.URI=S0(l.url,l.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",s),c.groupId=c.attrs["GROUP-ID"]=e[A],c.attrs["PATHWAY-ID"]=u,c});_.push(...y)})}function S0(_,e,s,u){const{HOST:A,PARAMS:y,[s]:l}=u;let c;e&&(c=l==null?void 0:l[e],c&&(_=c));const p=new self.URL(_);return A&&!c&&(p.host=A),y&&Object.keys(y).sort().forEach(r=>{r&&p.searchParams.set(r,y[r])}),p.href}const I8=/^age:\s*[\d.]+\s*$/im;class T0{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new Zo,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null,this.stats=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,s,u){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=s,this.callbacks=u,this.loadInternal()}loadInternal(){const{config:e,context:s}=this;if(!e||!s)return;const u=this.loader=new self.XMLHttpRequest,A=this.stats;A.loading.first=0,A.loaded=0,A.aborted=!1;const y=this.xhrSetup;y?Promise.resolve().then(()=>{if(!this.stats.aborted)return y(u,s.url)}).catch(l=>(u.open("GET",s.url,!0),y(u,s.url))).then(()=>{this.stats.aborted||this.openAndSendXhr(u,s,e)}).catch(l=>{this.callbacks.onError({code:u.status,text:l.message},s,u,A)}):this.openAndSendXhr(u,s,e)}openAndSendXhr(e,s,u){e.readyState||e.open("GET",s.url,!0);const A=s.headers,{maxTimeToFirstByteMs:y,maxLoadTimeMs:l}=u.loadPolicy;if(A)for(const c in A)e.setRequestHeader(c,A[c]);s.rangeEnd&&e.setRequestHeader("Range","bytes="+s.rangeStart+"-"+(s.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=s.responseType,self.clearTimeout(this.requestTimeout),u.timeout=y&&Ci(y)?y:l,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),u.timeout),e.send()}readystatechange(){const{context:e,loader:s,stats:u}=this;if(!e||!s)return;const A=s.readyState,y=this.config;if(!u.aborted&&A>=2&&(u.loading.first===0&&(u.loading.first=Math.max(self.performance.now(),u.loading.start),y.timeout!==y.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),y.timeout=y.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.loadPolicy.maxLoadTimeMs-(u.loading.first-u.loading.start)))),A===4)){self.clearTimeout(this.requestTimeout),s.onreadystatechange=null,s.onprogress=null;const l=s.status,c=s.responseType!=="text";if(l>=200&&l<300&&(c&&s.response||s.responseText!==null)){u.loading.end=Math.max(self.performance.now(),u.loading.first);const p=c?s.response:s.responseText,r=s.responseType==="arraybuffer"?p.byteLength:p.length;if(u.loaded=u.total=r,u.bwEstimate=u.total*8e3/(u.loading.end-u.loading.first),!this.callbacks)return;const i=this.callbacks.onProgress;if(i&&i(u,e,p,s),!this.callbacks)return;const t={url:s.responseURL,data:p,code:l};this.callbacks.onSuccess(t,u,e,s)}else{const p=y.loadPolicy.errorRetry,r=u.retry,i={url:e.url,data:void 0,code:l};Mo(p,r,!1,i)?this.retry(p):(Ft.error(`${l} while loading ${e.url}`),this.callbacks.onError({code:l,text:s.statusText},e,s,u))}}}loadtimeout(){var e;const s=(e=this.config)==null?void 0:e.loadPolicy.timeoutRetry,u=this.stats.retry;if(Mo(s,u,!0))this.retry(s);else{var A;Ft.warn(`timeout while loading ${(A=this.context)==null?void 0:A.url}`);const y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:s,stats:u}=this;this.retryDelay=wd(e,u.retry),u.retry++,Ft.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${s==null?void 0:s.url}, retrying ${u.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const s=this.stats;s.loaded=e.loaded,e.lengthComputable&&(s.total=e.total)}getCacheAge(){let e=null;if(this.loader&&I8.test(this.loader.getAllResponseHeaders())){const s=this.loader.getResponseHeader("age");e=s?parseFloat(s):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function L8(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const D8=/(\d+)-(\d+)\/(\d+)/;class vf{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||B8,this.controller=new self.AbortController,this.stats=new Zo}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,s,u){const A=this.stats;if(A.loading.start)throw new Error("Loader can only be used once.");A.loading.start=self.performance.now();const y=O8(e,this.controller.signal),l=u.onProgress,c=e.responseType==="arraybuffer",p=c?"byteLength":"length",{maxTimeToFirstByteMs:r,maxLoadTimeMs:i}=s.loadPolicy;this.context=e,this.config=s,this.callbacks=u,this.request=this.fetchSetup(e,y),self.clearTimeout(this.requestTimeout),s.timeout=r&&Ci(r)?r:i,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),u.onTimeout(A,e,this.response)},s.timeout),self.fetch(this.request).then(t=>{this.response=this.loader=t;const n=Math.max(self.performance.now(),A.loading.start);if(self.clearTimeout(this.requestTimeout),s.timeout=i,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),u.onTimeout(A,e,this.response)},i-(n-A.loading.start)),!t.ok){const{status:a,statusText:o}=t;throw new N8(o||"fetch, bad network response",a,t)}return A.loading.first=n,A.total=P8(t.headers)||A.total,l&&Ci(s.highWaterMark)?this.loadProgressively(t,A,e,s.highWaterMark,l):c?t.arrayBuffer():e.responseType==="json"?t.json():t.text()}).then(t=>{const n=this.response;if(!n)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),A.loading.end=Math.max(self.performance.now(),A.loading.first);const a=t[p];a&&(A.loaded=A.total=a);const o={url:n.url,data:t,code:n.status};l&&!Ci(s.highWaterMark)&&l(A,e,t,n),u.onSuccess(o,A,e,n)}).catch(t=>{if(self.clearTimeout(this.requestTimeout),A.aborted)return;const n=t&&t.code||0,a=t?t.message:null;u.onError({code:n,text:a},e,t?t.details:null,A)})}getCacheAge(){let e=null;if(this.response){const s=this.response.headers.get("age");e=s?parseFloat(s):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,s,u,A=0,y){const l=new Wp,c=e.body.getReader(),p=()=>c.read().then(r=>{if(r.done)return l.dataLength&&y(s,u,l.flush(),e),Promise.resolve(new ArrayBuffer(0));const i=r.value,t=i.length;return s.loaded+=t,t=A&&y(s,u,l.flush(),e)):y(s,u,i,e),p()}).catch(()=>Promise.reject());return p()}}function O8(_,e){const s={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(xn({},_.headers))};return _.rangeEnd&&s.headers.set("Range","bytes="+_.rangeStart+"-"+String(_.rangeEnd-1)),s}function M8(_){const e=D8.exec(_);if(e)return parseInt(e[2])-parseInt(e[1])+1}function P8(_){const e=_.get("Content-Range");if(e){const u=M8(e);if(Ci(u))return u}const s=_.get("Content-Length");if(s)return parseInt(s)}function B8(_,e){return new self.Request(_.url,e)}class N8 extends Error{constructor(e,s,u){super(e),this.code=void 0,this.details=void 0,this.code=s,this.details=u}}const F8=/\s/,U8={newCue(_,e,s,u){const A=[];let y,l,c,p,r;const i=self.VTTCue||self.TextTrackCue;for(let n=0;n=16?p--:p++;const a=p0(r.trim()),o=Md(e,s,a);_!=null&&(t=_.cues)!=null&&t.getCueById(o)||(l=new i(e,s,a),l.id=o,l.line=n+1,l.align="left",l.position=10+Math.min(80,Math.floor(p*8/32)*10),A.push(l))}return _&&A.length&&(A.sort((n,a)=>n.line==="auto"||a.line==="auto"?0:n.line>8&&a.line>8?a.line-n.line:n.line-a.line),A.forEach(n=>Np(_,n))),A}},G8={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},C0=Dn(Dn({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:T0,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:y5,bufferController:b4,capLevelController:Pd,errorController:a5,fpsController:W4,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Sp,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:G8},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},j8()),{},{subtitleStreamController:g4,subtitleTrackController:y4,timelineController:H4,audioStreamController:p4,audioTrackController:m4,emeController:ra,cmcdController:x8,contentSteeringController:R8});function j8(){return{cueHandler:U8,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function V8(_,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const s=$c(_),u=["manifest","level","frag"],A=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return u.forEach(y=>{const l=`${y==="level"?"playlist":y}LoadPolicy`,c=e[l]===void 0,p=[];A.forEach(r=>{const i=`${y}Loading${r}`,t=e[i];if(t!==void 0&&c){p.push(i);const n=s[l].default;switch(e[l]={default:n},r){case"TimeOut":n.maxLoadTimeMs=t,n.maxTimeToFirstByteMs=t;break;case"MaxRetry":n.errorRetry.maxNumRetry=t,n.timeoutRetry.maxNumRetry=t;break;case"RetryDelay":n.errorRetry.retryDelayMs=t,n.timeoutRetry.retryDelayMs=t;break;case"MaxRetryTimeout":n.errorRetry.maxRetryDelayMs=t,n.timeoutRetry.maxRetryDelayMs=t;break}}}),p.length&&Ft.warn(`hls.js config: "${p.join('", "')}" setting(s) are deprecated, use "${l}": ${JSON.stringify(e[l])}`)}),Dn(Dn({},s),e)}function $c(_){return _&&typeof _=="object"?Array.isArray(_)?_.map($c):Object.keys(_).reduce((e,s)=>(e[s]=$c(_[s]),e),{}):_}function H8(_){const e=_.loader;e!==vf&&e!==T0?(Ft.log("[config]: Custom loader detected, cannot enable progressive streaming"),_.progressive=!1):L8()&&(_.loader=vf,_.progressive=!0,_.enableSoftwareAES=!0,Ft.log("[config]: Progressive streaming enabled, using FetchLoader"))}let Cc;class z8 extends Sd{constructor(e,s){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=s,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.on(rt.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(rt.LEVEL_LOADED,this.onLevelLoaded,this),e.on(rt.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(rt.FRAG_BUFFERED,this.onFragBuffered,this),e.on(rt.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(rt.MANIFEST_LOADING,this.onManifestLoading,this),e.off(rt.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(rt.LEVEL_LOADED,this.onLevelLoaded,this),e.off(rt.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(rt.FRAG_BUFFERED,this.onFragBuffered,this),e.off(rt.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(s=>{s.loadError=0,s.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,s){this.resetLevels()}onManifestLoaded(e,s){const u=this.hls.config.preferManagedMediaSource,A=[],y={},l={};let c=!1,p=!1,r=!1;s.levels.forEach(i=>{var t,n;const a=i.attrs;let{audioCodec:o,videoCodec:d}=i;((t=o)==null?void 0:t.indexOf("mp4a.40.34"))!==-1&&(Cc||(Cc=/chrome|firefox/i.test(navigator.userAgent)),Cc&&(i.audioCodec=o=void 0)),o&&(i.audioCodec=o=Lo(o,u)),((n=d)==null?void 0:n.indexOf("avc1"))===0&&(d=i.videoCodec=P_(d));const{width:g,height:m,unknownCodecs:v}=i;if(c||(c=!!(g&&m)),p||(p=!!d),r||(r=!!o),v!=null&&v.length||o&&!uc(o,"audio",u)||d&&!uc(d,"video",u))return;const{CODECS:b,"FRAME-RATE":w,"HDCP-LEVEL":C,"PATHWAY-ID":D,RESOLUTION:R,"VIDEO-RANGE":T}=a,L=`${`${D||"."}-`}${i.bitrate}-${R}-${w}-${b}-${T}-${C}`;if(y[L])if(y[L].uri!==i.url&&!i.attrs["PATHWAY-ID"]){const I=l[L]+=1;i.attrs["PATHWAY-ID"]=new Array(I+1).join(".");const x=new la(i);y[L]=x,A.push(x)}else y[L].addGroupId("audio",a.AUDIO),y[L].addGroupId("text",a.SUBTITLES);else{const I=new la(i);y[L]=I,l[L]=1,A.push(I)}}),this.filterAndSortMediaOptions(A,s,c,p,r)}filterAndSortMediaOptions(e,s,u,A,y){let l=[],c=[],p=e;if((u||A)&&y&&(p=p.filter(({videoCodec:o,videoRange:d,width:g,height:m})=>(!!o||!!(g&&m))&&Y_(d))),p.length===0){Promise.resolve().then(()=>{if(this.hls){s.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(s.levels[0].attrs)}`);const o=new Error("no level with compatible codecs found in manifest");this.hls.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:s.url,error:o,reason:o.message})}});return}if(s.audioTracks){const{preferManagedMediaSource:o}=this.hls.config;l=s.audioTracks.filter(d=>!d.audioCodec||uc(d.audioCodec,"audio",o)),bf(l)}s.subtitles&&(c=s.subtitles,bf(c));const r=p.slice(0);p.sort((o,d)=>{if(o.attrs["HDCP-LEVEL"]!==d.attrs["HDCP-LEVEL"])return(o.attrs["HDCP-LEVEL"]||"")>(d.attrs["HDCP-LEVEL"]||"")?1:-1;if(u&&o.height!==d.height)return o.height-d.height;if(o.frameRate!==d.frameRate)return o.frameRate-d.frameRate;if(o.videoRange!==d.videoRange)return Do.indexOf(o.videoRange)-Do.indexOf(d.videoRange);if(o.videoCodec!==d.videoCodec){const g=wh(o.videoCodec),m=wh(d.videoCodec);if(g!==m)return m-g}if(o.uri===d.uri&&o.codecSet!==d.codecSet){const g=Io(o.codecSet),m=Io(d.codecSet);if(g!==m)return m-g}return o.bitrate!==d.bitrate?o.bitrate-d.bitrate:0});let i=r[0];if(this.steering&&(p=this.steering.filterParsedLevels(p),p.length!==r.length)){for(let o=0;og&&g===C0.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=m)}break}const n=y&&!A,a={levels:p,audioTracks:l,subtitleTracks:c,sessionData:s.sessionData,sessionKeys:s.sessionKeys,firstLevel:this._firstLevel,stats:s.stats,audio:y,video:A,altAudio:!n&&l.some(o=>!!o.url)};this.hls.trigger(rt.MANIFEST_PARSED,a),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const s=this._levels;if(s.length===0)return;if(e<0||e>=s.length){const i=new Error("invalid level idx"),t=e<0;if(this.hls.trigger(rt.ERROR,{type:Wi.OTHER_ERROR,details:qt.LEVEL_SWITCH_ERROR,level:e,fatal:t,error:i,reason:i.message}),t)return;e=Math.min(e,s.length-1)}const u=this.currentLevelIndex,A=this.currentLevel,y=A?A.attrs["PATHWAY-ID"]:void 0,l=s[e],c=l.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=l,u===e&&l.details&&A&&y===c)return;this.log(`Switching to level ${e} (${l.height?l.height+"p ":""}${l.videoRange?l.videoRange+" ":""}${l.codecSet?l.codecSet+" ":""}@${l.bitrate})${c?" with Pathway "+c:""} from level ${u}${y?" with Pathway "+y:""}`);const p={level:e,attrs:l.attrs,details:l.details,bitrate:l.bitrate,averageBitrate:l.averageBitrate,maxBitrate:l.maxBitrate,realBitrate:l.realBitrate,width:l.width,height:l.height,codecSet:l.codecSet,audioCodec:l.audioCodec,videoCodec:l.videoCodec,audioGroups:l.audioGroups,subtitleGroups:l.subtitleGroups,loaded:l.loaded,loadError:l.loadError,fragmentError:l.fragmentError,name:l.name,id:l.id,uri:l.uri,url:l.url,urlId:0,audioGroupIds:l.audioGroupIds,textGroupIds:l.textGroupIds};this.hls.trigger(rt.LEVEL_SWITCHING,p);const r=l.details;if(!r||r.live){const i=this.switchParams(l.uri,A==null?void 0:A.details);this.loadPlaylist(i)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,s){s.fatal||!s.context||s.context.type===ln.LEVEL&&s.context.level===this.level&&this.checkRetry(s)}onFragBuffered(e,{frag:s}){if(s!==void 0&&s.type===Hi.MAIN){const u=s.elementaryStreams;if(!Object.keys(u).some(y=>!!u[y]))return;const A=this._levels[s.level];A!=null&&A.loadError&&(this.log(`Resetting level error count of ${A.loadError} on frag buffered`),A.loadError=0)}}onLevelLoaded(e,s){var u;const{level:A,details:y}=s,l=this._levels[A];if(!l){var c;this.warn(`Invalid level index ${A}`),(c=s.deliveryDirectives)!=null&&c.skip&&(y.deltaUpdateFailed=!0);return}A===this.currentLevelIndex?(l.fragmentError===0&&(l.loadError=0),this.playlistLoaded(A,s,l.details)):(u=s.deliveryDirectives)!=null&&u.skip&&(y.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const s=this.currentLevelIndex,u=this.currentLevel;if(u&&this.shouldLoadPlaylist(u)){let A=u.uri;if(e)try{A=e.addDirectives(A)}catch(l){this.warn(`Could not construct new URL with HLS Delivery Directives: ${l}`)}const y=u.attrs["PATHWAY-ID"];this.log(`Loading level index ${s}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${y?" Pathway "+y:""} ${A}`),this.clearTimer(),this.hls.trigger(rt.LEVEL_LOADING,{url:A,level:s,pathwayId:u.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var s;const u=this._levels.filter((A,y)=>y!==e?!0:(this.steering&&this.steering.removeLevel(A),A===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,A.details&&A.details.fragments.forEach(l=>l.level=-1)),!1));jp(u),this._levels=u,this.currentLevelIndex>-1&&(s=this.currentLevel)!=null&&s.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(rt.LEVELS_UPDATED,{levels:u})}onLevelsUpdated(e,{levels:s}){this._levels=s}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:s,maxHdcpLevel:u}=this.hls;this._maxAutoLevel!==s&&(this._maxAutoLevel=s,this.hls.trigger(rt.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:s,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:u}))}}function bf(_){const e={};_.forEach(s=>{const u=s.groupId||"";s.id=e[u]=e[u]||0,e[u]++})}class W8{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const u in this.keyUriToKeyInfo){const A=this.keyUriToKeyInfo[u].loader;if(A){var s;if(e&&e!==((s=A.context)==null?void 0:s.frag.type))return;A.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const s=this.keyUriToKeyInfo[e];(s.mediaKeySessionContext||s.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const s=this.keyUriToKeyInfo[e].loader;s&&s.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,s=qt.KEY_LOAD_ERROR,u,A,y){return new Qr({type:Wi.NETWORK_ERROR,details:s,fatal:!1,frag:e,response:y,error:u,networkDetails:A})}loadClear(e,s){if(this.emeController&&this.config.emeEnabled){const{sn:u,cc:A}=e;for(let y=0;y{l.setKeyFormat(c)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(s=>this.loadInternal(e,s)):this.loadInternal(e)}loadInternal(e,s){var u,A;s&&e.setKeyFormat(s);const y=e.decryptdata;if(!y){const r=new Error(s?`Expected frag.decryptdata to be defined after setting format ${s}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,qt.KEY_LOAD_ERROR,r))}const l=y.uri;if(!l)return Promise.reject(this.createKeyLoadError(e,qt.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${l}"`)));let c=this.keyUriToKeyInfo[l];if((u=c)!=null&&u.decryptdata.key)return y.key=c.decryptdata.key,Promise.resolve({frag:e,keyInfo:c});if((A=c)!=null&&A.keyLoadPromise){var p;switch((p=c.mediaKeySessionContext)==null?void 0:p.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return c.keyLoadPromise.then(r=>(y.key=r.keyInfo.decryptdata.key,{frag:e,keyInfo:c}))}}switch(c=this.keyUriToKeyInfo[l]={decryptdata:y,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},y.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return y.keyFormat==="identity"?this.loadKeyHTTP(c,e):this.loadKeyEME(c,e);case"AES-128":return this.loadKeyHTTP(c,e);default:return Promise.reject(this.createKeyLoadError(e,qt.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${y.method}"`)))}}loadKeyEME(e,s){const u={frag:s,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const A=this.emeController.loadKey(u);if(A)return(e.keyLoadPromise=A.then(y=>(e.mediaKeySessionContext=y,u))).catch(y=>{throw e.keyLoadPromise=null,y})}return Promise.resolve(u)}loadKeyHTTP(e,s){const u=this.config,A=u.loader,y=new A(u);return s.keyLoader=e.loader=y,e.keyLoadPromise=new Promise((l,c)=>{const p={keyInfo:e,frag:s,responseType:"arraybuffer",url:e.decryptdata.uri},r=u.keyLoadPolicy.default,i={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},t={onSuccess:(n,a,o,d)=>{const{frag:g,keyInfo:m,url:v}=o;if(!g.decryptdata||m!==this.keyUriToKeyInfo[v])return c(this.createKeyLoadError(g,qt.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),d));m.decryptdata.key=g.decryptdata.key=new Uint8Array(n.data),g.keyLoader=null,m.loader=null,l({frag:g,keyInfo:m})},onError:(n,a,o,d)=>{this.resetLoader(a),c(this.createKeyLoadError(s,qt.KEY_LOAD_ERROR,new Error(`HTTP Error ${n.code} loading key ${n.text}`),o,Dn({url:p.url,data:void 0},n)))},onTimeout:(n,a,o)=>{this.resetLoader(a),c(this.createKeyLoadError(s,qt.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),o))},onAbort:(n,a,o)=>{this.resetLoader(a),c(this.createKeyLoadError(s,qt.INTERNAL_ABORTED,new Error("key loading aborted"),o))}};y.load(p,i,t)})}resetLoader(e){const{frag:s,keyInfo:u,url:A}=e,y=u.loader;s.keyLoader===y&&(s.keyLoader=null,u.loader=null),delete this.keyUriToKeyInfo[A],y&&y.destroy()}}function x0(){return self.SourceBuffer||self.WebKitSourceBuffer}function k0(){if(!ua())return!1;const e=x0();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function K8(){if(!k0())return!1;const _=ua();return typeof(_==null?void 0:_.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>_.isTypeSupported(La(e,"video")))||["mp4a.40.2","fLaC"].some(e=>_.isTypeSupported(La(e,"audio"))))}function q8(){var _;const e=x0();return typeof(e==null||(_=e.prototype)==null?void 0:_.changeType)=="function"}const Y8=250,bo=2,J8=.1,Q8=.05;class Z8{constructor(e,s,u,A){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=s,this.fragmentTracker=u,this.hls=A}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,s){const{config:u,media:A,stalled:y}=this;if(A===null)return;const{currentTime:l,seeking:c}=A,p=this.seeking&&!c,r=!this.seeking&&c;if(this.seeking=c,l!==e){if(this.moved=!0,c||(this.nudgeRetry=0),y!==null){if(this.stallReported){const g=self.performance.now()-y;Ft.warn(`playback not stuck anymore @${l}, after ${Math.round(g)}ms`),this.stallReported=!1}this.stalled=null}return}if(r||p){this.stalled=null;return}if(A.paused&&!c||A.ended||A.playbackRate===0||!mn.getBuffered(A).length){this.nudgeRetry=0;return}const i=mn.bufferInfo(A,l,0),t=i.nextStart||0;if(c){const g=i.len>bo,m=!t||s&&s.start<=l||t-l>bo&&!this.fragmentTracker.getPartialFragment(l);if(g||m)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var n;if(!(i.len>0)&&!t)return;const m=Math.max(t,i.start||0)-l,v=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,w=(v==null||(n=v.details)==null?void 0:n.live)?v.details.targetduration*2:bo,C=this.fragmentTracker.getPartialFragment(l);if(m>0&&(m<=w||C)){A.paused||this._trySkipBufferHole(C);return}}const a=self.performance.now();if(y===null){this.stalled=a;return}const o=a-y;if(!c&&o>=Y8&&(this._reportStall(i),!this.media))return;const d=mn.bufferInfo(A,l,u.maxBufferHole);this._tryFixBufferStall(d,o)}_tryFixBufferStall(e,s){const{config:u,fragmentTracker:A,media:y}=this;if(y===null)return;const l=y.currentTime,c=A.getPartialFragment(l);c&&(this._trySkipBufferHole(c)||!this.media)||(e.len>u.maxBufferHole||e.nextStart&&e.nextStart-lu.highBufferWatchdogPeriod*1e3&&(Ft.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:s,media:u,stallReported:A}=this;if(!A&&u){this.stallReported=!0;const y=new Error(`Playback stalling at @${u.currentTime} due to low buffer (${JSON.stringify(e)})`);Ft.warn(y.message),s.trigger(rt.ERROR,{type:Wi.MEDIA_ERROR,details:qt.BUFFER_STALLED_ERROR,fatal:!1,error:y,buffer:e.len})}}_trySkipBufferHole(e){const{config:s,hls:u,media:A}=this;if(A===null)return 0;const y=A.currentTime,l=mn.bufferInfo(A,y,0),c=y0&&l.len<1&&A.readyState<3,i=c-y;if(i>0&&(p||r)){if(i>s.maxBufferHole){const{fragmentTracker:n}=this;let a=!1;if(y===0){const o=n.getAppendedFrag(0,Hi.MAIN);o&&c1?(A=0,this.bitrateTest=!0):A=u.firstAutoLevel),this.level=u.nextLoadLevel=A,this.loadedmetadata=!1}s>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${s.toFixed(3)}`),e=s),this.state=ni.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=ni.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case ni.WAITING_LEVEL:{const{levels:s,level:u}=this,A=s==null?void 0:s[u],y=A==null?void 0:A.details;if(y&&(!y.live||this.levelLastLoaded===A)){if(this.waitForCdnTuneIn(y))break;this.state=ni.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=ni.IDLE;break}break}case ni.FRAG_LOADING_WAITING_RETRY:{var e;const s=self.performance.now(),u=this.retryDate;if(!u||s>=u||(e=this.media)!=null&&e.seeking){const{levels:A,level:y}=this,l=A==null?void 0:A[y];this.resetStartWhenNotLoaded(l||null),this.state=ni.IDLE}}break}this.state===ni.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:s,levels:u,media:A}=this,{config:y,nextLoadLevel:l}=e;if(s===null||!A&&(this.startFragRequested||!y.startFragPrefetch)||this.altAudio&&this.audioOnly||!(u!=null&&u[l]))return;const c=u[l],p=this.getMainFwdBufferInfo();if(p===null)return;const r=this.getLevelDetails();if(r&&this._streamEnded(p,r)){const g={};this.altAudio&&(g.type="video"),this.hls.trigger(rt.BUFFER_EOS,g),this.state=ni.ENDED;return}e.loadLevel!==l&&e.manualLevel===-1&&this.log(`Adapting to level ${l} from level ${this.level}`),this.level=e.nextLoadLevel=l;const i=c.details;if(!i||this.state===ni.WAITING_LEVEL||i.live&&this.levelLastLoaded!==c){this.level=l,this.state=ni.WAITING_LEVEL;return}const t=p.len,n=this.getMaxBufferLength(c.maxBitrate);if(t>=n)return;this.backtrackFragment&&this.backtrackFragment.start>p.end&&(this.backtrackFragment=null);const a=this.backtrackFragment?this.backtrackFragment.start:p.end;let o=this.getNextFragment(a,i);if(this.couldBacktrack&&!this.fragPrevious&&o&&o.sn!=="initSegment"&&this.fragmentTracker.getState(o)!==Fn.OK){var d;const m=((d=this.backtrackFragment)!=null?d:o).sn-i.startSN,v=i.fragments[m-1];v&&o.cc===v.cc&&(o=v,this.fragmentTracker.removeFragment(v))}else this.backtrackFragment&&p.len&&(this.backtrackFragment=null);if(o&&this.isLoopLoading(o,a)){if(!o.gap){const m=this.audioOnly&&!this.altAudio?fn.AUDIO:fn.VIDEO,v=(m===fn.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;v&&this.afterBufferFlushed(v,m,Hi.MAIN)}o=this.getNextFragmentLoopLoading(o,i,p,Hi.MAIN,n)}o&&(o.initSegment&&!o.initSegment.data&&!this.bitrateTest&&(o=o.initSegment),this.loadFragment(o,c,a))}loadFragment(e,s,u){const A=this.fragmentTracker.getState(e);this.fragCurrent=e,A===Fn.NOT_LOADED||A===Fn.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,s):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,s)):(this.startFragRequested=!0,super.loadFragment(e,s,u)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,Hi.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:s}=this;if(s!=null&&s.readyState){let u;const A=this.getAppendedFrag(s.currentTime);A&&A.start>1&&this.flushMainBuffer(0,A.start-1);const y=this.getLevelDetails();if(y!=null&&y.live){const c=this.getMainFwdBufferInfo();if(!c||c.len{const l=y.audioCodec;l&&(u=u||l.indexOf("mp4a.40.2")!==-1,A=A||l.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=u&&A&&!q8(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=s.levels,this.startFragRequested=!1}onLevelLoading(e,s){const{levels:u}=this;if(!u||this.state!==ni.IDLE)return;const A=u[s.level];(!A.details||A.details.live&&this.levelLastLoaded!==A||this.waitForCdnTuneIn(A.details))&&(this.state=ni.WAITING_LEVEL)}onLevelLoaded(e,s){var u;const{levels:A}=this,y=s.level,l=s.details,c=l.totalduration;if(!A){this.warn(`Levels were reset while loading level ${y}`);return}this.log(`Level ${y} loaded [${l.startSN},${l.endSN}]${l.lastPartSn?`[part-${l.lastPartSn}-${l.lastPartIndex}]`:""}, cc [${l.startCC}, ${l.endCC}] duration:${c}`);const p=A[y],r=this.fragCurrent;r&&(this.state===ni.FRAG_LOADING||this.state===ni.FRAG_LOADING_WAITING_RETRY)&&r.level!==s.level&&r.loader&&this.abortCurrentFrag();let i=0;if(l.live||(u=p.details)!=null&&u.live){var t;if(this.checkLiveUpdate(l),l.deltaUpdateFailed)return;i=this.alignPlaylists(l,p.details,(t=this.levelLastLoaded)==null?void 0:t.details)}if(p.details=l,this.levelLastLoaded=p,this.hls.trigger(rt.LEVEL_UPDATED,{details:l,level:y}),this.state===ni.WAITING_LEVEL){if(this.waitForCdnTuneIn(l))return;this.state=ni.IDLE}this.startFragRequested?l.live&&this.synchronizeToLiveEdge(l):this.setStartPosition(l,i),this.tick()}_handleFragmentLoadProgress(e){var s;const{frag:u,part:A,payload:y}=e,{levels:l}=this;if(!l){this.warn(`Levels were reset while fragment load was in progress. Fragment ${u.sn} of level ${u.level} will not be buffered`);return}const c=l[u.level],p=c.details;if(!p){this.warn(`Dropping fragment ${u.sn} of level ${u.level} after level details were reset`),this.fragmentTracker.removeFragment(u);return}const r=c.videoCodec,i=p.PTSKnown||!p.live,t=(s=u.initSegment)==null?void 0:s.data,n=this._getAudioCodec(c),a=this.transmuxer=this.transmuxer||new l0(this.hls,Hi.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),o=A?A.index:-1,d=o!==-1,g=new Td(u.level,u.sn,u.stats.chunkCount,y.byteLength,o,d),m=this.initPTS[u.cc];a.push(y,t,n,r,u,A,p.totalduration,i,g,m)}onAudioTrackSwitching(e,s){const u=this.altAudio;if(!!!s.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const l=this.fragCurrent;l&&(this.log("Switching to main audio track, cancel main fragment load"),l.abortRequests(),this.fragmentTracker.removeFragment(l)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const y=this.hls;u&&(y.trigger(rt.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),y.trigger(rt.AUDIO_TRACK_SWITCHED,s)}}onAudioTrackSwitched(e,s){const u=s.id,A=!!this.hls.audioTracks[u].url;if(A){const y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=A,this.tick()}onBufferCreated(e,s){const u=s.tracks;let A,y,l=!1;for(const c in u){const p=u[c];if(p.id==="main"){if(y=c,A=p,c==="video"){const r=u[c];r&&(this.videoBuffer=r.buffer)}}else l=!0}l&&A?(this.log(`Alternate track found, use ${y}.buffered to schedule main fragment loading`),this.mediaBuffer=A.buffer):this.mediaBuffer=this.media}onFragBuffered(e,s){const{frag:u,part:A}=s;if(u&&u.type!==Hi.MAIN)return;if(this.fragContextChanged(u)){this.warn(`Fragment ${u.sn}${A?" p: "+A.index:""} of level ${u.level} finished buffering, but was aborted. state: ${this.state}`),this.state===ni.PARSED&&(this.state=ni.IDLE);return}const y=A?A.stats:u.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),u.sn!=="initSegment"&&(this.fragPrevious=u),this.fragBufferedComplete(u,A)}onError(e,s){var u;if(s.fatal){this.state=ni.ERROR;return}switch(s.details){case qt.FRAG_GAP:case qt.FRAG_PARSING_ERROR:case qt.FRAG_DECRYPT_ERROR:case qt.FRAG_LOAD_ERROR:case qt.FRAG_LOAD_TIMEOUT:case qt.KEY_LOAD_ERROR:case qt.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Hi.MAIN,s);break;case qt.LEVEL_LOAD_ERROR:case qt.LEVEL_LOAD_TIMEOUT:case qt.LEVEL_PARSING_ERROR:!s.levelRetry&&this.state===ni.WAITING_LEVEL&&((u=s.context)==null?void 0:u.type)===ln.LEVEL&&(this.state=ni.IDLE);break;case qt.BUFFER_APPEND_ERROR:case qt.BUFFER_FULL_ERROR:if(!s.parent||s.parent!=="main")return;if(s.details===qt.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(s)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case qt.INTERNAL_EXCEPTION:this.recoverWorkerError(s);break}}checkBuffer(){const{media:e,gapController:s}=this;if(!(!e||!s||!e.readyState)){if(this.loadedmetadata||!mn.getBuffered(e).length){const u=this.state!==ni.IDLE?this.fragCurrent:null;s.poll(this.lastCurrentTime,u)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=ni.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:s}){if(s!==fn.AUDIO||this.audioOnly&&!this.altAudio){const u=(s===fn.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(u,s,Hi.MAIN),this.tick()}}onLevelsUpdated(e,s){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=s.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const s=e.currentTime;let u=this.startPosition;if(u>=0&&s0&&(l{const{hls:A}=this;if(!u||this.fragContextChanged(e))return;s.fragmentError=0,this.state=ni.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const y=e.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),A.trigger(rt.FRAG_LOADED,u),e.bitrateTest=!1})}_handleTransmuxComplete(e){var s;const u="main",{hls:A}=this,{remuxResult:y,chunkMeta:l}=e,c=this.getCurrentContext(l);if(!c){this.resetWhenMissingContext(l);return}const{frag:p,part:r,level:i}=c,{video:t,text:n,id3:a,initSegment:o}=y,{details:d}=i,g=this.altAudio?void 0:y.audio;if(this.fragContextChanged(p)){this.fragmentTracker.removeFragment(p);return}if(this.state=ni.PARSING,o){if(o!=null&&o.tracks){const b=p.initSegment||p;this._bufferInitSegment(i,o.tracks,b,l),A.trigger(rt.FRAG_PARSING_INIT_SEGMENT,{frag:b,id:u,tracks:o.tracks})}const m=o.initPTS,v=o.timescale;Ci(m)&&(this.initPTS[p.cc]={baseTime:m,timescale:v},A.trigger(rt.INIT_PTS_FOUND,{frag:p,id:u,initPTS:m,timescale:v}))}if(t&&d&&p.sn!=="initSegment"){const m=d.fragments[p.sn-1-d.startSN],v=p.sn===d.startSN,b=!m||p.cc>m.cc;if(y.independent!==!1){const{startPTS:w,endPTS:C,startDTS:D,endDTS:R}=t;if(r)r.elementaryStreams[t.type]={startPTS:w,endPTS:C,startDTS:D,endDTS:R};else if(t.firstKeyFrame&&t.independent&&l.id===1&&!b&&(this.couldBacktrack=!0),t.dropped&&t.independent){const T=this.getMainFwdBufferInfo(),P=(T?T.end:this.getLoadPosition())+this.config.maxBufferHole,L=t.firstKeyFramePTS?t.firstKeyFramePTS:w;if(!v&&Pbo&&(p.gap=!0);p.setElementaryStreamInfo(t.type,w,C,D,R),this.backtrackFragment&&(this.backtrackFragment=p),this.bufferFragmentData(t,p,r,l,v||b)}else if(v||b)p.gap=!0;else{this.backtrack(p);return}}if(g){const{startPTS:m,endPTS:v,startDTS:b,endDTS:w}=g;r&&(r.elementaryStreams[fn.AUDIO]={startPTS:m,endPTS:v,startDTS:b,endDTS:w}),p.setElementaryStreamInfo(fn.AUDIO,m,v,b,w),this.bufferFragmentData(g,p,r,l)}if(d&&a!=null&&(s=a.samples)!=null&&s.length){const m={id:u,frag:p,details:d,samples:a.samples};A.trigger(rt.FRAG_PARSING_METADATA,m)}if(d&&n){const m={id:u,frag:p,details:d,samples:n.samples};A.trigger(rt.FRAG_PARSING_USERDATA,m)}}_bufferInitSegment(e,s,u,A){if(this.state!==ni.PARSING)return;this.audioOnly=!!s.audio&&!s.video,this.altAudio&&!this.audioOnly&&delete s.audio;const{audio:y,video:l,audiovideo:c}=s;if(y){let p=e.audioCodec;const r=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(p&&(p.indexOf("mp4a.40.5")!==-1?p="mp4a.40.2":p="mp4a.40.5"),y.metadata.channelCount!==1&&r.indexOf("firefox")===-1&&(p="mp4a.40.5")),p&&p.indexOf("mp4a.40.5")!==-1&&r.indexOf("android")!==-1&&y.container!=="audio/mpeg"&&(p="mp4a.40.2",this.log(`Android: force audio codec to ${p}`)),e.audioCodec&&e.audioCodec!==p&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${p}"`),y.levelCodec=p,y.id="main",this.log(`Init audio buffer, container:${y.container}, codecs[selected/level/parsed]=[${p||""}/${e.audioCodec||""}/${y.codec}]`)}l&&(l.levelCodec=e.videoCodec,l.id="main",this.log(`Init video buffer, container:${l.container}, codecs[level/parsed]=[${e.videoCodec||""}/${l.codec}]`)),c&&this.log(`Init audiovideo buffer, container:${c.container}, codecs[level/parsed]=[${e.codecs}/${c.codec}]`),this.hls.trigger(rt.BUFFER_CODECS,s),Object.keys(s).forEach(p=>{const i=s[p].initSegment;i!=null&&i.byteLength&&this.hls.trigger(rt.BUFFER_APPENDING,{type:p,data:i,frag:u,part:null,chunkMeta:A,parent:u.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,Hi.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=ni.IDLE}checkFragmentChanged(){const e=this.media;let s=null;if(e&&e.readyState>1&&e.seeking===!1){const u=e.currentTime;if(mn.isBuffered(e,u)?s=this.getAppendedFrag(u):mn.isBuffered(e,u+.1)&&(s=this.getAppendedFrag(u+.1)),s){this.backtrackFragment=null;const A=this.fragPlaying,y=s.level;(!A||s.sn!==A.sn||A.level!==y)&&(this.fragPlaying=s,this.hls.trigger(rt.FRAG_CHANGED,{frag:s}),(!A||A.level!==y)&&this.hls.trigger(rt.LEVEL_SWITCHED,{level:y}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const s=e.currentTime,u=this.currentFrag;if(u&&Ci(s)&&Ci(u.programDateTime)){const A=u.programDateTime+(s-u.start)*1e3;return new Date(A)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class ls{static get version(){return"1.5.1-patch.1"}static isMSESupported(){return k0()}static isSupported(){return K8()}static getMediaSource(){return ua()}static get Events(){return rt}static get ErrorTypes(){return Wi}static get ErrorDetails(){return qt}static get DefaultConfig(){return ls.defaultConfig?ls.defaultConfig:C0}static set DefaultConfig(e){ls.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Dd,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,qb(e.debug||!1,"Hls instance");const s=this.config=V8(ls.DefaultConfig,e);this.userConfig=e,s.progressive&&H8(s);const{abrController:u,bufferController:A,capLevelController:y,errorController:l,fpsController:c}=s,p=new l(this),r=this.abrController=new u(this),i=this.bufferController=new A(this),t=this.capLevelController=new y(this),n=new c(this),a=new G_(this),o=new W_(this),d=s.contentSteeringController,g=d?new d(this):null,m=this.levelController=new z8(this,g),v=new b5(this),b=new W8(this.config),w=this.streamController=new $8(this,v,b);t.setStreamController(w),n.setStreamController(w);const C=[a,m,w];g&&C.splice(1,0,g),this.networkControllers=C;const D=[r,i,t,n,o,v];this.audioTrackController=this.createController(s.audioTrackController,C);const R=s.audioStreamController;R&&C.push(new R(this,v,b)),this.subtitleTrackController=this.createController(s.subtitleTrackController,C);const T=s.subtitleStreamController;T&&C.push(new T(this,v,b)),this.createController(s.timelineController,D),b.emeController=this.emeController=this.createController(s.emeController,D),this.cmcdController=this.createController(s.cmcdController,D),this.latencyController=this.createController(K_,D),this.coreComponents=D,C.push(p);const P=p.onErrorOut;typeof P=="function"&&this.on(rt.ERROR,P,p)}createController(e,s){if(e){const u=new e(this);return s&&s.push(u),u}return null}on(e,s,u=this){this._emitter.on(e,s,u)}once(e,s,u=this){this._emitter.once(e,s,u)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,s,u=this,A){this._emitter.off(e,s,u,A)}listeners(e){return this._emitter.listeners(e)}emit(e,s,u){return this._emitter.emit(e,s,u)}trigger(e,s){if(this.config.debug)return this.emit(e,e,s);try{return this.emit(e,e,s)}catch(u){if(Ft.error("An internal error happened while handling event "+e+'. Error message: "'+u.message+'". Here is a stacktrace:',u),!this.triggeringException){this.triggeringException=!0;const A=e===rt.ERROR;this.trigger(rt.ERROR,{type:Wi.OTHER_ERROR,details:qt.INTERNAL_EXCEPTION,fatal:A,event:e,error:u}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){Ft.log("destroy"),this.trigger(rt.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(s=>s.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(s=>s.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){Ft.log("attachMedia"),this._media=e,this.trigger(rt.MEDIA_ATTACHING,{media:e})}detachMedia(){Ft.log("detachMedia"),this.trigger(rt.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const s=this.media,u=this.url,A=this.url=yd.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,Ft.log(`loadSource:${A}`),s&&u&&(u!==A||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(s)),this.trigger(rt.MANIFEST_LOADING,{url:e})}startLoad(e=-1){Ft.log(`startLoad(${e})`),this.started=!0,this.networkControllers.forEach(s=>{s.startLoad(e)})}stopLoad(){Ft.log("stopLoad"),this.started=!1,this.networkControllers.forEach(e=>{e.stopLoad()})}resumeBuffering(){this.started&&this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.startLoad(-1)})}pauseBuffering(){this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.stopLoad()})}swapAudioCodec(){Ft.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){Ft.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){Ft.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){Ft.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){Ft.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){Ft.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){Ft.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const s=!!e;s!==this.config.capLevelToPlayerSize&&(s?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=s)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(Ft.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){q_(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:s}}=this;if(!e)return 0;const u=e.length;for(let A=0;A=s)return A;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:s,maxHdcpLevel:u}=this;let A;if(s===-1&&e!=null&&e.length?A=e.length-1:A=s,u)for(let y=A;y--;){const l=e[y].attrs["HDCP-LEVEL"];if(l&&l<=u)return y}return A}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var s;return(s=this.audioTrackController)==null?void 0:s.setAudioOption(e)}setSubtitleOption(e){var s;return(s=this.subtitleTrackController)==null||s.setSubtitleOption(e),null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const s=this.audioTrackController;s&&(s.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const s=this.subtitleTrackController;s&&(s.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const s=this.subtitleTrackController;s&&(s.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}ls.defaultConfig=void 0;var R0={exports:{}};(function(_,e){(function(s,u){_.exports=u()})(window,function(){return function(s){var u={};function A(y){if(u[y])return u[y].exports;var l=u[y]={i:y,l:!1,exports:{}};return s[y].call(l.exports,l,l.exports,A),l.l=!0,l.exports}return A.m=s,A.c=u,A.d=function(y,l,c){A.o(y,l)||Object.defineProperty(y,l,{enumerable:!0,get:c})},A.r=function(y){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},A.t=function(y,l){if(1&l&&(y=A(y)),8&l||4&l&&typeof y=="object"&&y&&y.__esModule)return y;var c=Object.create(null);if(A.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:y}),2&l&&typeof y!="string")for(var p in y)A.d(c,p,(function(r){return y[r]}).bind(null,p));return c},A.n=function(y){var l=y&&y.__esModule?function(){return y.default}:function(){return y};return A.d(l,"a",l),l},A.o=function(y,l){return Object.prototype.hasOwnProperty.call(y,l)},A.p="",A(A.s=24)}([function(s,u,A){var y=A(9),l=A.n(y),c=function(){function p(){}return p.e=function(r,i){r&&!p.FORCE_GLOBAL_TAG||(r=p.GLOBAL_TAG);var t="[".concat(r,"] > ").concat(i);p.ENABLE_CALLBACK&&p.emitter.emit("log","error",t),p.ENABLE_ERROR&&(console.error?console.error(t):console.warn?console.warn(t):console.log(t))},p.i=function(r,i){r&&!p.FORCE_GLOBAL_TAG||(r=p.GLOBAL_TAG);var t="[".concat(r,"] > ").concat(i);p.ENABLE_CALLBACK&&p.emitter.emit("log","info",t),p.ENABLE_INFO&&(console.info?console.info(t):console.log(t))},p.w=function(r,i){r&&!p.FORCE_GLOBAL_TAG||(r=p.GLOBAL_TAG);var t="[".concat(r,"] > ").concat(i);p.ENABLE_CALLBACK&&p.emitter.emit("log","warn",t),p.ENABLE_WARN&&(console.warn?console.warn(t):console.log(t))},p.d=function(r,i){r&&!p.FORCE_GLOBAL_TAG||(r=p.GLOBAL_TAG);var t="[".concat(r,"] > ").concat(i);p.ENABLE_CALLBACK&&p.emitter.emit("log","debug",t),p.ENABLE_DEBUG&&(console.debug?console.debug(t):console.log(t))},p.v=function(r,i){r&&!p.FORCE_GLOBAL_TAG||(r=p.GLOBAL_TAG);var t="[".concat(r,"] > ").concat(i);p.ENABLE_CALLBACK&&p.emitter.emit("log","verbose",t),p.ENABLE_VERBOSE&&console.log(t)},p}();c.GLOBAL_TAG="mpegts.js",c.FORCE_GLOBAL_TAG=!1,c.ENABLE_ERROR=!0,c.ENABLE_INFO=!0,c.ENABLE_WARN=!0,c.ENABLE_DEBUG=!0,c.ENABLE_VERBOSE=!0,c.ENABLE_CALLBACK=!1,c.emitter=new l.a,u.a=c},function(s,u,A){var y;(function(l){l.IO_ERROR="io_error",l.DEMUX_ERROR="demux_error",l.INIT_SEGMENT="init_segment",l.MEDIA_SEGMENT="media_segment",l.LOADING_COMPLETE="loading_complete",l.RECOVERED_EARLY_EOF="recovered_early_eof",l.MEDIA_INFO="media_info",l.METADATA_ARRIVED="metadata_arrived",l.SCRIPTDATA_ARRIVED="scriptdata_arrived",l.TIMED_ID3_METADATA_ARRIVED="timed_id3_metadata_arrived",l.SYNCHRONOUS_KLV_METADATA_ARRIVED="synchronous_klv_metadata_arrived",l.ASYNCHRONOUS_KLV_METADATA_ARRIVED="asynchronous_klv_metadata_arrived",l.SMPTE2038_METADATA_ARRIVED="smpte2038_metadata_arrived",l.SCTE35_METADATA_ARRIVED="scte35_metadata_arrived",l.PES_PRIVATE_DATA_DESCRIPTOR="pes_private_data_descriptor",l.PES_PRIVATE_DATA_ARRIVED="pes_private_data_arrived",l.STATISTICS_INFO="statistics_info",l.RECOMMEND_SEEKPOINT="recommend_seekpoint"})(y||(y={})),u.a=y},function(s,u,A){A.d(u,"c",function(){return l}),A.d(u,"b",function(){return c}),A.d(u,"a",function(){return p});var y=A(3),l={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},c={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},p=function(){function r(i){this._type=i||"undefined",this._status=l.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return r.prototype.destroy=function(){this._status=l.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},r.prototype.isWorking=function(){return this._status===l.kConnecting||this._status===l.kBuffering},Object.defineProperty(r.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(i){this._onContentLengthKnown=i},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(i){this._onURLRedirect=i},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(i){this._onDataArrival=i},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onError",{get:function(){return this._onError},set:function(i){this._onError=i},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onComplete",{get:function(){return this._onComplete},set:function(i){this._onComplete=i},enumerable:!1,configurable:!0}),r.prototype.open=function(i,t){throw new y.c("Unimplemented abstract function!")},r.prototype.abort=function(){throw new y.c("Unimplemented abstract function!")},r}()},function(s,u,A){A.d(u,"d",function(){return c}),A.d(u,"a",function(){return p}),A.d(u,"b",function(){return r}),A.d(u,"c",function(){return i});var y,l=(y=function(t,n){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,o){a.__proto__=o}||function(a,o){for(var d in o)Object.prototype.hasOwnProperty.call(o,d)&&(a[d]=o[d])})(t,n)},function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function a(){this.constructor=t}y(t,n),t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}),c=function(){function t(n){this._message=n}return Object.defineProperty(t.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return this.name+": "+this.message},t}(),p=function(t){function n(a){return t.call(this,a)||this}return l(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),n}(c),r=function(t){function n(a){return t.call(this,a)||this}return l(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),n}(c),i=function(t){function n(a){return t.call(this,a)||this}return l(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),n}(c)},function(s,u,A){var y;(function(l){l.ERROR="error",l.LOADING_COMPLETE="loading_complete",l.RECOVERED_EARLY_EOF="recovered_early_eof",l.MEDIA_INFO="media_info",l.METADATA_ARRIVED="metadata_arrived",l.SCRIPTDATA_ARRIVED="scriptdata_arrived",l.TIMED_ID3_METADATA_ARRIVED="timed_id3_metadata_arrived",l.SYNCHRONOUS_KLV_METADATA_ARRIVED="synchronous_klv_metadata_arrived",l.ASYNCHRONOUS_KLV_METADATA_ARRIVED="asynchronous_klv_metadata_arrived",l.SMPTE2038_METADATA_ARRIVED="smpte2038_metadata_arrived",l.SCTE35_METADATA_ARRIVED="scte35_metadata_arrived",l.PES_PRIVATE_DATA_DESCRIPTOR="pes_private_data_descriptor",l.PES_PRIVATE_DATA_ARRIVED="pes_private_data_arrived",l.STATISTICS_INFO="statistics_info",l.DESTROYING="destroying"})(y||(y={})),u.a=y},function(s,u,A){var y={};(function(){var l=self.navigator.userAgent.toLowerCase(),c=/(edge)\/([\w.]+)/.exec(l)||/(opr)[\/]([\w.]+)/.exec(l)||/(chrome)[ \/]([\w.]+)/.exec(l)||/(iemobile)[\/]([\w.]+)/.exec(l)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(l)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(l)||/(webkit)[ \/]([\w.]+)/.exec(l)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(l)||/(msie) ([\w.]+)/.exec(l)||l.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(l)||l.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(l)||[],p=/(ipad)/.exec(l)||/(ipod)/.exec(l)||/(windows phone)/.exec(l)||/(iphone)/.exec(l)||/(kindle)/.exec(l)||/(android)/.exec(l)||/(windows)/.exec(l)||/(mac)/.exec(l)||/(linux)/.exec(l)||/(cros)/.exec(l)||[],r={browser:c[5]||c[3]||c[1]||"",version:c[2]||c[4]||"0",majorVersion:c[4]||c[2]||"0",platform:p[0]||""},i={};if(r.browser){i[r.browser]=!0;var t=r.majorVersion.split(".");i.version={major:parseInt(r.majorVersion,10),string:r.version},t.length>1&&(i.version.minor=parseInt(t[1],10)),t.length>2&&(i.version.build=parseInt(t[2],10))}r.platform&&(i[r.platform]=!0),(i.chrome||i.opr||i.safari)&&(i.webkit=!0),(i.rv||i.iemobile)&&(i.rv&&delete i.rv,r.browser="msie",i.msie=!0),i.edge&&(delete i.edge,r.browser="msedge",i.msedge=!0),i.opr&&(r.browser="opera",i.opera=!0),i.safari&&i.android&&(r.browser="android",i.android=!0);for(var n in i.name=r.browser,i.platform=r.platform,y)y.hasOwnProperty(n)&&delete y[n];Object.assign(y,i)})(),u.a=y},function(s,u,A){u.a={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},function(s,u,A){var y;(function(l){l.ERROR="error",l.SOURCE_OPEN="source_open",l.UPDATE_END="update_end",l.BUFFER_FULL="buffer_full",l.START_STREAMING="start_streaming",l.END_STREAMING="end_streaming"})(y||(y={})),u.a=y},function(s,u,A){var y=A(9),l=A.n(y),c=A(0),p=function(){function r(){}return Object.defineProperty(r,"forceGlobalTag",{get:function(){return c.a.FORCE_GLOBAL_TAG},set:function(i){c.a.FORCE_GLOBAL_TAG=i,r._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"globalTag",{get:function(){return c.a.GLOBAL_TAG},set:function(i){c.a.GLOBAL_TAG=i,r._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"enableAll",{get:function(){return c.a.ENABLE_VERBOSE&&c.a.ENABLE_DEBUG&&c.a.ENABLE_INFO&&c.a.ENABLE_WARN&&c.a.ENABLE_ERROR},set:function(i){c.a.ENABLE_VERBOSE=i,c.a.ENABLE_DEBUG=i,c.a.ENABLE_INFO=i,c.a.ENABLE_WARN=i,c.a.ENABLE_ERROR=i,r._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"enableDebug",{get:function(){return c.a.ENABLE_DEBUG},set:function(i){c.a.ENABLE_DEBUG=i,r._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"enableVerbose",{get:function(){return c.a.ENABLE_VERBOSE},set:function(i){c.a.ENABLE_VERBOSE=i,r._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"enableInfo",{get:function(){return c.a.ENABLE_INFO},set:function(i){c.a.ENABLE_INFO=i,r._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"enableWarn",{get:function(){return c.a.ENABLE_WARN},set:function(i){c.a.ENABLE_WARN=i,r._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"enableError",{get:function(){return c.a.ENABLE_ERROR},set:function(i){c.a.ENABLE_ERROR=i,r._notifyChange()},enumerable:!1,configurable:!0}),r.getConfig=function(){return{globalTag:c.a.GLOBAL_TAG,forceGlobalTag:c.a.FORCE_GLOBAL_TAG,enableVerbose:c.a.ENABLE_VERBOSE,enableDebug:c.a.ENABLE_DEBUG,enableInfo:c.a.ENABLE_INFO,enableWarn:c.a.ENABLE_WARN,enableError:c.a.ENABLE_ERROR,enableCallback:c.a.ENABLE_CALLBACK}},r.applyConfig=function(i){c.a.GLOBAL_TAG=i.globalTag,c.a.FORCE_GLOBAL_TAG=i.forceGlobalTag,c.a.ENABLE_VERBOSE=i.enableVerbose,c.a.ENABLE_DEBUG=i.enableDebug,c.a.ENABLE_INFO=i.enableInfo,c.a.ENABLE_WARN=i.enableWarn,c.a.ENABLE_ERROR=i.enableError,c.a.ENABLE_CALLBACK=i.enableCallback},r._notifyChange=function(){var i=r.emitter;if(i.listenerCount("change")>0){var t=r.getConfig();i.emit("change",t)}},r.registerListener=function(i){r.emitter.addListener("change",i)},r.removeListener=function(i){r.emitter.removeListener("change",i)},r.addLogListener=function(i){c.a.emitter.addListener("log",i),c.a.emitter.listenerCount("log")>0&&(c.a.ENABLE_CALLBACK=!0,r._notifyChange())},r.removeLogListener=function(i){c.a.emitter.removeListener("log",i),c.a.emitter.listenerCount("log")===0&&(c.a.ENABLE_CALLBACK=!1,r._notifyChange())},r}();p.emitter=new l.a,u.a=p},function(s,u,A){var y,l=typeof Reflect=="object"?Reflect:null,c=l&&typeof l.apply=="function"?l.apply:function(w,C,D){return Function.prototype.apply.call(w,C,D)};y=l&&typeof l.ownKeys=="function"?l.ownKeys:Object.getOwnPropertySymbols?function(w){return Object.getOwnPropertyNames(w).concat(Object.getOwnPropertySymbols(w))}:function(w){return Object.getOwnPropertyNames(w)};var p=Number.isNaN||function(w){return w!=w};function r(){r.init.call(this)}s.exports=r,s.exports.once=function(w,C){return new Promise(function(D,R){function T(L){w.removeListener(C,P),R(L)}function P(){typeof w.removeListener=="function"&&w.removeListener("error",T),D([].slice.call(arguments))}b(w,C,P,{once:!0}),C!=="error"&&function(L,I,x){typeof L.on=="function"&&b(L,"error",I,x)}(w,T,{once:!0})})},r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var i=10;function t(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}function n(w){return w._maxListeners===void 0?r.defaultMaxListeners:w._maxListeners}function a(w,C,D,R){var T,P,L,I;if(t(D),(P=w._events)===void 0?(P=w._events=Object.create(null),w._eventsCount=0):(P.newListener!==void 0&&(w.emit("newListener",C,D.listener?D.listener:D),P=w._events),L=P[C]),L===void 0)L=P[C]=D,++w._eventsCount;else if(typeof L=="function"?L=P[C]=R?[D,L]:[L,D]:R?L.unshift(D):L.push(D),(T=n(w))>0&&L.length>T&&!L.warned){L.warned=!0;var x=new Error("Possible EventEmitter memory leak detected. "+L.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");x.name="MaxListenersExceededWarning",x.emitter=w,x.type=C,x.count=L.length,I=x,console&&console.warn&&console.warn(I)}return w}function o(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(w,C,D){var R={fired:!1,wrapFn:void 0,target:w,type:C,listener:D},T=o.bind(R);return T.listener=D,R.wrapFn=T,T}function g(w,C,D){var R=w._events;if(R===void 0)return[];var T=R[C];return T===void 0?[]:typeof T=="function"?D?[T.listener||T]:[T]:D?function(P){for(var L=new Array(P.length),I=0;I0&&(P=C[0]),P instanceof Error)throw P;var L=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw L.context=P,L}var I=T[w];if(I===void 0)return!1;if(typeof I=="function")c(I,this,C);else{var x=I.length,O=v(I,x);for(D=0;D=0;P--)if(D[P]===C||D[P].listener===C){L=D[P].listener,T=P;break}if(T<0)return this;T===0?D.shift():function(I,x){for(;x+1=0;R--)this.removeListener(w,C[R]);return this},r.prototype.listeners=function(w){return g(this,w,!0)},r.prototype.rawListeners=function(w){return g(this,w,!1)},r.listenerCount=function(w,C){return typeof w.listenerCount=="function"?w.listenerCount(C):m.call(w,C)},r.prototype.listenerCount=m,r.prototype.eventNames=function(){return this._eventsCount>0?y(this._events):[]}},function(s,u,A){var y=A(3),l=function(){function c(p){this.TAG="ExpGolomb",this._buffer=p,this._buffer_index=0,this._total_bytes=p.byteLength,this._total_bits=8*p.byteLength,this._current_word=0,this._current_word_bits_left=0}return c.prototype.destroy=function(){this._buffer=null},c.prototype._fillCurrentWord=function(){var p=this._total_bytes-this._buffer_index;if(p<=0)throw new y.a("ExpGolomb: _fillCurrentWord() but no bytes available");var r=Math.min(4,p),i=new Uint8Array(4);i.set(this._buffer.subarray(this._buffer_index,this._buffer_index+r)),this._current_word=new DataView(i.buffer).getUint32(0,!1),this._buffer_index+=r,this._current_word_bits_left=8*r},c.prototype.readBits=function(p){if(p>32)throw new y.b("ExpGolomb: readBits() bits exceeded max 32bits!");if(p<=this._current_word_bits_left){var r=this._current_word>>>32-p;return this._current_word<<=p,this._current_word_bits_left-=p,r}var i=this._current_word_bits_left?this._current_word:0;i>>>=32-this._current_word_bits_left;var t=p-this._current_word_bits_left;this._fillCurrentWord();var n=Math.min(t,this._current_word_bits_left),a=this._current_word>>>32-n;return this._current_word<<=n,this._current_word_bits_left-=n,i=i<>>p)return this._current_word<<=p,this._current_word_bits_left-=p,p;return this._fillCurrentWord(),p+this._skipLeadingZero()},c.prototype.readUEG=function(){var p=this._skipLeadingZero();return this.readBits(p+1)-1},c.prototype.readSEG=function(){var p=this.readUEG();return 1&p?p+1>>>1:-1*(p>>>1)},c}();u.a=l},function(s,u,A){A.d(u,"b",function(){return c}),A.d(u,"a",function(){return p});var y=A(2),l=A(6),c={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},p={NETWORK_EXCEPTION:y.b.EXCEPTION,NETWORK_STATUS_CODE_INVALID:y.b.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:y.b.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:y.b.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:l.a.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:l.a.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:l.a.CODEC_UNSUPPORTED}},function(s,u,A){A.d(u,"d",function(){return y}),A.d(u,"b",function(){return l}),A.d(u,"a",function(){return c}),A.d(u,"c",function(){return p});var y=function(r,i,t,n,a){this.dts=r,this.pts=i,this.duration=t,this.originalDts=n,this.isSyncPoint=a,this.fileposition=null},l=function(){function r(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return r.prototype.appendSyncPoint=function(i){i.isSyncPoint=!0,this.syncPoints.push(i)},r}(),c=function(){function r(){this._list=[]}return r.prototype.clear=function(){this._list=[]},r.prototype.appendArray=function(i){var t=this._list;i.length!==0&&(t.length>0&&i[0].originalDts=t[o].dts&&it[a].lastSample.originalDts&&i=t[a].lastSample.originalDts&&(a===t.length-1||a0&&(o=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=o,this._list.splice(o,0,n)},r.prototype.getLastSegmentBefore=function(i){var t=this._searchNearestSegmentBefore(i);return t>=0?this._list[t]:null},r.prototype.getLastSampleBefore=function(i){var t=this.getLastSegmentBefore(i);return t!=null?t.lastSample:null},r.prototype.getLastSyncPointBefore=function(i){for(var t=this._searchNearestSegmentBefore(i),n=this._list[t].syncPoints;n.length===0&&t>0;)t--,n=this._list[t].syncPoints;return n.length>0?n[n.length-1]:null},r}()},function(s,u,A){var y=function(){function l(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return l.prototype.isComplete=function(){var c=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,p=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&c&&p},l.prototype.isSeekable=function(){return this.hasKeyframesIndex===!0},l.prototype.getNearestKeyframe=function(c){if(this.keyframesIndex==null)return null;var p=this.keyframesIndex,r=this._search(p.times,c);return{index:r,milliseconds:p.times[r],fileposition:p.filepositions[r]}},l.prototype._search=function(c,p){var r=0,i=c.length-1,t=0,n=0,a=i;for(p=c[t]&&p=Re.byteLength)return this.eof_flag_=!0,Re.byteLength;var ut=Re[De+0]<<24|Re[De+1]<<16|Re[De+2]<<8|Re[De+3],gt=Re[De+0]<<16|Re[De+1]<<8|Re[De+2];if(ut===1||gt===1)return De;De++}},Ue.prototype.readNextNaluPayload=function(){for(var Ve=this.data_,De=null;De==null&&!this.eof_flag_;){var Re=this.current_startcode_offset_,ut=31&Ve[Re+=(Ve[Re]<<24|Ve[Re+1]<<16|Ve[Re+2]<<8|Ve[Re+3])===1?4:3],gt=(128&Ve[Re])>>>7,Ce=this.findNextStartCodeOffset(Re);if(this.current_startcode_offset_=Ce,!(ut>=t.kReserved0)&>===0){var ze=Ve.subarray(Re,Ce);(De=new v).type=ut,De.data=ze}}return De},Ue}(),C=function(){function Ue(Ve,De,Re){var ut=8+Ve.byteLength+1+2+De.byteLength,gt=!1;Ve[3]!==66&&Ve[3]!==77&&Ve[3]!==88&&(gt=!0,ut+=4);var Ce=this.data=new Uint8Array(ut);Ce[0]=1,Ce[1]=Ve[1],Ce[2]=Ve[2],Ce[3]=Ve[3],Ce[4]=255,Ce[5]=225;var ze=Ve.byteLength;Ce[6]=ze>>>8,Ce[7]=255&ze;var At=8;Ce.set(Ve,8),Ce[At+=ze]=1;var Je=De.byteLength;Ce[At+1]=Je>>>8,Ce[At+2]=255&Je,Ce.set(De,At+3),At+=3+Je,gt&&(Ce[At]=252|Re.chroma_format_idc,Ce[At+1]=248|Re.bit_depth_luma-8,Ce[At+2]=248|Re.bit_depth_chroma-8,Ce[At+3]=0,At+=4)}return Ue.prototype.getData=function(){return this.data},Ue}(),D=A(22),R=A(10);(function(Ue){Ue[Ue.kNull=0]="kNull",Ue[Ue.kAACMain=1]="kAACMain",Ue[Ue.kAAC_LC=2]="kAAC_LC",Ue[Ue.kAAC_SSR=3]="kAAC_SSR",Ue[Ue.kAAC_LTP=4]="kAAC_LTP",Ue[Ue.kAAC_SBR=5]="kAAC_SBR",Ue[Ue.kAAC_Scalable=6]="kAAC_Scalable",Ue[Ue.kLayer1=32]="kLayer1",Ue[Ue.kLayer2=33]="kLayer2",Ue[Ue.kLayer3=34]="kLayer3"})(g||(g={})),function(Ue){Ue[Ue.k96000Hz=0]="k96000Hz",Ue[Ue.k88200Hz=1]="k88200Hz",Ue[Ue.k64000Hz=2]="k64000Hz",Ue[Ue.k48000Hz=3]="k48000Hz",Ue[Ue.k44100Hz=4]="k44100Hz",Ue[Ue.k32000Hz=5]="k32000Hz",Ue[Ue.k24000Hz=6]="k24000Hz",Ue[Ue.k22050Hz=7]="k22050Hz",Ue[Ue.k16000Hz=8]="k16000Hz",Ue[Ue.k12000Hz=9]="k12000Hz",Ue[Ue.k11025Hz=10]="k11025Hz",Ue[Ue.k8000Hz=11]="k8000Hz",Ue[Ue.k7350Hz=12]="k7350Hz"}(m||(m={}));var T,P,L=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],I=(T=function(Ue,Ve){return(T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(De,Re){De.__proto__=Re}||function(De,Re){for(var ut in Re)Object.prototype.hasOwnProperty.call(Re,ut)&&(De[ut]=Re[ut])})(Ue,Ve)},function(Ue,Ve){if(typeof Ve!="function"&&Ve!==null)throw new TypeError("Class extends value "+String(Ve)+" is not a constructor or null");function De(){this.constructor=Ue}T(Ue,Ve),Ue.prototype=Ve===null?Object.create(Ve):(De.prototype=Ve.prototype,new De)}),x=function(){},O=function(Ue){function Ve(){return Ue!==null&&Ue.apply(this,arguments)||this}return I(Ve,Ue),Ve}(x),G=function(){function Ue(Ve){this.TAG="AACADTSParser",this.data_=Ve,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&l.a.e(this.TAG,"Could not found ADTS syncword until payload end")}return Ue.prototype.findNextSyncwordOffset=function(Ve){for(var De=Ve,Re=this.data_;;){if(De+7>=Re.byteLength)return this.eof_flag_=!0,Re.byteLength;if((Re[De+0]<<8|Re[De+1])>>>4===4095)return De;De++}},Ue.prototype.readNextAACFrame=function(){for(var Ve=this.data_,De=null;De==null&&!this.eof_flag_;){var Re=this.current_syncword_offset_,ut=(8&Ve[Re+1])>>>3,gt=(6&Ve[Re+1])>>>1,Ce=1&Ve[Re+1],ze=(192&Ve[Re+2])>>>6,At=(60&Ve[Re+2])>>>2,Je=(1&Ve[Re+2])<<2|(192&Ve[Re+3])>>>6,$e=(3&Ve[Re+3])<<11|Ve[Re+4]<<3|(224&Ve[Re+5])>>>5;if(Ve[Re+6],Re+$e>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var Be=Ce===1?7:9,it=$e-Be;Re+=Be;var Ne=this.findNextSyncwordOffset(Re+it);if(this.current_syncword_offset_=Ne,(ut===0||ut===1)&>===0){var Qe=Ve.subarray(Re,Re+it);(De=new x).audio_object_type=ze+1,De.sampling_freq_index=At,De.sampling_frequency=L[At],De.channel_config=Je,De.data=Qe}}return De},Ue.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},Ue.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},Ue}(),J=function(){function Ue(Ve){this.TAG="AACLOASParser",this.data_=Ve,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&l.a.e(this.TAG,"Could not found LOAS syncword until payload end")}return Ue.prototype.findNextSyncwordOffset=function(Ve){for(var De=Ve,Re=this.data_;;){if(De+1>=Re.byteLength)return this.eof_flag_=!0,Re.byteLength;if((Re[De+0]<<3|Re[De+1]>>>5)===695)return De;De++}},Ue.prototype.getLATMValue=function(Ve){for(var De=Ve.readBits(2),Re=0,ut=0;ut<=De;ut++)Re<<=8,Re|=Ve.readByte();return Re},Ue.prototype.readNextAACFrame=function(Ve){for(var De=this.data_,Re=null;Re==null&&!this.eof_flag_;){var ut=this.current_syncword_offset_,gt=(31&De[ut+1])<<8|De[ut+2];if(ut+3+gt>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var Ce=new R.a(De.subarray(ut+3,ut+3+gt)),ze=null;if(Ce.readBool()){if(Ve==null){l.a.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(ut+3+gt),Ce.destroy();continue}ze=Ve}else{var At=Ce.readBool();if(At&&Ce.readBool()){l.a.e(this.TAG,"audioMuxVersionA is Not Supported"),Ce.destroy();break}if(At&&this.getLATMValue(Ce),!Ce.readBool()){l.a.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),Ce.destroy();break}if(Ce.readBits(6)!==0){l.a.e(this.TAG,"more than 2 numSubFrames Not Supported"),Ce.destroy();break}if(Ce.readBits(4)!==0){l.a.e(this.TAG,"more than 2 numProgram Not Supported"),Ce.destroy();break}if(Ce.readBits(3)!==0){l.a.e(this.TAG,"more than 2 numLayer Not Supported"),Ce.destroy();break}var Je=At?this.getLATMValue(Ce):0,$e=Ce.readBits(5);Je-=5;var Be=Ce.readBits(4);Je-=4;var it=Ce.readBits(4);Je-=4,Ce.readBits(3),(Je-=3)>0&&Ce.readBits(Je);var Ne=Ce.readBits(3);if(Ne!==0){l.a.e(this.TAG,"frameLengthType = ".concat(Ne,". Only frameLengthType = 0 Supported")),Ce.destroy();break}Ce.readByte();var Qe=Ce.readBool();if(Qe)if(At)this.getLATMValue(Ce);else{for(var Me=0;;){Me<<=8;var Se=Ce.readBool();if(Me+=Ce.readByte(),!Se)break}console.log(Me)}Ce.readBool()&&Ce.readByte(),(ze=new O).audio_object_type=$e,ze.sampling_freq_index=Be,ze.sampling_frequency=L[ze.sampling_freq_index],ze.channel_config=it,ze.other_data_present=Qe}for(var K=0;;){var xe=Ce.readByte();if(K+=xe,xe!==255)break}for(var be=new Uint8Array(K),Te=0;Te=6?(Re=5,Ve=new Array(4),Ce=ut-3):(Re=2,Ve=new Array(2),Ce=ut):ze.indexOf("android")!==-1?(Re=2,Ve=new Array(2),Ce=ut):(Re=5,Ce=ut,Ve=new Array(4),ut>=6?Ce=ut-3:gt===1&&(Re=2,Ve=new Array(2),Ce=ut)),Ve[0]=Re<<3,Ve[0]|=(15&ut)>>>1,Ve[1]=(15&ut)<<7,Ve[1]|=(15>)<<3,Re===5&&(Ve[1]|=(15&Ce)>>>1,Ve[2]=(1&Ce)<<7,Ve[2]|=8,Ve[3]=0),this.config=Ve,this.sampling_rate=L[ut],this.channel_count=gt,this.codec_mimetype="mp4a.40."+Re,this.original_codec_mimetype="mp4a.40."+De},le=function(){},ne=function(){};(function(Ue){Ue[Ue.kSpliceNull=0]="kSpliceNull",Ue[Ue.kSpliceSchedule=4]="kSpliceSchedule",Ue[Ue.kSpliceInsert=5]="kSpliceInsert",Ue[Ue.kTimeSignal=6]="kTimeSignal",Ue[Ue.kBandwidthReservation=7]="kBandwidthReservation",Ue[Ue.kPrivateCommand=255]="kPrivateCommand"})(P||(P={}));var ee,M=function(Ue){var Ve=Ue.readBool();return Ve?(Ue.readBits(6),{time_specified_flag:Ve,pts_time:4*Ue.readBits(31)+Ue.readBits(2)}):(Ue.readBits(7),{time_specified_flag:Ve})},Y=function(Ue){var Ve=Ue.readBool();return Ue.readBits(6),{auto_return:Ve,duration:4*Ue.readBits(31)+Ue.readBits(2)}},j=function(Ue,Ve){var De=Ve.readBits(8);return Ue?{component_tag:De}:{component_tag:De,splice_time:M(Ve)}},z=function(Ue){return{component_tag:Ue.readBits(8),utc_splice_time:Ue.readBits(32)}},q=function(Ue){var Ve=Ue.readBits(32),De=Ue.readBool();Ue.readBits(7);var Re={splice_event_id:Ve,splice_event_cancel_indicator:De};if(De)return Re;if(Re.out_of_network_indicator=Ue.readBool(),Re.program_splice_flag=Ue.readBool(),Re.duration_flag=Ue.readBool(),Ue.readBits(5),Re.program_splice_flag)Re.utc_splice_time=Ue.readBits(32);else{Re.component_count=Ue.readBits(8),Re.components=[];for(var ut=0;ut=Re.byteLength)return this.eof_flag_=!0,Re.byteLength;var ut=Re[De+0]<<24|Re[De+1]<<16|Re[De+2]<<8|Re[De+3],gt=Re[De+0]<<16|Re[De+1]<<8|Re[De+2];if(ut===1||gt===1)return De;De++}},Ue.prototype.readNextNaluPayload=function(){for(var Ve=this.data_,De=null;De==null&&!this.eof_flag_;){var Re=this.current_startcode_offset_,ut=Ve[Re+=(Ve[Re]<<24|Ve[Re+1]<<16|Ve[Re+2]<<8|Ve[Re+3])===1?4:3]>>1&63,gt=(128&Ve[Re])>>>7,Ce=this.findNextStartCodeOffset(Re);if(this.current_startcode_offset_=Ce,gt===0){var ze=Ve.subarray(Re,Ce);(De=new He).type=ut,De.data=ze}}return De},Ue}(),je=function(){function Ue(Ve,De,Re,ut){var gt=23+(5+Ve.byteLength)+(5+De.byteLength)+(5+Re.byteLength),Ce=this.data=new Uint8Array(gt);Ce[0]=1,Ce[1]=(3&ut.general_profile_space)<<6|(ut.general_tier_flag?1:0)<<5|31&ut.general_profile_idc,Ce[2]=ut.general_profile_compatibility_flags_1,Ce[3]=ut.general_profile_compatibility_flags_2,Ce[4]=ut.general_profile_compatibility_flags_3,Ce[5]=ut.general_profile_compatibility_flags_4,Ce[6]=ut.general_constraint_indicator_flags_1,Ce[7]=ut.general_constraint_indicator_flags_2,Ce[8]=ut.general_constraint_indicator_flags_3,Ce[9]=ut.general_constraint_indicator_flags_4,Ce[10]=ut.general_constraint_indicator_flags_5,Ce[11]=ut.general_constraint_indicator_flags_6,Ce[12]=ut.general_level_idc,Ce[13]=240|(3840&ut.min_spatial_segmentation_idc)>>8,Ce[14]=255&ut.min_spatial_segmentation_idc,Ce[15]=252|3&ut.parallelismType,Ce[16]=252|3&ut.chroma_format_idc,Ce[17]=248|7&ut.bit_depth_luma_minus8,Ce[18]=248|7&ut.bit_depth_chroma_minus8,Ce[19]=0,Ce[20]=0,Ce[21]=(3&ut.constant_frame_rate)<<6|(7&ut.num_temporal_layers)<<3|(ut.temporal_id_nested?1:0)<<2|3,Ce[22]=3,Ce[23]=128|ee.kSliceVPS,Ce[24]=0,Ce[25]=1,Ce[26]=(65280&Ve.byteLength)>>8,Ce[27]=(255&Ve.byteLength)>>0,Ce.set(Ve,28),Ce[23+(5+Ve.byteLength)+0]=128|ee.kSliceSPS,Ce[23+(5+Ve.byteLength)+1]=0,Ce[23+(5+Ve.byteLength)+2]=1,Ce[23+(5+Ve.byteLength)+3]=(65280&De.byteLength)>>8,Ce[23+(5+Ve.byteLength)+4]=(255&De.byteLength)>>0,Ce.set(De,23+(5+Ve.byteLength)+5),Ce[23+(5+Ve.byteLength+5+De.byteLength)+0]=128|ee.kSlicePPS,Ce[23+(5+Ve.byteLength+5+De.byteLength)+1]=0,Ce[23+(5+Ve.byteLength+5+De.byteLength)+2]=1,Ce[23+(5+Ve.byteLength+5+De.byteLength)+3]=(65280&Re.byteLength)>>8,Ce[23+(5+Ve.byteLength+5+De.byteLength)+4]=(255&Re.byteLength)>>0,Ce.set(Re,23+(5+Ve.byteLength+5+De.byteLength)+5)}return Ue.prototype.getData=function(){return this.data},Ue}(),ht=A(15),_e=function(){},Oe=function(){},pt=function(){},vt=[[64,64,80,80,96,96,112,112,128,128,160,160,192,192,224,224,256,256,320,320,384,384,448,448,512,512,640,640,768,768,896,896,1024,1024,1152,1152,1280,1280],[69,70,87,88,104,105,121,122,139,140,174,175,208,209,243,244,278,279,348,349,417,418,487,488,557,558,696,697,835,836,975,976,1114,1115,1253,1254,1393,1394],[96,96,120,120,144,144,168,168,192,192,240,240,288,288,336,336,384,384,480,480,576,576,672,672,768,768,960,960,1152,1152,1344,1344,1536,1536,1728,1728,1920,1920]],tt=function(){function Ue(Ve){this.TAG="AC3Parser",this.data_=Ve,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&l.a.e(this.TAG,"Could not found AC3 syncword until payload end")}return Ue.prototype.findNextSyncwordOffset=function(Ve){for(var De=Ve,Re=this.data_;;){if(De+7>=Re.byteLength)return this.eof_flag_=!0,Re.byteLength;if((Re[De+0]<<8|Re[De+1]<<0)===2935)return De;De++}},Ue.prototype.readNextAC3Frame=function(){for(var Ve=this.data_,De=null;De==null&&!this.eof_flag_;){var Re=this.current_syncword_offset_,ut=Ve[Re+4]>>6,gt=[48e3,44200,33e3][ut],Ce=63&Ve[Re+4],ze=2*vt[ut][Ce];if(isNaN(ze)||Re+ze>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var At=this.findNextSyncwordOffset(Re+ze);this.current_syncword_offset_=At;var Je=Ve[Re+5]>>3,$e=7&Ve[Re+5],Be=Ve[Re+6]>>5,it=0;1&Be&&Be!==1&&(it+=2),4&Be&&(it+=2),Be===2&&(it+=2);var Ne=(Ve[Re+6]<<8|Ve[Re+7]<<0)>>12-it&1,Qe=[2,1,2,3,3,4,4,5][Be]+Ne;(De=new pt).sampling_frequency=gt,De.channel_count=Qe,De.channel_mode=Be,De.bit_stream_identification=Je,De.low_frequency_effects_channel_on=Ne,De.bit_stream_mode=$e,De.frame_size_code=Ce,De.data=Ve.subarray(Re,Re+ze)}return De},Ue.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},Ue.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},Ue}(),pe=function(Ue){var Ve;Ve=[Ue.sampling_rate_code<<6|Ue.bit_stream_identification<<1|Ue.bit_stream_mode>>2,(3&Ue.bit_stream_mode)<<6|Ue.channel_mode<<3|Ue.low_frequency_effects_channel_on<<2|Ue.frame_size_code>>4,Ue.frame_size_code<<4&224],this.config=Ve,this.sampling_rate=Ue.sampling_frequency,this.bit_stream_identification=Ue.bit_stream_identification,this.bit_stream_mode=Ue.bit_stream_mode,this.low_frequency_effects_channel_on=Ue.low_frequency_effects_channel_on,this.channel_count=Ue.channel_count,this.channel_mode=Ue.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},ue=function(){},W=function(){function Ue(Ve){this.TAG="EAC3Parser",this.data_=Ve,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&l.a.e(this.TAG,"Could not found AC3 syncword until payload end")}return Ue.prototype.findNextSyncwordOffset=function(Ve){for(var De=Ve,Re=this.data_;;){if(De+7>=Re.byteLength)return this.eof_flag_=!0,Re.byteLength;if((Re[De+0]<<8|Re[De+1]<<0)===2935)return De;De++}},Ue.prototype.readNextEAC3Frame=function(){for(var Ve=this.data_,De=null;De==null&&!this.eof_flag_;){var Re=this.current_syncword_offset_,ut=new R.a(Ve.subarray(Re+2)),gt=(ut.readBits(2),ut.readBits(3),ut.readBits(11)+1<<1),Ce=ut.readBits(2),ze=null,At=null;Ce===3?(ze=[24e3,22060,16e3][Ce=ut.readBits(2)],At=3):(ze=[48e3,44100,32e3][Ce],At=ut.readBits(2));var Je=ut.readBits(3),$e=ut.readBits(1),Be=ut.readBits(5);if(Re+gt>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var it=this.findNextSyncwordOffset(Re+gt);this.current_syncword_offset_=it;var Ne=[2,1,2,3,3,4,4,5][Je]+$e;ut.destroy(),(De=new ue).sampling_frequency=ze,De.channel_count=Ne,De.channel_mode=Je,De.bit_stream_identification=Be,De.low_frequency_effects_channel_on=$e,De.frame_size=gt,De.num_blks=[1,2,3,6][At],De.data=Ve.subarray(Re,Re+gt)}return De},Ue.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},Ue.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},Ue}(),ke=function(Ue){var Ve,De=Math.floor(Ue.frame_size*Ue.sampling_frequency/(16*Ue.num_blks));Ve=[255&De,248&De,Ue.sampling_rate_code<<6|Ue.bit_stream_identification<<1|0,0|Ue.channel_mode<<1|Ue.low_frequency_effects_channel_on<<0,0],this.config=Ve,this.sampling_rate=Ue.sampling_frequency,this.bit_stream_identification=Ue.bit_stream_identification,this.num_blks=Ue.num_blks,this.low_frequency_effects_channel_on=Ue.low_frequency_effects_channel_on,this.channel_count=Ue.channel_count,this.channel_mode=Ue.channel_mode,this.codec_mimetype="ec-3",this.original_codec_mimetype="ec-3"},Ae=function(){},Ye=function(){var Ue=function(Ve,De){return(Ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Re,ut){Re.__proto__=ut}||function(Re,ut){for(var gt in ut)Object.prototype.hasOwnProperty.call(ut,gt)&&(Re[gt]=ut[gt])})(Ve,De)};return function(Ve,De){if(typeof De!="function"&&De!==null)throw new TypeError("Class extends value "+String(De)+" is not a constructor or null");function Re(){this.constructor=Ve}Ue(Ve,De),Ve.prototype=De===null?Object.create(De):(Re.prototype=De.prototype,new Re)}}(),lt=function(){return(lt=Object.assign||function(Ue){for(var Ve,De=1,Re=arguments.length;De=4?(l.a.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),ut-=4):gt===204&&l.a.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:gt,sync_offset:ut})},Ve.prototype.bindDataSource=function(De){return De.onDataArrival=this.parseChunks.bind(this),this},Ve.prototype.resetMediaInfo=function(){this.media_info_=new c.a},Ve.prototype.parseChunks=function(De,Re){if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new p.a("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var ut=0;for(this.first_parse_&&(this.first_parse_=!1,ut=this.sync_offset_);ut+this.ts_packet_size_<=De.byteLength;){var gt=Re+ut;this.ts_packet_size_===192&&(ut+=4);var Ce=new Uint8Array(De,ut,188),ze=Ce[0];if(ze!==71){l.a.e(this.TAG,"sync_byte = ".concat(ze,", not 0x47"));break}var At=(64&Ce[1])>>>6,Je=(Ce[1],(31&Ce[1])<<8|Ce[2]),$e=(48&Ce[3])>>>4,Be=15&Ce[3],it=!(!this.pmt_||this.pmt_.pcr_pid!==Je),Ne={},Qe=4;if($e==2||$e==3){var Me=Ce[4];if(Me>0&&(it||$e==3)&&(Ne.discontinuity_indicator=(128&Ce[5])>>>7,Ne.random_access_indicator=(64&Ce[5])>>>6,Ne.elementary_stream_priority_indicator=(32&Ce[5])>>>5,(16&Ce[5])>>>4)){var Se=300*this.getPcrBase(Ce)+((1&Ce[10])<<8|Ce[11]);this.last_pcr_=Se}if($e==2||5+Me===188){ut+=188,this.ts_packet_size_===204&&(ut+=16);continue}Qe=5+Me}if($e==1||$e==3){if(Je===0||Je===this.current_pmt_pid_||this.pmt_!=null&&this.pmt_.pid_stream_type[Je]===y.kSCTE35){var K=188-Qe;this.handleSectionSlice(De,ut+Qe,K,{pid:Je,file_position:gt,payload_unit_start_indicator:At,continuity_conunter:Be,random_access_indicator:Ne.random_access_indicator})}else if(this.pmt_!=null&&this.pmt_.pid_stream_type[Je]!=null){K=188-Qe;var xe=this.pmt_.pid_stream_type[Je];Je!==this.pmt_.common_pids.h264&&Je!==this.pmt_.common_pids.h265&&Je!==this.pmt_.common_pids.adts_aac&&Je!==this.pmt_.common_pids.loas_aac&&Je!==this.pmt_.common_pids.ac3&&Je!==this.pmt_.common_pids.eac3&&Je!==this.pmt_.common_pids.opus&&Je!==this.pmt_.common_pids.mp3&&this.pmt_.pes_private_data_pids[Je]!==!0&&this.pmt_.timed_id3_pids[Je]!==!0&&this.pmt_.synchronous_klv_pids[Je]!==!0&&this.pmt_.asynchronous_klv_pids[Je]!==!0||this.handlePESSlice(De,ut+Qe,K,{pid:Je,stream_type:xe,file_position:gt,payload_unit_start_indicator:At,continuity_conunter:Be,random_access_indicator:Ne.random_access_indicator})}}ut+=188,this.ts_packet_size_===204&&(ut+=16)}return this.dispatchAudioVideoMediaSegment(),ut},Ve.prototype.handleSectionSlice=function(De,Re,ut,gt){var Ce=new Uint8Array(De,Re,ut),ze=this.section_slice_queues_[gt.pid];if(gt.payload_unit_start_indicator){var At=Ce[0];if(ze!=null&&ze.total_length!==0){var Je=new Uint8Array(De,Re+1,Math.min(ut,At));ze.slices.push(Je),ze.total_length+=Je.byteLength,ze.total_length===ze.expected_length?this.emitSectionSlices(ze,gt):this.clearSlices(ze,gt)}for(var $e=1+At;$e=ze.expected_length&&this.clearSlices(ze,gt),$e+=Je.byteLength}}else ze!=null&&ze.total_length!==0&&(Je=new Uint8Array(De,Re,Math.min(ut,ze.expected_length-ze.total_length)),ze.slices.push(Je),ze.total_length+=Je.byteLength,ze.total_length===ze.expected_length?this.emitSectionSlices(ze,gt):ze.total_length>=ze.expected_length&&this.clearSlices(ze,gt))},Ve.prototype.handlePESSlice=function(De,Re,ut,gt){var Ce=new Uint8Array(De,Re,ut),ze=Ce[0]<<16|Ce[1]<<8|Ce[2],At=(Ce[3],Ce[4]<<8|Ce[5]);if(gt.payload_unit_start_indicator){if(ze!==1)return void l.a.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(ze));var Je=this.pes_slice_queues_[gt.pid];Je&&(Je.expected_length===0||Je.expected_length===Je.total_length?this.emitPESSlices(Je,gt):this.clearSlices(Je,gt)),this.pes_slice_queues_[gt.pid]=new d,this.pes_slice_queues_[gt.pid].file_position=gt.file_position,this.pes_slice_queues_[gt.pid].random_access_indicator=gt.random_access_indicator}if(this.pes_slice_queues_[gt.pid]!=null){var $e=this.pes_slice_queues_[gt.pid];$e.slices.push(Ce),gt.payload_unit_start_indicator&&($e.expected_length=At===0?0:At+6),$e.total_length+=Ce.byteLength,$e.expected_length>0&&$e.expected_length===$e.total_length?this.emitPESSlices($e,gt):$e.expected_length>0&&$e.expected_length<$e.total_length&&this.clearSlices($e,gt)}},Ve.prototype.emitSectionSlices=function(De,Re){for(var ut=new Uint8Array(De.total_length),gt=0,Ce=0;gt>>6,At=Re[8],Je=void 0,$e=void 0;ze!==2&&ze!==3||(Je=this.getTimestamp(Re,9),$e=ze===3?this.getTimestamp(Re,14):Je);var Be=9+At,it=void 0;if(Ce!==0){if(Ce<3+At)return void l.a.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");it=Ce-3-At}else it=Re.byteLength-Be;var Ne=Re.subarray(Be,Be+it);switch(De.stream_type){case y.kMPEG1Audio:case y.kMPEG2Audio:this.parseMP3Payload(Ne,Je);break;case y.kPESPrivateData:this.pmt_.common_pids.opus===De.pid?this.parseOpusPayload(Ne,Je):this.pmt_.common_pids.ac3===De.pid?this.parseAC3Payload(Ne,Je):this.pmt_.common_pids.eac3===De.pid?this.parseEAC3Payload(Ne,Je):this.pmt_.asynchronous_klv_pids[De.pid]?this.parseAsynchronousKLVMetadataPayload(Ne,De.pid,gt):this.pmt_.smpte2038_pids[De.pid]?this.parseSMPTE2038MetadataPayload(Ne,Je,$e,De.pid,gt):this.parsePESPrivateDataPayload(Ne,Je,$e,De.pid,gt);break;case y.kADTSAAC:this.parseADTSAACPayload(Ne,Je);break;case y.kLOASAAC:this.parseLOASAACPayload(Ne,Je);break;case y.kAC3:this.parseAC3Payload(Ne,Je);break;case y.kEAC3:this.parseEAC3Payload(Ne,Je);break;case y.kMetadata:this.pmt_.timed_id3_pids[De.pid]?this.parseTimedID3MetadataPayload(Ne,Je,$e,De.pid,gt):this.pmt_.synchronous_klv_pids[De.pid]&&this.parseSynchronousKLVMetadataPayload(Ne,Je,$e,De.pid,gt);break;case y.kH264:this.parseH264Payload(Ne,Je,$e,De.file_position,De.random_access_indicator);break;case y.kH265:this.parseH265Payload(Ne,Je,$e,De.file_position,De.random_access_indicator)}}else(gt===188||gt===191||gt===240||gt===241||gt===255||gt===242||gt===248)&&De.stream_type===y.kPESPrivateData&&(Be=6,it=void 0,it=Ce!==0?Ce:Re.byteLength-Be,Ne=Re.subarray(Be,Be+it),this.parsePESPrivateDataPayload(Ne,void 0,void 0,De.pid,gt));else l.a.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(ut))},Ve.prototype.parsePAT=function(De){var Re=De[0];if(Re===0){var ut=(15&De[1])<<8|De[2],gt=(De[3],De[4],(62&De[5])>>>1),Ce=1&De[5],ze=De[6],At=(De[7],null);if(Ce===1&&ze===0)(At=new i).version_number=gt;else if((At=this.pat_)==null)return;for(var Je=ut-5-4,$e=-1,Be=-1,it=8;it<8+Je;it+=4){var Ne=De[it]<<8|De[it+1],Qe=(31&De[it+2])<<8|De[it+3];Ne===0?At.network_pid=Qe:(At.program_pmt_pid[Ne]=Qe,$e===-1&&($e=Ne),Be===-1&&(Be=Qe))}Ce===1&&ze===0&&(this.pat_==null&&l.a.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(At))),this.pat_=At,this.current_program_=$e,this.current_pmt_pid_=Be)}else l.a.e(this.TAG,"parsePAT: table_id ".concat(Re," is not corresponded to PAT!"))},Ve.prototype.parsePMT=function(De){var Re=De[0];if(Re===2){var ut=(15&De[1])<<8|De[2],gt=De[3]<<8|De[4],Ce=(62&De[5])>>>1,ze=1&De[5],At=De[6],Je=(De[7],null);if(ze===1&&At===0)(Je=new n).program_number=gt,Je.version_number=Ce,this.program_pmt_map_[gt]=Je;else if((Je=this.program_pmt_map_[gt])==null)return;Je.pcr_pid=(31&De[8])<<8|De[9];for(var $e=(15&De[10])<<8|De[11],Be=12+$e,it=ut-9-$e-4,Ne=Be;Ne0){for(var be=Ne+5;be0)for(be=Ne+5;be1&&(l.a.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(ze,"ms, PES pts: ").concat(Ce,"ms")),Ce=ze)}}for(var At,Je=new G(De),$e=null,Be=Ce;($e=Je.readNextAACFrame())!=null;){gt=1024/$e.sampling_frequency*1e3;var it={codec:"aac",data:$e};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"aac",audio_object_type:$e.audio_object_type,sampling_freq_index:$e.sampling_freq_index,sampling_frequency:$e.sampling_frequency,channel_config:$e.channel_config},this.dispatchAudioInitSegment(it)):this.detectAudioMetadataChange(it)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(it)),At=Be;var Ne=Math.floor(Be),Qe={unit:$e.data,length:$e.data.byteLength,pts:Ne,dts:Ne};this.audio_track_.samples.push(Qe),this.audio_track_.length+=$e.data.byteLength,Be+=gt}Je.hasIncompleteData()&&(this.aac_last_incomplete_data_=Je.getIncompleteData()),At&&(this.audio_last_sample_pts_=At)}},Ve.prototype.parseLOASAACPayload=function(De,Re){var ut;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var gt=new Uint8Array(De.byteLength+this.aac_last_incomplete_data_.byteLength);gt.set(this.aac_last_incomplete_data_,0),gt.set(De,this.aac_last_incomplete_data_.byteLength),De=gt}var Ce,ze;if(Re!=null&&(ze=Re/this.timescale_),this.audio_metadata_.codec==="aac"){if(Re==null&&this.audio_last_sample_pts_!=null)Ce=1024/this.audio_metadata_.sampling_frequency*1e3,ze=this.audio_last_sample_pts_+Ce;else if(Re==null)return void l.a.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.audio_last_sample_pts_){Ce=1024/this.audio_metadata_.sampling_frequency*1e3;var At=this.audio_last_sample_pts_+Ce;Math.abs(At-ze)>1&&(l.a.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(At,"ms, PES pts: ").concat(ze,"ms")),ze=At)}}for(var Je,$e=new J(De),Be=null,it=ze;(Be=$e.readNextAACFrame((ut=this.loas_previous_frame)!==null&&ut!==void 0?ut:void 0))!=null;){this.loas_previous_frame=Be,Ce=1024/Be.sampling_frequency*1e3;var Ne={codec:"aac",data:Be};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"aac",audio_object_type:Be.audio_object_type,sampling_freq_index:Be.sampling_freq_index,sampling_frequency:Be.sampling_frequency,channel_config:Be.channel_config},this.dispatchAudioInitSegment(Ne)):this.detectAudioMetadataChange(Ne)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(Ne)),Je=it;var Qe=Math.floor(it),Me={unit:Be.data,length:Be.data.byteLength,pts:Qe,dts:Qe};this.audio_track_.samples.push(Me),this.audio_track_.length+=Be.data.byteLength,it+=Ce}$e.hasIncompleteData()&&(this.aac_last_incomplete_data_=$e.getIncompleteData()),Je&&(this.audio_last_sample_pts_=Je)}},Ve.prototype.parseAC3Payload=function(De,Re){if(!this.has_video_||this.video_init_segment_dispatched_){var ut,gt;if(Re!=null&&(gt=Re/this.timescale_),this.audio_metadata_.codec==="ac-3"){if(Re==null&&this.audio_last_sample_pts_!=null)ut=1536/this.audio_metadata_.sampling_frequency*1e3,gt=this.audio_last_sample_pts_+ut;else if(Re==null)return void l.a.w(this.TAG,"AC3: Unknown pts")}for(var Ce,ze=new tt(De),At=null,Je=gt;(At=ze.readNextAC3Frame())!=null;){ut=1536/At.sampling_frequency*1e3;var $e={codec:"ac-3",data:At};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"ac-3",sampling_frequency:At.sampling_frequency,bit_stream_identification:At.bit_stream_identification,bit_stream_mode:At.bit_stream_mode,low_frequency_effects_channel_on:At.low_frequency_effects_channel_on,channel_mode:At.channel_mode},this.dispatchAudioInitSegment($e)):this.detectAudioMetadataChange($e)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment($e)),Ce=Je;var Be=Math.floor(Je),it={unit:At.data,length:At.data.byteLength,pts:Be,dts:Be};this.audio_track_.samples.push(it),this.audio_track_.length+=At.data.byteLength,Je+=ut}Ce&&(this.audio_last_sample_pts_=Ce)}},Ve.prototype.parseEAC3Payload=function(De,Re){if(!this.has_video_||this.video_init_segment_dispatched_){var ut,gt;if(Re!=null&&(gt=Re/this.timescale_),this.audio_metadata_.codec==="ec-3"){if(Re==null&&this.audio_last_sample_pts_!=null)ut=256*this.audio_metadata_.num_blks/this.audio_metadata_.sampling_frequency*1e3,gt=this.audio_last_sample_pts_+ut;else if(Re==null)return void l.a.w(this.TAG,"EAC3: Unknown pts")}for(var Ce,ze=new W(De),At=null,Je=gt;(At=ze.readNextEAC3Frame())!=null;){ut=1536/At.sampling_frequency*1e3;var $e={codec:"ec-3",data:At};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"ec-3",sampling_frequency:At.sampling_frequency,bit_stream_identification:At.bit_stream_identification,low_frequency_effects_channel_on:At.low_frequency_effects_channel_on,num_blks:At.num_blks,channel_mode:At.channel_mode},this.dispatchAudioInitSegment($e)):this.detectAudioMetadataChange($e)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment($e)),Ce=Je;var Be=Math.floor(Je),it={unit:At.data,length:At.data.byteLength,pts:Be,dts:Be};this.audio_track_.samples.push(it),this.audio_track_.length+=At.data.byteLength,Je+=ut}Ce&&(this.audio_last_sample_pts_=Ce)}},Ve.prototype.parseOpusPayload=function(De,Re){if(!this.has_video_||this.video_init_segment_dispatched_){var ut,gt;if(Re!=null&&(gt=Re/this.timescale_),this.audio_metadata_.codec==="opus"){if(Re==null&&this.audio_last_sample_pts_!=null)ut=20,gt=this.audio_last_sample_pts_+ut;else if(Re==null)return void l.a.w(this.TAG,"Opus: Unknown pts")}for(var Ce,ze=gt,At=0;At>>3&3,At=(6&De[1])>>1,Je=(240&De[2])>>>4,$e=(12&De[2])>>>2,Be=(De[3]>>>6&3)!==3?2:1,it=0,Ne=34;switch(ze){case 0:it=[11025,12e3,8e3,0][$e];break;case 2:it=[22050,24e3,16e3,0][$e];break;case 3:it=[44100,48e3,32e3,0][$e]}switch(At){case 1:Ne=34,Je=2&&r[a]===3&&r[a-1]===0&&r[a-2]===0||(t[n]=r[a],n++);return new Uint8Array(t.buffer,0,n)},c.parseVPS=function(p){var r=c._ebsp2rbsp(p),i=new y.a(r);return i.readByte(),i.readByte(),i.readBits(4),i.readBits(2),i.readBits(6),{num_temporal_layers:i.readBits(3)+1,temporal_id_nested:i.readBool()}},c.parseSPS=function(p){var r=c._ebsp2rbsp(p),i=new y.a(r);i.readByte(),i.readByte();for(var t=0,n=0,a=0,o=0,d=(i.readBits(4),i.readBits(3)),g=(i.readBool(),i.readBits(2)),m=i.readBool(),v=i.readBits(5),b=i.readByte(),w=i.readByte(),C=i.readByte(),D=i.readByte(),R=i.readByte(),T=i.readByte(),P=i.readByte(),L=i.readByte(),I=i.readByte(),x=i.readByte(),O=i.readByte(),G=[],J=[],te=0;te0)for(te=d;te<8;te++)i.readBits(2);for(te=0;te1&&i.readSEG(),te=0;te0&&tt<=16?(ht=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][tt-1],_e=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][tt-1]):tt===255&&(ht=i.readBits(16),_e=i.readBits(16))}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(3),i.readBool(),i.readBool()&&(i.readByte(),i.readByte(),i.readByte())),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool(),i.readBool(),i.readBool(),i.readBool()&&(i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG()),i.readBool()&&(pt=i.readBits(32),vt=i.readBits(32),i.readBool()&&i.readUEG(),i.readBool())){var pe=!1,ue=!1,W=!1;for(pe=i.readBool(),ue=i.readBool(),(pe||ue)&&((W=i.readBool())&&(i.readByte(),i.readBits(5),i.readBool(),i.readBits(5)),i.readBits(4),i.readBits(4),W&&i.readBits(4),i.readBits(5),i.readBits(5),i.readBits(5)),te=0;te<=d;te++){var ke=i.readBool();Oe=ke;var Ae=!0,Ye=1;ke||(Ae=i.readBool());var lt=!1;if(Ae?i.readUEG():lt=i.readBool(),lt||(Ye=i.readUEG()+1),pe){for(fe=0;fe=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"averageKBps",{get:function(){var T=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/T/1024},enumerable:!1,configurable:!0}),R}(),p=A(2),r=A(5),i=A(3),t=(y=function(R,T){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(P,L){P.__proto__=L}||function(P,L){for(var I in L)Object.prototype.hasOwnProperty.call(L,I)&&(P[I]=L[I])})(R,T)},function(R,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");function P(){this.constructor=R}y(R,T),R.prototype=T===null?Object.create(T):(P.prototype=T.prototype,new P)}),n=function(R){function T(P,L){var I=R.call(this,"fetch-stream-loader")||this;return I.TAG="FetchStreamLoader",I._seekHandler=P,I._config=L,I._needStash=!0,I._requestAbort=!1,I._abortController=null,I._contentLength=null,I._receivedLength=0,I}return t(T,R),T.isSupported=function(){try{var P=r.a.msedge&&r.a.version.minor>=15048,L=!r.a.msedge||P;return self.fetch&&self.ReadableStream&&L}catch{return!1}},T.prototype.destroy=function(){this.isWorking()&&this.abort(),R.prototype.destroy.call(this)},T.prototype.open=function(P,L){var I=this;this._dataSource=P,this._range=L;var x=P.url;this._config.reuseRedirectedURL&&P.redirectedURL!=null&&(x=P.redirectedURL);var O=this._seekHandler.getConfig(x,L),G=new self.Headers;if(typeof O.headers=="object"){var J=O.headers;for(var te in J)J.hasOwnProperty(te)&&G.append(te,J[te])}var le={method:"GET",headers:G,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var te in this._config.headers)G.append(te,this._config.headers[te]);P.cors===!1&&(le.mode="same-origin"),P.withCredentials&&(le.credentials="include"),P.referrerPolicy&&(le.referrerPolicy=P.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,le.signal=this._abortController.signal),this._status=p.c.kConnecting,self.fetch(O.url,le).then(function(ne){if(I._requestAbort)return I._status=p.c.kIdle,void ne.body.cancel();if(ne.ok&&ne.status>=200&&ne.status<=299){if(ne.url!==O.url&&I._onURLRedirect){var ee=I._seekHandler.removeURLParameters(ne.url);I._onURLRedirect(ee)}var M=ne.headers.get("Content-Length");return M!=null&&(I._contentLength=parseInt(M),I._contentLength!==0&&I._onContentLengthKnown&&I._onContentLengthKnown(I._contentLength)),I._pump.call(I,ne.body.getReader())}if(I._status=p.c.kError,!I._onError)throw new i.d("FetchStreamLoader: Http code invalid, "+ne.status+" "+ne.statusText);I._onError(p.b.HTTP_STATUS_CODE_INVALID,{code:ne.status,msg:ne.statusText})}).catch(function(ne){if(!I._abortController||!I._abortController.signal.aborted){if(I._status=p.c.kError,!I._onError)throw ne;I._onError(p.b.EXCEPTION,{code:-1,msg:ne.message})}})},T.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==p.c.kBuffering||!r.a.chrome)&&this._abortController)try{this._abortController.abort()}catch{}},T.prototype._pump=function(P){var L=this;return P.read().then(function(I){if(I.done)if(L._contentLength!==null&&L._receivedLength299)){if(this._status=p.c.kError,!this._onError)throw new i.d("MozChunkedLoader: Http code invalid, "+L.status+" "+L.statusText);this._onError(p.b.HTTP_STATUS_CODE_INVALID,{code:L.status,msg:L.statusText})}else this._status=p.c.kBuffering}},T.prototype._onProgress=function(P){if(this._status!==p.c.kError){this._contentLength===null&&P.total!==null&&P.total!==0&&(this._contentLength=P.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var L=P.target.response,I=this._range.from+this._receivedLength;this._receivedLength+=L.byteLength,this._onDataArrival&&this._onDataArrival(L,I,this._receivedLength)}},T.prototype._onLoadEnd=function(P){this._requestAbort!==!0?this._status!==p.c.kError&&(this._status=p.c.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1},T.prototype._onXhrError=function(P){this._status=p.c.kError;var L=0,I=null;if(this._contentLength&&P.loaded=200&&L.status<=299){if(this._status=p.c.kBuffering,L.responseURL!=null){var I=this._seekHandler.removeURLParameters(L.responseURL);L.responseURL!==this._currentRequestURL&&I!==this._currentRedirectedURL&&(this._currentRedirectedURL=I,this._onURLRedirect&&this._onURLRedirect(I))}var x=L.getResponseHeader("Content-Length");if(x!=null&&this._contentLength==null){var O=parseInt(x);O>0&&(this._contentLength=O,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else{if(this._status=p.c.kError,!this._onError)throw new i.d("MSStreamLoader: Http code invalid, "+L.status+" "+L.statusText);this._onError(p.b.HTTP_STATUS_CODE_INVALID,{code:L.status,msg:L.statusText})}else if(L.readyState===3&&L.status>=200&&L.status<=299){this._status=p.c.kBuffering;var G=L.response;this._reader.readAsArrayBuffer(G)}},T.prototype._xhrOnError=function(P){this._status=p.c.kError;var L=p.b.EXCEPTION,I={code:-1,msg:P.constructor.name+" "+P.type};if(!this._onError)throw new i.d(I.msg);this._onError(L,I)},T.prototype._msrOnProgress=function(P){var L=P.target.result;if(L!=null){var I=L.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=L.byteLength;var x=this._totalRange.from+this._receivedLength;this._receivedLength+=I.byteLength,this._onDataArrival&&this._onDataArrival(I,x,this._receivedLength),L.byteLength>=this._bufferLimit&&(l.a.v(this.TAG,"MSStream buffer exceeded max size near ".concat(x+I.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}else this._doReconnectIfNeeded()},T.prototype._doReconnectIfNeeded=function(){if(this._contentLength==null||this._receivedLength=this._contentLength&&(I=this._range.from+this._contentLength-1),this._currentRequestRange={from:L,to:I},this._internalOpen(this._dataSource,this._currentRequestRange)},T.prototype._internalOpen=function(P,L){this._lastTimeLoaded=0;var I=P.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?I=this._currentRedirectedURL:P.redirectedURL!=null&&(I=P.redirectedURL));var x=this._seekHandler.getConfig(I,L);this._currentRequestURL=x.url;var O=this._xhr=new XMLHttpRequest;if(O.open("GET",x.url,!0),O.responseType="arraybuffer",O.onreadystatechange=this._onReadyStateChange.bind(this),O.onprogress=this._onProgress.bind(this),O.onload=this._onLoad.bind(this),O.onerror=this._onXhrError.bind(this),P.withCredentials&&(O.withCredentials=!0),typeof x.headers=="object"){var G=x.headers;for(var J in G)G.hasOwnProperty(J)&&O.setRequestHeader(J,G[J])}if(typeof this._config.headers=="object"){G=this._config.headers;for(var J in G)G.hasOwnProperty(J)&&O.setRequestHeader(J,G[J])}O.send()},T.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=p.c.kComplete},T.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},T.prototype._onReadyStateChange=function(P){var L=P.target;if(L.readyState===2){if(L.responseURL!=null){var I=this._seekHandler.removeURLParameters(L.responseURL);L.responseURL!==this._currentRequestURL&&I!==this._currentRedirectedURL&&(this._currentRedirectedURL=I,this._onURLRedirect&&this._onURLRedirect(I))}if(L.status>=200&&L.status<=299){if(this._waitForTotalLength)return;this._status=p.c.kBuffering}else{if(this._status=p.c.kError,!this._onError)throw new i.d("RangeLoader: Http code invalid, "+L.status+" "+L.statusText);this._onError(p.b.HTTP_STATUS_CODE_INVALID,{code:L.status,msg:L.statusText})}}},T.prototype._onProgress=function(P){if(this._status!==p.c.kError){if(this._contentLength===null){var L=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,L=!0;var I=P.total;this._internalAbort(),I!=null&I!==0&&(this._totalLength=I)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,L)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var x=P.loaded-this._lastTimeLoaded;this._lastTimeLoaded=P.loaded,this._speedSampler.addBytes(x)}},T.prototype._normalizeSpeed=function(P){var L=this._chunkSizeKBList,I=L.length-1,x=0,O=0,G=I;if(P=L[x]&&P=3&&(L=this._speedSampler.currentKBps)),L!==0){var I=this._normalizeSpeed(L);this._currentSpeedNormalized!==I&&(this._currentSpeedNormalized=I,this._currentChunkSizeKB=I)}var x=P.target.response,O=this._range.from+this._receivedLength;this._receivedLength+=x.byteLength;var G=!1;this._contentLength!=null&&this._receivedLength0&&this._receivedLength0)for(var O=L.split("&"),G=0;G0;J[0]!==this._startName&&J[0]!==this._endName&&(te&&(x+="&"),x+=O[G])}return x.length===0?P:P+"?"+x},R}(),D=function(){function R(T,P,L){this.TAG="IOController",this._config=P,this._extraData=L,this._stashInitialSize=65536,P.stashInitialSize!=null&&P.stashInitialSize>0&&(this._stashInitialSize=P.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=Math.max(this._stashSize,3145728),this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,P.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=T,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(T.url),this._refTotalLength=T.filesize?T.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new c,this._speedNormalizeList=[32,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return R.prototype.destroy=function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},R.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},R.prototype.isPaused=function(){return this._paused},Object.defineProperty(R.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"extraData",{get:function(){return this._extraData},set:function(T){this._extraData=T},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(T){this._onDataArrival=T},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(T){this._onSeeked=T},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onError",{get:function(){return this._onError},set:function(T){this._onError=T},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onComplete",{get:function(){return this._onComplete},set:function(T){this._onComplete=T},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(T){this._onRedirect=T},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(T){this._onRecoveredEarlyEof=T},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"hasRedirect",{get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"currentSpeed",{get:function(){return this._loaderClass===m?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),R.prototype._selectSeekHandler=function(){var T=this._config;if(T.seekType==="range")this._seekHandler=new w(this._config.rangeLoadZeroStart);else if(T.seekType==="param"){var P=T.seekParamStart||"bstart",L=T.seekParamEnd||"bend";this._seekHandler=new C(P,L)}else{if(T.seekType!=="custom")throw new i.b("Invalid seekType in config: ".concat(T.seekType));if(typeof T.customSeekHandler!="function")throw new i.b("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new T.customSeekHandler}},R.prototype._selectLoader=function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=b;else if(n.isSupported())this._loaderClass=n;else if(o.isSupported())this._loaderClass=o;else{if(!m.isSupported())throw new i.d("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=m}},R.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)},R.prototype.open=function(T){this._currentRange={from:0,to:-1},T&&(this._currentRange.from=T),this._speedSampler.reset(),T||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},R.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},R.prototype.pause=function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},R.prototype.resume=function(){if(this._paused){this._paused=!1;var T=this._resumeFrom;this._resumeFrom=0,this._internalSeek(T,!0)}},R.prototype.seek=function(T){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(T,!0)},R.prototype._internalSeek=function(T,P){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(P),this._loader.destroy(),this._loader=null;var L={from:T,to:-1};this._currentRange={from:L.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,L),this._onSeeked&&this._onSeeked()},R.prototype.updateUrl=function(T){if(!T||typeof T!="string"||T.length===0)throw new i.b("Url must be a non-empty string!");this._dataSource.url=T},R.prototype._expandBuffer=function(T){for(var P=this._stashSize;P+10485760){var I=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(L,0,P).set(I,0)}this._stashBuffer=L,this._bufferSize=P}},R.prototype._normalizeSpeed=function(T){var P=this._speedNormalizeList,L=P.length-1,I=0,x=0,O=L;if(T=P[I]&&T=512&&T<=1024?Math.floor(1.5*T):2*T)>8192&&(P=8192);var L=1024*P+1048576;this._bufferSize0){var O=this._stashBuffer.slice(0,this._stashUsed);(te=this._dispatchChunks(O,this._stashByteStart))0&&(le=new Uint8Array(O,te),J.set(le,0),this._stashUsed=le.byteLength,this._stashByteStart+=te):(this._stashUsed=0,this._stashByteStart+=te),this._stashUsed+T.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+T.byteLength),J=new Uint8Array(this._stashBuffer,0,this._bufferSize)),J.set(new Uint8Array(T),this._stashUsed),this._stashUsed+=T.byteLength}else(te=this._dispatchChunks(T,P))this._bufferSize&&(this._expandBuffer(G),J=new Uint8Array(this._stashBuffer,0,this._bufferSize)),J.set(new Uint8Array(T,te),0),this._stashUsed+=G,this._stashByteStart=P+te);else if(this._stashUsed===0){var G;(te=this._dispatchChunks(T,P))this._bufferSize&&this._expandBuffer(G),(J=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(T,te),0),this._stashUsed+=G,this._stashByteStart=P+te)}else{var J,te;if(this._stashUsed+T.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+T.byteLength),(J=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(T),this._stashUsed),this._stashUsed+=T.byteLength,(te=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))0){var le=new Uint8Array(this._stashBuffer,te);J.set(le,0)}this._stashUsed-=te,this._stashByteStart+=te}}},R.prototype._flushStashBuffer=function(T){if(this._stashUsed>0){var P=this._stashBuffer.slice(0,this._stashUsed),L=this._dispatchChunks(P,this._stashByteStart),I=P.byteLength-L;if(L0){var x=new Uint8Array(this._stashBuffer,0,this._bufferSize),O=new Uint8Array(P,L);x.set(O,0),this._stashUsed=O.byteLength,this._stashByteStart+=L}return 0}l.a.w(this.TAG,"".concat(I," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,I}return 0},R.prototype._onLoaderComplete=function(T,P){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},R.prototype._onLoaderError=function(T,P){switch(l.a.e(this.TAG,"Loader error, code = ".concat(P.code,", msg = ").concat(P.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,T=p.b.UNRECOVERABLE_EARLY_EOF),T){case p.b.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var L=this._currentRange.to+1;return void(L=128){Y.push(String.fromCharCode(65535&Z)),z+=2;continue}}else if(j[z]<240){if(i(j,z,2)&&(Z=(15&j[z])<<12|(63&j[z+1])<<6|63&j[z+2])>=2048&&(63488&Z)!=55296){Y.push(String.fromCharCode(65535&Z)),z+=3;continue}}else if(j[z]<248){var Z;if(i(j,z,3)&&(Z=(7&j[z])<<18|(63&j[z+1])<<12|(63&j[z+2])<<6|63&j[z+3])>65536&&Z<1114112){Z-=65536,Y.push(String.fromCharCode(Z>>>10|55296)),Y.push(String.fromCharCode(1023&Z|56320)),z+=4;continue}}}Y.push("�"),++z}return Y.join("")},a=A(3),o=(t=new ArrayBuffer(2),new DataView(t).setInt16(0,256,!0),new Int16Array(t)[0]===256),d=function(){function M(){}return M.parseScriptData=function(Y,j,z){var q={};try{var Z=M.parseValue(Y,j,z),X=M.parseValue(Y,j+Z.size,z-Z.size);q[Z.data]=X.data}catch(oe){c.a.e("AMF",oe.toString())}return q},M.parseObject=function(Y,j,z){if(z<3)throw new a.a("Data not enough when parse ScriptDataObject");var q=M.parseString(Y,j,z),Z=M.parseValue(Y,j+q.size,z-q.size),X=Z.objectEnd;return{data:{name:q.data,value:Z.data},size:q.size+Z.size,objectEnd:X}},M.parseVariable=function(Y,j,z){return M.parseObject(Y,j,z)},M.parseString=function(Y,j,z){if(z<2)throw new a.a("Data not enough when parse String");var q=new DataView(Y,j,z).getUint16(0,!o);return{data:q>0?n(new Uint8Array(Y,j+2,q)):"",size:2+q}},M.parseLongString=function(Y,j,z){if(z<4)throw new a.a("Data not enough when parse LongString");var q=new DataView(Y,j,z).getUint32(0,!o);return{data:q>0?n(new Uint8Array(Y,j+4,q)):"",size:4+q}},M.parseDate=function(Y,j,z){if(z<10)throw new a.a("Data size invalid when parse Date");var q=new DataView(Y,j,z),Z=q.getFloat64(0,!o),X=q.getInt16(8,!o);return{data:new Date(Z+=60*X*1e3),size:10}},M.parseValue=function(Y,j,z){if(z<1)throw new a.a("Data not enough when parse Value");var q,Z=new DataView(Y,j,z),X=1,oe=Z.getUint8(0),he=!1;try{switch(oe){case 0:q=Z.getFloat64(1,!o),X+=8;break;case 1:q=!!Z.getUint8(1),X+=1;break;case 2:var ie=M.parseString(Y,j+1,z-1);q=ie.data,X+=ie.size;break;case 3:q={};var fe=0;for((16777215&Z.getUint32(z-4,!o))==9&&(fe=3);X>3,Z=(4&Y[z])!=0,X=(2&Y[z])!=0;Y[z],z+=1,Z&&(z+=1);var oe=Number.POSITIVE_INFINITY;if(X){oe=0;for(var he=0;oe|=(127&Y[z])<<7*he,(128&Y[z+=1])!=0;he++);}q===1&&(j=M.parseSeuqneceHeader(Y.subarray(z,z+oe))),z+=oe}return j},M.parseSeuqneceHeader=function(Y){var j=new R.a(Y),z=j.readBits(3),q=(j.readBool(),j.readBool()),Z=!0,X=0,oe=0,he=[];if(q)he.push({operating_point_idc:0,level:j.readBits(5),tier:0});else{if(j.readBool()){var ie=j.readBits(32),fe=j.readBits(32),se=j.readBool();if(se){for(var Ee=0;j.readBits(1)===0;)Ee+=1;Ee>=32||(1<7?j.readBits(1):0;he.push({operating_point_idc:je,level:ht,tier:_e}),He&&j.readBool()&&j.readBits(4)}}var Oe=he[0],pt=Oe.level,vt=Oe.tier,tt=j.readBits(4),pe=j.readBits(4),ue=j.readBits(tt+1)+1,W=j.readBits(pe+1)+1,ke=!1;q||(ke=j.readBool()),ke&&(j.readBits(4),j.readBits(4)),j.readBool(),j.readBool(),j.readBool();var Ae=!1;q||(j.readBool(),j.readBool(),j.readBool(),j.readBool(),(Ae=j.readBool())&&(j.readBool(),j.readBool()),(j.readBool()||j.readBits(1))&&(j.readBool()||j.readBits(1)),Ae&&j.readBits(3)+1),j.readBool(),j.readBool(),j.readBool();var Ye=j.readBool(),lt=8;z===2&&Ye?lt=j.readBool()?12:10:lt=Ye?10:8;var mt=!1;z!==1&&(mt=j.readBool()),j.readBool()&&(j.readBits(8),j.readBits(8),j.readBits(8));var Ue=1,Ve=1;return mt?(j.readBits(1),Ue=1,Ve=1):(j.readBits(1),z==0?(Ue=1,Ve=1):z==1?(Ue=0,Ve=0):lt==12?j.readBits(1)&&j.readBits(1):(Ue=1,Ve=0),Ue&&Ve&&j.readBits(2),j.readBits(1)),j.readBool(),j.destroy(),j=null,{codec_mimetype:"av01.".concat(z,".").concat(M.getLevelString(pt,vt),".").concat(lt.toString(10).padStart(2,"0")),level:pt,tier:vt,level_string:M.getLevelString(pt,vt),profile_idc:z,profile_string:"".concat(z),bit_depth:lt,ref_frames:1,chroma_format:M.getChromaFormat(mt,Ue,Ve),chroma_format_string:M.getChromaFormatString(mt,Ue,Ve),frame_rate:{fixed:Z,fps:X/oe,fps_den:oe,fps_num:X},sar_ratio:{width:1,height:1},codec_size:{width:ue,height:W},present_size:{width:1*ue,height:W}}},M.getLevelString=function(Y,j){return"".concat(Y.toString(10).padStart(2,"0")).concat(j===0?"M":"H")},M.getChromaFormat=function(Y,j,z){return Y?0:j===0&&z===0?3:j===1&&z===0?2:j===1&&z===1?1:Number.NaN},M.getChromaFormatString=function(Y,j,z){return Y?"4:0:0":j===0&&z===0?"4:4:4":j===1&&z===0?"4:2:2":j===1&&z===1?"4:2:0":"Unknown"},M}(),P=function(){function M(Y,j){this.TAG="FLVDemuxer",this._config=j,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=Y.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=Y.hasAudioTrack,this._hasVideo=Y.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new r.a,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var z=new ArrayBuffer(2);return new DataView(z).setInt16(0,256,!0),new Int16Array(z)[0]===256}()}return M.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},M.probe=function(Y){var j=new Uint8Array(Y);if(j.byteLength<9)return{needMoreData:!0};var z={match:!1};if(j[0]!==70||j[1]!==76||j[2]!==86||j[3]!==1)return z;var q,Z,X=(4&j[4])>>>2!=0,oe=(1&j[4])!=0,he=(q=j)[Z=5]<<24|q[Z+1]<<16|q[Z+2]<<8|q[Z+3];return he<9?z:{match:!0,consumed:he,dataOffset:he,hasAudioTrack:X,hasVideoTrack:oe}},M.prototype.bindDataSource=function(Y){return Y.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(M.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(Y){this._onTrackMetadata=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(Y){this._onMediaInfo=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(Y){this._onMetaDataArrived=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(Y){this._onScriptDataArrived=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"onError",{get:function(){return this._onError},set:function(Y){this._onError=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(Y){this._onDataAvailable=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(Y){this._timestampBase=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"overridedDuration",{get:function(){return this._duration},set:function(Y){this._durationOverrided=!0,this._duration=Y,this._mediaInfo.duration=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"overridedHasAudio",{set:function(Y){this._hasAudioFlagOverrided=!0,this._hasAudio=Y,this._mediaInfo.hasAudio=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"overridedHasVideo",{set:function(Y){this._hasVideoFlagOverrided=!0,this._hasVideo=Y,this._mediaInfo.hasVideo=Y},enumerable:!1,configurable:!0}),M.prototype.resetMediaInfo=function(){this._mediaInfo=new r.a},M.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},M.prototype.parseChunks=function(Y,j){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new a.a("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var z=0,q=this._littleEndian;if(j===0){if(!(Y.byteLength>13))return 0;z=M.probe(Y).dataOffset}for(this._firstParse&&(this._firstParse=!1,j+z!==this._dataOffset&&c.a.w(this.TAG,"First time parsing but chunk byteStart invalid!"),(Z=new DataView(Y,z)).getUint32(0,!q)!==0&&c.a.w(this.TAG,"PrevTagSize0 !== 0 !!!"),z+=4);zY.byteLength)break;var X=Z.getUint8(0),oe=16777215&Z.getUint32(0,!q);if(z+11+oe+4>Y.byteLength)break;if(X===8||X===9||X===18){var he=Z.getUint8(4),ie=Z.getUint8(5),fe=Z.getUint8(6)|ie<<8|he<<16|Z.getUint8(7)<<24;16777215&Z.getUint32(7,!q)&&c.a.w(this.TAG,"Meet tag which has StreamID != 0!");var se=z+11;switch(X){case 8:this._parseAudioData(Y,se,oe,fe);break;case 9:this._parseVideoData(Y,se,oe,fe,j+z);break;case 18:this._parseScriptData(Y,se,oe)}var Ee=Z.getUint32(11+oe,!q);Ee!==11+oe&&c.a.w(this.TAG,"Invalid PrevTagSize ".concat(Ee)),z+=11+oe+4}else c.a.w(this.TAG,"Unsupported tag type ".concat(X,", skipped")),z+=11+oe+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),z},M.prototype._parseScriptData=function(Y,j,z){var q=d.parseScriptData(Y,j,z);if(q.hasOwnProperty("onMetaData")){if(q.onMetaData==null||typeof q.onMetaData!="object")return void c.a.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&c.a.w(this.TAG,"Found another onMetaData tag!"),this._metadata=q;var Z=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},Z)),typeof Z.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=Z.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof Z.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=Z.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof Z.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=Z.audiodatarate),typeof Z.videodatarate=="number"&&(this._mediaInfo.videoDataRate=Z.videodatarate),typeof Z.width=="number"&&(this._mediaInfo.width=Z.width),typeof Z.height=="number"&&(this._mediaInfo.height=Z.height),typeof Z.duration=="number"){if(!this._durationOverrided){var X=Math.floor(Z.duration*this._timescale);this._duration=X,this._mediaInfo.duration=X}}else this._mediaInfo.duration=0;if(typeof Z.framerate=="number"){var oe=Math.floor(1e3*Z.framerate);if(oe>0){var he=oe/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=he,this._referenceFrameRate.fps_num=oe,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=he}}if(typeof Z.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var ie=Z.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(ie),Z.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=Z,c.a.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(q).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},q))},M.prototype._parseKeyframesIndex=function(Y){for(var j=[],z=[],q=1;q>>4;if(X===2||X===10){var oe=0,he=(12&Z)>>>2;if(he>=0&&he<=4){oe=this._flvSoundRateTable[he];var ie=1&Z,fe=this._audioMetadata,se=this._audioTrack;if(fe||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(fe=this._audioMetadata={}).type="audio",fe.id=se.id,fe.timescale=this._timescale,fe.duration=this._duration,fe.audioSampleRate=oe,fe.channelCount=ie===0?1:2),X===10){var Ee=this._parseAACAudioData(Y,j+1,z-1);if(Ee==null)return;if(Ee.packetType===0){if(fe.config){if(D(Ee.data.config,fe.config))return;c.a.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var He=Ee.data;fe.audioSampleRate=He.samplingRate,fe.channelCount=He.channelCount,fe.codec=He.codec,fe.originalCodec=He.originalCodec,fe.config=He.config,fe.refSampleDuration=1024/fe.audioSampleRate*fe.timescale,c.a.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",fe),(je=this._mediaInfo).audioCodec=fe.originalCodec,je.audioSampleRate=fe.audioSampleRate,je.audioChannelCount=fe.channelCount,je.hasVideo?je.videoCodec!=null&&(je.mimeType='video/x-flv; codecs="'+je.videoCodec+","+je.audioCodec+'"'):je.mimeType='video/x-flv; codecs="'+je.audioCodec+'"',je.isComplete()&&this._onMediaInfo(je)}else if(Ee.packetType===1){var Ie=this._timestampBase+q,at={unit:Ee.data,length:Ee.data.byteLength,dts:Ie,pts:Ie};se.samples.push(at),se.length+=Ee.data.length}else c.a.e(this.TAG,"Flv: Unsupported AAC data type ".concat(Ee.packetType))}else if(X===2){if(!fe.codec){var je;if((He=this._parseMP3AudioData(Y,j+1,z-1,!0))==null)return;fe.audioSampleRate=He.samplingRate,fe.channelCount=He.channelCount,fe.codec=He.codec,fe.originalCodec=He.originalCodec,fe.refSampleDuration=1152/fe.audioSampleRate*fe.timescale,c.a.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",fe),(je=this._mediaInfo).audioCodec=fe.codec,je.audioSampleRate=fe.audioSampleRate,je.audioChannelCount=fe.channelCount,je.audioDataRate=He.bitRate,je.hasVideo?je.videoCodec!=null&&(je.mimeType='video/x-flv; codecs="'+je.videoCodec+","+je.audioCodec+'"'):je.mimeType='video/x-flv; codecs="'+je.audioCodec+'"',je.isComplete()&&this._onMediaInfo(je)}var ht=this._parseMP3AudioData(Y,j+1,z-1,!1);if(ht==null)return;Ie=this._timestampBase+q;var _e={unit:ht,length:ht.byteLength,dts:Ie,pts:Ie};se.samples.push(_e),se.length+=ht.length}}else this._onError(m.a.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+he)}else this._onError(m.a.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+X)}},M.prototype._parseAACAudioData=function(Y,j,z){if(!(z<=1)){var q={},Z=new Uint8Array(Y,j,z);return q.packetType=Z[0],Z[0]===0?q.data=this._parseAACAudioSpecificConfig(Y,j+1,z-1):q.data=Z.subarray(1),q}c.a.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},M.prototype._parseAACAudioSpecificConfig=function(Y,j,z){var q,Z,X=new Uint8Array(Y,j,z),oe=null,he=0,ie=null;if(he=q=X[0]>>>3,(Z=(7&X[0])<<1|X[1]>>>7)<0||Z>=this._mpegSamplingRates.length)this._onError(m.a.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var fe=this._mpegSamplingRates[Z],se=(120&X[1])>>>3;if(!(se<0||se>=8)){he===5&&(ie=(7&X[1])<<1|X[2]>>>7,(124&X[2])>>>2);var Ee=self.navigator.userAgent.toLowerCase();return Ee.indexOf("firefox")!==-1?Z>=6?(he=5,oe=new Array(4),ie=Z-3):(he=2,oe=new Array(2),ie=Z):Ee.indexOf("android")!==-1?(he=2,oe=new Array(2),ie=Z):(he=5,ie=Z,oe=new Array(4),Z>=6?ie=Z-3:se===1&&(he=2,oe=new Array(2),ie=Z)),oe[0]=he<<3,oe[0]|=(15&Z)>>>1,oe[1]=(15&Z)<<7,oe[1]|=(15&se)<<3,he===5&&(oe[1]|=(15&ie)>>>1,oe[2]=(1&ie)<<7,oe[2]|=8,oe[3]=0),{config:oe,samplingRate:fe,channelCount:se,codec:"mp4a.40."+he,originalCodec:"mp4a.40."+q}}this._onError(m.a.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},M.prototype._parseMP3AudioData=function(Y,j,z,q){if(!(z<4)){this._littleEndian;var Z=new Uint8Array(Y,j,z),X=null;if(q){if(Z[0]!==255)return;var oe=Z[1]>>>3&3,he=(6&Z[1])>>1,ie=(240&Z[2])>>>4,fe=(12&Z[2])>>>2,se=(Z[3]>>>6&3)!==3?2:1,Ee=0,He=0;switch(oe){case 0:Ee=this._mpegAudioV25SampleRateTable[fe];break;case 2:Ee=this._mpegAudioV20SampleRateTable[fe];break;case 3:Ee=this._mpegAudioV10SampleRateTable[fe]}switch(he){case 1:ie>>4;if(128&X){var he=15&X,ie=String.fromCharCode.apply(String,new Uint8Array(Y,j,z).slice(1,5));if(ie==="hvc1")this._parseEnhancedHEVCVideoPacket(Y,j+5,z-5,q,Z,oe,he);else{if(ie!=="av01")return void this._onError(m.a.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(ie));this._parseEnhancedAV1VideoPacket(Y,j+5,z-5,q,Z,oe,he)}}else{var fe=15&X;if(fe===7)this._parseAVCVideoPacket(Y,j+1,z-1,q,Z,oe);else{if(fe!==12)return void this._onError(m.a.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(fe));this._parseHEVCVideoPacket(Y,j+1,z-1,q,Z,oe)}}}},M.prototype._parseAVCVideoPacket=function(Y,j,z,q,Z,X){if(z<4)c.a.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var oe=this._littleEndian,he=new DataView(Y,j,z),ie=he.getUint8(0),fe=(16777215&he.getUint32(0,!oe))<<8>>8;if(ie===0)this._parseAVCDecoderConfigurationRecord(Y,j+4,z-4);else if(ie===1)this._parseAVCVideoData(Y,j+4,z-4,q,Z,X,fe);else if(ie!==2)return void this._onError(m.a.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(ie))}},M.prototype._parseHEVCVideoPacket=function(Y,j,z,q,Z,X){if(z<4)c.a.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var oe=this._littleEndian,he=new DataView(Y,j,z),ie=he.getUint8(0),fe=(16777215&he.getUint32(0,!oe))<<8>>8;if(ie===0)this._parseHEVCDecoderConfigurationRecord(Y,j+4,z-4);else if(ie===1)this._parseHEVCVideoData(Y,j+4,z-4,q,Z,X,fe);else if(ie!==2)return void this._onError(m.a.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(ie))}},M.prototype._parseEnhancedHEVCVideoPacket=function(Y,j,z,q,Z,X,oe){var he=this._littleEndian,ie=new DataView(Y,j,z);if(oe===0)this._parseHEVCDecoderConfigurationRecord(Y,j,z);else if(oe===1){var fe=(4294967040&ie.getUint32(0,!he))>>8;this._parseHEVCVideoData(Y,j+3,z-3,q,Z,X,fe)}else if(oe===3)this._parseHEVCVideoData(Y,j,z,q,Z,X,0);else if(oe!==2)return void this._onError(m.a.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(oe))},M.prototype._parseEnhancedAV1VideoPacket=function(Y,j,z,q,Z,X,oe){if(this._littleEndian,oe===0)this._parseAV1CodecConfigurationRecord(Y,j,z);else if(oe===1)this._parseAV1VideoData(Y,j,z,q,Z,X,0);else{if(oe===5)return void this._onError(m.a.FORMAT_ERROR,"Flv: Not Supported MP2T AV1 video packet type ".concat(oe));if(oe!==2)return void this._onError(m.a.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(oe))}},M.prototype._parseAVCDecoderConfigurationRecord=function(Y,j,z){if(z<7)c.a.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var q=this._videoMetadata,Z=this._videoTrack,X=this._littleEndian,oe=new DataView(Y,j,z);if(q){if(q.avcc!==void 0){var he=new Uint8Array(Y,j,z);if(D(he,q.avcc))return;c.a.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(q=this._videoMetadata={}).type="video",q.id=Z.id,q.timescale=this._timescale,q.duration=this._duration;var ie=oe.getUint8(0),fe=oe.getUint8(1);if(oe.getUint8(2),oe.getUint8(3),ie===1&&fe!==0)if(this._naluLengthSize=1+(3&oe.getUint8(4)),this._naluLengthSize===3||this._naluLengthSize===4){var se=31&oe.getUint8(5);if(se!==0){se>1&&c.a.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(se));for(var Ee=6,He=0;He1&&c.a.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(ue)),Ee++,He=0;He=z){c.a.w(this.TAG,"Malformed Nalu near timestamp ".concat(Ie,", offset = ").concat(Ee,", dataSize = ").concat(z));break}var je=ie.getUint32(Ee,!he);if(He===3&&(je>>>=8),je>z-He)return void c.a.w(this.TAG,"Malformed Nalus near timestamp ".concat(Ie,", NaluSize > DataSize!"));var ht=31&ie.getUint8(Ee+He);ht===5&&(at=!0);var _e=new Uint8Array(Y,j+Ee,He+je),Oe={type:ht,data:_e};fe.push(Oe),se+=_e.byteLength,Ee+=He+je}if(fe.length){var pt=this._videoTrack,vt={units:fe,length:se,isKeyframe:at,dts:Ie,cts:oe,pts:Ie+oe};at&&(vt.fileposition=Z),pt.samples.push(vt),pt.length+=se}},M.prototype._parseHEVCVideoData=function(Y,j,z,q,Z,X,oe){for(var he=this._littleEndian,ie=new DataView(Y,j,z),fe=[],se=0,Ee=0,He=this._naluLengthSize,Ie=this._timestampBase+q,at=X===1;Ee=z){c.a.w(this.TAG,"Malformed Nalu near timestamp ".concat(Ie,", offset = ").concat(Ee,", dataSize = ").concat(z));break}var je=ie.getUint32(Ee,!he);if(He===3&&(je>>>=8),je>z-He)return void c.a.w(this.TAG,"Malformed Nalus near timestamp ".concat(Ie,", NaluSize > DataSize!"));var ht=ie.getUint8(Ee+He)>>1&63;ht!==19&&ht!==20&&ht!==21||(at=!0);var _e=new Uint8Array(Y,j+Ee,He+je),Oe={type:ht,data:_e};fe.push(Oe),se+=_e.byteLength,Ee+=He+je}if(fe.length){var pt=this._videoTrack,vt={units:fe,length:se,isKeyframe:at,dts:Ie,cts:oe,pts:Ie+oe};at&&(vt.fileposition=Z),pt.samples.push(vt),pt.length+=se}},M.prototype._parseAV1VideoData=function(Y,j,z,q,Z,X,oe){this._littleEndian;var he,ie=[],fe=this._timestampBase+q,se=X===1;if(he=z,ie.push({unitType:0,data:new Uint8Array(Y,j+0,z)}),ie.length){var Ee=this._videoTrack,He={units:ie,length:he,isKeyframe:se,dts:fe,cts:oe,pts:fe+oe};se&&(He.fileposition=Z),Ee.samples.push(He),Ee.length+=he}},M}(),L=A(14),I=function(M,Y,j){for(var z,q=0,Z=Y.length;q>>24&255,z[1]=j>>>16&255,z[2]=j>>>8&255,z[3]=255&j,z.set(Y,4);var oe=8;for(X=0;X>>24&255,Y>>>16&255,Y>>>8&255,255&Y,j>>>24&255,j>>>16&255,j>>>8&255,255&j,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]))},M.trak=function(Y){return M.box(M.types.trak,M.tkhd(Y),M.mdia(Y))},M.tkhd=function(Y){var j=Y.id,z=Y.duration,q=Y.presentWidth,Z=Y.presentHeight;return M.box(M.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,j>>>24&255,j>>>16&255,j>>>8&255,255&j,0,0,0,0,z>>>24&255,z>>>16&255,z>>>8&255,255&z,0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,q>>>8&255,255&q,0,0,Z>>>8&255,255&Z,0,0]))},M.mdia=function(Y){return M.box(M.types.mdia,M.mdhd(Y),M.hdlr(Y),M.minf(Y))},M.mdhd=function(Y){var j=Y.timescale,z=Y.duration;return M.box(M.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,j>>>24&255,j>>>16&255,j>>>8&255,255&j,z>>>24&255,z>>>16&255,z>>>8&255,255&z,85,196,0,0]))},M.hdlr=function(Y){var j=null;return j=Y.type==="audio"?M.constants.HDLR_AUDIO:M.constants.HDLR_VIDEO,M.box(M.types.hdlr,j)},M.minf=function(Y){var j=null;return j=Y.type==="audio"?M.box(M.types.smhd,M.constants.SMHD):M.box(M.types.vmhd,M.constants.VMHD),M.box(M.types.minf,j,M.dinf(),M.stbl(Y))},M.dinf=function(){return M.box(M.types.dinf,M.box(M.types.dref,M.constants.DREF))},M.stbl=function(Y){return M.box(M.types.stbl,M.stsd(Y),M.box(M.types.stts,M.constants.STTS),M.box(M.types.stsc,M.constants.STSC),M.box(M.types.stsz,M.constants.STSZ),M.box(M.types.stco,M.constants.STCO))},M.stsd=function(Y){return Y.type==="audio"?Y.codec==="mp3"?M.box(M.types.stsd,M.constants.STSD_PREFIX,M.mp3(Y)):Y.codec==="ac-3"?M.box(M.types.stsd,M.constants.STSD_PREFIX,M.ac3(Y)):Y.codec==="ec-3"?M.box(M.types.stsd,M.constants.STSD_PREFIX,M.ec3(Y)):Y.codec==="opus"?M.box(M.types.stsd,M.constants.STSD_PREFIX,M.Opus(Y)):M.box(M.types.stsd,M.constants.STSD_PREFIX,M.mp4a(Y)):Y.type==="video"&&Y.codec.startsWith("hvc1")?M.box(M.types.stsd,M.constants.STSD_PREFIX,M.hvc1(Y)):Y.type==="video"&&Y.codec.startsWith("av01")?M.box(M.types.stsd,M.constants.STSD_PREFIX,M.av01(Y)):M.box(M.types.stsd,M.constants.STSD_PREFIX,M.avc1(Y))},M.mp3=function(Y){var j=Y.channelCount,z=Y.audioSampleRate,q=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j,0,16,0,0,0,0,z>>>8&255,255&z,0,0]);return M.box(M.types[".mp3"],q)},M.mp4a=function(Y){var j=Y.channelCount,z=Y.audioSampleRate,q=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j,0,16,0,0,0,0,z>>>8&255,255&z,0,0]);return M.box(M.types.mp4a,q,M.esds(Y))},M.ac3=function(Y){var j=Y.channelCount,z=Y.audioSampleRate,q=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j,0,16,0,0,0,0,z>>>8&255,255&z,0,0]);return M.box(M.types["ac-3"],q,M.box(M.types.dac3,new Uint8Array(Y.config)))},M.ec3=function(Y){var j=Y.channelCount,z=Y.audioSampleRate,q=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j,0,16,0,0,0,0,z>>>8&255,255&z,0,0]);return M.box(M.types["ec-3"],q,M.box(M.types.dec3,new Uint8Array(Y.config)))},M.esds=function(Y){var j=Y.config||[],z=j.length,q=new Uint8Array([0,0,0,0,3,23+z,0,1,0,4,15+z,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([z]).concat(j).concat([6,1,2]));return M.box(M.types.esds,q)},M.Opus=function(Y){var j=Y.channelCount,z=Y.audioSampleRate,q=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j,0,16,0,0,0,0,z>>>8&255,255&z,0,0]);return M.box(M.types.Opus,q,M.dOps(Y))},M.dOps=function(Y){var j=Y.channelCount,z=Y.channelConfigCode,q=Y.audioSampleRate;if(Y.config)return M.box(M.types.dOps,X);var Z=[];switch(z){case 1:case 2:Z=[0];break;case 0:Z=[255,1,1,0,1];break;case 128:Z=[255,2,0,0,1];break;case 3:Z=[1,2,1,0,2,1];break;case 4:Z=[1,2,2,0,1,2,3];break;case 5:Z=[1,3,2,0,4,1,2,3];break;case 6:Z=[1,4,2,0,4,1,2,3,5];break;case 7:Z=[1,4,2,0,4,1,2,3,5,6];break;case 8:Z=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:Z=[1,1,2,0,1];break;case 131:Z=[1,1,3,0,1,2];break;case 132:Z=[1,1,4,0,1,2,3];break;case 133:Z=[1,1,5,0,1,2,3,4];break;case 134:Z=[1,1,6,0,1,2,3,4,5];break;case 135:Z=[1,1,7,0,1,2,3,4,5,6];break;case 136:Z=[1,1,8,0,1,2,3,4,5,6,7]}var X=new Uint8Array(I([0,j,0,0,q>>>24&255,q>>>17&255,q>>>8&255,q>>>0&255,0,0],Z));return M.box(M.types.dOps,X)},M.avc1=function(Y){var j=Y.avcc,z=Y.codecWidth,q=Y.codecHeight,Z=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,z>>>8&255,255&z,q>>>8&255,255&q,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return M.box(M.types.avc1,Z,M.box(M.types.avcC,j))},M.hvc1=function(Y){var j=Y.hvcc,z=Y.codecWidth,q=Y.codecHeight,Z=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,z>>>8&255,255&z,q>>>8&255,255&q,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return M.box(M.types.hvc1,Z,M.box(M.types.hvcC,j))},M.av01=function(Y){var j=Y.av1c,z=Y.codecWidth||192,q=Y.codecHeight||108,Z=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,z>>>8&255,255&z,q>>>8&255,255&q,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return M.box(M.types.av01,Z,M.box(M.types.av1C,j))},M.mvex=function(Y){return M.box(M.types.mvex,M.trex(Y))},M.trex=function(Y){var j=Y.id,z=new Uint8Array([0,0,0,0,j>>>24&255,j>>>16&255,j>>>8&255,255&j,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return M.box(M.types.trex,z)},M.moof=function(Y,j){return M.box(M.types.moof,M.mfhd(Y.sequenceNumber),M.traf(Y,j))},M.mfhd=function(Y){var j=new Uint8Array([0,0,0,0,Y>>>24&255,Y>>>16&255,Y>>>8&255,255&Y]);return M.box(M.types.mfhd,j)},M.traf=function(Y,j){var z=Y.id,q=M.box(M.types.tfhd,new Uint8Array([0,0,0,0,z>>>24&255,z>>>16&255,z>>>8&255,255&z])),Z=M.box(M.types.tfdt,new Uint8Array([0,0,0,0,j>>>24&255,j>>>16&255,j>>>8&255,255&j])),X=M.sdtp(Y),oe=M.trun(Y,X.byteLength+16+16+8+16+8+8);return M.box(M.types.traf,q,Z,oe,X)},M.sdtp=function(Y){for(var j=Y.samples||[],z=j.length,q=new Uint8Array(4+z),Z=0;Z>>24&255,q>>>16&255,q>>>8&255,255&q,j>>>24&255,j>>>16&255,j>>>8&255,255&j],0);for(var oe=0;oe>>24&255,he>>>16&255,he>>>8&255,255&he,ie>>>24&255,ie>>>16&255,ie>>>8&255,255&ie,fe.isLeading<<2|fe.dependsOn,fe.isDependedOn<<6|fe.hasRedundancy<<4|fe.isNonSync,0,0,se>>>24&255,se>>>16&255,se>>>8&255,255&se],12+16*oe)}return M.box(M.types.trun,X)},M.mdat=function(Y){return M.box(M.types.mdat,Y)},M}();x.init();var O=x,G=function(){function M(){}return M.getSilentFrame=function(Y,j){if(Y==="mp4a.40.2"){if(j===1)return new Uint8Array([0,200,0,128,35,128]);if(j===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(j===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(j===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(j===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(j===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(j===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(j===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(j===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},M}(),J=A(12),te=function(){function M(Y){this.TAG="MP4Remuxer",this._config=Y,this._isLive=Y.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new J.c("audio"),this._videoSegmentInfoList=new J.c("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!p.a.chrome||!(p.a.version.major<50||p.a.version.major===50&&p.a.version.build<2661)),this._fillSilentAfterSeek=p.a.msedge||p.a.msie,this._mp3UseMpegAudio=!p.a.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return M.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},M.prototype.bindDataSource=function(Y){return Y.onDataAvailable=this.remux.bind(this),Y.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(M.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(Y){this._onInitSegment=Y},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(Y){this._onMediaSegment=Y},enumerable:!1,configurable:!0}),M.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},M.prototype.seek=function(Y){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},M.prototype.remux=function(Y,j){if(!this._onMediaSegment)throw new a.a("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(Y,j),j&&this._remuxVideo(j),Y&&this._remuxAudio(Y)},M.prototype._onTrackMetadataReceived=function(Y,j){var z=null,q="mp4",Z=j.codec;if(Y==="audio")this._audioMeta=j,j.codec==="mp3"&&this._mp3UseMpegAudio?(q="mpeg",Z="",z=new Uint8Array):z=O.generateInitSegment(j);else{if(Y!=="video")return;this._videoMeta=j,z=O.generateInitSegment(j)}if(!this._onInitSegment)throw new a.a("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(Y,{type:Y,data:z.buffer,codec:Z,container:"".concat(Y,"/").concat(q),mediaDuration:j.duration})},M.prototype._calculateDtsBase=function(Y,j){this._dtsBaseInited||(Y&&Y.samples&&Y.samples.length&&(this._audioDtsBase=Y.samples[0].dts),j&&j.samples&&j.samples.length&&(this._videoDtsBase=j.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},M.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},M.prototype.flushStashedSamples=function(){var Y=this._videoStashedLastSample,j=this._audioStashedLastSample,z={type:"video",id:1,sequenceNumber:0,samples:[],length:0};Y!=null&&(z.samples.push(Y),z.length=Y.length);var q={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};j!=null&&(q.samples.push(j),q.length=j.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(z,!0),this._remuxAudio(q,!0)},M.prototype._remuxAudio=function(Y,j){if(this._audioMeta!=null){var z,q=Y,Z=q.samples,X=void 0,oe=-1,he=this._audioMeta.refSampleDuration,ie=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,fe=this._dtsBaseInited&&this._audioNextDts===void 0,se=!1;if(Z&&Z.length!==0&&(Z.length!==1||j)){var Ee=0,He=null,Ie=0;ie?(Ee=0,Ie=q.length):(Ee=8,Ie=8+q.length);var at=null;if(Z.length>1&&(Ie-=(at=Z.pop()).length),this._audioStashedLastSample!=null){var je=this._audioStashedLastSample;this._audioStashedLastSample=null,Z.unshift(je),Ie+=je.length}at!=null&&(this._audioStashedLastSample=at);var ht=Z[0].dts-this._dtsBase;if(this._audioNextDts)X=ht-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())X=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(se=!0);else{var _e=this._audioSegmentInfoList.getLastSampleBefore(ht);if(_e!=null){var Oe=ht-(_e.originalDts+_e.duration);Oe<=3&&(Oe=0),X=ht-(_e.dts+_e.duration+Oe)}else X=0}if(se){var pt=ht-X,vt=this._videoSegmentInfoList.getLastSegmentBefore(ht);if(vt!=null&&vt.beginDts=3*he&&this._fillAudioTimestampGap&&!p.a.safari){Ye=!0;var Ve,De=Math.floor(X/he);c.a.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync. +`+"originalDts: ".concat(Ae," ms, curRefDts: ").concat(Ue," ms, ")+"dtsCorrection: ".concat(Math.round(X)," ms, generate: ").concat(De," frames")),tt=Math.floor(Ue),mt=Math.floor(Ue+he)-tt,(Ve=G.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount))==null&&(c.a.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),Ve=ke),lt=[];for(var Re=0;Re=1?ue[ue.length-1].duration:Math.floor(he),this._audioNextDts=tt+mt;oe===-1&&(oe=tt),ue.push({dts:tt,pts:tt,cts:0,unit:je.unit,size:je.unit.byteLength,duration:mt,originalDts:Ae,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),Ye&&ue.push.apply(ue,lt)}}if(ue.length===0)return q.samples=[],void(q.length=0);for(ie?He=new Uint8Array(Ie):((He=new Uint8Array(Ie))[0]=Ie>>>24&255,He[1]=Ie>>>16&255,He[2]=Ie>>>8&255,He[3]=255&Ie,He.set(O.types.mdat,4)),W=0;W1&&(Ee-=(He=X.pop()).length),this._videoStashedLastSample!=null){var Ie=this._videoStashedLastSample;this._videoStashedLastSample=null,X.unshift(Ie),Ee+=Ie.length}He!=null&&(this._videoStashedLastSample=He);var at=X[0].dts-this._dtsBase;if(this._videoNextDts)oe=at-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())oe=0;else{var je=this._videoSegmentInfoList.getLastSampleBefore(at);if(je!=null){var ht=at-(je.originalDts+je.duration);ht<=3&&(ht=0),oe=at-(je.dts+je.duration+ht)}else oe=0}for(var _e=new J.b,Oe=[],pt=0;pt=1?Oe[Oe.length-1].duration:Math.floor(this._videoMeta.refSampleDuration),tt){var Ae=new J.d(pe,W,ke,Ie.dts,!0);Ae.fileposition=Ie.fileposition,_e.appendSyncPoint(Ae)}Oe.push({dts:pe,pts:W,cts:ue,units:Ie.units,size:Ie.length,isKeyframe:tt,duration:ke,originalDts:vt,flags:{isLeading:0,dependsOn:tt?2:1,isDependedOn:tt?1:0,hasRedundancy:0,isNonSync:tt?0:1}})}for((se=new Uint8Array(Ee))[0]=Ee>>>24&255,se[1]=Ee>>>16&255,se[2]=Ee>>>8&255,se[3]=255&Ee,se.set(O.types.mdat,4),pt=0;pt0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,q=this._demuxer.parseChunks(Y,j);else{var Z=null;(Z=P.probe(Y)).match&&(this._setupFLVDemuxerRemuxer(Z),q=this._demuxer.parseChunks(Y,j)),Z.match||Z.needMoreData||(Z=L.a.probe(Y)).match&&(this._setupTSDemuxerRemuxer(Z),q=this._demuxer.parseChunks(Y,j)),Z.match||Z.needMoreData||(Z=null,c.a.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then(function(){z._internalAbort()}),this._emitter.emit(ne.a.DEMUX_ERROR,m.a.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return q},M.prototype._setupFLVDemuxerRemuxer=function(Y){this._demuxer=new P(Y,this._config),this._remuxer||(this._remuxer=new te(this._config));var j=this._mediaDataSource;j.duration==null||isNaN(j.duration)||(this._demuxer.overridedDuration=j.duration),typeof j.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=j.hasAudio),typeof j.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=j.hasVideo),this._demuxer.timestampBase=j.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},M.prototype._setupTSDemuxerRemuxer=function(Y){var j=this._demuxer=new L.a(Y,this._config);this._remuxer||(this._remuxer=new te(this._config)),j.onError=this._onDemuxException.bind(this),j.onMediaInfo=this._onMediaInfo.bind(this),j.onMetaDataArrived=this._onMetaDataArrived.bind(this),j.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),j.onSynchronousKLVMetadata=this._onSynchronousKLVMetadata.bind(this),j.onAsynchronousKLVMetadata=this._onAsynchronousKLVMetadata.bind(this),j.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),j.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),j.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),j.onPESPrivateData=this._onPESPrivateData.bind(this),this._remuxer.bindDataSource(this._demuxer),this._demuxer.bindDataSource(this._ioctl),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},M.prototype._onMediaInfo=function(Y){var j=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},Y),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,r.a.prototype));var z=Object.assign({},Y);Object.setPrototypeOf(z,r.a.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=z,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var q=j._pendingSeekTime;j._pendingSeekTime=null,j.seek(q)})},M.prototype._onMetaDataArrived=function(Y){this._emitter.emit(ne.a.METADATA_ARRIVED,Y)},M.prototype._onScriptDataArrived=function(Y){this._emitter.emit(ne.a.SCRIPTDATA_ARRIVED,Y)},M.prototype._onTimedID3Metadata=function(Y){var j=this._remuxer.getTimestampBase();j!=null&&(Y.pts!=null&&(Y.pts-=j),Y.dts!=null&&(Y.dts-=j),this._emitter.emit(ne.a.TIMED_ID3_METADATA_ARRIVED,Y))},M.prototype._onSynchronousKLVMetadata=function(Y){var j=this._remuxer.getTimestampBase();j!=null&&(Y.pts!=null&&(Y.pts-=j),Y.dts!=null&&(Y.dts-=j),this._emitter.emit(ne.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,Y))},M.prototype._onAsynchronousKLVMetadata=function(Y){this._emitter.emit(ne.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,Y)},M.prototype._onSMPTE2038Metadata=function(Y){var j=this._remuxer.getTimestampBase();j!=null&&(Y.pts!=null&&(Y.pts-=j),Y.dts!=null&&(Y.dts-=j),Y.nearest_pts!=null&&(Y.nearest_pts-=j),this._emitter.emit(ne.a.SMPTE2038_METADATA_ARRIVED,Y))},M.prototype._onSCTE35Metadata=function(Y){var j=this._remuxer.getTimestampBase();j!=null&&(Y.pts!=null&&(Y.pts-=j),Y.nearest_pts!=null&&(Y.nearest_pts-=j),this._emitter.emit(ne.a.SCTE35_METADATA_ARRIVED,Y))},M.prototype._onPESPrivateDataDescriptor=function(Y){this._emitter.emit(ne.a.PES_PRIVATE_DATA_DESCRIPTOR,Y)},M.prototype._onPESPrivateData=function(Y){var j=this._remuxer.getTimestampBase();j!=null&&(Y.pts!=null&&(Y.pts-=j),Y.nearest_pts!=null&&(Y.nearest_pts-=j),Y.dts!=null&&(Y.dts-=j),this._emitter.emit(ne.a.PES_PRIVATE_DATA_ARRIVED,Y))},M.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},M.prototype._onIOComplete=function(Y){var j=Y+1;j0&&z[0].originalDts===q&&(q=z[0].pts),this._emitter.emit(ne.a.RECOMMEND_SEEKPOINT,q)}},M.prototype._enableStatisticsReporter=function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},M.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},M.prototype._reportSegmentMediaInfo=function(Y){var j=this._mediaInfo.segments[Y],z=Object.assign({},j);z.duration=this._mediaInfo.duration,z.segmentCount=this._mediaInfo.segmentCount,delete z.segments,delete z.keyframesIndex,this._emitter.emit(ne.a.MEDIA_INFO,z)},M.prototype._reportStatisticsInfo=function(){var Y={};Y.url=this._ioctl.currentURL,Y.hasRedirect=this._ioctl.hasRedirect,Y.hasRedirect&&(Y.redirectedURL=this._ioctl.currentRedirectedURL),Y.speed=this._ioctl.currentSpeed,Y.loaderType=this._ioctl.loaderType,Y.currentSegmentIndex=this._currentSegmentIndex,Y.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(ne.a.STATISTICS_INFO,Y)},M}());u.a=ee},function(s,u,A){var y=function(){function l(){}return l.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(c,p){return c.__proto__=p,c},Object.assign=Object.assign||function(c){if(c==null)throw new TypeError("Cannot convert undefined or null to object");for(var p=Object(c),r=1;r0?0|p:0;return this.substring(r,r+c.length)===c}}),typeof self.Promise!="function"&&A(25).polyfill()},l}();y.install(),u.a=y},function(s,u,A){var y=A(9),l=A.n(y),c=A(0),p=A(5),r=A(7),i=A(3),t=function(){function n(a){this.TAG="MSEController",this._config=a,this._emitter=new l.a,this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onStartStreaming:this._onStartStreaming.bind(this),onEndStreaming:this._onEndStreaming.bind(this),onQualityChange:this._onQualityChange.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._useManagedMediaSource="ManagedMediaSource"in self&&!("MediaSource"in self),this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElementProxy=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]}}return n.prototype.destroy=function(){this._mediaSource&&this.shutdown(),this._mediaSourceObjectURL&&this.revokeObjectURL(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},n.prototype.on=function(a,o){this._emitter.addListener(a,o)},n.prototype.off=function(a,o){this._emitter.removeListener(a,o)},n.prototype.initialize=function(a){if(this._mediaSource)throw new i.a("MediaSource has been attached to an HTMLMediaElement!");this._useManagedMediaSource&&c.a.v(this.TAG,"Using ManagedMediaSource");var o=this._mediaSource=this._useManagedMediaSource?new self.ManagedMediaSource:new self.MediaSource;o.addEventListener("sourceopen",this.e.onSourceOpen),o.addEventListener("sourceended",this.e.onSourceEnded),o.addEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(o.addEventListener("startstreaming",this.e.onStartStreaming),o.addEventListener("endstreaming",this.e.onEndStreaming),o.addEventListener("qualitychange",this.e.onQualityChange)),this._mediaElementProxy=a},n.prototype.shutdown=function(){if(this._mediaSource){var a=this._mediaSource;for(var o in this._sourceBuffers){var d=this._pendingSegments[o];d.splice(0,d.length),this._pendingSegments[o]=null,this._pendingRemoveRanges[o]=null,this._lastInitSegments[o]=null;var g=this._sourceBuffers[o];if(g){if(a.readyState!=="closed"){try{a.removeSourceBuffer(g)}catch(m){c.a.e(this.TAG,m.message)}g.removeEventListener("error",this.e.onSourceBufferError),g.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[o]=null,this._sourceBuffers[o]=null}}if(a.readyState==="open")try{a.endOfStream()}catch(m){c.a.e(this.TAG,m.message)}this._mediaElementProxy=null,a.removeEventListener("sourceopen",this.e.onSourceOpen),a.removeEventListener("sourceended",this.e.onSourceEnded),a.removeEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(a.removeEventListener("startstraming",this.e.onStartStreaming),a.removeEventListener("endstreaming",this.e.onEndStreaming),a.removeEventListener("qualitychange",this.e.onQualityChange)),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._mediaSource=null}},n.prototype.isManagedMediaSource=function(){return this._useManagedMediaSource},n.prototype.getObject=function(){if(!this._mediaSource)throw new i.a("MediaSource has not been initialized yet!");return this._mediaSource},n.prototype.getHandle=function(){if(!this._mediaSource)throw new i.a("MediaSource has not been initialized yet!");return this._mediaSource.handle},n.prototype.getObjectURL=function(){if(!this._mediaSource)throw new i.a("MediaSource has not been initialized yet!");return this._mediaSourceObjectURL==null&&(this._mediaSourceObjectURL=URL.createObjectURL(this._mediaSource)),this._mediaSourceObjectURL},n.prototype.revokeObjectURL=function(){this._mediaSourceObjectURL&&(URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},n.prototype.appendInitSegment=function(a,o){if(o===void 0&&(o=void 0),!this._mediaSource||this._mediaSource.readyState!=="open"||this._mediaSource.streaming===!1)return this._pendingSourceBufferInit.push(a),void this._pendingSegments[a.type].push(a);var d=a,g="".concat(d.container);d.codec&&d.codec.length>0&&(g+=";codecs=".concat(d.codec));var m=!1;if(c.a.v(this.TAG,"Received Initialization Segment, mimeType: "+g),this._lastInitSegments[d.type]=d,g!==this._mimeTypes[d.type]){if(this._mimeTypes[d.type])c.a.v(this.TAG,"Notice: ".concat(d.type," mimeType changed, origin: ").concat(this._mimeTypes[d.type],", target: ").concat(g));else{m=!0;try{var v=this._sourceBuffers[d.type]=this._mediaSource.addSourceBuffer(g);v.addEventListener("error",this.e.onSourceBufferError),v.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(b){return c.a.e(this.TAG,b.message),void this._emitter.emit(r.a.ERROR,{code:b.code,msg:b.message})}}this._mimeTypes[d.type]=g}o||this._pendingSegments[d.type].push(d),m||this._sourceBuffers[d.type]&&!this._sourceBuffers[d.type].updating&&this._doAppendSegments(),p.a.safari&&d.container==="audio/mpeg"&&d.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=d.mediaDuration/1e3,this._updateMediaSourceDuration())},n.prototype.appendMediaSegment=function(a){var o=a;this._pendingSegments[o.type].push(o),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var d=this._sourceBuffers[o.type];!d||d.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},n.prototype.flush=function(){for(var a in this._sourceBuffers)if(this._sourceBuffers[a]){var o=this._sourceBuffers[a];if(this._mediaSource.readyState==="open")try{o.abort()}catch(w){c.a.e(this.TAG,w.message)}var d=this._pendingSegments[a];if(d.splice(0,d.length),this._mediaSource.readyState!=="closed"){for(var g=0;g=1&&a-g.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},n.prototype._doCleanupSourceBuffer=function(){var a=this._mediaElementProxy.getCurrentTime();for(var o in this._sourceBuffers){var d=this._sourceBuffers[o];if(d){for(var g=d.buffered,m=!1,v=0;v=this._config.autoCleanupMaxBackwardDuration){m=!0;var C=a-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[o].push({start:b,end:C})}}else w0&&(isNaN(o)||d>o)&&(c.a.v(this.TAG,"Update MediaSource duration from ".concat(o," to ").concat(d)),this._mediaSource.duration=d),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},n.prototype._doRemoveRanges=function(){for(var a in this._pendingRemoveRanges)if(this._sourceBuffers[a]&&!this._sourceBuffers[a].updating)for(var o=this._sourceBuffers[a],d=this._pendingRemoveRanges[a];d.length&&!o.updating;){var g=d.shift();o.remove(g.start,g.end)}},n.prototype._doAppendSegments=function(){var a=this._pendingSegments;for(var o in a)if(this._sourceBuffers[o]&&!this._sourceBuffers[o].updating&&this._mediaSource.streaming!==!1&&a[o].length>0){var d=a[o].shift();if(typeof d.timestampOffset=="number"&&isFinite(d.timestampOffset)){var g=this._sourceBuffers[o].timestampOffset,m=d.timestampOffset/1e3;Math.abs(g-m)>.1&&(c.a.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(g," to ").concat(m)),this._sourceBuffers[o].timestampOffset=m),delete d.timestampOffset}if(!d.data||d.data.byteLength===0)continue;try{this._sourceBuffers[o].appendBuffer(d.data),this._isBufferFull=!1}catch(v){this._pendingSegments[o].unshift(d),v.code===22?(this._isBufferFull||this._emitter.emit(r.a.BUFFER_FULL),this._isBufferFull=!0):(c.a.e(this.TAG,v.message),this._emitter.emit(r.a.ERROR,{code:v.code,msg:v.message}))}}},n.prototype._onSourceOpen=function(){if(c.a.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var a=this._pendingSourceBufferInit;a.length;){var o=a.shift();this.appendInitSegment(o,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(r.a.SOURCE_OPEN)},n.prototype._onStartStreaming=function(){c.a.v(this.TAG,"ManagedMediaSource onStartStreaming"),this._emitter.emit(r.a.START_STREAMING)},n.prototype._onEndStreaming=function(){c.a.v(this.TAG,"ManagedMediaSource onEndStreaming"),this._emitter.emit(r.a.END_STREAMING)},n.prototype._onQualityChange=function(){c.a.v(this.TAG,"ManagedMediaSource onQualityChange")},n.prototype._onSourceEnded=function(){c.a.v(this.TAG,"MediaSource onSourceEnded")},n.prototype._onSourceClose=function(){c.a.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(this._mediaSource.removeEventListener("startstraming",this.e.onStartStreaming),this._mediaSource.removeEventListener("endstreaming",this.e.onEndStreaming),this._mediaSource.removeEventListener("qualitychange",this.e.onQualityChange)))},n.prototype._hasPendingSegments=function(){var a=this._pendingSegments;return a.video.length>0||a.audio.length>0},n.prototype._hasPendingRemoveRanges=function(){var a=this._pendingRemoveRanges;return a.video.length>0||a.audio.length>0},n.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(r.a.UPDATE_END)},n.prototype._onSourceBufferError=function(a){c.a.e(this.TAG,"SourceBuffer Error: ".concat(a))},n}();u.a=t},function(s,u,A){var y=A(9),l=A.n(y),c=A(21),p=A.n(c),r=A(0),i=A(8),t=A(17),n=A(1),a=(A(23),A(13)),o=A(14),d=function(){function g(m,v){if(this.TAG="Transmuxer",this._emitter=new l.a,v.enableWorker&&typeof Worker<"u")try{this._worker=p()(23),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[m,v]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},i.a.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:i.a.getConfig()})}catch{r.a.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new t.a(m,v)}else this._controller=new t.a(m,v);if(this._controller){var b=this._controller;b.on(n.a.IO_ERROR,this._onIOError.bind(this)),b.on(n.a.DEMUX_ERROR,this._onDemuxError.bind(this)),b.on(n.a.INIT_SEGMENT,this._onInitSegment.bind(this)),b.on(n.a.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),b.on(n.a.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),b.on(n.a.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),b.on(n.a.MEDIA_INFO,this._onMediaInfo.bind(this)),b.on(n.a.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),b.on(n.a.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),b.on(n.a.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),b.on(n.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,this._onSynchronousKLVMetadataArrived.bind(this)),b.on(n.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,this._onAsynchronousKLVMetadataArrived.bind(this)),b.on(n.a.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),b.on(n.a.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),b.on(n.a.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),b.on(n.a.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),b.on(n.a.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),b.on(n.a.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return g.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),i.a.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},g.prototype.on=function(m,v){this._emitter.addListener(m,v)},g.prototype.off=function(m,v){this._emitter.removeListener(m,v)},g.prototype.hasWorker=function(){return this._worker!=null},g.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},g.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},g.prototype.seek=function(m){this._worker?this._worker.postMessage({cmd:"seek",param:m}):this._controller.seek(m)},g.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},g.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},g.prototype.switchPrimaryAudio=function(){this._worker?this._worker.postMessage({cmd:"switch_audio",param:"primary"}):this._controller._demuxer instanceof o.a&&(this._controller._demuxer.preferred_secondary_audio=!1)},g.prototype.switchSecondaryAudio=function(){this._worker?this._worker.postMessage({cmd:"switch_audio",param:"secondary"}):this._controller._demuxer instanceof o.a&&(this._controller._demuxer.preferred_secondary_audio=!0)},g.prototype._onInitSegment=function(m,v){var b=this;Promise.resolve().then(function(){b._emitter.emit(n.a.INIT_SEGMENT,m,v)})},g.prototype._onMediaSegment=function(m,v){var b=this;Promise.resolve().then(function(){b._emitter.emit(n.a.MEDIA_SEGMENT,m,v)})},g.prototype._onLoadingComplete=function(){var m=this;Promise.resolve().then(function(){m._emitter.emit(n.a.LOADING_COMPLETE)})},g.prototype._onRecoveredEarlyEof=function(){var m=this;Promise.resolve().then(function(){m._emitter.emit(n.a.RECOVERED_EARLY_EOF)})},g.prototype._onMediaInfo=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.MEDIA_INFO,m)})},g.prototype._onMetaDataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.METADATA_ARRIVED,m)})},g.prototype._onScriptDataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.SCRIPTDATA_ARRIVED,m)})},g.prototype._onTimedID3MetadataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.TIMED_ID3_METADATA_ARRIVED,m)})},g.prototype._onSynchronousKLVMetadataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,m)})},g.prototype._onAsynchronousKLVMetadataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,m)})},g.prototype._onSMPTE2038MetadataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.SMPTE2038_METADATA_ARRIVED,m)})},g.prototype._onSCTE35MetadataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.SCTE35_METADATA_ARRIVED,m)})},g.prototype._onPESPrivateDataDescriptor=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.PES_PRIVATE_DATA_DESCRIPTOR,m)})},g.prototype._onPESPrivateDataArrived=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.PES_PRIVATE_DATA_ARRIVED,m)})},g.prototype._onStatisticsInfo=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.STATISTICS_INFO,m)})},g.prototype._onIOError=function(m,v){var b=this;Promise.resolve().then(function(){b._emitter.emit(n.a.IO_ERROR,m,v)})},g.prototype._onDemuxError=function(m,v){var b=this;Promise.resolve().then(function(){b._emitter.emit(n.a.DEMUX_ERROR,m,v)})},g.prototype._onRecommendSeekpoint=function(m){var v=this;Promise.resolve().then(function(){v._emitter.emit(n.a.RECOMMEND_SEEKPOINT,m)})},g.prototype._onLoggingConfigChanged=function(m){this._worker&&this._worker.postMessage({cmd:"logging_config",param:m})},g.prototype._onWorkerMessage=function(m){var v=m.data,b=v.data;if(v.msg==="destroyed"||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(v.msg){case n.a.INIT_SEGMENT:case n.a.MEDIA_SEGMENT:this._emitter.emit(v.msg,b.type,b.data);break;case n.a.LOADING_COMPLETE:case n.a.RECOVERED_EARLY_EOF:this._emitter.emit(v.msg);break;case n.a.MEDIA_INFO:Object.setPrototypeOf(b,a.a.prototype),this._emitter.emit(v.msg,b);break;case n.a.METADATA_ARRIVED:case n.a.SCRIPTDATA_ARRIVED:case n.a.TIMED_ID3_METADATA_ARRIVED:case n.a.SYNCHRONOUS_KLV_METADATA_ARRIVED:case n.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED:case n.a.SMPTE2038_METADATA_ARRIVED:case n.a.SCTE35_METADATA_ARRIVED:case n.a.PES_PRIVATE_DATA_DESCRIPTOR:case n.a.PES_PRIVATE_DATA_ARRIVED:case n.a.STATISTICS_INFO:this._emitter.emit(v.msg,b);break;case n.a.IO_ERROR:case n.a.DEMUX_ERROR:this._emitter.emit(v.msg,b.type,b.info);break;case n.a.RECOMMEND_SEEKPOINT:this._emitter.emit(v.msg,b);break;case"logcat_callback":r.a.emitter.emit("log",b.type,b.logcat)}},g}();u.a=d},function(s,u,A){function y(r){var i={};function t(a){if(i[a])return i[a].exports;var o=i[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=r,t.c=i,t.i=function(a){return a},t.d=function(a,o,d){t.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:d})},t.r=function(a){Object.defineProperty(a,"__esModule",{value:!0})},t.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return t.d(o,"a",o),o},t.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},t.p="/",t.oe=function(a){throw console.error(a),a};var n=t(t.s=ENTRY_MODULE);return n.default||n}function l(r){return(r+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function c(r,i,t){var n={};n[t]=[];var a=i.toString(),o=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return n;for(var d,g=o[1],m=new RegExp("(\\\\n|\\W)"+l(g)+"\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)","g");d=m.exec(a);)d[3]!=="dll-reference"&&n[t].push(d[3]);for(m=new RegExp("\\("+l(g)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)',"g");d=m.exec(a);)r[d[2]]||(n[t].push(d[1]),r[d[2]]=A(d[1]).m),n[d[2]]=n[d[2]]||[],n[d[2]].push(d[4]);for(var v,b=Object.keys(n),w=0;w0},!1)}s.exports=function(r,i){i=i||{};var t={main:A.m},n=i.all?{main:Object.keys(t.main)}:function(m,v){for(var b={main:[v]},w={main:[]},C={main:{}};p(b);)for(var D=Object.keys(b),R=0;R=2&&r[a]===3&&r[a-1]===0&&r[a-2]===0||(t[n]=r[a],n++);return new Uint8Array(t.buffer,0,n)},c.parseSPS=function(p){for(var r=p.subarray(1,4),i="avc1.",t=0;t<3;t++){var n=r[t].toString(16);n.length<2&&(n="0"+n),i+=n}var a=c._ebsp2rbsp(p),o=new y.a(a);o.readByte();var d=o.readByte();o.readByte();var g=o.readByte();o.readUEG();var m=c.getProfileString(d),v=c.getLevelString(g),b=1,w=420,C=8,D=8;if((d===100||d===110||d===122||d===244||d===44||d===83||d===86||d===118||d===128||d===138||d===144)&&((b=o.readUEG())===3&&o.readBits(1),b<=3&&(w=[0,420,422,444][b]),C=o.readUEG()+8,D=o.readUEG()+8,o.readBits(1),o.readBool()))for(var R=b!==3?8:12,T=0;T0&&Z<16?(ee=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][Z-1],M=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][Z-1]):Z===255&&(ee=o.readByte()<<8|o.readByte(),M=o.readByte()<<8|o.readByte())}if(o.readBool()&&o.readBool(),o.readBool()&&(o.readBits(4),o.readBool()&&o.readBits(24)),o.readBool()&&(o.readUEG(),o.readUEG()),o.readBool()){var X=o.readBits(32),oe=o.readBits(32);j=o.readBool(),Y=(z=oe)/(q=2*X)}}var he=1;ee===1&&M===1||(he=ee/M);var ie=0,fe=0;b===0?(ie=1,fe=2-G):(ie=b===3?1:2,fe=(b===1?2:1)*(2-G));var se=16*(x+1),Ee=16*(O+1)*(2-G);se-=(J+te)*ie,Ee-=(le+ne)*fe;var He=Math.ceil(se*he);return o.destroy(),o=null,{codec_mimetype:i,profile_idc:d,level_idc:g,profile_string:m,level_string:v,chroma_format_idc:b,bit_depth:C,bit_depth_luma:C,bit_depth_chroma:D,ref_frames:I,chroma_format:w,chroma_format_string:c.getChromaFormatString(w),frame_rate:{fixed:j,fps:Y,fps_den:q,fps_num:z},sar_ratio:{width:ee,height:M},codec_size:{width:se,height:Ee},present_size:{width:He,height:Ee}}},c._skipScalingList=function(p,r){for(var i=8,t=8,n=0;n"u"&&A!==void 0&&{}.toString.call(A)==="[object process]",v=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function b(){var oe=setTimeout;return function(){return oe(C,1)}}var w=new Array(1e3);function C(){for(var oe=0;oe1)for(var w=1;w0){var z=this._media_element.buffered.start(0);(z<1&&M0){var z=j.start(0);if(z<1&&Y=z&&M0&&this._suspendTransmuxerIfBufferedPositionExceeded(j)},ee.prototype._suspendTransmuxerIfBufferedPositionExceeded=function(M){M>=this._media_element.currentTime+this._config.lazyLoadMaxDuration&&!this._paused&&(t.a.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this.suspendTransmuxer(),this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate))},ee.prototype.suspendTransmuxer=function(){this._paused=!0,this._on_pause_transmuxer()},ee.prototype._resumeTransmuxerIfNeeded=function(){for(var M=this._media_element.buffered,Y=this._media_element.currentTime,j=this._config.lazyLoadRecoverDuration,z=!1,q=0;q=Z&&Y=X-j&&(z=!0);break}}z&&(t.a.v(this.TAG,"Continue loading from paused position"),this.resumeTransmuxer(),this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate))},ee.prototype.resumeTransmuxer=function(){this._paused=!1,this._on_resume_transmuxer()},ee}(),P=function(){function ee(M,Y){this.TAG="StartupStallJumper",this._media_element=null,this._on_direct_seek=null,this._canplay_received=!1,this.e=null,this._media_element=M,this._on_direct_seek=Y,this.e={onMediaCanPlay:this._onMediaCanPlay.bind(this),onMediaStalled:this._onMediaStalled.bind(this),onMediaProgress:this._onMediaProgress.bind(this)},this._media_element.addEventListener("canplay",this.e.onMediaCanPlay),this._media_element.addEventListener("stalled",this.e.onMediaStalled),this._media_element.addEventListener("progress",this.e.onMediaProgress)}return ee.prototype.destroy=function(){this._media_element.removeEventListener("canplay",this.e.onMediaCanPlay),this._media_element.removeEventListener("stalled",this.e.onMediaStalled),this._media_element.removeEventListener("progress",this.e.onMediaProgress),this._media_element=null,this._on_direct_seek=null},ee.prototype._onMediaCanPlay=function(M){this._canplay_received=!0,this._media_element.removeEventListener("canplay",this.e.onMediaCanPlay)},ee.prototype._onMediaStalled=function(M){this._detectAndFixStuckPlayback(!0)},ee.prototype._onMediaProgress=function(M){this._detectAndFixStuckPlayback()},ee.prototype._detectAndFixStuckPlayback=function(M){var Y=this._media_element,j=Y.buffered;M||!this._canplay_received||Y.readyState<2?j.length>0&&Y.currentTimethis._config.liveBufferLatencyMaxLatency&&z-Y>this._config.liveBufferLatencyMaxLatency){var q=z-this._config.liveBufferLatencyMinRemain;this._on_direct_seek(q)}}},ee}(),I=function(){function ee(M,Y){this._config=null,this._media_element=null,this.e=null,this._config=M,this._media_element=Y,this.e={onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this)},this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate)}return ee.prototype.destroy=function(){this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element=null,this._config=null},ee.prototype._onMediaTimeUpdate=function(M){if(this._config.isLive&&this._config.liveSync){var Y=this._getCurrentLatency();if(Y>this._config.liveSyncMaxLatency){var j=Math.min(2,Math.max(1,this._config.liveSyncPlaybackRate));this._media_element.playbackRate=j}else Y>this._config.liveSyncTargetLatency||this._media_element.playbackRate!==1&&this._media_element.playbackRate!==0&&(this._media_element.playbackRate=1)}},ee.prototype._getCurrentLatency=function(){if(!this._media_element)return 0;var M=this._media_element.buffered,Y=this._media_element.currentTime;return M.length==0?0:M.end(M.length-1)-Y},ee}(),x=function(){function ee(M,Y){this.TAG="PlayerEngineMainThread",this._emitter=new n,this._media_element=null,this._mse_controller=null,this._transmuxer=null,this._pending_seek_time=null,this._seeking_handler=null,this._loading_controller=null,this._startup_stall_jumper=null,this._live_latency_chaser=null,this._live_latency_synchronizer=null,this._mse_source_opened=!1,this._has_pending_load=!1,this._loaded_metadata_received=!1,this._media_info=null,this._statistics_info=null,this.e=null,this._media_data_source=M,this._config=p(),typeof Y=="object"&&Object.assign(this._config,Y),M.isLive===!0&&(this._config.isLive=!0),this.e={onMediaLoadedMetadata:this._onMediaLoadedMetadata.bind(this)}}return ee.prototype.destroy=function(){this._emitter.emit(d.a.DESTROYING),this._transmuxer&&this.unload(),this._media_element&&this.detachMediaElement(),this.e=null,this._media_data_source=null,this._emitter.removeAllListeners(),this._emitter=null},ee.prototype.on=function(M,Y){var j=this;this._emitter.addListener(M,Y),M===d.a.MEDIA_INFO&&this._media_info?Promise.resolve().then(function(){return j._emitter.emit(d.a.MEDIA_INFO,j.mediaInfo)}):M==d.a.STATISTICS_INFO&&this._statistics_info&&Promise.resolve().then(function(){return j._emitter.emit(d.a.STATISTICS_INFO,j.statisticsInfo)})},ee.prototype.off=function(M,Y){this._emitter.removeListener(M,Y)},ee.prototype.attachMediaElement=function(M){var Y=this;this._media_element=M,M.src="",M.removeAttribute("src"),M.srcObject=null,M.load(),M.addEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._mse_controller=new o.a(this._config),this._mse_controller.on(m.a.UPDATE_END,this._onMSEUpdateEnd.bind(this)),this._mse_controller.on(m.a.BUFFER_FULL,this._onMSEBufferFull.bind(this)),this._mse_controller.on(m.a.SOURCE_OPEN,this._onMSESourceOpen.bind(this)),this._mse_controller.on(m.a.ERROR,this._onMSEError.bind(this)),this._mse_controller.on(m.a.START_STREAMING,this._onMSEStartStreaming.bind(this)),this._mse_controller.on(m.a.END_STREAMING,this._onMSEEndStreaming.bind(this)),this._mse_controller.initialize({getCurrentTime:function(){return Y._media_element.currentTime},getReadyState:function(){return Y._media_element.readyState}}),this._mse_controller.isManagedMediaSource()?(M.disableRemotePlayback=!0,M.srcObject=this._mse_controller.getObject()):M.src=this._mse_controller.getObjectURL()},ee.prototype.detachMediaElement=function(){this._media_element&&(this._mse_controller.shutdown(),this._media_element.removeEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element=null,this._mse_controller.revokeObjectURL()),this._mse_controller&&(this._mse_controller.destroy(),this._mse_controller=null)},ee.prototype.load=function(){var M=this;if(!this._media_element)throw new b.a("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new b.a("load() has been called, please call unload() first!");this._has_pending_load||(!this._config.deferLoadAfterSourceOpen||this._mse_source_opened?(this._transmuxer=new g.a(this._media_data_source,this._config),this._transmuxer.on(w.a.INIT_SEGMENT,function(Y,j){M._mse_controller.appendInitSegment(j)}),this._transmuxer.on(w.a.MEDIA_SEGMENT,function(Y,j){M._mse_controller.appendMediaSegment(j),!M._config.isLive&&Y==="video"&&j.data&&j.data.byteLength>0&&"info"in j&&M._seeking_handler.appendSyncPoints(j.info.syncPoints),M._loading_controller.notifyBufferedPositionChanged(j.info.endDts/1e3)}),this._transmuxer.on(w.a.LOADING_COMPLETE,function(){M._mse_controller.endOfStream(),M._emitter.emit(d.a.LOADING_COMPLETE)}),this._transmuxer.on(w.a.RECOVERED_EARLY_EOF,function(){M._emitter.emit(d.a.RECOVERED_EARLY_EOF)}),this._transmuxer.on(w.a.IO_ERROR,function(Y,j){M._emitter.emit(d.a.ERROR,v.b.NETWORK_ERROR,Y,j)}),this._transmuxer.on(w.a.DEMUX_ERROR,function(Y,j){M._emitter.emit(d.a.ERROR,v.b.MEDIA_ERROR,Y,j)}),this._transmuxer.on(w.a.MEDIA_INFO,function(Y){M._media_info=Y,M._emitter.emit(d.a.MEDIA_INFO,Object.assign({},Y))}),this._transmuxer.on(w.a.STATISTICS_INFO,function(Y){M._statistics_info=M._fillStatisticsInfo(Y),M._emitter.emit(d.a.STATISTICS_INFO,Object.assign({},Y))}),this._transmuxer.on(w.a.RECOMMEND_SEEKPOINT,function(Y){M._media_element&&!M._config.accurateSeek&&M._seeking_handler.directSeek(Y/1e3)}),this._transmuxer.on(w.a.METADATA_ARRIVED,function(Y){M._emitter.emit(d.a.METADATA_ARRIVED,Y)}),this._transmuxer.on(w.a.SCRIPTDATA_ARRIVED,function(Y){M._emitter.emit(d.a.SCRIPTDATA_ARRIVED,Y)}),this._transmuxer.on(w.a.TIMED_ID3_METADATA_ARRIVED,function(Y){M._emitter.emit(d.a.TIMED_ID3_METADATA_ARRIVED,Y)}),this._transmuxer.on(w.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,function(Y){M._emitter.emit(d.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,Y)}),this._transmuxer.on(w.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,function(Y){M._emitter.emit(d.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,Y)}),this._transmuxer.on(w.a.SMPTE2038_METADATA_ARRIVED,function(Y){M._emitter.emit(d.a.SMPTE2038_METADATA_ARRIVED,Y)}),this._transmuxer.on(w.a.SCTE35_METADATA_ARRIVED,function(Y){M._emitter.emit(d.a.SCTE35_METADATA_ARRIVED,Y)}),this._transmuxer.on(w.a.PES_PRIVATE_DATA_DESCRIPTOR,function(Y){M._emitter.emit(d.a.PES_PRIVATE_DATA_DESCRIPTOR,Y)}),this._transmuxer.on(w.a.PES_PRIVATE_DATA_ARRIVED,function(Y){M._emitter.emit(d.a.PES_PRIVATE_DATA_ARRIVED,Y)}),this._seeking_handler=new R(this._config,this._media_element,this._onRequiredUnbufferedSeek.bind(this)),this._loading_controller=new T(this._config,this._media_element,this._onRequestPauseTransmuxer.bind(this),this._onRequestResumeTransmuxer.bind(this)),this._startup_stall_jumper=new P(this._media_element,this._onRequestDirectSeek.bind(this)),this._config.isLive&&this._config.liveBufferLatencyChasing&&(this._live_latency_chaser=new L(this._config,this._media_element,this._onRequestDirectSeek.bind(this))),this._config.isLive&&this._config.liveSync&&(this._live_latency_synchronizer=new I(this._config,this._media_element)),this._media_element.readyState>0&&this._seeking_handler.directSeek(0),this._transmuxer.open()):this._has_pending_load=!0)},ee.prototype.unload=function(){var M,Y,j,z,q,Z,X,oe,he;(M=this._media_element)===null||M===void 0||M.pause(),(Y=this._live_latency_synchronizer)===null||Y===void 0||Y.destroy(),this._live_latency_synchronizer=null,(j=this._live_latency_chaser)===null||j===void 0||j.destroy(),this._live_latency_chaser=null,(z=this._startup_stall_jumper)===null||z===void 0||z.destroy(),this._startup_stall_jumper=null,(q=this._loading_controller)===null||q===void 0||q.destroy(),this._loading_controller=null,(Z=this._seeking_handler)===null||Z===void 0||Z.destroy(),this._seeking_handler=null,(X=this._mse_controller)===null||X===void 0||X.flush(),(oe=this._transmuxer)===null||oe===void 0||oe.close(),(he=this._transmuxer)===null||he===void 0||he.destroy(),this._transmuxer=null},ee.prototype.play=function(){return this._media_element.play()},ee.prototype.pause=function(){this._media_element.pause()},ee.prototype.seek=function(M){this._media_element&&this._seeking_handler?this._seeking_handler.seek(M):this._pending_seek_time=M},ee.prototype.switchPrimaryAudio=function(){this._transmuxer.switchPrimaryAudio()},ee.prototype.switchSecondaryAudio=function(){this._transmuxer.switchSecondaryAudio()},Object.defineProperty(ee.prototype,"mediaInfo",{get:function(){return Object.assign({},this._media_info)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"statisticsInfo",{get:function(){return Object.assign({},this._statistics_info)},enumerable:!1,configurable:!0}),ee.prototype._onMSESourceOpen=function(){this._mse_source_opened=!0,this._has_pending_load&&(this._has_pending_load=!1,this.load())},ee.prototype._onMSEUpdateEnd=function(){this._config.isLive&&this._config.liveBufferLatencyChasing&&this._live_latency_chaser&&this._live_latency_chaser.notifyBufferedRangeUpdate(),this._loading_controller.notifyBufferedPositionChanged()},ee.prototype._onMSEBufferFull=function(){t.a.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._loading_controller.suspendTransmuxer()},ee.prototype._onMSEError=function(M){this._emitter.emit(d.a.ERROR,v.b.MEDIA_ERROR,v.a.MEDIA_MSE_ERROR,M)},ee.prototype._onMSEStartStreaming=function(){this._loaded_metadata_received&&(this._config.isLive||(t.a.v(this.TAG,"Resume transmuxing task due to ManagedMediaSource onStartStreaming"),this._loading_controller.resumeTransmuxer()))},ee.prototype._onMSEEndStreaming=function(){this._config.isLive||(t.a.v(this.TAG,"Suspend transmuxing task due to ManagedMediaSource onEndStreaming"),this._loading_controller.suspendTransmuxer())},ee.prototype._onMediaLoadedMetadata=function(M){this._loaded_metadata_received=!0,this._pending_seek_time!=null&&(this._seeking_handler.seek(this._pending_seek_time),this._pending_seek_time=null)},ee.prototype._onRequestDirectSeek=function(M){this._seeking_handler.directSeek(M)},ee.prototype._onRequiredUnbufferedSeek=function(M){this._mse_controller.flush(),this._transmuxer.seek(M)},ee.prototype._onRequestPauseTransmuxer=function(){this._transmuxer.pause()},ee.prototype._onRequestResumeTransmuxer=function(){this._transmuxer.resume()},ee.prototype._fillStatisticsInfo=function(M){if(M.playerType="MSEPlayer",!(this._media_element instanceof HTMLVideoElement))return M;var Y=!0,j=0,z=0;if(this._media_element.getVideoPlaybackQuality){var q=this._media_element.getVideoPlaybackQuality();j=q.totalVideoFrames,z=q.droppedVideoFrames}else this._media_element.webkitDecodedFrameCount!=null?(j=this._media_element.webkitDecodedFrameCount,z=this._media_element.webkitDroppedFrameCount):Y=!1;return Y&&(M.decodedFrames=j,M.droppedFrames=z),M},ee}(),O=y(21),G=y(8),J=function(){function ee(M,Y){this.TAG="PlayerEngineDedicatedThread",this._emitter=new n,this._media_element=null,this._worker_destroying=!1,this._seeking_handler=null,this._loading_controller=null,this._startup_stall_jumper=null,this._live_latency_chaser=null,this._live_latency_synchronizer=null,this._pending_seek_time=null,this._media_info=null,this._statistics_info=null,this.e=null,this._media_data_source=M,this._config=p(),typeof Y=="object"&&Object.assign(this._config,Y),M.isLive===!0&&(this._config.isLive=!0),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this),onMediaLoadedMetadata:this._onMediaLoadedMetadata.bind(this),onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this),onMediaReadyStateChanged:this._onMediaReadyStateChange.bind(this)},G.a.registerListener(this.e.onLoggingConfigChanged),this._worker=O(28,{all:!0}),this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",media_data_source:this._media_data_source,config:this._config}),this._worker.postMessage({cmd:"logging_config",logging_config:G.a.getConfig()})}return ee.isSupported=function(){return!!(self.Worker&&self.MediaSource&&"canConstructInDedicatedWorker"in self.MediaSource&&self.MediaSource.canConstructInDedicatedWorker===!0)},ee.prototype.destroy=function(){this._emitter.emit(d.a.DESTROYING),this.unload(),this.detachMediaElement(),this._worker_destroying=!0,this._worker.postMessage({cmd:"destroy"}),G.a.removeListener(this.e.onLoggingConfigChanged),this.e=null,this._media_data_source=null,this._emitter.removeAllListeners(),this._emitter=null},ee.prototype.on=function(M,Y){var j=this;this._emitter.addListener(M,Y),M===d.a.MEDIA_INFO&&this._media_info?Promise.resolve().then(function(){return j._emitter.emit(d.a.MEDIA_INFO,j.mediaInfo)}):M==d.a.STATISTICS_INFO&&this._statistics_info&&Promise.resolve().then(function(){return j._emitter.emit(d.a.STATISTICS_INFO,j.statisticsInfo)})},ee.prototype.off=function(M,Y){this._emitter.removeListener(M,Y)},ee.prototype.attachMediaElement=function(M){this._media_element=M,this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element.addEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element.addEventListener("readystatechange",this.e.onMediaReadyStateChanged),this._worker.postMessage({cmd:"initialize_mse"})},ee.prototype.detachMediaElement=function(){this._worker.postMessage({cmd:"shutdown_mse"}),this._media_element&&(this._media_element.removeEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element.removeEventListener("readystatechange",this.e.onMediaReadyStateChanged),this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element=null)},ee.prototype.load=function(){this._worker.postMessage({cmd:"load"}),this._seeking_handler=new R(this._config,this._media_element,this._onRequiredUnbufferedSeek.bind(this)),this._loading_controller=new T(this._config,this._media_element,this._onRequestPauseTransmuxer.bind(this),this._onRequestResumeTransmuxer.bind(this)),this._startup_stall_jumper=new P(this._media_element,this._onRequestDirectSeek.bind(this)),this._config.isLive&&this._config.liveBufferLatencyChasing&&(this._live_latency_chaser=new L(this._config,this._media_element,this._onRequestDirectSeek.bind(this))),this._config.isLive&&this._config.liveSync&&(this._live_latency_synchronizer=new I(this._config,this._media_element)),this._media_element.readyState>0&&this._seeking_handler.directSeek(0)},ee.prototype.unload=function(){var M,Y,j,z,q,Z;(M=this._media_element)===null||M===void 0||M.pause(),this._worker.postMessage({cmd:"unload"}),(Y=this._live_latency_synchronizer)===null||Y===void 0||Y.destroy(),this._live_latency_synchronizer=null,(j=this._live_latency_chaser)===null||j===void 0||j.destroy(),this._live_latency_chaser=null,(z=this._startup_stall_jumper)===null||z===void 0||z.destroy(),this._startup_stall_jumper=null,(q=this._loading_controller)===null||q===void 0||q.destroy(),this._loading_controller=null,(Z=this._seeking_handler)===null||Z===void 0||Z.destroy(),this._seeking_handler=null},ee.prototype.play=function(){return this._media_element.play()},ee.prototype.pause=function(){this._media_element.pause()},ee.prototype.seek=function(M){this._media_element&&this._seeking_handler?this._seeking_handler.seek(M):this._pending_seek_time=M},ee.prototype.switchPrimaryAudio=function(){this._worker.postMessage({cmd:"switch_audio",audio_track:"primary"})},ee.prototype.switchSecondaryAudio=function(){this._worker.postMessage({cmd:"switch_audio",audio_track:"secondary"})},Object.defineProperty(ee.prototype,"mediaInfo",{get:function(){return Object.assign({},this._media_info)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"statisticsInfo",{get:function(){return Object.assign({},this._statistics_info)},enumerable:!1,configurable:!0}),ee.prototype._onLoggingConfigChanged=function(M){var Y;(Y=this._worker)===null||Y===void 0||Y.postMessage({cmd:"logging_config",logging_config:M})},ee.prototype._onMSEUpdateEnd=function(){this._config.isLive&&this._config.liveBufferLatencyChasing&&this._live_latency_chaser&&this._live_latency_chaser.notifyBufferedRangeUpdate(),this._loading_controller.notifyBufferedPositionChanged()},ee.prototype._onMSEBufferFull=function(){t.a.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._loading_controller.suspendTransmuxer()},ee.prototype._onMediaLoadedMetadata=function(M){this._pending_seek_time!=null&&(this._seeking_handler.seek(this._pending_seek_time),this._pending_seek_time=null)},ee.prototype._onRequestDirectSeek=function(M){this._seeking_handler.directSeek(M)},ee.prototype._onRequiredUnbufferedSeek=function(M){this._worker.postMessage({cmd:"unbuffered_seek",milliseconds:M})},ee.prototype._onRequestPauseTransmuxer=function(){this._worker.postMessage({cmd:"pause_transmuxer"})},ee.prototype._onRequestResumeTransmuxer=function(){this._worker.postMessage({cmd:"resume_transmuxer"})},ee.prototype._onMediaTimeUpdate=function(M){this._worker.postMessage({cmd:"timeupdate",current_time:M.target.currentTime})},ee.prototype._onMediaReadyStateChange=function(M){this._worker.postMessage({cmd:"readystatechange",ready_state:M.target.readyState})},ee.prototype._onWorkerMessage=function(M){var Y,j=M.data,z=j.msg;if(z=="destroyed"||this._worker_destroying)return this._worker_destroying=!1,(Y=this._worker)===null||Y===void 0||Y.terminate(),void(this._worker=null);switch(z){case"mse_init":var q=j;this._media_element.srcObject=q.handle;break;case"mse_event":(q=j).event==m.a.UPDATE_END?this._onMSEUpdateEnd():q.event==m.a.BUFFER_FULL&&this._onMSEBufferFull();break;case"transmuxing_event":if((q=j).event==w.a.MEDIA_INFO){var Z=j;this._media_info=Z.info,this._emitter.emit(d.a.MEDIA_INFO,Object.assign({},Z.info))}else if(q.event==w.a.STATISTICS_INFO){var X=j;this._statistics_info=this._fillStatisticsInfo(X.info),this._emitter.emit(d.a.STATISTICS_INFO,Object.assign({},X.info))}else if(q.event==w.a.RECOMMEND_SEEKPOINT){var oe=j;this._media_element&&!this._config.accurateSeek&&this._seeking_handler.directSeek(oe.milliseconds/1e3)}break;case"player_event":if((q=j).event==d.a.ERROR){var he=j;this._emitter.emit(d.a.ERROR,he.error_type,he.error_detail,he.info)}else if("extraData"in q){var ie=j;this._emitter.emit(ie.event,ie.extraData)}break;case"logcat_callback":q=j,t.a.emitter.emit("log",q.type,q.logcat);break;case"buffered_position_changed":q=j,this._loading_controller.notifyBufferedPositionChanged(q.buffered_position_milliseconds/1e3)}},ee.prototype._fillStatisticsInfo=function(M){if(M.playerType="MSEPlayer",!(this._media_element instanceof HTMLVideoElement))return M;var Y=!0,j=0,z=0;if(this._media_element.getVideoPlaybackQuality){var q=this._media_element.getVideoPlaybackQuality();j=q.totalVideoFrames,z=q.droppedVideoFrames}else this._media_element.webkitDecodedFrameCount!=null?(j=this._media_element.webkitDecodedFrameCount,z=this._media_element.webkitDroppedFrameCount):Y=!1;return Y&&(M.decodedFrames=j,M.droppedFrames=z),M},ee}(),te=function(){function ee(M,Y){this.TAG="MSEPlayer",this._type="MSEPlayer",this._media_element=null,this._player_engine=null;var j=M.type.toLowerCase();if(j!=="mse"&&j!=="mpegts"&&j!=="m2ts"&&j!=="flv")throw new b.b("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");if(Y&&Y.enableWorkerForMSE&&J.isSupported())try{this._player_engine=new J(M,Y)}catch{t.a.e(this.TAG,"Error while initializing PlayerEngineDedicatedThread, fallback to PlayerEngineMainThread"),this._player_engine=new x(M,Y)}else this._player_engine=new x(M,Y)}return ee.prototype.destroy=function(){this._player_engine.destroy(),this._player_engine=null,this._media_element=null},ee.prototype.on=function(M,Y){this._player_engine.on(M,Y)},ee.prototype.off=function(M,Y){this._player_engine.off(M,Y)},ee.prototype.attachMediaElement=function(M){this._media_element=M,this._player_engine.attachMediaElement(M)},ee.prototype.detachMediaElement=function(){this._media_element=null,this._player_engine.detachMediaElement()},ee.prototype.load=function(){this._player_engine.load()},ee.prototype.unload=function(){this._player_engine.unload()},ee.prototype.play=function(){return this._player_engine.play()},ee.prototype.pause=function(){this._player_engine.pause()},ee.prototype.switchPrimaryAudio=function(){this._player_engine.switchPrimaryAudio()},ee.prototype.switchSecondaryAudio=function(){this._player_engine.switchSecondaryAudio()},Object.defineProperty(ee.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"buffered",{get:function(){return this._media_element.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"duration",{get:function(){return this._media_element.duration},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"volume",{get:function(){return this._media_element.volume},set:function(M){this._media_element.volume=M},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"muted",{get:function(){return this._media_element.muted},set:function(M){this._media_element.muted=M},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"currentTime",{get:function(){return this._media_element?this._media_element.currentTime:0},set:function(M){this._player_engine.seek(M)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"mediaInfo",{get:function(){return this._player_engine.mediaInfo},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"statisticsInfo",{get:function(){return this._player_engine.statisticsInfo},enumerable:!1,configurable:!0}),ee}(),le=function(){function ee(M,Y){this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new a.a,this._config=p(),typeof Y=="object"&&Object.assign(this._config,Y);var j=M.type.toLowerCase();if(j==="mse"||j==="mpegts"||j==="m2ts"||j==="flv")throw new b.b("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");if(M.hasOwnProperty("segments"))throw new b.b("NativePlayer(".concat(M.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=M,this._mediaElement=null}return ee.prototype.destroy=function(){this._emitter.emit(d.a.DESTROYING),this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},ee.prototype.on=function(M,Y){var j=this;M===d.a.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){j._emitter.emit(d.a.MEDIA_INFO,j.mediaInfo)}):M===d.a.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){j._emitter.emit(d.a.STATISTICS_INFO,j.statisticsInfo)}),this._emitter.addListener(M,Y)},ee.prototype.off=function(M,Y){this._emitter.removeListener(M,Y)},ee.prototype.attachMediaElement=function(M){if(this._mediaElement=M,M.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{M.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch{}},ee.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},ee.prototype.load=function(){if(!this._mediaElement)throw new b.a("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},ee.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},ee.prototype.play=function(){return this._mediaElement.play()},ee.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(ee.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(M){this._mediaElement.volume=M},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(M){this._mediaElement.muted=M},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(M){this._mediaElement?this._mediaElement.currentTime=M:this._pendingSeekTime=M},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"mediaInfo",{get:function(){var M={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(M.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(M.width=this._mediaElement.videoWidth,M.height=this._mediaElement.videoHeight)),M},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"statisticsInfo",{get:function(){var M={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return M;var Y=!0,j=0,z=0;if(this._mediaElement.getVideoPlaybackQuality){var q=this._mediaElement.getVideoPlaybackQuality();j=q.totalVideoFrames,z=q.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(j=this._mediaElement.webkitDecodedFrameCount,z=this._mediaElement.webkitDroppedFrameCount):Y=!1;return Y&&(M.decodedFrames=j,M.droppedFrames=z),M},enumerable:!1,configurable:!0}),ee.prototype._onvLoadedMetadata=function(M){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(d.a.MEDIA_INFO,this.mediaInfo)},ee.prototype._reportStatisticsInfo=function(){this._emitter.emit(d.a.STATISTICS_INFO,this.statisticsInfo)},ee}();A.a.install();var ne={createPlayer:function(ee,M){var Y=ee;if(Y==null||typeof Y!="object")throw new b.b("MediaDataSource must be an javascript object!");if(!Y.hasOwnProperty("type"))throw new b.b("MediaDataSource must has type field to indicate video file type!");switch(Y.type){case"mse":case"mpegts":case"m2ts":case"flv":return new te(Y,M);default:return new le(Y,M)}},isSupported:function(){return r.supportMSEH264Playback()},getFeatureList:function(){return r.getFeatureList()}};ne.BaseLoader=i.a,ne.LoaderStatus=i.c,ne.LoaderErrors=i.b,ne.Events=d.a,ne.ErrorTypes=v.b,ne.ErrorDetails=v.a,ne.MSEPlayer=te,ne.NativePlayer=le,ne.LoggingControl=G.a,Object.defineProperty(ne,"version",{enumerable:!0,get:function(){return"1.7.3"}}),u.default=ne}])})})(R0);var $8=R0.exports;const xc=sd($8);class ed{constructor(e,s,u=window.document){we(this,"restart_required_when_quality_switched",!1);we(this,"player");we(this,"playback_mode");we(this,"document");we(this,"abort_controller",null);this.player=e,this.playback_mode=s,this.document=u}async init(){const e=Ln(),s=cn(),u=Sn();this.abort_controller=new AbortController;const y=document.querySelector(".route-container"),A=this.player.container.querySelector(".dplayer-capture-icon"),l=this.player.container.querySelector(".dplayer-comment-capture-icon"),c=document.querySelector(".tweet-form__textarea"),p=document.querySelector(".tweet-button"),r=document.querySelector(".remote-control-button-data"),i=document.querySelector(".remote-control-button-back"),t=document.querySelector(".remote-control-button-select"),n=document.querySelector(".remote-control-button-up"),a=document.querySelector(".remote-control-button-left"),o=document.querySelector(".remote-control-button-right"),d=document.querySelector(".remote-control-button-down"),g=document.querySelector(".remote-control-button-blue"),m=document.querySelector(".remote-control-button-red"),v=document.querySelector(".remote-control-button-green"),b=document.querySelector(".remote-control-button-yellow"),w=[{mode:"Live",key:"ArrowUp",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.is_zapping=!0,Es.push({path:`/tv/watch/${e.channel.previous.display_channel_id}`})}},{mode:"Live",key:"ArrowDown",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.is_zapping=!0,Es.push({path:`/tv/watch/${e.channel.next.display_channel_id}`})}},{mode:"Both",key:"Slash",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.shortcut_key_modal=!s.shortcut_key_modal}},{mode:"Both",key:"Space",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.toggle()}},{mode:"Live",key:"ArrowLeft",repeat:!0,ctrl:!0,shift:!1,alt:!1,handler:()=>{this.player.video.paused===!1&&this.player.video.pause(),this.player.video.currentTime=this.player.video.currentTime-.5}},{mode:"Live",key:"ArrowRight",repeat:!0,ctrl:!0,shift:!1,alt:!1,handler:()=>{this.player.video.paused===!1&&this.player.video.pause(),this.player.video.currentTime=this.player.video.currentTime+.5}},{mode:"Video",key:"ArrowLeft",repeat:!0,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.seek(this.player.video.currentTime-5)}},{mode:"Video",key:"ArrowRight",repeat:!0,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.seek(this.player.video.currentTime+5)}},{mode:"Video",key:"ArrowLeft",repeat:!0,ctrl:!0,shift:!1,alt:!1,handler:()=>{this.player.seek(this.player.video.currentTime-15)}},{mode:"Video",key:"ArrowRight",repeat:!0,ctrl:!0,shift:!1,alt:!1,handler:()=>{this.player.seek(this.player.video.currentTime+15)}},{mode:"Video",key:"ArrowLeft",repeat:!0,ctrl:!1,shift:!0,alt:!1,handler:()=>{this.player.seek(this.player.video.currentTime-30)}},{mode:"Video",key:"ArrowRight",repeat:!0,ctrl:!1,shift:!0,alt:!1,handler:()=>{this.player.seek(this.player.video.currentTime+30)}},{mode:"Video",key:"ArrowLeft",repeat:!0,ctrl:!1,shift:!1,alt:!0,handler:()=>{this.player.seek(this.player.video.currentTime-60)}},{mode:"Video",key:"ArrowRight",repeat:!0,ctrl:!1,shift:!1,alt:!0,handler:()=>{this.player.seek(this.player.video.currentTime+60)}},{mode:"Both",key:"ArrowUp",repeat:!0,ctrl:!0,shift:!1,alt:!1,handler:()=>{this.player.volume(this.player.volume()+.05)}},{mode:"Both",key:"ArrowDown",repeat:!0,ctrl:!0,shift:!1,alt:!1,handler:()=>{this.player.volume(this.player.volume()-.05)}},{mode:"Both",key:"KeyQ",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.container.classList.contains("dplayer-mobile")?this.player.video.muted=!this.player.video.muted:this.player.template.volumeButtonIcon.click(),this.player.video.muted===!0?this.player.notice("音量をミュート中"):this.player.notice("音量をミュート解除")}},{mode:"Live",key:"KeyW",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.sync()}},{mode:"Both",key:"KeyR",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.event_emitter.emit("PlayerRestartRequired",{message:"プレイヤーを再起動しました。",is_error_message:!1})}},{mode:"Both",key:"KeyF",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.fullScreen.toggle()}},{mode:"Both",key:"KeyE",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{document.pictureInPictureEnabled&&this.player.template.pipButton.click()}},{mode:"Both",key:"KeyS",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.subtitle.toggle(),this.player.subtitle.container.classList.contains("dplayer-subtitle-hide")?this.player.notice(`${this.player.tran("Hide subtitle")}`):this.player.notice(`${this.player.tran("Show subtitle")}`)}},{mode:"Both",key:"KeyD",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.template.showDanmaku.click(),this.player.template.showDanmakuToggle.checked?this.player.notice(`${this.player.tran("Show comment")}`):this.player.notice(`${this.player.tran("Hide comment")}`)}},{mode:"Both",key:"KeyC",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{A.click()}},{mode:"Both",key:"KeyV",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{l.click()}},{mode:"Live",key:"KeyM",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.controller.show(),this.player.comment.show(),s.event_emitter.emit("SetControlDisplayTimer",{}),window.setTimeout(()=>this.player.template.commentInput.focus(),100)}},{mode:"Both",key:"KeyP",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.is_panel_display=!s.is_panel_display}},{mode:"Live",key:"KeyK",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.tv_panel_active_tab="Program"}},{mode:"Video",key:"KeyK",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.video_panel_active_tab="RecordedProgram"}},{mode:"Live",key:"KeyL",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.tv_panel_active_tab="Channel"}},{mode:"Video",key:"KeyL",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.video_panel_active_tab="Series"}},{mode:"Both",key:"Semicolon",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.playback_mode==="Live"?s.tv_panel_active_tab="Comment":s.video_panel_active_tab="Comment"}},{mode:"Both",key:"Quote",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.playback_mode==="Live"?s.tv_panel_active_tab="Twitter":s.video_panel_active_tab="Twitter"}},{mode:"Both",key:"BracketRight",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.twitter_active_tab="Search"}},{mode:"Both",key:"Backslash",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.twitter_active_tab="Timeline"}},{mode:"Both",key:"IntlRo",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.twitter_active_tab="Capture"}},{mode:"Live",key:"KeyD",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{r==null||r.click()}},{mode:"Live",key:"Backspace",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{i==null||i.click()}},{mode:"Live",key:"Enter",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{t==null||t.click()}},{mode:"Live",key:"ArrowUp",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{n==null||n.click()}},{mode:"Live",key:"ArrowLeft",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{a==null||a.click()}},{mode:"Live",key:"ArrowRight",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{o==null||o.click()}},{mode:"Live",key:"ArrowDown",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{d==null||d.click()}},{mode:"Live",key:"F9",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{g==null||g.click()}},{mode:"Live",key:"F10",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{m==null||m.click()}},{mode:"Live",key:"F11",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{v==null||v.click()}},{mode:"Live",key:"F12",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{b==null||b.click()}}];let C=0;this.document.addEventListener("keydown",D=>{if(D.isComposing===!0||D.keyCode===229)return;let R=!1;D.repeat&&(R=!0);const T=si.time();T-C<.05&&(R=!0),C=T;const P=si.isMacOS()===!0?D.metaKey:D.ctrlKey,L=D.shiftKey,I=D.altKey,x=this.playback_mode==="Live"?s.tv_panel_active_tab:s.video_panel_active_tab,O=document.activeElement instanceof HTMLInputElement||document.activeElement instanceof HTMLTextAreaElement;if(this.playback_mode==="Live"&&R===!1&&P===!1&&I===(u.settings.tv_channel_selection_requires_alt_key===!0)&&O===!1){const G=L?"BS":"GR";let J=null;if(["Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9"].includes(D.code)&&(J=Number(D.code.replace("Digit",""))),D.code==="Digit0"&&(J=10),D.code==="Minus"&&(J=11),D.code==="Equal"&&(J=12),["Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9"].includes(D.code)&&(J=Number(D.code.replace("Numpad",""))),D.code==="Numpad0"&&(J=10),J!==null){const te=e.getChannelByRemoconID(G,J);if(te!==null&&te.display_channel_id!==e.display_channel_id){Es.push({path:`/tv/watch/${te.display_channel_id}`}),D.preventDefault(),D.stopPropagation();return}}}if(this.playback_mode==="Live"&&D.code==="KeyM"&&R===!1&&P===!0&&L===!1&&I===!1&&this.player.template.controller.classList.contains("dplayer-controller-comment")&&(O===!1||document.activeElement===this.player.template.commentInput)){this.player.comment.hide(),D.preventDefault(),D.stopPropagation();return}if(D.code==="Enter"&&R===!1&&(P===!0||L===!0)&&I===!1&&s.is_panel_display===!0&&x==="Twitter"&&(O===!1||document.activeElement===c)){p.click(),D.preventDefault(),D.stopPropagation();return}if(D.code==="Tab"&&R===!1&&P===!1&&L===!1&&I===!1&&(O===!1||document.activeElement===c)){document.activeElement===c?c.blur():(s.is_panel_display=!0,this.playback_mode==="Live"?s.tv_panel_active_tab="Twitter":s.video_panel_active_tab="Twitter",s.is_document_pip===!0&&window.focus(),c.focus(),y.scrollLeft=0,window.setTimeout(()=>{c.focus(),y.scrollLeft=0},.1*1e3)),D.preventDefault(),D.stopPropagation();return}if(D.code==="Space"&&R===!1&&P===!1&&L===!0&&I===!1&&s.is_document_pip===!1&&s.is_panel_display===!0&&x==="Twitter"&&s.twitter_active_tab==="Capture"&&O===!1){this.player.toggle(),D.preventDefault(),D.stopPropagation();return}if(P===!1&&L===!1&&I===!1&&s.is_document_pip===!1&&s.is_panel_display===!0&&x==="Twitter"&&s.twitter_active_tab==="Capture"&&O===!1&&(()=>{if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(D.code)){if(s.twitter_captures.length===0)return!0;if(s.twitter_captures.some(ne=>ne.focused===!0)===!1)return s.twitter_captures[s.twitter_captures.length-1].focused=!0,!0;const J=s.twitter_captures.findIndex(ne=>ne.focused===!0);if(D.code==="ArrowUp"){if(J-2<0)return!0;s.twitter_captures[J-2].focused=!0}if(D.code==="ArrowDown"){if(J+2>s.twitter_captures.length-1)return!0;s.twitter_captures[J+2].focused=!0}if(D.code==="ArrowLeft"){if(J-1<0)return!0;s.twitter_captures[J-1].focused=!0}if(D.code==="ArrowRight"){if(J+1>s.twitter_captures.length-1)return!0;s.twitter_captures[J+1].focused=!0}s.twitter_captures[J].focused=!1;const te=s.twitter_captures.find(ne=>ne.focused===!0);s.twitter_zoom_capture_modal===!0&&(s.twitter_zoom_capture=te);const le=document.querySelector(`img[src="${te.image_url}"]`).parentElement;return R?le.scrollIntoView({block:"nearest",inline:"nearest",behavior:"auto"}):le.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"}),!0}if(D.code==="Enter"){if(D.target===this.player.template.commentInput)return!0;if(s.twitter_zoom_capture_modal===!0)return s.twitter_zoom_capture_modal=!1,!0;const J=s.twitter_captures.find(te=>te.focused===!0);return J===void 0||(s.twitter_zoom_capture=J,s.twitter_zoom_capture_modal=!0),!0}if(D.code==="Space"){const J=s.twitter_captures.find(le=>le.focused===!0);return J===void 0||document.querySelector(`img[src="${J.image_url}"]`).parentElement.click(),!0}return!1})()===!0){D.preventDefault(),D.stopPropagation();return}if(O!==!0){for(const G of w)if(!(G.mode!=="Both"&&G.mode!==this.playback_mode)&&G.key===D.code&&!(G.repeat===!1&&R===!0)&&G.ctrl===P&&G.shift===L&&G.alt===I){G.handler(),D.preventDefault(),D.stopPropagation();return}}},{signal:this.abort_controller.signal}),console.log("[KeyboardShortcutManager] Initialized.")}async destroy(){const e=cn();if(this.playback_mode==="Live"&&e.is_zapping===!0){const s=Ic(()=>e.is_player_initialized,(y,A)=>{A===!1&&y===!0&&(s(),u(),this.abort_controller!==null&&(this.abort_controller.abort(),this.abort_controller=null),console.log("[KeyboardShortcutManager] Destroyed. (Zapping finished)"))}),u=Ic(()=>e.is_watching,(y,A)=>{A===!0&&y===!1&&(s(),u(),this.abort_controller!==null&&(this.abort_controller.abort(),this.abort_controller=null),console.log("[KeyboardShortcutManager] Destroyed. (Zapping canceled)"))})}else this.abort_controller!==null&&(this.abort_controller.abort(),this.abort_controller=null),console.log("[KeyboardShortcutManager] Destroyed.")}}/** + */var c;c=function(){function p(oe){return typeof oe=="function"}var r=Array.isArray?Array.isArray:function(oe){return Object.prototype.toString.call(oe)==="[object Array]"},i=0,t=void 0,n=void 0,a=function(oe,he){w[i]=oe,w[i+1]=he,(i+=2)===2&&(n?n(C):L())},o=typeof window<"u"?window:void 0,d=o||{},g=d.MutationObserver||d.WebKitMutationObserver,m=typeof self>"u"&&y!==void 0&&{}.toString.call(y)==="[object process]",v=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function b(){var oe=setTimeout;return function(){return oe(C,1)}}var w=new Array(1e3);function C(){for(var oe=0;oe1)for(var w=1;w0){var z=this._media_element.buffered.start(0);(z<1&&M0){var z=j.start(0);if(z<1&&Y=z&&M0&&this._suspendTransmuxerIfBufferedPositionExceeded(j)},ee.prototype._suspendTransmuxerIfBufferedPositionExceeded=function(M){M>=this._media_element.currentTime+this._config.lazyLoadMaxDuration&&!this._paused&&(t.a.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this.suspendTransmuxer(),this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate))},ee.prototype.suspendTransmuxer=function(){this._paused=!0,this._on_pause_transmuxer()},ee.prototype._resumeTransmuxerIfNeeded=function(){for(var M=this._media_element.buffered,Y=this._media_element.currentTime,j=this._config.lazyLoadRecoverDuration,z=!1,q=0;q=Z&&Y=X-j&&(z=!0);break}}z&&(t.a.v(this.TAG,"Continue loading from paused position"),this.resumeTransmuxer(),this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate))},ee.prototype.resumeTransmuxer=function(){this._paused=!1,this._on_resume_transmuxer()},ee}(),P=function(){function ee(M,Y){this.TAG="StartupStallJumper",this._media_element=null,this._on_direct_seek=null,this._canplay_received=!1,this.e=null,this._media_element=M,this._on_direct_seek=Y,this.e={onMediaCanPlay:this._onMediaCanPlay.bind(this),onMediaStalled:this._onMediaStalled.bind(this),onMediaProgress:this._onMediaProgress.bind(this)},this._media_element.addEventListener("canplay",this.e.onMediaCanPlay),this._media_element.addEventListener("stalled",this.e.onMediaStalled),this._media_element.addEventListener("progress",this.e.onMediaProgress)}return ee.prototype.destroy=function(){this._media_element.removeEventListener("canplay",this.e.onMediaCanPlay),this._media_element.removeEventListener("stalled",this.e.onMediaStalled),this._media_element.removeEventListener("progress",this.e.onMediaProgress),this._media_element=null,this._on_direct_seek=null},ee.prototype._onMediaCanPlay=function(M){this._canplay_received=!0,this._media_element.removeEventListener("canplay",this.e.onMediaCanPlay)},ee.prototype._onMediaStalled=function(M){this._detectAndFixStuckPlayback(!0)},ee.prototype._onMediaProgress=function(M){this._detectAndFixStuckPlayback()},ee.prototype._detectAndFixStuckPlayback=function(M){var Y=this._media_element,j=Y.buffered;M||!this._canplay_received||Y.readyState<2?j.length>0&&Y.currentTimethis._config.liveBufferLatencyMaxLatency&&z-Y>this._config.liveBufferLatencyMaxLatency){var q=z-this._config.liveBufferLatencyMinRemain;this._on_direct_seek(q)}}},ee}(),I=function(){function ee(M,Y){this._config=null,this._media_element=null,this.e=null,this._config=M,this._media_element=Y,this.e={onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this)},this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate)}return ee.prototype.destroy=function(){this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element=null,this._config=null},ee.prototype._onMediaTimeUpdate=function(M){if(this._config.isLive&&this._config.liveSync){var Y=this._getCurrentLatency();if(Y>this._config.liveSyncMaxLatency){var j=Math.min(2,Math.max(1,this._config.liveSyncPlaybackRate));this._media_element.playbackRate=j}else Y>this._config.liveSyncTargetLatency||this._media_element.playbackRate!==1&&this._media_element.playbackRate!==0&&(this._media_element.playbackRate=1)}},ee.prototype._getCurrentLatency=function(){if(!this._media_element)return 0;var M=this._media_element.buffered,Y=this._media_element.currentTime;return M.length==0?0:M.end(M.length-1)-Y},ee}(),x=function(){function ee(M,Y){this.TAG="PlayerEngineMainThread",this._emitter=new n,this._media_element=null,this._mse_controller=null,this._transmuxer=null,this._pending_seek_time=null,this._seeking_handler=null,this._loading_controller=null,this._startup_stall_jumper=null,this._live_latency_chaser=null,this._live_latency_synchronizer=null,this._mse_source_opened=!1,this._has_pending_load=!1,this._loaded_metadata_received=!1,this._media_info=null,this._statistics_info=null,this.e=null,this._media_data_source=M,this._config=p(),typeof Y=="object"&&Object.assign(this._config,Y),M.isLive===!0&&(this._config.isLive=!0),this.e={onMediaLoadedMetadata:this._onMediaLoadedMetadata.bind(this)}}return ee.prototype.destroy=function(){this._emitter.emit(d.a.DESTROYING),this._transmuxer&&this.unload(),this._media_element&&this.detachMediaElement(),this.e=null,this._media_data_source=null,this._emitter.removeAllListeners(),this._emitter=null},ee.prototype.on=function(M,Y){var j=this;this._emitter.addListener(M,Y),M===d.a.MEDIA_INFO&&this._media_info?Promise.resolve().then(function(){return j._emitter.emit(d.a.MEDIA_INFO,j.mediaInfo)}):M==d.a.STATISTICS_INFO&&this._statistics_info&&Promise.resolve().then(function(){return j._emitter.emit(d.a.STATISTICS_INFO,j.statisticsInfo)})},ee.prototype.off=function(M,Y){this._emitter.removeListener(M,Y)},ee.prototype.attachMediaElement=function(M){var Y=this;this._media_element=M,M.src="",M.removeAttribute("src"),M.srcObject=null,M.load(),M.addEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._mse_controller=new o.a(this._config),this._mse_controller.on(m.a.UPDATE_END,this._onMSEUpdateEnd.bind(this)),this._mse_controller.on(m.a.BUFFER_FULL,this._onMSEBufferFull.bind(this)),this._mse_controller.on(m.a.SOURCE_OPEN,this._onMSESourceOpen.bind(this)),this._mse_controller.on(m.a.ERROR,this._onMSEError.bind(this)),this._mse_controller.on(m.a.START_STREAMING,this._onMSEStartStreaming.bind(this)),this._mse_controller.on(m.a.END_STREAMING,this._onMSEEndStreaming.bind(this)),this._mse_controller.initialize({getCurrentTime:function(){return Y._media_element.currentTime},getReadyState:function(){return Y._media_element.readyState}}),this._mse_controller.isManagedMediaSource()?(M.disableRemotePlayback=!0,M.srcObject=this._mse_controller.getObject()):M.src=this._mse_controller.getObjectURL()},ee.prototype.detachMediaElement=function(){this._media_element&&(this._mse_controller.shutdown(),this._media_element.removeEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element=null,this._mse_controller.revokeObjectURL()),this._mse_controller&&(this._mse_controller.destroy(),this._mse_controller=null)},ee.prototype.load=function(){var M=this;if(!this._media_element)throw new b.a("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new b.a("load() has been called, please call unload() first!");this._has_pending_load||(!this._config.deferLoadAfterSourceOpen||this._mse_source_opened?(this._transmuxer=new g.a(this._media_data_source,this._config),this._transmuxer.on(w.a.INIT_SEGMENT,function(Y,j){M._mse_controller.appendInitSegment(j)}),this._transmuxer.on(w.a.MEDIA_SEGMENT,function(Y,j){M._mse_controller.appendMediaSegment(j),!M._config.isLive&&Y==="video"&&j.data&&j.data.byteLength>0&&"info"in j&&M._seeking_handler.appendSyncPoints(j.info.syncPoints),M._loading_controller.notifyBufferedPositionChanged(j.info.endDts/1e3)}),this._transmuxer.on(w.a.LOADING_COMPLETE,function(){M._mse_controller.endOfStream(),M._emitter.emit(d.a.LOADING_COMPLETE)}),this._transmuxer.on(w.a.RECOVERED_EARLY_EOF,function(){M._emitter.emit(d.a.RECOVERED_EARLY_EOF)}),this._transmuxer.on(w.a.IO_ERROR,function(Y,j){M._emitter.emit(d.a.ERROR,v.b.NETWORK_ERROR,Y,j)}),this._transmuxer.on(w.a.DEMUX_ERROR,function(Y,j){M._emitter.emit(d.a.ERROR,v.b.MEDIA_ERROR,Y,j)}),this._transmuxer.on(w.a.MEDIA_INFO,function(Y){M._media_info=Y,M._emitter.emit(d.a.MEDIA_INFO,Object.assign({},Y))}),this._transmuxer.on(w.a.STATISTICS_INFO,function(Y){M._statistics_info=M._fillStatisticsInfo(Y),M._emitter.emit(d.a.STATISTICS_INFO,Object.assign({},Y))}),this._transmuxer.on(w.a.RECOMMEND_SEEKPOINT,function(Y){M._media_element&&!M._config.accurateSeek&&M._seeking_handler.directSeek(Y/1e3)}),this._transmuxer.on(w.a.METADATA_ARRIVED,function(Y){M._emitter.emit(d.a.METADATA_ARRIVED,Y)}),this._transmuxer.on(w.a.SCRIPTDATA_ARRIVED,function(Y){M._emitter.emit(d.a.SCRIPTDATA_ARRIVED,Y)}),this._transmuxer.on(w.a.TIMED_ID3_METADATA_ARRIVED,function(Y){M._emitter.emit(d.a.TIMED_ID3_METADATA_ARRIVED,Y)}),this._transmuxer.on(w.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,function(Y){M._emitter.emit(d.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,Y)}),this._transmuxer.on(w.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,function(Y){M._emitter.emit(d.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,Y)}),this._transmuxer.on(w.a.SMPTE2038_METADATA_ARRIVED,function(Y){M._emitter.emit(d.a.SMPTE2038_METADATA_ARRIVED,Y)}),this._transmuxer.on(w.a.SCTE35_METADATA_ARRIVED,function(Y){M._emitter.emit(d.a.SCTE35_METADATA_ARRIVED,Y)}),this._transmuxer.on(w.a.PES_PRIVATE_DATA_DESCRIPTOR,function(Y){M._emitter.emit(d.a.PES_PRIVATE_DATA_DESCRIPTOR,Y)}),this._transmuxer.on(w.a.PES_PRIVATE_DATA_ARRIVED,function(Y){M._emitter.emit(d.a.PES_PRIVATE_DATA_ARRIVED,Y)}),this._seeking_handler=new R(this._config,this._media_element,this._onRequiredUnbufferedSeek.bind(this)),this._loading_controller=new T(this._config,this._media_element,this._onRequestPauseTransmuxer.bind(this),this._onRequestResumeTransmuxer.bind(this)),this._startup_stall_jumper=new P(this._media_element,this._onRequestDirectSeek.bind(this)),this._config.isLive&&this._config.liveBufferLatencyChasing&&(this._live_latency_chaser=new L(this._config,this._media_element,this._onRequestDirectSeek.bind(this))),this._config.isLive&&this._config.liveSync&&(this._live_latency_synchronizer=new I(this._config,this._media_element)),this._media_element.readyState>0&&this._seeking_handler.directSeek(0),this._transmuxer.open()):this._has_pending_load=!0)},ee.prototype.unload=function(){var M,Y,j,z,q,Z,X,oe,he;(M=this._media_element)===null||M===void 0||M.pause(),(Y=this._live_latency_synchronizer)===null||Y===void 0||Y.destroy(),this._live_latency_synchronizer=null,(j=this._live_latency_chaser)===null||j===void 0||j.destroy(),this._live_latency_chaser=null,(z=this._startup_stall_jumper)===null||z===void 0||z.destroy(),this._startup_stall_jumper=null,(q=this._loading_controller)===null||q===void 0||q.destroy(),this._loading_controller=null,(Z=this._seeking_handler)===null||Z===void 0||Z.destroy(),this._seeking_handler=null,(X=this._mse_controller)===null||X===void 0||X.flush(),(oe=this._transmuxer)===null||oe===void 0||oe.close(),(he=this._transmuxer)===null||he===void 0||he.destroy(),this._transmuxer=null},ee.prototype.play=function(){return this._media_element.play()},ee.prototype.pause=function(){this._media_element.pause()},ee.prototype.seek=function(M){this._media_element&&this._seeking_handler?this._seeking_handler.seek(M):this._pending_seek_time=M},ee.prototype.switchPrimaryAudio=function(){this._transmuxer.switchPrimaryAudio()},ee.prototype.switchSecondaryAudio=function(){this._transmuxer.switchSecondaryAudio()},Object.defineProperty(ee.prototype,"mediaInfo",{get:function(){return Object.assign({},this._media_info)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"statisticsInfo",{get:function(){return Object.assign({},this._statistics_info)},enumerable:!1,configurable:!0}),ee.prototype._onMSESourceOpen=function(){this._mse_source_opened=!0,this._has_pending_load&&(this._has_pending_load=!1,this.load())},ee.prototype._onMSEUpdateEnd=function(){this._config.isLive&&this._config.liveBufferLatencyChasing&&this._live_latency_chaser&&this._live_latency_chaser.notifyBufferedRangeUpdate(),this._loading_controller.notifyBufferedPositionChanged()},ee.prototype._onMSEBufferFull=function(){t.a.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._loading_controller.suspendTransmuxer()},ee.prototype._onMSEError=function(M){this._emitter.emit(d.a.ERROR,v.b.MEDIA_ERROR,v.a.MEDIA_MSE_ERROR,M)},ee.prototype._onMSEStartStreaming=function(){this._loaded_metadata_received&&(this._config.isLive||(t.a.v(this.TAG,"Resume transmuxing task due to ManagedMediaSource onStartStreaming"),this._loading_controller.resumeTransmuxer()))},ee.prototype._onMSEEndStreaming=function(){this._config.isLive||(t.a.v(this.TAG,"Suspend transmuxing task due to ManagedMediaSource onEndStreaming"),this._loading_controller.suspendTransmuxer())},ee.prototype._onMediaLoadedMetadata=function(M){this._loaded_metadata_received=!0,this._pending_seek_time!=null&&(this._seeking_handler.seek(this._pending_seek_time),this._pending_seek_time=null)},ee.prototype._onRequestDirectSeek=function(M){this._seeking_handler.directSeek(M)},ee.prototype._onRequiredUnbufferedSeek=function(M){this._mse_controller.flush(),this._transmuxer.seek(M)},ee.prototype._onRequestPauseTransmuxer=function(){this._transmuxer.pause()},ee.prototype._onRequestResumeTransmuxer=function(){this._transmuxer.resume()},ee.prototype._fillStatisticsInfo=function(M){if(M.playerType="MSEPlayer",!(this._media_element instanceof HTMLVideoElement))return M;var Y=!0,j=0,z=0;if(this._media_element.getVideoPlaybackQuality){var q=this._media_element.getVideoPlaybackQuality();j=q.totalVideoFrames,z=q.droppedVideoFrames}else this._media_element.webkitDecodedFrameCount!=null?(j=this._media_element.webkitDecodedFrameCount,z=this._media_element.webkitDroppedFrameCount):Y=!1;return Y&&(M.decodedFrames=j,M.droppedFrames=z),M},ee}(),O=A(21),G=A(8),J=function(){function ee(M,Y){this.TAG="PlayerEngineDedicatedThread",this._emitter=new n,this._media_element=null,this._worker_destroying=!1,this._seeking_handler=null,this._loading_controller=null,this._startup_stall_jumper=null,this._live_latency_chaser=null,this._live_latency_synchronizer=null,this._pending_seek_time=null,this._media_info=null,this._statistics_info=null,this.e=null,this._media_data_source=M,this._config=p(),typeof Y=="object"&&Object.assign(this._config,Y),M.isLive===!0&&(this._config.isLive=!0),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this),onMediaLoadedMetadata:this._onMediaLoadedMetadata.bind(this),onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this),onMediaReadyStateChanged:this._onMediaReadyStateChange.bind(this)},G.a.registerListener(this.e.onLoggingConfigChanged),this._worker=O(28,{all:!0}),this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",media_data_source:this._media_data_source,config:this._config}),this._worker.postMessage({cmd:"logging_config",logging_config:G.a.getConfig()})}return ee.isSupported=function(){return!!(self.Worker&&self.MediaSource&&"canConstructInDedicatedWorker"in self.MediaSource&&self.MediaSource.canConstructInDedicatedWorker===!0)},ee.prototype.destroy=function(){this._emitter.emit(d.a.DESTROYING),this.unload(),this.detachMediaElement(),this._worker_destroying=!0,this._worker.postMessage({cmd:"destroy"}),G.a.removeListener(this.e.onLoggingConfigChanged),this.e=null,this._media_data_source=null,this._emitter.removeAllListeners(),this._emitter=null},ee.prototype.on=function(M,Y){var j=this;this._emitter.addListener(M,Y),M===d.a.MEDIA_INFO&&this._media_info?Promise.resolve().then(function(){return j._emitter.emit(d.a.MEDIA_INFO,j.mediaInfo)}):M==d.a.STATISTICS_INFO&&this._statistics_info&&Promise.resolve().then(function(){return j._emitter.emit(d.a.STATISTICS_INFO,j.statisticsInfo)})},ee.prototype.off=function(M,Y){this._emitter.removeListener(M,Y)},ee.prototype.attachMediaElement=function(M){this._media_element=M,this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element.addEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element.addEventListener("readystatechange",this.e.onMediaReadyStateChanged),this._worker.postMessage({cmd:"initialize_mse"})},ee.prototype.detachMediaElement=function(){this._worker.postMessage({cmd:"shutdown_mse"}),this._media_element&&(this._media_element.removeEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element.removeEventListener("readystatechange",this.e.onMediaReadyStateChanged),this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element=null)},ee.prototype.load=function(){this._worker.postMessage({cmd:"load"}),this._seeking_handler=new R(this._config,this._media_element,this._onRequiredUnbufferedSeek.bind(this)),this._loading_controller=new T(this._config,this._media_element,this._onRequestPauseTransmuxer.bind(this),this._onRequestResumeTransmuxer.bind(this)),this._startup_stall_jumper=new P(this._media_element,this._onRequestDirectSeek.bind(this)),this._config.isLive&&this._config.liveBufferLatencyChasing&&(this._live_latency_chaser=new L(this._config,this._media_element,this._onRequestDirectSeek.bind(this))),this._config.isLive&&this._config.liveSync&&(this._live_latency_synchronizer=new I(this._config,this._media_element)),this._media_element.readyState>0&&this._seeking_handler.directSeek(0)},ee.prototype.unload=function(){var M,Y,j,z,q,Z;(M=this._media_element)===null||M===void 0||M.pause(),this._worker.postMessage({cmd:"unload"}),(Y=this._live_latency_synchronizer)===null||Y===void 0||Y.destroy(),this._live_latency_synchronizer=null,(j=this._live_latency_chaser)===null||j===void 0||j.destroy(),this._live_latency_chaser=null,(z=this._startup_stall_jumper)===null||z===void 0||z.destroy(),this._startup_stall_jumper=null,(q=this._loading_controller)===null||q===void 0||q.destroy(),this._loading_controller=null,(Z=this._seeking_handler)===null||Z===void 0||Z.destroy(),this._seeking_handler=null},ee.prototype.play=function(){return this._media_element.play()},ee.prototype.pause=function(){this._media_element.pause()},ee.prototype.seek=function(M){this._media_element&&this._seeking_handler?this._seeking_handler.seek(M):this._pending_seek_time=M},ee.prototype.switchPrimaryAudio=function(){this._worker.postMessage({cmd:"switch_audio",audio_track:"primary"})},ee.prototype.switchSecondaryAudio=function(){this._worker.postMessage({cmd:"switch_audio",audio_track:"secondary"})},Object.defineProperty(ee.prototype,"mediaInfo",{get:function(){return Object.assign({},this._media_info)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"statisticsInfo",{get:function(){return Object.assign({},this._statistics_info)},enumerable:!1,configurable:!0}),ee.prototype._onLoggingConfigChanged=function(M){var Y;(Y=this._worker)===null||Y===void 0||Y.postMessage({cmd:"logging_config",logging_config:M})},ee.prototype._onMSEUpdateEnd=function(){this._config.isLive&&this._config.liveBufferLatencyChasing&&this._live_latency_chaser&&this._live_latency_chaser.notifyBufferedRangeUpdate(),this._loading_controller.notifyBufferedPositionChanged()},ee.prototype._onMSEBufferFull=function(){t.a.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._loading_controller.suspendTransmuxer()},ee.prototype._onMediaLoadedMetadata=function(M){this._pending_seek_time!=null&&(this._seeking_handler.seek(this._pending_seek_time),this._pending_seek_time=null)},ee.prototype._onRequestDirectSeek=function(M){this._seeking_handler.directSeek(M)},ee.prototype._onRequiredUnbufferedSeek=function(M){this._worker.postMessage({cmd:"unbuffered_seek",milliseconds:M})},ee.prototype._onRequestPauseTransmuxer=function(){this._worker.postMessage({cmd:"pause_transmuxer"})},ee.prototype._onRequestResumeTransmuxer=function(){this._worker.postMessage({cmd:"resume_transmuxer"})},ee.prototype._onMediaTimeUpdate=function(M){this._worker.postMessage({cmd:"timeupdate",current_time:M.target.currentTime})},ee.prototype._onMediaReadyStateChange=function(M){this._worker.postMessage({cmd:"readystatechange",ready_state:M.target.readyState})},ee.prototype._onWorkerMessage=function(M){var Y,j=M.data,z=j.msg;if(z=="destroyed"||this._worker_destroying)return this._worker_destroying=!1,(Y=this._worker)===null||Y===void 0||Y.terminate(),void(this._worker=null);switch(z){case"mse_init":var q=j;this._media_element.srcObject=q.handle;break;case"mse_event":(q=j).event==m.a.UPDATE_END?this._onMSEUpdateEnd():q.event==m.a.BUFFER_FULL&&this._onMSEBufferFull();break;case"transmuxing_event":if((q=j).event==w.a.MEDIA_INFO){var Z=j;this._media_info=Z.info,this._emitter.emit(d.a.MEDIA_INFO,Object.assign({},Z.info))}else if(q.event==w.a.STATISTICS_INFO){var X=j;this._statistics_info=this._fillStatisticsInfo(X.info),this._emitter.emit(d.a.STATISTICS_INFO,Object.assign({},X.info))}else if(q.event==w.a.RECOMMEND_SEEKPOINT){var oe=j;this._media_element&&!this._config.accurateSeek&&this._seeking_handler.directSeek(oe.milliseconds/1e3)}break;case"player_event":if((q=j).event==d.a.ERROR){var he=j;this._emitter.emit(d.a.ERROR,he.error_type,he.error_detail,he.info)}else if("extraData"in q){var ie=j;this._emitter.emit(ie.event,ie.extraData)}break;case"logcat_callback":q=j,t.a.emitter.emit("log",q.type,q.logcat);break;case"buffered_position_changed":q=j,this._loading_controller.notifyBufferedPositionChanged(q.buffered_position_milliseconds/1e3)}},ee.prototype._fillStatisticsInfo=function(M){if(M.playerType="MSEPlayer",!(this._media_element instanceof HTMLVideoElement))return M;var Y=!0,j=0,z=0;if(this._media_element.getVideoPlaybackQuality){var q=this._media_element.getVideoPlaybackQuality();j=q.totalVideoFrames,z=q.droppedVideoFrames}else this._media_element.webkitDecodedFrameCount!=null?(j=this._media_element.webkitDecodedFrameCount,z=this._media_element.webkitDroppedFrameCount):Y=!1;return Y&&(M.decodedFrames=j,M.droppedFrames=z),M},ee}(),te=function(){function ee(M,Y){this.TAG="MSEPlayer",this._type="MSEPlayer",this._media_element=null,this._player_engine=null;var j=M.type.toLowerCase();if(j!=="mse"&&j!=="mpegts"&&j!=="m2ts"&&j!=="flv")throw new b.b("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");if(Y&&Y.enableWorkerForMSE&&J.isSupported())try{this._player_engine=new J(M,Y)}catch{t.a.e(this.TAG,"Error while initializing PlayerEngineDedicatedThread, fallback to PlayerEngineMainThread"),this._player_engine=new x(M,Y)}else this._player_engine=new x(M,Y)}return ee.prototype.destroy=function(){this._player_engine.destroy(),this._player_engine=null,this._media_element=null},ee.prototype.on=function(M,Y){this._player_engine.on(M,Y)},ee.prototype.off=function(M,Y){this._player_engine.off(M,Y)},ee.prototype.attachMediaElement=function(M){this._media_element=M,this._player_engine.attachMediaElement(M)},ee.prototype.detachMediaElement=function(){this._media_element=null,this._player_engine.detachMediaElement()},ee.prototype.load=function(){this._player_engine.load()},ee.prototype.unload=function(){this._player_engine.unload()},ee.prototype.play=function(){return this._player_engine.play()},ee.prototype.pause=function(){this._player_engine.pause()},ee.prototype.switchPrimaryAudio=function(){this._player_engine.switchPrimaryAudio()},ee.prototype.switchSecondaryAudio=function(){this._player_engine.switchSecondaryAudio()},Object.defineProperty(ee.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"buffered",{get:function(){return this._media_element.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"duration",{get:function(){return this._media_element.duration},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"volume",{get:function(){return this._media_element.volume},set:function(M){this._media_element.volume=M},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"muted",{get:function(){return this._media_element.muted},set:function(M){this._media_element.muted=M},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"currentTime",{get:function(){return this._media_element?this._media_element.currentTime:0},set:function(M){this._player_engine.seek(M)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"mediaInfo",{get:function(){return this._player_engine.mediaInfo},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"statisticsInfo",{get:function(){return this._player_engine.statisticsInfo},enumerable:!1,configurable:!0}),ee}(),le=function(){function ee(M,Y){this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new a.a,this._config=p(),typeof Y=="object"&&Object.assign(this._config,Y);var j=M.type.toLowerCase();if(j==="mse"||j==="mpegts"||j==="m2ts"||j==="flv")throw new b.b("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");if(M.hasOwnProperty("segments"))throw new b.b("NativePlayer(".concat(M.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=M,this._mediaElement=null}return ee.prototype.destroy=function(){this._emitter.emit(d.a.DESTROYING),this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},ee.prototype.on=function(M,Y){var j=this;M===d.a.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){j._emitter.emit(d.a.MEDIA_INFO,j.mediaInfo)}):M===d.a.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){j._emitter.emit(d.a.STATISTICS_INFO,j.statisticsInfo)}),this._emitter.addListener(M,Y)},ee.prototype.off=function(M,Y){this._emitter.removeListener(M,Y)},ee.prototype.attachMediaElement=function(M){if(this._mediaElement=M,M.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{M.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch{}},ee.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},ee.prototype.load=function(){if(!this._mediaElement)throw new b.a("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},ee.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},ee.prototype.play=function(){return this._mediaElement.play()},ee.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(ee.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(M){this._mediaElement.volume=M},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(M){this._mediaElement.muted=M},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(M){this._mediaElement?this._mediaElement.currentTime=M:this._pendingSeekTime=M},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"mediaInfo",{get:function(){var M={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(M.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(M.width=this._mediaElement.videoWidth,M.height=this._mediaElement.videoHeight)),M},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"statisticsInfo",{get:function(){var M={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return M;var Y=!0,j=0,z=0;if(this._mediaElement.getVideoPlaybackQuality){var q=this._mediaElement.getVideoPlaybackQuality();j=q.totalVideoFrames,z=q.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(j=this._mediaElement.webkitDecodedFrameCount,z=this._mediaElement.webkitDroppedFrameCount):Y=!1;return Y&&(M.decodedFrames=j,M.droppedFrames=z),M},enumerable:!1,configurable:!0}),ee.prototype._onvLoadedMetadata=function(M){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(d.a.MEDIA_INFO,this.mediaInfo)},ee.prototype._reportStatisticsInfo=function(){this._emitter.emit(d.a.STATISTICS_INFO,this.statisticsInfo)},ee}();y.a.install();var ne={createPlayer:function(ee,M){var Y=ee;if(Y==null||typeof Y!="object")throw new b.b("MediaDataSource must be an javascript object!");if(!Y.hasOwnProperty("type"))throw new b.b("MediaDataSource must has type field to indicate video file type!");switch(Y.type){case"mse":case"mpegts":case"m2ts":case"flv":return new te(Y,M);default:return new le(Y,M)}},isSupported:function(){return r.supportMSEH264Playback()},getFeatureList:function(){return r.getFeatureList()}};ne.BaseLoader=i.a,ne.LoaderStatus=i.c,ne.LoaderErrors=i.b,ne.Events=d.a,ne.ErrorTypes=v.b,ne.ErrorDetails=v.a,ne.MSEPlayer=te,ne.NativePlayer=le,ne.LoggingControl=G.a,Object.defineProperty(ne,"version",{enumerable:!0,get:function(){return"1.7.3"}}),u.default=ne}])})})(R0);var e6=R0.exports;const xc=sd(e6);class ed{constructor(e,s,u=window.document){we(this,"restart_required_when_quality_switched",!1);we(this,"player");we(this,"playback_mode");we(this,"document");we(this,"abort_controller",null);this.player=e,this.playback_mode=s,this.document=u}async init(){const e=Ln(),s=cn(),u=Sn();this.abort_controller=new AbortController;const A=document.querySelector(".route-container"),y=this.player.container.querySelector(".dplayer-capture-icon"),l=this.player.container.querySelector(".dplayer-comment-capture-icon"),c=document.querySelector(".tweet-form__textarea"),p=document.querySelector(".tweet-button"),r=document.querySelector(".remote-control-button-data"),i=document.querySelector(".remote-control-button-back"),t=document.querySelector(".remote-control-button-select"),n=document.querySelector(".remote-control-button-up"),a=document.querySelector(".remote-control-button-left"),o=document.querySelector(".remote-control-button-right"),d=document.querySelector(".remote-control-button-down"),g=document.querySelector(".remote-control-button-blue"),m=document.querySelector(".remote-control-button-red"),v=document.querySelector(".remote-control-button-green"),b=document.querySelector(".remote-control-button-yellow"),w=[{mode:"Live",key:"ArrowUp",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.is_zapping=!0,Es.push({path:`/tv/watch/${e.channel.previous.display_channel_id}`})}},{mode:"Live",key:"ArrowDown",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.is_zapping=!0,Es.push({path:`/tv/watch/${e.channel.next.display_channel_id}`})}},{mode:"Both",key:"Slash",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.shortcut_key_modal=!s.shortcut_key_modal}},{mode:"Both",key:"Space",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.toggle()}},{mode:"Live",key:"ArrowLeft",repeat:!0,ctrl:!0,shift:!1,alt:!1,handler:()=>{this.player.video.paused===!1&&this.player.video.pause(),this.player.video.currentTime=this.player.video.currentTime-.5}},{mode:"Live",key:"ArrowRight",repeat:!0,ctrl:!0,shift:!1,alt:!1,handler:()=>{this.player.video.paused===!1&&this.player.video.pause(),this.player.video.currentTime=this.player.video.currentTime+.5}},{mode:"Video",key:"ArrowLeft",repeat:!0,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.seek(this.player.video.currentTime-5)}},{mode:"Video",key:"ArrowRight",repeat:!0,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.seek(this.player.video.currentTime+5)}},{mode:"Video",key:"ArrowLeft",repeat:!0,ctrl:!0,shift:!1,alt:!1,handler:()=>{this.player.seek(this.player.video.currentTime-15)}},{mode:"Video",key:"ArrowRight",repeat:!0,ctrl:!0,shift:!1,alt:!1,handler:()=>{this.player.seek(this.player.video.currentTime+15)}},{mode:"Video",key:"ArrowLeft",repeat:!0,ctrl:!1,shift:!0,alt:!1,handler:()=>{this.player.seek(this.player.video.currentTime-30)}},{mode:"Video",key:"ArrowRight",repeat:!0,ctrl:!1,shift:!0,alt:!1,handler:()=>{this.player.seek(this.player.video.currentTime+30)}},{mode:"Video",key:"ArrowLeft",repeat:!0,ctrl:!1,shift:!1,alt:!0,handler:()=>{this.player.seek(this.player.video.currentTime-60)}},{mode:"Video",key:"ArrowRight",repeat:!0,ctrl:!1,shift:!1,alt:!0,handler:()=>{this.player.seek(this.player.video.currentTime+60)}},{mode:"Both",key:"ArrowUp",repeat:!0,ctrl:!0,shift:!1,alt:!1,handler:()=>{this.player.volume(this.player.volume()+.05)}},{mode:"Both",key:"ArrowDown",repeat:!0,ctrl:!0,shift:!1,alt:!1,handler:()=>{this.player.volume(this.player.volume()-.05)}},{mode:"Both",key:"KeyQ",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.container.classList.contains("dplayer-mobile")?this.player.video.muted=!this.player.video.muted:this.player.template.volumeButtonIcon.click(),this.player.video.muted===!0?this.player.notice("音量をミュート中"):this.player.notice("音量をミュート解除")}},{mode:"Live",key:"KeyW",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.sync()}},{mode:"Both",key:"KeyR",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.event_emitter.emit("PlayerRestartRequired",{message:"プレイヤーを再起動しました。",is_error_message:!1})}},{mode:"Both",key:"KeyF",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.fullScreen.toggle()}},{mode:"Both",key:"KeyE",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{document.pictureInPictureEnabled&&this.player.template.pipButton.click()}},{mode:"Both",key:"KeyS",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.subtitle.toggle(),this.player.subtitle.container.classList.contains("dplayer-subtitle-hide")?this.player.notice(`${this.player.tran("Hide subtitle")}`):this.player.notice(`${this.player.tran("Show subtitle")}`)}},{mode:"Both",key:"KeyD",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.template.showDanmaku.click(),this.player.template.showDanmakuToggle.checked?this.player.notice(`${this.player.tran("Show comment")}`):this.player.notice(`${this.player.tran("Hide comment")}`)}},{mode:"Both",key:"KeyC",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{y.click()}},{mode:"Both",key:"KeyV",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{l.click()}},{mode:"Live",key:"KeyM",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.player.controller.show(),this.player.comment.show(),s.event_emitter.emit("SetControlDisplayTimer",{}),window.setTimeout(()=>this.player.template.commentInput.focus(),100)}},{mode:"Both",key:"KeyP",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.is_panel_display=!s.is_panel_display}},{mode:"Live",key:"KeyK",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.tv_panel_active_tab="Program"}},{mode:"Video",key:"KeyK",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.video_panel_active_tab="RecordedProgram"}},{mode:"Live",key:"KeyL",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.tv_panel_active_tab="Channel"}},{mode:"Video",key:"KeyL",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.video_panel_active_tab="Series"}},{mode:"Both",key:"Semicolon",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.playback_mode==="Live"?s.tv_panel_active_tab="Comment":s.video_panel_active_tab="Comment"}},{mode:"Both",key:"Quote",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{this.playback_mode==="Live"?s.tv_panel_active_tab="Twitter":s.video_panel_active_tab="Twitter"}},{mode:"Both",key:"BracketRight",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.twitter_active_tab="Search"}},{mode:"Both",key:"Backslash",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.twitter_active_tab="Timeline"}},{mode:"Both",key:"IntlRo",repeat:!1,ctrl:!1,shift:!1,alt:!1,handler:()=>{s.twitter_active_tab="Capture"}},{mode:"Live",key:"KeyD",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{r==null||r.click()}},{mode:"Live",key:"Backspace",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{i==null||i.click()}},{mode:"Live",key:"Enter",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{t==null||t.click()}},{mode:"Live",key:"ArrowUp",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{n==null||n.click()}},{mode:"Live",key:"ArrowLeft",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{a==null||a.click()}},{mode:"Live",key:"ArrowRight",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{o==null||o.click()}},{mode:"Live",key:"ArrowDown",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{d==null||d.click()}},{mode:"Live",key:"F9",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{g==null||g.click()}},{mode:"Live",key:"F10",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{m==null||m.click()}},{mode:"Live",key:"F11",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{v==null||v.click()}},{mode:"Live",key:"F12",repeat:!1,ctrl:!1,shift:!1,alt:!0,handler:()=>{b==null||b.click()}}];let C=0;this.document.addEventListener("keydown",D=>{if(D.isComposing===!0||D.keyCode===229)return;let R=!1;D.repeat&&(R=!0);const T=si.time();T-C<.05&&(R=!0),C=T;const P=si.isMacOS()===!0?D.metaKey:D.ctrlKey,L=D.shiftKey,I=D.altKey,x=this.playback_mode==="Live"?s.tv_panel_active_tab:s.video_panel_active_tab,O=document.activeElement instanceof HTMLInputElement||document.activeElement instanceof HTMLTextAreaElement;if(this.playback_mode==="Live"&&R===!1&&P===!1&&I===(u.settings.tv_channel_selection_requires_alt_key===!0)&&O===!1){const G=L?"BS":"GR";let J=null;if(["Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9"].includes(D.code)&&(J=Number(D.code.replace("Digit",""))),D.code==="Digit0"&&(J=10),D.code==="Minus"&&(J=11),D.code==="Equal"&&(J=12),["Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9"].includes(D.code)&&(J=Number(D.code.replace("Numpad",""))),D.code==="Numpad0"&&(J=10),J!==null){const te=e.getChannelByRemoconID(G,J);if(te!==null&&te.display_channel_id!==e.display_channel_id){Es.push({path:`/tv/watch/${te.display_channel_id}`}),D.preventDefault(),D.stopPropagation();return}}}if(this.playback_mode==="Live"&&D.code==="KeyM"&&R===!1&&P===!0&&L===!1&&I===!1&&this.player.template.controller.classList.contains("dplayer-controller-comment")&&(O===!1||document.activeElement===this.player.template.commentInput)){this.player.comment.hide(),D.preventDefault(),D.stopPropagation();return}if(D.code==="Enter"&&R===!1&&(P===!0||L===!0)&&I===!1&&s.is_panel_display===!0&&x==="Twitter"&&(O===!1||document.activeElement===c)){p.click(),D.preventDefault(),D.stopPropagation();return}if(D.code==="Tab"&&R===!1&&P===!1&&L===!1&&I===!1&&(O===!1||document.activeElement===c)){document.activeElement===c?c.blur():(s.is_panel_display=!0,this.playback_mode==="Live"?s.tv_panel_active_tab="Twitter":s.video_panel_active_tab="Twitter",s.is_document_pip===!0&&window.focus(),c.focus(),A.scrollLeft=0,window.setTimeout(()=>{c.focus(),A.scrollLeft=0},.1*1e3)),D.preventDefault(),D.stopPropagation();return}if(D.code==="Space"&&R===!1&&P===!1&&L===!0&&I===!1&&s.is_document_pip===!1&&s.is_panel_display===!0&&x==="Twitter"&&s.twitter_active_tab==="Capture"&&O===!1){this.player.toggle(),D.preventDefault(),D.stopPropagation();return}if(P===!1&&L===!1&&I===!1&&s.is_document_pip===!1&&s.is_panel_display===!0&&x==="Twitter"&&s.twitter_active_tab==="Capture"&&O===!1&&(()=>{if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(D.code)){if(s.twitter_captures.length===0)return!0;if(s.twitter_captures.some(ne=>ne.focused===!0)===!1)return s.twitter_captures[s.twitter_captures.length-1].focused=!0,!0;const J=s.twitter_captures.findIndex(ne=>ne.focused===!0);if(D.code==="ArrowUp"){if(J-2<0)return!0;s.twitter_captures[J-2].focused=!0}if(D.code==="ArrowDown"){if(J+2>s.twitter_captures.length-1)return!0;s.twitter_captures[J+2].focused=!0}if(D.code==="ArrowLeft"){if(J-1<0)return!0;s.twitter_captures[J-1].focused=!0}if(D.code==="ArrowRight"){if(J+1>s.twitter_captures.length-1)return!0;s.twitter_captures[J+1].focused=!0}s.twitter_captures[J].focused=!1;const te=s.twitter_captures.find(ne=>ne.focused===!0);s.twitter_zoom_capture_modal===!0&&(s.twitter_zoom_capture=te);const le=document.querySelector(`img[src="${te.image_url}"]`).parentElement;return R?le.scrollIntoView({block:"nearest",inline:"nearest",behavior:"auto"}):le.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"}),!0}if(D.code==="Enter"){if(D.target===this.player.template.commentInput)return!0;if(s.twitter_zoom_capture_modal===!0)return s.twitter_zoom_capture_modal=!1,!0;const J=s.twitter_captures.find(te=>te.focused===!0);return J===void 0||(s.twitter_zoom_capture=J,s.twitter_zoom_capture_modal=!0),!0}if(D.code==="Space"){const J=s.twitter_captures.find(le=>le.focused===!0);return J===void 0||document.querySelector(`img[src="${J.image_url}"]`).parentElement.click(),!0}return!1})()===!0){D.preventDefault(),D.stopPropagation();return}if(O!==!0){for(const G of w)if(!(G.mode!=="Both"&&G.mode!==this.playback_mode)&&G.key===D.code&&!(G.repeat===!1&&R===!0)&&G.ctrl===P&&G.shift===L&&G.alt===I){G.handler(),D.preventDefault(),D.stopPropagation();return}}},{signal:this.abort_controller.signal}),console.log("[KeyboardShortcutManager] Initialized.")}async destroy(){const e=cn();if(this.playback_mode==="Live"&&e.is_zapping===!0){const s=Ic(()=>e.is_player_initialized,(A,y)=>{y===!1&&A===!0&&(s(),u(),this.abort_controller!==null&&(this.abort_controller.abort(),this.abort_controller=null),console.log("[KeyboardShortcutManager] Destroyed. (Zapping finished)"))}),u=Ic(()=>e.is_watching,(A,y)=>{y===!0&&A===!1&&(s(),u(),this.abort_controller!==null&&(this.abort_controller.abort(),this.abort_controller=null),console.log("[KeyboardShortcutManager] Destroyed. (Zapping canceled)"))})}else this.abort_controller!==null&&(this.abort_controller.abort(),this.abort_controller=null),console.log("[KeyboardShortcutManager] Destroyed.")}}/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: Apache-2.0 - */const I0=Symbol("Comlink.proxy"),e6=Symbol("Comlink.endpoint"),t6=Symbol("Comlink.releaseProxy"),kc=Symbol("Comlink.finalizer"),_o=Symbol("Comlink.thrown"),L0=_=>typeof _=="object"&&_!==null||typeof _=="function",i6={canHandle:_=>L0(_)&&_[I0],serialize(_){const{port1:e,port2:s}=new MessageChannel;return O0(_,e),[s,[s]]},deserialize(_){return _.start(),Nd(_)}},n6={canHandle:_=>L0(_)&&_o in _,serialize({value:_}){let e;return _ instanceof Error?e={isError:!0,value:{message:_.message,name:_.name,stack:_.stack}}:e={isError:!1,value:_},[e,[]]},deserialize(_){throw _.isError?Object.assign(new Error(_.value.message),_.value):_.value}},D0=new Map([["proxy",i6],["throw",n6]]);function r6(_,e){for(const s of _)if(e===s||s==="*"||s instanceof RegExp&&s.test(e))return!0;return!1}function O0(_,e=globalThis,s=["*"]){e.addEventListener("message",function u(y){if(!y||!y.data)return;if(!r6(s,y.origin)){console.warn(`Invalid origin '${y.origin}' for comlink proxy`);return}const{id:A,type:l,path:c}=Object.assign({path:[]},y.data),p=(y.data.argumentList||[]).map(bs);let r;try{const i=c.slice(0,-1).reduce((n,a)=>n[a],_),t=c.reduce((n,a)=>n[a],_);switch(l){case"GET":r=t;break;case"SET":i[c.slice(-1)[0]]=bs(y.data.value),r=!0;break;case"APPLY":r=t.apply(i,p);break;case"CONSTRUCT":{const n=new t(...p);r=F0(n)}break;case"ENDPOINT":{const{port1:n,port2:a}=new MessageChannel;O0(_,a),r=N0(n,[n])}break;case"RELEASE":r=void 0;break;default:return}}catch(i){r={value:i,[_o]:0}}Promise.resolve(r).catch(i=>({value:i,[_o]:0})).then(i=>{const[t,n]=Go(i);e.postMessage(Object.assign(Object.assign({},t),{id:A}),n),l==="RELEASE"&&(e.removeEventListener("message",u),M0(e),kc in _&&typeof _[kc]=="function"&&_[kc]())}).catch(i=>{const[t,n]=Go({value:new TypeError("Unserializable return value"),[_o]:0});e.postMessage(Object.assign(Object.assign({},t),{id:A}),n)})}),e.start&&e.start()}function s6(_){return _.constructor.name==="MessagePort"}function M0(_){s6(_)&&_.close()}function Nd(_,e){return td(_,[],e)}function oo(_){if(_)throw new Error("Proxy has been released and is not useable")}function P0(_){return Ys(_,{type:"RELEASE"}).then(()=>{M0(_)})}const Fo=new WeakMap,Uo="FinalizationRegistry"in globalThis&&new FinalizationRegistry(_=>{const e=(Fo.get(_)||0)-1;Fo.set(_,e),e===0&&P0(_)});function a6(_,e){const s=(Fo.get(e)||0)+1;Fo.set(e,s),Uo&&Uo.register(_,e,_)}function o6(_){Uo&&Uo.unregister(_)}function td(_,e=[],s=function(){}){let u=!1;const y=new Proxy(s,{get(A,l){if(oo(u),l===t6)return()=>{o6(y),P0(_),u=!0};if(l==="then"){if(e.length===0)return{then:()=>y};const c=Ys(_,{type:"GET",path:e.map(p=>p.toString())}).then(bs);return c.then.bind(c)}return td(_,[...e,l])},set(A,l,c){oo(u);const[p,r]=Go(c);return Ys(_,{type:"SET",path:[...e,l].map(i=>i.toString()),value:p},r).then(bs)},apply(A,l,c){oo(u);const p=e[e.length-1];if(p===e6)return Ys(_,{type:"ENDPOINT"}).then(bs);if(p==="bind")return td(_,e.slice(0,-1));const[r,i]=_f(c);return Ys(_,{type:"APPLY",path:e.map(t=>t.toString()),argumentList:r},i).then(bs)},construct(A,l){oo(u);const[c,p]=_f(l);return Ys(_,{type:"CONSTRUCT",path:e.map(r=>r.toString()),argumentList:c},p).then(bs)}});return a6(y,_),y}function l6(_){return Array.prototype.concat.apply([],_)}function _f(_){const e=_.map(Go);return[e.map(s=>s[0]),l6(e.map(s=>s[1]))]}const B0=new WeakMap;function N0(_,e){return B0.set(_,e),_}function F0(_){return Object.assign(_,{[I0]:!0})}function Go(_){for(const[e,s]of D0)if(s.canHandle(_)){const[u,y]=s.serialize(_);return[{type:"HANDLER",name:e,value:u},y]}return[{type:"RAW",value:_},B0.get(_)||[]]}function bs(_){switch(_.type){case"HANDLER":return D0.get(_.name).deserialize(_.value);case"RAW":return _.value}}function Ys(_,e,s){return new Promise(u=>{const y=c6();_.addEventListener("message",function A(l){!l.data||!l.data.id||l.data.id!==y||(_.removeEventListener("message",A),u(l.data))}),_.start&&_.start(),_.postMessage(Object.assign({id:y},e),s)})}function c6(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function $o(_,e,s,u){function y(A){return A instanceof s?A:new s(function(l){l(A)})}return new(s||(s=Promise))(function(A,l){function c(i){try{r(u.next(i))}catch(t){l(t)}}function p(i){try{r(u.throw(i))}catch(t){l(t)}}function r(i){i.done?A(i.value):y(i.value).then(c,p)}r((u=u.apply(_,[])).next())})}function d6(_){return $o(this,void 0,void 0,function*(){return new Promise(function(e,s){const u=document.createElement("img");u.crossOrigin="anonymous",u.src=_,u.onload=function(y){const A=y.target;e(A)},u.onabort=s,u.onerror=s})})}function u6(_){return $o(this,void 0,void 0,function*(){return new Promise(function(e,s){const u=document.createElement("canvas"),y=u.getContext("2d");if(y){const{width:A,height:l}=_;u.width=A,u.height=l,y.drawImage(_,0,0,A,l),u.toBlob(function(c){c?e(c):s("Cannot get blob from image element")},"image/png",1)}})})}function h6(_){return $o(this,void 0,void 0,function*(){const e=URL.createObjectURL(_),s=yield d6(e);return yield u6(s)})}function f6(_){return $o(this,void 0,void 0,function*(){const e={[_.type]:_},s=new ClipboardItem(e);yield navigator.clipboard.write([s])})}class Ef{static async uploadCapture(e,s){const u=new FormData;u.append("image",e,s);const y=await kr.post("/captures",u,{headers:{"Content-Type":"multipart/form-data"}});if(y.type==="error")switch(y.data.detail){case"Permission denied to save the file":{As.error("キャプチャのアップロードに失敗しました。保存先フォルダに書き込み権限がありません。");break}case"No space left on the device":{As.error("キャプチャのアップロードに失敗しました。保存先フォルダに空き容量がありません。");break}case"Unexpected error occurred while saving the file":{As.error("キャプチャのアップロードに失敗しました。保存中に予期しないエラーが発生しました。");break}default:{Number.isNaN(y.status)?(y.error.code===Pl.ECONNABORTED?As.warning("キャプチャのアップロード中にサーバーへの接続が切断されました。リトライします。"):y.error.code===Pl.ETIMEDOUT?As.warning("キャプチャのアップロード中にサーバーへの接続がタイムアウトしました。リトライします。"):y.error.code===Pl.ERR_NETWORK?As.warning("キャプチャのアップロード中に予期しないネットワークエラーが発生しました。リトライします。"):As.warning("キャプチャのアップロードに失敗しました。リトライします。"),await this.uploadCapture(e,s)):kr.showGenericError(y,"キャプチャのアップロードに失敗しました。");break}}}}const wf=Nd(new Worker(new URL("/assets/CaptureCompositor-CiYI9DNZ.js",import.meta.url)));class Sf{constructor(e,s){we(this,"restart_required_when_quality_switched",!1);we(this,"player");we(this,"playback_mode");we(this,"capture_button",null);we(this,"comment_capture_button",null);this.player=e,this.playback_mode=s}async init(){const e=this.player.container.querySelector(".dplayer-capture-icon"),s=this.player.container.querySelector(".dplayer-comment-capture-icon");e!==null&&e.remove(),s!==null&&s.remove(),this.player.container.querySelector(".dplayer-player-restart-icon").insertAdjacentHTML("afterend",` + */const I0=Symbol("Comlink.proxy"),t6=Symbol("Comlink.endpoint"),i6=Symbol("Comlink.releaseProxy"),kc=Symbol("Comlink.finalizer"),_o=Symbol("Comlink.thrown"),L0=_=>typeof _=="object"&&_!==null||typeof _=="function",n6={canHandle:_=>L0(_)&&_[I0],serialize(_){const{port1:e,port2:s}=new MessageChannel;return O0(_,e),[s,[s]]},deserialize(_){return _.start(),Nd(_)}},r6={canHandle:_=>L0(_)&&_o in _,serialize({value:_}){let e;return _ instanceof Error?e={isError:!0,value:{message:_.message,name:_.name,stack:_.stack}}:e={isError:!1,value:_},[e,[]]},deserialize(_){throw _.isError?Object.assign(new Error(_.value.message),_.value):_.value}},D0=new Map([["proxy",n6],["throw",r6]]);function s6(_,e){for(const s of _)if(e===s||s==="*"||s instanceof RegExp&&s.test(e))return!0;return!1}function O0(_,e=globalThis,s=["*"]){e.addEventListener("message",function u(A){if(!A||!A.data)return;if(!s6(s,A.origin)){console.warn(`Invalid origin '${A.origin}' for comlink proxy`);return}const{id:y,type:l,path:c}=Object.assign({path:[]},A.data),p=(A.data.argumentList||[]).map(bs);let r;try{const i=c.slice(0,-1).reduce((n,a)=>n[a],_),t=c.reduce((n,a)=>n[a],_);switch(l){case"GET":r=t;break;case"SET":i[c.slice(-1)[0]]=bs(A.data.value),r=!0;break;case"APPLY":r=t.apply(i,p);break;case"CONSTRUCT":{const n=new t(...p);r=F0(n)}break;case"ENDPOINT":{const{port1:n,port2:a}=new MessageChannel;O0(_,a),r=N0(n,[n])}break;case"RELEASE":r=void 0;break;default:return}}catch(i){r={value:i,[_o]:0}}Promise.resolve(r).catch(i=>({value:i,[_o]:0})).then(i=>{const[t,n]=Go(i);e.postMessage(Object.assign(Object.assign({},t),{id:y}),n),l==="RELEASE"&&(e.removeEventListener("message",u),M0(e),kc in _&&typeof _[kc]=="function"&&_[kc]())}).catch(i=>{const[t,n]=Go({value:new TypeError("Unserializable return value"),[_o]:0});e.postMessage(Object.assign(Object.assign({},t),{id:y}),n)})}),e.start&&e.start()}function a6(_){return _.constructor.name==="MessagePort"}function M0(_){a6(_)&&_.close()}function Nd(_,e){return td(_,[],e)}function oo(_){if(_)throw new Error("Proxy has been released and is not useable")}function P0(_){return Ys(_,{type:"RELEASE"}).then(()=>{M0(_)})}const Fo=new WeakMap,Uo="FinalizationRegistry"in globalThis&&new FinalizationRegistry(_=>{const e=(Fo.get(_)||0)-1;Fo.set(_,e),e===0&&P0(_)});function o6(_,e){const s=(Fo.get(e)||0)+1;Fo.set(e,s),Uo&&Uo.register(_,e,_)}function l6(_){Uo&&Uo.unregister(_)}function td(_,e=[],s=function(){}){let u=!1;const A=new Proxy(s,{get(y,l){if(oo(u),l===i6)return()=>{l6(A),P0(_),u=!0};if(l==="then"){if(e.length===0)return{then:()=>A};const c=Ys(_,{type:"GET",path:e.map(p=>p.toString())}).then(bs);return c.then.bind(c)}return td(_,[...e,l])},set(y,l,c){oo(u);const[p,r]=Go(c);return Ys(_,{type:"SET",path:[...e,l].map(i=>i.toString()),value:p},r).then(bs)},apply(y,l,c){oo(u);const p=e[e.length-1];if(p===t6)return Ys(_,{type:"ENDPOINT"}).then(bs);if(p==="bind")return td(_,e.slice(0,-1));const[r,i]=_f(c);return Ys(_,{type:"APPLY",path:e.map(t=>t.toString()),argumentList:r},i).then(bs)},construct(y,l){oo(u);const[c,p]=_f(l);return Ys(_,{type:"CONSTRUCT",path:e.map(r=>r.toString()),argumentList:c},p).then(bs)}});return o6(A,_),A}function c6(_){return Array.prototype.concat.apply([],_)}function _f(_){const e=_.map(Go);return[e.map(s=>s[0]),c6(e.map(s=>s[1]))]}const B0=new WeakMap;function N0(_,e){return B0.set(_,e),_}function F0(_){return Object.assign(_,{[I0]:!0})}function Go(_){for(const[e,s]of D0)if(s.canHandle(_)){const[u,A]=s.serialize(_);return[{type:"HANDLER",name:e,value:u},A]}return[{type:"RAW",value:_},B0.get(_)||[]]}function bs(_){switch(_.type){case"HANDLER":return D0.get(_.name).deserialize(_.value);case"RAW":return _.value}}function Ys(_,e,s){return new Promise(u=>{const A=d6();_.addEventListener("message",function y(l){!l.data||!l.data.id||l.data.id!==A||(_.removeEventListener("message",y),u(l.data))}),_.start&&_.start(),_.postMessage(Object.assign({id:A},e),s)})}function d6(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function $o(_,e,s,u){function A(y){return y instanceof s?y:new s(function(l){l(y)})}return new(s||(s=Promise))(function(y,l){function c(i){try{r(u.next(i))}catch(t){l(t)}}function p(i){try{r(u.throw(i))}catch(t){l(t)}}function r(i){i.done?y(i.value):A(i.value).then(c,p)}r((u=u.apply(_,[])).next())})}function u6(_){return $o(this,void 0,void 0,function*(){return new Promise(function(e,s){const u=document.createElement("img");u.crossOrigin="anonymous",u.src=_,u.onload=function(A){const y=A.target;e(y)},u.onabort=s,u.onerror=s})})}function h6(_){return $o(this,void 0,void 0,function*(){return new Promise(function(e,s){const u=document.createElement("canvas"),A=u.getContext("2d");if(A){const{width:y,height:l}=_;u.width=y,u.height=l,A.drawImage(_,0,0,y,l),u.toBlob(function(c){c?e(c):s("Cannot get blob from image element")},"image/png",1)}})})}function f6(_){return $o(this,void 0,void 0,function*(){const e=URL.createObjectURL(_),s=yield u6(e);return yield h6(s)})}function p6(_){return $o(this,void 0,void 0,function*(){const e={[_.type]:_},s=new ClipboardItem(e);yield navigator.clipboard.write([s])})}class Ef{static async uploadCapture(e,s){const u=new FormData;u.append("image",e,s);const A=await kr.post("/captures",u,{headers:{"Content-Type":"multipart/form-data"}});if(A.type==="error")switch(A.data.detail){case"Permission denied to save the file":{As.error("キャプチャのアップロードに失敗しました。保存先フォルダに書き込み権限がありません。");break}case"No space left on the device":{As.error("キャプチャのアップロードに失敗しました。保存先フォルダに空き容量がありません。");break}case"Unexpected error occurred while saving the file":{As.error("キャプチャのアップロードに失敗しました。保存中に予期しないエラーが発生しました。");break}default:{Number.isNaN(A.status)?(A.error.code===Pl.ECONNABORTED?As.warning("キャプチャのアップロード中にサーバーへの接続が切断されました。リトライします。"):A.error.code===Pl.ETIMEDOUT?As.warning("キャプチャのアップロード中にサーバーへの接続がタイムアウトしました。リトライします。"):A.error.code===Pl.ERR_NETWORK?As.warning("キャプチャのアップロード中に予期しないネットワークエラーが発生しました。リトライします。"):As.warning("キャプチャのアップロードに失敗しました。リトライします。"),await this.uploadCapture(e,s)):kr.showGenericError(A,"キャプチャのアップロードに失敗しました。");break}}}}const U0=Symbol("getEndpoint"),wf=function(){const _=new Worker(new URL("/assets/CaptureCompositor-IHku5OQc.js",import.meta.url)),e=Nd(_);return new Proxy(e,{get(s,u,A){return u===U0?_:Reflect.get(...arguments)}})}();class Sf{constructor(e,s){we(this,"restart_required_when_quality_switched",!1);we(this,"player");we(this,"playback_mode");we(this,"capture_button",null);we(this,"comment_capture_button",null);this.player=e,this.playback_mode=s}async init(){const e=this.player.container.querySelector(".dplayer-capture-icon"),s=this.player.container.querySelector(".dplayer-comment-capture-icon");e!==null&&e.remove(),s!==null&&s.remove(),this.player.container.querySelector(".dplayer-player-restart-icon").insertAdjacentHTML("afterend",`
@@ -2229,25 +2229,25 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
- `),this.comment_capture_button=this.player.container.querySelector(".dplayer-comment-capture-icon"),this.capture_button.addEventListener("click",()=>this.captureAndSave(!1)),this.comment_capture_button.addEventListener("click",()=>this.captureAndSave(!0)),await wf.loadFonts(),console.log("[CaptureManager] Initialized.")}addHighlight(e=!1){lr(this.capture_button!==null&&this.comment_capture_button!==null),e?this.comment_capture_button.classList.add("dplayer-capturing"):this.capture_button.classList.add("dplayer-capturing")}removeHighlight(e=!1){lr(this.capture_button!==null&&this.comment_capture_button!==null),e?this.comment_capture_button.classList.remove("dplayer-capturing"):this.capture_button.classList.remove("dplayer-capturing")}createCaptureCommentData(){const e={container_width:this.player.danmaku.container.offsetWidth,container_height:this.player.danmaku.container.offsetHeight,opacity:this.player.danmaku._opacity,comments:[]},s=".dplayer-danmaku-item:not(.dplayer-danmaku-item--demo)";for(const u of this.player.danmaku.container.querySelectorAll(s)){if(u.textContent===null)continue;const y=window.getComputedStyle(u);e.comments.push({top:u.getBoundingClientRect().top-this.player.danmaku.container.getBoundingClientRect().top,left:u.getBoundingClientRect().left-this.player.danmaku.container.getBoundingClientRect().left,color:y.color,font_size:parseFloat(y.fontSize.replaceAll("px","")),text:u.textContent.trim()})}return e.comments.length===0?null:e}createCaptureExifData(){var p,r,i,t,n,a;const e=Ln(),s=cn(),u=Rr().format(),y=this.player.plugins.aribb24Caption,l=y.isShowing===!0&&y.isPresent()?y.getTextContent():null;let c;return this.playback_mode==="Live"?c={captured_at:u,captured_playback_position:-1,network_id:e.channel.current.network_id,service_id:e.channel.current.service_id,event_id:((p=e.channel.current.program_present)==null?void 0:p.event_id)??-1,title:((r=e.channel.current.program_present)==null?void 0:r.title)??"放送休止",description:((i=e.channel.current.program_present)==null?void 0:i.description)??"",start_time:((t=e.channel.current.program_present)==null?void 0:t.start_time)??"2000-01-01T00:00:00+09:00",end_time:((n=e.channel.current.program_present)==null?void 0:n.end_time)??"2000-01-01T00:00:00+09:00",duration:((a=e.channel.current.program_present)==null?void 0:a.duration)??0,caption_text:l,is_caption_composited:!1,is_comment_composited:!1}:c={captured_at:u,captured_playback_position:-1,network_id:s.recorded_program.network_id??-1,service_id:s.recorded_program.service_id??-1,event_id:s.recorded_program.event_id??-1,title:s.recorded_program.title,description:s.recorded_program.description,start_time:s.recorded_program.start_time,end_time:s.recorded_program.end_time,duration:s.recorded_program.duration,caption_text:l,is_caption_composited:!1,is_comment_composited:!1},this.playback_mode==="Live"?c.captured_playback_position=Rr().diff(Rr(c.start_time),"second",!0):c.captured_playback_position=this.player.video.currentTime-s.recorded_program.recording_start_margin,c}async captureAndSave(e){const s=Ln(),u=cn(),y=Sn(),A=si.time();if(this.playback_mode==="Live"&&s.channel.current.is_radiochannel===!0){this.player.notice("ラジオチャンネルはキャプチャできません。",void 0,void 0,"#FF6F6A");return}if(this.player.video.videoWidth===0&&this.player.video.videoHeight===0){this.player.notice("読み込み中はキャプチャできません。",void 0,void 0,"#FF6F6A");return}if(e===!0&&this.player.danmaku.showing===!1){this.player.notice("コメントを付けてキャプチャするには、コメント表示をオンにしてください。",void 0,void 0,"#FF6F6A");return}this.addHighlight(e);const l=this.player.plugins.aribb24Caption,c=this.player.plugins.aribb24Superimpose??null,p=l.getRawCanvas(),r=(c==null?void 0:c.getRawCanvas())??null,i=l.isShowing===!0&&l.isPresent(),t=c&&c.isShowing===!0&&c.isPresent(),n=await Promise.all([createImageBitmap(this.player.video),i?createImageBitmap(p):null,t?createImageBitmap(r):null]),a=n.filter(L=>L!==null),o=n[0],d=n[1],g=n[2],m=e?this.createCaptureCommentData():null,v=this.createCaptureExifData();console.log("\x1B[36m[CaptureManager] Composite start:");const b=si.time(),C=await(await new wf(N0({mode:y.settings.capture_caption_mode,capture:o,caption:d,superimpose:g,capture_comment_data:m,capture_exif_data:v},a))).composite();console.log("\x1B[36m[CaptureManager] Composite end:",si.mathFloor(si.time()-b,3),"sec");const D=`Capture_${Rr().format("YYYYMMDD-HHmmss")}`,R=`${D}.jpg`,T=`${D}_caption.jpg`;C.capture_normal!==null&&(u.event_emitter.emit("CaptureCompleted",{capture:C.capture_normal,filename:R}),["Browser","Both"].includes(y.settings.capture_save_mode)&&si.downloadBlobData(C.capture_normal,R),["UploadServer","Both"].includes(y.settings.capture_save_mode)&&Ef.uploadCapture(C.capture_normal,R)),C.capture_caption!==null&&(u.event_emitter.emit("CaptureCompleted",{capture:C.capture_caption,filename:R}),["Browser","Both"].includes(y.settings.capture_save_mode)&&si.downloadBlobData(C.capture_caption,T),["UploadServer","Both"].includes(y.settings.capture_save_mode)&&Ef.uploadCapture(C.capture_caption,T));const P=si.mathFloor(si.time()-A,3);if(P<.1?setTimeout(()=>this.removeHighlight(e),100):this.removeHighlight(e),console.log("\x1B[36m[CaptureManager] Total:",P,"sec"),y.settings.capture_copy_to_clipboard===!0){for(const L of[C.capture_normal,C.capture_caption])if(L!==null)try{await f6(await h6(L))}catch(I){this.player.notice("クリップボードへのキャプチャのコピーに失敗しました。",void 0,void 0,"#FF6F6A"),console.error(I)}}}async destroy(){console.log("[CaptureManager] Destroyed.")}}var U0={exports:{}};/*! For license information please see web-bml.js.LICENSE.txt */(function(_,e){(function(s,u){_.exports=u()})(Ho,()=>(()=>{var s={1015:function(A,l){var c;c=function(p){var r,i,t,n;p.version="0.4.1",p.parse=function(kt,Gt){return i=String(kt),t=i.length,o(Gt),xt(),function(ii){P=L=d,r.locations&&(I=new Tt),x=G=null,O=[],Mt();var yi=ii||mi(),Ei=!0;for(ii||(yi.body=[]);w!==j;){var Mi=on();yi.body.push(Mi),Ei&&Ii(Mi)&&li(!0),Ei=!1}return Kt(yi,"Program")}(r.program)};var a=p.defaultOptions={ecmaVersion:5,strictSemicolons:!1,allowTrailingCommas:!0,forbidReserved:!1,locations:!1,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null};function o(kt){for(var Gt in r=kt||{},a)Object.prototype.hasOwnProperty.call(r,Gt)||(r[Gt]=a[Gt]);n=r.sourceFile||null}var d,g,m,v,b,w,C,D,R,T,P,L,I,x,O,G,J=p.getLineInfo=function(kt,Gt){for(var ii=1,yi=0;;){bt.lastIndex=yi;var Ei=bt.exec(kt);if(!(Ei&&Ei.index=170&&dt.test(String.fromCharCode(kt)))},Lt=p.isIdentifierChar=function(kt){return kt<48?kt===36:kt<58||!(kt<65)&&(kt<91||(kt<97?kt===95:kt<123||kt>=170&&yt.test(String.fromCharCode(kt))))};function Tt(){this.line=R,this.column=d-T}function xt(){R=1,d=T=0,D=!0,jt()}function Ut(kt,Gt){m=d,r.locations&&(b=new Tt),w=kt,jt(),C=Gt,D=kt.beforeExpr}function Vt(){var kt,Gt=r.onComment&&r.locations&&new Tt,ii=d,yi=i.indexOf("*/",d+=2);if(yi===-1&&te(d-2,"Unterminated comment"),d=yi+2,r.locations)for(bt.lastIndex=ii;(kt=bt.exec(i))&&kt.index8&&kt<14)++d;else if(kt===47){var Gt;if((Gt=i.charCodeAt(d+1))===42)Vt();else{if(Gt!==47)break;Bt()}}else if(kt===160)++d;else{if(!(kt>=5760&&et.test(String.fromCharCode(kt))))break;++d}}}function Mt(kt){if(kt?d=g+1:g=d,r.locations&&(v=new Tt),kt)return Jt();if(d>=t)return Ut(j);var Gt=i.charCodeAt(d);if(Rt(Gt)||Gt===92)return ui();var ii=function(Ei){switch(Ei){case 46:return function(){var xi=i.charCodeAt(d+1);return xi>=48&&xi<=57?di(!0):(++d,Ut(ze))}();case 40:return++d,Ut(De);case 41:return++d,Ut(Re);case 59:return++d,Ut(gt);case 44:return++d,Ut(ut);case 91:return++d,Ut(lt);case 93:return++d,Ut(mt);case 123:return++d,Ut(Ue);case 125:return++d,Ut(Ve);case 58:return++d,Ut(Ce);case 63:return++d,Ut(At);case 48:var Mi=i.charCodeAt(d+1);if(Mi===120||Mi===88)return function(){d+=2;var xi=Wt(16);return xi==null&&te(g+2,"Expected hexadecimal number"),Rt(i.charCodeAt(d))&&te(d,"Identifier directly after number"),Ut(ne,xi)}();case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return di(!1);case 34:case 39:return function(xi){d++;for(var Vi="";;){d>=t&&te(g,"Unterminated string constant");var $i=i.charCodeAt(d);if($i===xi)return++d,Ut(M,Vi);if($i===92){$i=i.charCodeAt(++d);var pn=/^[0-7]+/.exec(i.slice(d,d+3));for(pn&&(pn=pn[0]);pn&&parseInt(pn,8)>255;)pn=pn.slice(0,-1);if(pn==="0"&&(pn=null),++d,pn)G&&te(d-2,"Octal literal in strict mode"),Vi+=String.fromCharCode(parseInt(pn,8)),d+=pn.length-1;else switch($i){case 110:Vi+=` + `),this.comment_capture_button=this.player.container.querySelector(".dplayer-comment-capture-icon"),this.capture_button.addEventListener("click",()=>this.captureAndSave(!1)),this.comment_capture_button.addEventListener("click",()=>this.captureAndSave(!0)),await wf.loadFonts(),console.log("[CaptureManager] Initialized.")}addHighlight(e=!1){lr(this.capture_button!==null&&this.comment_capture_button!==null),e?this.comment_capture_button.classList.add("dplayer-capturing"):this.capture_button.classList.add("dplayer-capturing")}removeHighlight(e=!1){lr(this.capture_button!==null&&this.comment_capture_button!==null),e?this.comment_capture_button.classList.remove("dplayer-capturing"):this.capture_button.classList.remove("dplayer-capturing")}createCaptureCommentData(){const e={container_width:this.player.danmaku.container.offsetWidth,container_height:this.player.danmaku.container.offsetHeight,opacity:this.player.danmaku._opacity,comments:[]},s=".dplayer-danmaku-item:not(.dplayer-danmaku-item--demo)";for(const u of this.player.danmaku.container.querySelectorAll(s)){if(u.textContent===null)continue;const A=window.getComputedStyle(u);e.comments.push({top:u.getBoundingClientRect().top-this.player.danmaku.container.getBoundingClientRect().top,left:u.getBoundingClientRect().left-this.player.danmaku.container.getBoundingClientRect().left,color:A.color,font_size:parseFloat(A.fontSize.replaceAll("px","")),text:u.textContent.trim()})}return e.comments.length===0?null:e}createCaptureExifData(){var p,r,i,t,n,a;const e=Ln(),s=cn(),u=Rr().format(),A=this.player.plugins.aribb24Caption,l=A.isShowing===!0&&A.isPresent()?A.getTextContent():null;let c;return this.playback_mode==="Live"?c={captured_at:u,captured_playback_position:-1,network_id:e.channel.current.network_id,service_id:e.channel.current.service_id,event_id:((p=e.channel.current.program_present)==null?void 0:p.event_id)??-1,title:((r=e.channel.current.program_present)==null?void 0:r.title)??"放送休止",description:((i=e.channel.current.program_present)==null?void 0:i.description)??"",start_time:((t=e.channel.current.program_present)==null?void 0:t.start_time)??"2000-01-01T00:00:00+09:00",end_time:((n=e.channel.current.program_present)==null?void 0:n.end_time)??"2000-01-01T00:00:00+09:00",duration:((a=e.channel.current.program_present)==null?void 0:a.duration)??0,caption_text:l,is_caption_composited:!1,is_comment_composited:!1}:c={captured_at:u,captured_playback_position:-1,network_id:s.recorded_program.network_id??-1,service_id:s.recorded_program.service_id??-1,event_id:s.recorded_program.event_id??-1,title:s.recorded_program.title,description:s.recorded_program.description,start_time:s.recorded_program.start_time,end_time:s.recorded_program.end_time,duration:s.recorded_program.duration,caption_text:l,is_caption_composited:!1,is_comment_composited:!1},this.playback_mode==="Live"?c.captured_playback_position=Rr().diff(Rr(c.start_time),"second",!0):c.captured_playback_position=this.player.video.currentTime-s.recorded_program.recording_start_margin,c}async captureAndSave(e){const s=Ln(),u=cn(),A=Sn(),y=si.time();if(this.playback_mode==="Live"&&s.channel.current.is_radiochannel===!0){this.player.notice("ラジオチャンネルはキャプチャできません。",void 0,void 0,"#FF6F6A");return}if(this.player.video.videoWidth===0&&this.player.video.videoHeight===0){this.player.notice("読み込み中はキャプチャできません。",void 0,void 0,"#FF6F6A");return}if(e===!0&&this.player.danmaku.showing===!1){this.player.notice("コメントを付けてキャプチャするには、コメント表示をオンにしてください。",void 0,void 0,"#FF6F6A");return}this.addHighlight(e);const l=this.player.plugins.aribb24Caption,c=this.player.plugins.aribb24Superimpose??null,p=l.getRawCanvas(),r=(c==null?void 0:c.getRawCanvas())??null,i=l.isShowing===!0&&l.isPresent(),t=c&&c.isShowing===!0&&c.isPresent(),n=await Promise.all([createImageBitmap(this.player.video),i?createImageBitmap(p):null,t?createImageBitmap(r):null]),a=n.filter(L=>L!==null),o=n[0],d=n[1],g=n[2],m=e?this.createCaptureCommentData():null,v=this.createCaptureExifData();console.log("\x1B[36m[CaptureManager] Composite start:");const b=si.time(),C=await(await new wf(N0({mode:A.settings.capture_caption_mode,capture:o,caption:d,superimpose:g,capture_comment_data:m,capture_exif_data:v},a))).composite();console.log("\x1B[36m[CaptureManager] Composite end:",si.mathFloor(si.time()-b,3),"sec");const D=`Capture_${Rr().format("YYYYMMDD-HHmmss")}`,R=`${D}.jpg`,T=`${D}_caption.jpg`;C.capture_normal!==null&&(u.event_emitter.emit("CaptureCompleted",{capture:C.capture_normal,filename:R}),["Browser","Both"].includes(A.settings.capture_save_mode)&&si.downloadBlobData(C.capture_normal,R),["UploadServer","Both"].includes(A.settings.capture_save_mode)&&Ef.uploadCapture(C.capture_normal,R)),C.capture_caption!==null&&(u.event_emitter.emit("CaptureCompleted",{capture:C.capture_caption,filename:R}),["Browser","Both"].includes(A.settings.capture_save_mode)&&si.downloadBlobData(C.capture_caption,T),["UploadServer","Both"].includes(A.settings.capture_save_mode)&&Ef.uploadCapture(C.capture_caption,T));const P=si.mathFloor(si.time()-y,3);if(P<.1?setTimeout(()=>this.removeHighlight(e),100):this.removeHighlight(e),console.log("\x1B[36m[CaptureManager] Total:",P,"sec"),A.settings.capture_copy_to_clipboard===!0){for(const L of[C.capture_normal,C.capture_caption])if(L!==null)try{await p6(await f6(L))}catch(I){this.player.notice("クリップボードへのキャプチャのコピーに失敗しました。",void 0,void 0,"#FF6F6A"),console.error(I)}}}async destroy(){console.log("[CaptureManager] Destroyed.")}}var G0={exports:{}};/*! For license information please see web-bml.js.LICENSE.txt */(function(_,e){(function(s,u){_.exports=u()})(Ho,()=>(()=>{var s={1015:function(y,l){var c;c=function(p){var r,i,t,n;p.version="0.4.1",p.parse=function(kt,Gt){return i=String(kt),t=i.length,o(Gt),xt(),function(ii){P=L=d,r.locations&&(I=new Tt),x=G=null,O=[],Mt();var yi=ii||mi(),Ei=!0;for(ii||(yi.body=[]);w!==j;){var Mi=on();yi.body.push(Mi),Ei&&Ii(Mi)&&li(!0),Ei=!1}return Kt(yi,"Program")}(r.program)};var a=p.defaultOptions={ecmaVersion:5,strictSemicolons:!1,allowTrailingCommas:!0,forbidReserved:!1,locations:!1,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null};function o(kt){for(var Gt in r=kt||{},a)Object.prototype.hasOwnProperty.call(r,Gt)||(r[Gt]=a[Gt]);n=r.sourceFile||null}var d,g,m,v,b,w,C,D,R,T,P,L,I,x,O,G,J=p.getLineInfo=function(kt,Gt){for(var ii=1,yi=0;;){bt.lastIndex=yi;var Ei=bt.exec(kt);if(!(Ei&&Ei.index=170&&dt.test(String.fromCharCode(kt)))},Lt=p.isIdentifierChar=function(kt){return kt<48?kt===36:kt<58||!(kt<65)&&(kt<91||(kt<97?kt===95:kt<123||kt>=170&&yt.test(String.fromCharCode(kt))))};function Tt(){this.line=R,this.column=d-T}function xt(){R=1,d=T=0,D=!0,jt()}function Ut(kt,Gt){m=d,r.locations&&(b=new Tt),w=kt,jt(),C=Gt,D=kt.beforeExpr}function Vt(){var kt,Gt=r.onComment&&r.locations&&new Tt,ii=d,yi=i.indexOf("*/",d+=2);if(yi===-1&&te(d-2,"Unterminated comment"),d=yi+2,r.locations)for(bt.lastIndex=ii;(kt=bt.exec(i))&&kt.index8&&kt<14)++d;else if(kt===47){var Gt;if((Gt=i.charCodeAt(d+1))===42)Vt();else{if(Gt!==47)break;Bt()}}else if(kt===160)++d;else{if(!(kt>=5760&&et.test(String.fromCharCode(kt))))break;++d}}}function Mt(kt){if(kt?d=g+1:g=d,r.locations&&(v=new Tt),kt)return Jt();if(d>=t)return Ut(j);var Gt=i.charCodeAt(d);if(Rt(Gt)||Gt===92)return ui();var ii=function(Ei){switch(Ei){case 46:return function(){var xi=i.charCodeAt(d+1);return xi>=48&&xi<=57?di(!0):(++d,Ut(ze))}();case 40:return++d,Ut(De);case 41:return++d,Ut(Re);case 59:return++d,Ut(gt);case 44:return++d,Ut(ut);case 91:return++d,Ut(lt);case 93:return++d,Ut(mt);case 123:return++d,Ut(Ue);case 125:return++d,Ut(Ve);case 58:return++d,Ut(Ce);case 63:return++d,Ut(At);case 48:var Mi=i.charCodeAt(d+1);if(Mi===120||Mi===88)return function(){d+=2;var xi=Wt(16);return xi==null&&te(g+2,"Expected hexadecimal number"),Rt(i.charCodeAt(d))&&te(d,"Identifier directly after number"),Ut(ne,xi)}();case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return di(!1);case 34:case 39:return function(xi){d++;for(var Vi="";;){d>=t&&te(g,"Unterminated string constant");var $i=i.charCodeAt(d);if($i===xi)return++d,Ut(M,Vi);if($i===92){$i=i.charCodeAt(++d);var pn=/^[0-7]+/.exec(i.slice(d,d+3));for(pn&&(pn=pn[0]);pn&&parseInt(pn,8)>255;)pn=pn.slice(0,-1);if(pn==="0"&&(pn=null),++d,pn)G&&te(d-2,"Octal literal in strict mode"),Vi+=String.fromCharCode(parseInt(pn,8)),d+=pn.length-1;else switch($i){case 110:Vi+=` `;break;case 114:Vi+="\r";break;case 120:Vi+=String.fromCharCode(oi(2));break;case 117:Vi+=String.fromCharCode(oi(4));break;case 85:Vi+=String.fromCharCode(oi(8));break;case 116:Vi+=" ";break;case 98:Vi+="\b";break;case 118:Vi+="\v";break;case 102:Vi+="\f";break;case 48:Vi+="\0";break;case 13:i.charCodeAt(d)===10&&++d;case 10:r.locations&&(T=d,++R);break;default:Vi+=String.fromCharCode($i)}}else $i!==13&&$i!==10&&$i!==8232&&$i!==8233||te(g,"Unterminated string constant"),Vi+=String.fromCharCode($i),++d}}(Ei);case 47:return function(){var xi=i.charCodeAt(d+1);return D?(++d,Jt()):xi===61?Ot(Be,2):Ot(Je,1)}();case 37:case 42:return i.charCodeAt(d+1)===61?Ot(Be,2):Ot(S,1);case 124:case 38:return function(xi){var Vi=i.charCodeAt(d+1);return Vi===xi?Ot(xi===124?Qe:Me,2):Vi===61?Ot(Be,2):Ot(xi===124?Se:xe,1)}(Ei);case 94:return i.charCodeAt(d+1)===61?Ot(Be,2):Ot(K,1);case 43:case 45:return function(xi){var Vi=i.charCodeAt(d+1);return Vi===xi?Vi==45&&i.charCodeAt(d+2)==62&&wt.test(i.slice(L,d))?(d+=3,Bt(),jt(),Mt()):Ot(it,2):Vi===61?Ot(Be,2):Ot(N,1)}(Ei);case 60:case 62:return function(xi){var Vi=i.charCodeAt(d+1),$i=1;return Vi===xi?($i=xi===62&&i.charCodeAt(d+2)===62?3:2,i.charCodeAt(d+$i)===61?Ot(Be,$i+1):Ot(V,$i)):Vi==33&&xi==60&&i.charCodeAt(d+2)==45&&i.charCodeAt(d+3)==45?(d+=4,Bt(),jt(),Mt()):(Vi===61&&($i=i.charCodeAt(d+2)===61?3:2),Ot(Te,$i))}(Ei);case 61:case 33:return function(xi){return i.charCodeAt(d+1)===61?Ot(be,i.charCodeAt(d+2)===61?3:2):Ot(xi===61?$e:Ne,1)}(Ei);case 126:return Ot(Ne,1)}return!1}(Gt);if(ii===!1){var yi=String.fromCharCode(Gt);if(yi==="\\"||dt.test(yi))return ui();te(d,"Unexpected character '"+yi+"'")}return ii}function Ot(kt,Gt){var ii=i.slice(d,d+Gt);d+=Gt,Ut(kt,ii)}function Jt(){for(var kt,Gt,ii=d;;){d>=t&&te(ii,"Unterminated regular expression");var yi=i.charAt(d);if(wt.test(yi)&&te(ii,"Unterminated regular expression"),kt)kt=!1;else{if(yi==="[")Gt=!0;else if(yi==="]"&&Gt)Gt=!1;else if(yi==="/"&&!Gt)break;kt=yi==="\\"}++d}var Ei=i.slice(ii,d);++d;var Mi=$t();return Mi&&!/^[gmsiy]*$/.test(Mi)&&te(ii,"Invalid regexp flag"),Ut(ee,new RegExp(Ei,Mi))}function Wt(kt,Gt){for(var ii=d,yi=0,Ei=0,Mi=Gt??1/0;Ei=97?Vi-97+10:Vi>=65?Vi-65+10:Vi>=48&&Vi<=57?Vi-48:1/0)>=kt)break;++d,yi=yi*kt+xi}return d===ii||Gt!=null&&d-ii!==Gt?null:yi}function di(kt){var Gt=d,ii=!1,yi=i.charCodeAt(d)===48;kt||Wt(10)!==null||te(Gt,"Invalid number"),i.charCodeAt(d)===46&&(++d,Wt(10),ii=!0);var Ei=i.charCodeAt(d);Ei!==69&&Ei!==101||((Ei=i.charCodeAt(++d))!==43&&Ei!==45||++d,Wt(10)===null&&te(Gt,"Invalid number"),ii=!0),Rt(i.charCodeAt(d))&&te(d,"Identifier directly after number");var Mi,xi=i.slice(Gt,d);return ii?Mi=parseFloat(xi):yi&&xi.length!==1?/[89]/.test(xi)||G?te(Gt,"Invalid number"):Mi=parseInt(xi,8):Mi=parseInt(xi,10),Ut(ne,Mi)}function oi(kt){var Gt=Wt(16,kt);return Gt===null&&te(g,"Bad character escape sequence"),Gt}function $t(){ce=!1;for(var kt,Gt=!0,ii=d;;){var yi=i.charCodeAt(d);if(Lt(yi))ce&&(kt+=i.charAt(d)),++d;else{if(yi!==92)break;ce||(kt=i.slice(ii,d)),ce=!0,i.charCodeAt(++d)!=117&&te(d,"Expecting Unicode escape sequence \\uXXXX"),++d;var Ei=oi(4),Mi=String.fromCharCode(Ei);Mi||te(d-1,"Invalid Unicode escape"),(Gt?Rt(Ei):Lt(Ei))||te(d-4,"Invalid Unicode escape"),kt+=Mi}Gt=!1}return ce?kt:i.slice(ii,d)}function ui(){var kt=$t(),Gt=Y;return ce||(nt(kt)?Gt=Ye[kt]:(r.forbidReserved&&(r.ecmaVersion===3?me:ye)(kt)||G&&Pe(kt))&&te(g,"The keyword '"+kt+"' is reserved")),Ut(Gt,kt)}function ti(){P=g,L=m,I=b,Mt()}function li(kt){if(G=kt,d=L,r.locations)for(;d=5&&kt.type==="ExpressionStatement"&&kt.expression.type==="Literal"&&kt.expression.value==="use strict"}function ei(kt){if(w===kt)return ti(),!0}function ji(){return!r.strictSemicolons&&(w===j||w===Ve||wt.test(i.slice(L,g)))}function Li(){ei(gt)||ji()||Bi()}function Ti(kt){w===kt?ti():Bi()}function Bi(){te(g,"Unexpected token")}function dn(kt){kt.type!=="Identifier"&&kt.type!=="MemberExpression"&&te(kt.start,"Assigning to rvalue"),G&&kt.type==="Identifier"&&We(kt.name)&&te(kt.start,"Assigning to "+kt.name+" in strict mode")}var rn={kind:"loop"},Un={kind:"switch"};function on(){(w===Je||w===Be&&C=="/=")&&Mt(!0);var kt=w,Gt=mi();switch(kt){case z:case X:ti();var ii=kt===z;ei(gt)||ji()?Gt.label=null:w!==Y?Bi():(Gt.label=sr(),Li());for(var yi=0;yiGt){var Ei=gi(kt);Ei.left=kt,Ei.operator=C;var Mi=w;return ti(),Ei.right=rr(Or(),yi,ii),rr(Kt(Ei,Mi===Qe||Mi===Me?"LogicalExpression":"BinaryExpression"),Gt,ii)}return kt}function Or(){if(w.prefix){var kt=mi(),Gt=w.isUpdate;return kt.operator=C,kt.prefix=!0,D=!0,ti(),kt.argument=Or(),Gt?dn(kt.argument):G&&kt.operator==="delete"&&kt.argument.type==="Identifier"&&te(kt.start,"Deleting local variable in strict mode"),Kt(kt,Gt?"UpdateExpression":"UnaryExpression")}for(var ii=br(cr());w.postfix&&!ji();)(kt=gi(ii)).operator=C,kt.prefix=!1,kt.argument=ii,dn(ii),ti(),ii=Kt(kt,"UpdateExpression");return ii}function br(kt,Gt){var ii;return ei(ze)?((ii=gi(kt)).object=kt,ii.property=sr(!0),ii.computed=!1,br(Kt(ii,"MemberExpression"),Gt)):ei(lt)?((ii=gi(kt)).object=kt,ii.property=yn(),ii.computed=!0,Ti(mt),br(Kt(ii,"MemberExpression"),Gt)):!Gt&&ei(De)?((ii=gi(kt)).callee=kt,ii.arguments=cs(Re,!1),br(Kt(ii,"CallExpression"),Gt)):kt}function cr(){switch(w){case pe:var kt=mi();return ti(),Kt(kt,"ThisExpression");case Y:return sr();case ne:case M:case ee:return(kt=mi()).value=C,kt.raw=i.slice(g,m),ti(),Kt(kt,"Literal");case ue:case W:case ke:return(kt=mi()).value=w.atomValue,kt.raw=w.keyword,ti(),Kt(kt,"Literal");case De:var Gt=v,ii=g;ti();var yi=yn();return yi.start=ii,yi.end=m,r.locations&&(yi.loc.start=Gt,yi.loc.end=b),r.ranges&&(yi.range=[ii,m]),Ti(Re),yi;case lt:return kt=mi(),ti(),kt.elements=cs(mt,!0,!0),Kt(kt,"ArrayExpression");case Ue:return function(){var Ei=mi(),Mi=!0,xi=!1;for(Ei.properties=[],ti();!ei(Ve);){if(Mi)Mi=!1;else if(Ti(ut),r.allowTrailingCommas&&ei(Ve))break;var Vi,$i={key:_r()},pn=!1;if(ei(Ce)?($i.value=yn(!0),Vi=$i.kind="init"):r.ecmaVersion>=5&&$i.key.type==="Identifier"&&($i.key.name==="get"||$i.key.name==="set")?(pn=xi=!0,Vi=$i.kind=$i.key.name,$i.key=_r(),w!==De&&Bi(),$i.value=Mr(mi(),!1)):Bi(),$i.key.type==="Identifier"&&(G||xi))for(var ar=0;ar=0)for(var Vi=0;Vi=5&&kt.type==="ExpressionStatement"&&kt.expression.type==="Literal"&&kt.expression.value==="use strict"}function ei(kt){if(w===kt)return ti(),!0}function ji(){return!r.strictSemicolons&&(w===j||w===Ve||wt.test(i.slice(L,g)))}function Li(){ei(gt)||ji()||Bi()}function Ti(kt){w===kt?ti():Bi()}function Bi(){te(g,"Unexpected token")}function dn(kt){kt.type!=="Identifier"&&kt.type!=="MemberExpression"&&te(kt.start,"Assigning to rvalue"),G&&kt.type==="Identifier"&&We(kt.name)&&te(kt.start,"Assigning to "+kt.name+" in strict mode")}var rn={kind:"loop"},Un={kind:"switch"};function on(){(w===Je||w===Be&&C=="/=")&&Mt(!0);var kt=w,Gt=mi();switch(kt){case z:case X:ti();var ii=kt===z;ei(gt)||ji()?Gt.label=null:w!==Y?Bi():(Gt.label=sr(),Li());for(var yi=0;yiGt){var Ei=gi(kt);Ei.left=kt,Ei.operator=C;var Mi=w;return ti(),Ei.right=rr(Or(),yi,ii),rr(Kt(Ei,Mi===Qe||Mi===Me?"LogicalExpression":"BinaryExpression"),Gt,ii)}return kt}function Or(){if(w.prefix){var kt=mi(),Gt=w.isUpdate;return kt.operator=C,kt.prefix=!0,D=!0,ti(),kt.argument=Or(),Gt?dn(kt.argument):G&&kt.operator==="delete"&&kt.argument.type==="Identifier"&&te(kt.start,"Deleting local variable in strict mode"),Kt(kt,Gt?"UpdateExpression":"UnaryExpression")}for(var ii=br(cr());w.postfix&&!ji();)(kt=gi(ii)).operator=C,kt.prefix=!1,kt.argument=ii,dn(ii),ti(),ii=Kt(kt,"UpdateExpression");return ii}function br(kt,Gt){var ii;return ei(ze)?((ii=gi(kt)).object=kt,ii.property=sr(!0),ii.computed=!1,br(Kt(ii,"MemberExpression"),Gt)):ei(lt)?((ii=gi(kt)).object=kt,ii.property=yn(),ii.computed=!0,Ti(mt),br(Kt(ii,"MemberExpression"),Gt)):!Gt&&ei(De)?((ii=gi(kt)).callee=kt,ii.arguments=cs(Re,!1),br(Kt(ii,"CallExpression"),Gt)):kt}function cr(){switch(w){case pe:var kt=mi();return ti(),Kt(kt,"ThisExpression");case Y:return sr();case ne:case M:case ee:return(kt=mi()).value=C,kt.raw=i.slice(g,m),ti(),Kt(kt,"Literal");case ue:case W:case ke:return(kt=mi()).value=w.atomValue,kt.raw=w.keyword,ti(),Kt(kt,"Literal");case De:var Gt=v,ii=g;ti();var yi=yn();return yi.start=ii,yi.end=m,r.locations&&(yi.loc.start=Gt,yi.loc.end=b),r.ranges&&(yi.range=[ii,m]),Ti(Re),yi;case lt:return kt=mi(),ti(),kt.elements=cs(mt,!0,!0),Kt(kt,"ArrayExpression");case Ue:return function(){var Ei=mi(),Mi=!0,xi=!1;for(Ei.properties=[],ti();!ei(Ve);){if(Mi)Mi=!1;else if(Ti(ut),r.allowTrailingCommas&&ei(Ve))break;var Vi,$i={key:_r()},pn=!1;if(ei(Ce)?($i.value=yn(!0),Vi=$i.kind="init"):r.ecmaVersion>=5&&$i.key.type==="Identifier"&&($i.key.name==="get"||$i.key.name==="set")?(pn=xi=!0,Vi=$i.kind=$i.key.name,$i.key=_r(),w!==De&&Bi(),$i.value=Mr(mi(),!1)):Bi(),$i.key.type==="Identifier"&&(G||xi))for(var ar=0;ar=0)for(var Vi=0;Vi"u"?this:globalThis,r.WORKER_CODE=["onmessage = function(e) {","var result;","var data = e.data;","switch (data[0]) {","case 'split':","result = data[1].split(data[2], data[3]);","break;","case 'match':","result = data[1].match(data[2]);","break;","case 'search':","result = data[1].search(data[2]);","break;","case 'replace':","result = data[1].replace(data[2], data[3]);","break;","case 'exec':","var regexp = data[1];","regexp.lastIndex = data[2];","result = [regexp.exec(data[3]), data[1].lastIndex];","break;","default:","throw Error('Unknown RegExp operation: ' + data[0]);","}","postMessage(result);","};"],r.legalArrayLength=function(i){var t=i>>>0;return t===Number(i)?t:NaN},r.legalArrayIndex=function(i){var t=i>>>0;return String(t)===String(i)&&t!==4294967295?t:NaN},r.stripLocations_=function(i,t,n){for(var a in t?i.start=t:delete i.start,n?i.end=n:delete i.end,i)if(a!=="loc"&&i.hasOwnProperty(a)){var o=i[a];o&&typeof o=="object"&&r.stripLocations_(o,t,n)}},r.prototype.REGEXP_MODE=2,r.prototype.REGEXP_THREAD_TIMEOUT=1e3,r.prototype.POLYFILL_TIMEOUT=1e3,r.prototype.getterStep_=!1,r.prototype.setterStep_=!1,r.prototype.appendCodeNumber_=0,r.prototype.parse_=function(i,t){var n={};for(var a in r.PARSE_OPTIONS)n[a]=r.PARSE_OPTIONS[a];return n.sourceFile=t,p.parse(i,n)},r.prototype.appendCode=function(i,t){var n=this.stateStack[0];if(!n||n.node.type!=="Program")throw Error("Expecting original AST to start with a Program node.");if(typeof i=="string"&&(i=typeof t=="string"?this.parse_(i,t):this.parse_(i,"appendCode"+this.appendCodeNumber_++)),!i||i.type!=="Program")throw Error("Expecting new AST to start with a Program node.");this.populateScope_(i,n.scope),Array.prototype.push.apply(n.node.body,i.body),n.done=!1},r.prototype.step=function(){var i=this.stateStack,t=Date.now();do{var n=i[i.length-1];if(!n)return!1;var a=n.node,o=a.type;if(o==="Program"&&n.done)return!1;if(this.paused_)return!0;try{var d=this.stepFunctions_[o](i,n,a)}catch(g){if(g!==r.STEP_ERROR)throw g}if(d){if(d instanceof Promise)return d;i.push(d)}if(this.getterStep_)throw Error("Getter not supported in this context");if(this.setterStep_)throw Error("Setter not supported in this context")}while(!a.end&&t+this.POLYFILL_TIMEOUT>Date.now());return!0},r.prototype.run=function(){for(;!this.paused_&&this.step(););return this.paused_},r.prototype.runAsync=function(i,t){for(var n=performance.now();!this.paused_;){var a=this.step();if(a instanceof Promise)return a;if(!a)break;if(performance.now()-n>=i)return t()}return Promise.resolve(this.paused_)},r.prototype.initGlobal=function(i){this.setProperty(i,"NaN",NaN,r.NONCONFIGURABLE_READONLY_NONENUMERABLE_DESCRIPTOR),this.setProperty(i,"undefined",void 0,r.NONCONFIGURABLE_READONLY_NONENUMERABLE_DESCRIPTOR),this.setProperty(i,"this",i,r.NONCONFIGURABLE_READONLY_NONENUMERABLE_DESCRIPTOR),this.setProperty(i,"self",i),this.OBJECT_PROTO=new r.Object(null),this.FUNCTION_PROTO=new r.Object(this.OBJECT_PROTO),this.initFunction(i),this.initObject(i),i.proto=this.OBJECT_PROTO,this.setProperty(i,"constructor",this.OBJECT,r.NONENUMERABLE_DESCRIPTOR),this.initArray(i),this.initBoolean(i),this.initError(i),this.setProperty(i,"parseInt",this.createNativeFunction(parseInt,!1),r.NONENUMERABLE_DESCRIPTOR),this.setProperty(i,"isNaN",this.createNativeFunction(isNaN,!1),r.NONENUMERABLE_DESCRIPTOR),this.OBJECT=this.OBJECT,this.OBJECT_PROTO=this.OBJECT_PROTO,this.FUNCTION=this.FUNCTION,this.FUNCTION_PROTO=this.FUNCTION_PROTO,this.ARRAY=this.ARRAY,this.ARRAY_PROTO=this.ARRAY_PROTO,this.REGEXP=this.REGEXP,this.REGEXP_PROTO=this.REGEXP_PROTO,this.DATE=this.DATE,this.DATE_PROTO=this.DATE_PROTO,this.initFunc_&&this.initFunc_(this,i)},r.prototype.functionCodeNumber_=0,r.prototype.initFunction=function(i){var t,n=this,a=/^[A-Za-z_$][\w$]*$/;t=function(o){if(arguments.length)var d=String(arguments[arguments.length-1]);else d="";var g=Array.prototype.slice.call(arguments,0,-1).join(",").trim();if(g){for(var m=g.split(/\s*,\s*/),v=0;v>> 0;","if (!len || len < 2) {","return o;","}","for (var i = 0; i < len / 2 - 0.5; i++) {","var x = o[i];","var hasX = i in o;","if ((len - i - 1) in o) {","o[i] = o[len - i - 1];","} else {","delete o[i];","}","if (hasX) {","o[len - i - 1] = x;","} else {","delete o[len - i - 1];","}","}","return o;","}","});","Object.defineProperty(Array.prototype, 'join',","{configurable: true, writable: true, value:","function join(opt_separator) {","if (!this) throw TypeError();","var o = Object(this);","var sep = typeof opt_separator === 'undefined' ?","',' : ('' + opt_separator);","var str = '';","for (var i = 0; i < o.length; i++) {","if (i && sep) {","str += sep;","}","str += (o[i] === null || o[i] === undefined) ? '' : o[i];","}","return str;","}","});","Object.defineProperty(Array.prototype, 'sort',","{configurable: true, writable: true, value:","function sort(opt_comp) {","if (!this) throw TypeError();","if (typeof opt_comp !== 'function') {","opt_comp = undefined;","}","for (var i = 0; i < this.length; i++) {","var changes = 0;","for (var j = 0; j < this.length - i - 1; j++) {","if (opt_comp ? (opt_comp(this[j], this[j + 1]) > 0) :","(String(this[j]) > String(this[j + 1]))) {","var swap = this[j];","var hasSwap = j in this;","if ((j + 1) in this) {","this[j] = this[j + 1];","} else {","delete this[j];","}","if (hasSwap) {","this[j + 1] = swap;","} else {","delete this[j + 1];","}","changes++;","}","}","if (!changes) break;","}","return this;","}","});","")},r.prototype.initString=function(i){throw new Error("removed")},r.prototype.initBoolean=function(i){var t,n=this;t=function(a){return a=r.nativeGlobal.Boolean(a),n.calledWithNew()?(this.data=a,this):a},this.BOOLEAN=this.createNativeFunction(t,!0),this.setNativeFunctionPrototype(this.BOOLEAN,"toString",function(){return this.data.toString()}),this.setNativeFunctionPrototype(this.BOOLEAN,"valueOf",function(){return this.data.valueOf()}),this.setProperty(i,"Boolean",this.BOOLEAN,r.NONENUMERABLE_DESCRIPTOR)},r.prototype.initNumber=function(i){throw new Error("removed")},r.prototype.initDate=function(i){throw new Error("removed")},r.prototype.initRegExp=function(i){throw new Error("removed")},r.prototype.initError=function(i){var t=this;this.ERROR=this.createNativeFunction(function(a){if(t.calledWithNew())var o=this;else o=t.createObject(t.ERROR);return t.populateError(o,a),o},!0),this.setProperty(i,"Error",this.ERROR,r.NONENUMERABLE_DESCRIPTOR),this.setProperty(this.ERROR.properties.prototype,"message","",r.NONENUMERABLE_DESCRIPTOR),this.setProperty(this.ERROR.properties.prototype,"name","Error",r.NONENUMERABLE_DESCRIPTOR);var n=function(a){var o=t.createNativeFunction(function(d){if(t.calledWithNew())var g=this;else g=t.createObject(o);return t.populateError(g,d),g},!0);return t.setProperty(o,"prototype",t.createObject(t.ERROR),r.NONENUMERABLE_DESCRIPTOR),t.setProperty(o.properties.prototype,"name",a,r.NONENUMERABLE_DESCRIPTOR),t.setProperty(i,a,o,r.NONENUMERABLE_DESCRIPTOR),o};this.EVAL_ERROR=n("EvalError"),this.RANGE_ERROR=n("RangeError"),this.REFERENCE_ERROR=n("ReferenceError"),this.SYNTAX_ERROR=n("SyntaxError"),this.TYPE_ERROR=n("TypeError"),this.URI_ERROR=n("URIError")},r.prototype.initMath=function(i){throw new Error("removed")},r.prototype.initJSON=function(i){throw new Error("removed")},r.prototype.isa=function(i,t){if(i==null||!t)return!1;var n=t.properties.prototype;if(i===n)return!0;for(i=this.getPrototype(i);i;){if(i===n)return!0;i=i.proto}return!1},r.prototype.populateRegExp=function(i,t){i.data=new RegExp(t.source,t.flags),this.setProperty(i,"lastIndex",t.lastIndex,r.NONENUMERABLE_DESCRIPTOR),this.setProperty(i,"source",t.source,r.READONLY_NONENUMERABLE_DESCRIPTOR),this.setProperty(i,"global",t.global,r.READONLY_NONENUMERABLE_DESCRIPTOR),this.setProperty(i,"ignoreCase",t.ignoreCase,r.READONLY_NONENUMERABLE_DESCRIPTOR),this.setProperty(i,"multiline",t.multiline,r.READONLY_NONENUMERABLE_DESCRIPTOR)},r.prototype.populateError=function(i,t){t&&this.setProperty(i,"message",String(t),r.NONENUMERABLE_DESCRIPTOR);for(var n=[],a=this.stateStack.length-1;a>=0;a--){var o=this.stateStack[a],d=o.node;if(d.type==="CallExpression"){var g=o.func_;g&&n.length&&(n[n.length-1].name=this.getProperty(g,"name"))}!d.loc||n.length&&d.type!=="CallExpression"||n.push({loc:d.loc})}var m=(b=String(this.getProperty(i,"name")))+": "+String(this.getProperty(i,"message"))+` `;for(a=0;a0;a.pop()){var o=a[a.length-1];switch(o.node.type){case"TryStatement":return void(o.cv={type:i,value:t,label:n});case"CallExpression":case"NewExpression":if(i===r.Completion.RETURN)return void(o.value=t);if(i!==r.Completion.THROW)throw Error("Unsynatctic break/continue not rejected by Acorn");break;case"Program":o.done=!0;break e}if(i===r.Completion.BREAK){if(n?o.labels&&o.labels.indexOf(n)!==-1:o.isLoop||o.isSwitch)return void a.pop()}else if(i===r.Completion.CONTINUE&&(n?o.labels&&o.labels.indexOf(n)!==-1:o.isLoop))return}var d;if(this.isa(t,this.ERROR)){var g={EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError},m=String(this.getProperty(t,"name")),v=this.getProperty(t,"message").valueOf();(d=(g[m]||Error)(v)).stack=String(this.getProperty(t,"stack"))}else d=String(t);throw d},r.prototype.createGetter_=function(i,t){if(!this.getterStep_)throw Error("Unexpected call to createGetter");this.getterStep_=!1;var n=Array.isArray(t)?t[0]:t,a=new this.nodeConstructor({options:{}});a.type="CallExpression";var o=new r.State(a,this.stateStack[this.stateStack.length-1].scope);return o.doneCallee_=!0,o.funcThis_=n,o.func_=i,o.doneArgs_=!0,o.arguments_=[],o},r.prototype.createSetter_=function(i,t,n){if(!this.setterStep_)throw Error("Unexpected call to createSetter");this.setterStep_=!1;var a=Array.isArray(t)?t[0]:this.globalObject,o=new this.nodeConstructor({options:{}});o.type="CallExpression";var d=new r.State(o,this.stateStack[this.stateStack.length-1].scope);return d.doneCallee_=!0,d.funcThis_=a,d.func_=i,d.doneArgs_=!0,d.arguments_=[n],d},r.prototype.boxThis_=function(i){if(i==null)return this.globalObject;if(!(i instanceof r.Object)){var t=this.createObjectProto(this.getPrototype(i));return t.data=i,t}return i},r.prototype.getGlobalScope=function(){return this.globalScope},r.prototype.getStateStack=function(){return this.stateStack},r.prototype.setStateStack=function(i){this.stateStack=i},r.Value,r.State=function(i,t){this.node=i,this.scope=t},r.Scope=function(i,t,n){this.parentScope=i,this.strict=t,this.object=n},r.Object=function(i){this.getter=Object.create(null),this.setter=Object.create(null),this.properties=Object.create(null),this.proto=i},r.Object.prototype.proto=null,r.Object.prototype.class="Object",r.Object.prototype.data=null,r.Object.prototype.toString=function(){if(!(this instanceof r.Object))return String(this);if(this.class==="Array"){(d=r.toStringCycles_).push(this);try{var i=[],t=this.properties.length,n=!1;t>1024&&(t=1e3,n=!0);for(var a=0;a>=":g>>=m;break;case">>>=":g>>>=m;break;case"&=":g&=m;break;case"^=":g^=m;break;case"|=":g|=m;break;default:throw SyntaxError("Unknown assignment expression: "+n.operator)}var v=this.setValue(t.leftReference_,g);if(v)return t.doneSetter_=!0,t.setterValue_=g,this.createSetter_(v,t.leftReference_,g);i.pop(),i[i.length-1].value=g},r.prototype.stepBinaryExpression=function(i,t,n){if(!t.doneLeft_)return t.doneLeft_=!0,new r.State(n.left,t.scope);if(!t.doneRight_)return t.doneRight_=!0,t.leftValue_=t.value,new r.State(n.right,t.scope);i.pop();var a,o=t.leftValue_,d=t.value;switch(n.operator){case"==":a=o==d;break;case"!=":a=o!=d;break;case"===":a=o===d;break;case"!==":a=o!==d;break;case">":a=o>d;break;case">=":a=o>=d;break;case"<":a=o>":a=o>>d;break;case">>>":a=o>>>d;break;case"in":d instanceof r.Object||this.throwException(this.TYPE_ERROR,"'in' expects an object, not '"+d+"'"),a=this.hasProperty(d,o);break;case"instanceof":this.isa(d,this.FUNCTION)||this.throwException(this.TYPE_ERROR,"Right-hand side of instanceof is not an object"),a=o instanceof r.Object&&this.isa(o,d);break;default:throw SyntaxError("Unknown binary operator: "+n.operator)}i[i.length-1].value=a},r.prototype.stepBlockStatement=function(i,t,n){var a=t.n_||0,o=n.body[a];if(o)return t.n_=a+1,new r.State(o,t.scope);i.pop()},r.prototype.stepBreakStatement=function(i,t,n){var a=n.label&&n.label.name;this.unwind(r.Completion.BREAK,void 0,a)},r.prototype.evalCodeNumber_=0,r.prototype.stepCallExpression=function(i,t,n){if(!t.doneCallee_){t.doneCallee_=1;var a=new r.State(n.callee,t.scope);return a.components=!0,a}if(t.doneCallee_===1){t.doneCallee_=2;var o=t.value;if(Array.isArray(o)){if(t.func_=this.getValue(o),o[0]===r.SCOPE_REFERENCE?t.directEval_=o[1]==="eval":t.funcThis_=o[0],o=t.func_,this.getterStep_)return t.doneCallee_=1,this.createGetter_(o,t.value)}else t.func_=o;t.arguments_=[],t.n_=0}if(o=t.func_,!t.doneArgs_){if(t.n_!==0&&t.arguments_.push(t.value),n.arguments[t.n_])return new r.State(n.arguments[t.n_++],t.scope);if(n.type==="NewExpression"){if(o instanceof r.Object&&!o.illegalConstructor||this.throwException(this.TYPE_ERROR,o+" is not a constructor"),o===this.ARRAY)t.funcThis_=this.createArray();else{var d=o.properties.prototype;typeof d=="object"&&d!==null||(d=this.OBJECT_PROTO),t.funcThis_=this.createObjectProto(d)}t.isConstructor=!0}t.doneArgs_=!0}if(t.doneExec_)i.pop(),t.isConstructor&&typeof t.value!="object"?i[i.length-1].value=t.funcThis_:i[i.length-1].value=t.value;else{t.doneExec_=!0,o instanceof r.Object||this.throwException(this.TYPE_ERROR,o+" is not a function");var g=o.node;if(g){for(var m=this.createScope(g.body,o.parentScope),v=0;vv?t.arguments_[v]:void 0;this.setProperty(m.object,b,w)}var C=this.createArray();for(v=0;v{Object.defineProperty(l,"__esModule",{value:!0}),l.TsBuffer=void 0;const p=c(8764);l.TsBuffer=class{constructor(){we(this,"chunks",[]);we(this,"length",0);we(this,"entireLength")}add(r){this.chunks.push(r),this.length+=r.length}reset(){this.chunks.length=0,this.length=0}concat(){return p.Buffer.concat(this.chunks)}}},4018:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8764),r=c(4914),i=c(5991);l.default=class{constructor(t){we(this,"buffer");we(this,"position",0);we(this,"graphic",[66,74,48,49]);we(this,"graphicMode",[1,1,1,1]);we(this,"graphicByte",[2,1,1,1]);we(this,"graphicL",0);we(this,"graphicR",2);we(this,"graphicNormal",!0);we(this,"sjis",[]);we(this,"result","");this.buffer=t}decode(){try{for(;this.position0&&(this.result+=(0,r.decode)(p.Buffer.from(this.sjis),"shift-jis"),this.sjis=[]),this.result}readC0(){switch(this.getNext()){case 32:this.graphicNormal?this.sjis.push(129,64):this.sjis.push(32);break;case 13:this.sjis.push(13,10);break;case 14:this.graphicL=1;break;case 15:this.graphicL=0;break;case 25:this.readSS2();break;case 29:this.readSS3();break;case 27:this.readESC();break;case 22:this.position+=1;break;case 28:this.position+=2}}readC1(){switch(this.getNext()){case 137:case 136:this.graphicNormal=!1;break;case 138:this.graphicNormal=!0;break;case 139:this.graphicNormal=this.getNext()!==96;break;case 144:this.getNext()===32&&(this.position+=1);break;case 145:case 147:case 148:case 151:case 152:this.position+=1;break;case 149:for(;this.position67;)this.position++;break;case 155:this.readCSI()}}readGL(){if(this.graphicMode[this.graphicL]===1)switch(this.graphic[this.graphicL]){case 54:case 74:case 73:this.graphicNormal?this.sjis.push(...i.default.ascii[this.getNext()]):this.sjis.push(this.getNext());break;case 48:case 55:this.sjis.push(...i.default.hiragana[this.getNext()]);break;case 49:case 56:this.sjis.push(...i.default.katakana[this.getNext()]);break;case 57:case 58:case 59:case 66:const t=this.getNext(),n=this.getNext();this.useUnicode(t,n)?(this.sjis.length>0&&(this.result+=(0,r.decode)(p.Buffer.from(this.sjis),"shift-jis"),this.sjis=[]),this.result+=this.getUnicode(t,n)):this.sjis.push(...this.getSjis(t,n))}else this.position+=this.graphicByte[this.graphicL]}readGR(){if(this.graphicMode[this.graphicR]===1)switch(this.graphic[this.graphicR]){case 54:case 74:this.graphicNormal?this.sjis.push(...i.default.ascii[127&this.getNext()]):this.sjis.push(127&this.getNext());break;case 48:case 55:this.sjis.push(...i.default.hiragana[127&this.getNext()]);break;case 49:case 56:case 73:this.sjis.push(...i.default.katakana[127&this.getNext()]);break;case 57:case 58:case 59:case 66:const t=127&this.getNext(),n=127&this.getNext();this.useUnicode(t,n)?(this.sjis.length>0&&(this.result+=(0,r.decode)(p.Buffer.from(this.sjis),"shift-jis"),this.sjis=[]),this.result+=this.getUnicode(t,n)):this.sjis.push(...this.getSjis(t,n))}else this.position+=this.graphicByte[this.graphicR]}readESC(){const t=this.getNext();if(t===36){const n=this.getNext();if(n>=40&&n<=43){const a=this.getNext();if(a===32){const o=this.getNext();this.graphic[n-40]=o,this.graphicMode[n-40]=2,this.graphicByte[n-40]=2}else if(a===40){const o=this.getNext();this.graphic[n-40]=o,this.graphicMode[n-40]=3,this.graphicByte[n-40]=1}else this.graphic[n-40]=a,this.graphicMode[n-40]=1,this.graphicByte[n-40]=2}else this.graphic[0]=n,this.graphicMode[0]=1,this.graphicByte[0]=2}else if(t>=40&&t<=43){const n=this.getNext();if(n===32){const a=this.getNext();this.graphic[t-40]=a,this.graphicMode[t-40]=2,this.graphicByte[t-40]=1}else this.graphic[t-40]=n,this.graphicMode[t-40]=1,this.graphicByte[t-40]=1}else t===110?this.graphicL=2:t===111?this.graphicL=3:t===124?this.graphicR=3:t===125?this.graphicR=2:t===126&&(this.graphicR=1)}readSS2(){const t=this.graphicL;this.graphicL=2,this.readGL(),this.graphicL=t}readSS3(){const t=this.graphicL;this.graphicL=3,this.readGL(),this.graphicL=t}readCSI(){}getNext(){if(this.buffer.length===this.position)throw new Error("Buffer out of range");return this.buffer[this.position++]}useUnicode(t,n){if(t>=117&&n>=33){const a=t<<8|n;return a>=29985&&a<=30283||a>=31309&&a<=32381}return!1}getSjis(t,n){if(t>=117&&n>=33){const o=t<<8|n;return o>=29985&&o<=30283?i.default.gaiji_2[o]:o>=31309&&o<=32381?i.default.gaiji_1[o]:[]}const a=1&t?n>95?32:31:126;return[t=(t+1>>1)+(t<95?112:176)&255,n=n+a&255]}getUnicode(t,n){if(t>=117&&n>=33){const a=t<<8|n;return a>=29985&&a<=30283?i.default.gaiji_2_unicode[a]:a>=31309&&a<=32381?i.default.gaiji_1_unicode[a]:""}return""}}},5991:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.default={ascii:{33:[129,73],34:[129,104],35:[129,148],36:[129,144],37:[129,147],38:[129,149],39:[129,102],40:[129,105],41:[129,106],42:[129,150],43:[129,123],44:[129,67],45:[129,124],46:[129,68],47:[129,94],48:[130,79],49:[130,80],50:[130,81],51:[130,82],52:[130,83],53:[130,84],54:[130,85],55:[130,86],56:[130,87],57:[130,88],58:[129,70],59:[129,71],60:[129,131],61:[129,129],62:[129,132],63:[129,72],64:[129,151],65:[130,96],66:[130,97],67:[130,98],68:[130,99],69:[130,100],70:[130,101],71:[130,102],72:[130,103],73:[130,104],74:[130,105],75:[130,106],76:[130,107],77:[130,108],78:[130,109],79:[130,110],80:[130,111],81:[130,112],82:[130,113],83:[130,114],84:[130,115],85:[130,116],86:[130,117],87:[130,118],88:[130,119],89:[130,120],90:[130,121],91:[129,109],92:[129,143],93:[129,110],94:[129,79],95:[129,81],96:[129,101],97:[130,129],98:[130,130],99:[130,131],100:[130,132],101:[130,133],102:[130,134],103:[130,135],104:[130,136],105:[130,137],106:[130,138],107:[130,139],108:[130,140],109:[130,141],110:[130,142],111:[130,143],112:[130,144],113:[130,145],114:[130,146],115:[130,147],116:[130,148],117:[130,149],118:[130,150],119:[130,151],120:[130,152],121:[130,153],122:[130,154],123:[129,111],124:[129,98],125:[129,112],126:[129,80]},hiragana:{33:[130,159],34:[130,160],35:[130,161],36:[130,162],37:[130,163],38:[130,164],39:[130,165],40:[130,166],41:[130,167],42:[130,168],43:[130,169],44:[130,170],45:[130,171],46:[130,172],47:[130,173],48:[130,174],49:[130,175],50:[130,176],51:[130,177],52:[130,178],53:[130,179],54:[130,180],55:[130,181],56:[130,182],57:[130,183],58:[130,184],59:[130,185],60:[130,186],61:[130,187],62:[130,188],63:[130,189],64:[130,190],65:[130,191],66:[130,192],67:[130,193],68:[130,194],69:[130,195],70:[130,196],71:[130,197],72:[130,198],73:[130,199],74:[130,200],75:[130,201],76:[130,202],77:[130,203],78:[130,204],79:[130,205],80:[130,206],81:[130,207],82:[130,208],83:[130,209],84:[130,210],85:[130,211],86:[130,212],87:[130,213],88:[130,214],89:[130,215],90:[130,216],91:[130,217],92:[130,218],93:[130,219],94:[130,220],95:[130,221],96:[130,222],97:[130,223],98:[130,224],99:[130,225],100:[130,226],101:[130,227],102:[130,228],103:[130,229],104:[130,230],105:[130,231],106:[130,232],107:[130,233],108:[130,234],109:[130,235],110:[130,236],111:[130,237],112:[130,238],113:[130,239],114:[130,240],115:[130,241],116:[129,64],117:[129,64],118:[129,64],119:[129,84],120:[129,85],121:[129,91],122:[129,66],123:[129,117],124:[129,118],125:[129,65],126:[129,69]},katakana:{33:[131,64],34:[131,65],35:[131,66],36:[131,67],37:[131,68],38:[131,69],39:[131,70],40:[131,71],41:[131,72],42:[131,73],43:[131,74],44:[131,75],45:[131,76],46:[131,77],47:[131,78],48:[131,79],49:[131,80],50:[131,81],51:[131,82],52:[131,83],53:[131,84],54:[131,85],55:[131,86],56:[131,87],57:[131,88],58:[131,89],59:[131,90],60:[131,91],61:[131,92],62:[131,93],63:[131,94],64:[131,95],65:[131,96],66:[131,97],67:[131,98],68:[131,99],69:[131,100],70:[131,101],71:[131,102],72:[131,103],73:[131,104],74:[131,105],75:[131,106],76:[131,107],77:[131,108],78:[131,109],79:[131,110],80:[131,111],81:[131,112],82:[131,113],83:[131,114],84:[131,115],85:[131,116],86:[131,117],87:[131,118],88:[131,119],89:[131,120],90:[131,121],91:[131,122],92:[131,123],93:[131,124],94:[131,125],95:[131,126],96:[131,128],97:[131,129],98:[131,130],99:[131,131],100:[131,132],101:[131,133],102:[131,134],103:[131,135],104:[131,136],105:[131,137],106:[131,138],107:[131,139],108:[131,140],109:[131,141],110:[131,142],111:[131,143],112:[131,144],113:[131,145],114:[131,146],115:[131,147],116:[131,148],117:[131,149],118:[131,150],119:[129,82],120:[129,83],121:[129,91],122:[129,66],123:[129,117],124:[129,118],125:[129,65],126:[129,69]},gaiji_1:{31309:[49,48,46],31310:[49,49,46],31311:[49,50,46],31312:[91,72,86,93],31313:[91,83,68,93],31314:[91,130,111,93],31315:[91,130,118,93],31316:[91,77,86,93],31317:[91,142,232,93],31318:[91,142,154,93],31319:[91,145,111,93],31320:[91,131,102,93],31321:[91,130,114,93],31322:[91,147,241,93],31323:[91,145,189,93],31324:[91,137,240,93],31325:[91,83,83,93],31326:[91,130,97,93],31327:[91,130,109,93],31328:[129,161],31329:[129,156],31330:[91,147,86,93],31331:[91,140,240,93],31332:[91,137,102,93],31333:[91,150,179,93],31334:[91,151,191,93],31335:[91,129,69,93],31336:[91,145,79,93],31337:[91,140,227,93],31338:[91,141,196,93],31339:[91,144,86,93],31340:[91,143,137,93],31341:[91,143,73,93],31342:[91,144,182,93],31343:[91,148,204,93],31344:[91,144,186,93],31345:[91,144,129,93],31346:[91,80,80,86,93],31347:[40,148,233,41],31348:[130,217,130,169],31777:[129,168],31778:[129,169],31779:[129,170],31780:[129,171],31781:[129,69],31782:[129,69],31783:[148,78],31784:[140,142],31785:[147,250],31786:[137,126],31787:[109,94,50],31788:[109,94,51],31789:[99,109],31790:[99,109,94,50],31791:[99,109,94,51],31792:[130,79,46],31793:[130,80,46],31794:[130,81,46],31795:[130,82,46],31796:[130,83,46],31797:[130,84,46],31798:[130,85,46],31799:[130,86,46],31800:[130,87,46],31801:[130,88,46],31802:[142,129],31803:[149,155],31804:[140,179],31805:[140,204],31806:[145,79],31807:[140,227],31808:[130,79,44],31809:[130,80,44],31810:[130,81,44],31811:[130,82,44],31812:[130,83,44],31813:[130,84,44],31814:[130,85,44],31815:[130,86,44],31816:[130,87,44],31817:[130,88,44],31818:[91,142,208,93],31819:[91,141,224,93],31820:[91,151,76,93],31821:[91,138,148,93],31822:[91,145,227,93],31823:[40,150,226,41],31824:[129,69],31825:[129,69],31826:[129,69],31827:[129,69],31828:[129,69],31829:[129,69],31830:[129,69],31831:[40,67,68,41],31832:[40,118,110,41],31833:[40,111,98,41],31834:[40,99,98,41],31835:[40,99,101],31836:[109,98,41],31837:[40,104,112,41],31838:[40,98,114,41],31839:[40,130,144,41],31840:[40,130,147,41],31841:[40,109,115,41],31842:[40,130,148,41],31843:[40,98,115,41],31844:[40,130,130,41],31845:[40,116,98,41],31846:[40,116,112,41],31847:[40,100,115,41],31848:[40,97,103,41],31849:[40,101,103,41],31850:[40,118,111,41],31851:[40,102,108,41],31852:[40,107,101],31853:[121,41],31854:[40,115,97],31855:[120,41],31856:[40,115,121],31857:[110,41],31858:[40,111,114],31859:[103,41],31860:[40,112,101],31861:[114,41],31862:[40,130,113,41],31863:[40,130,98,41],31864:[40,226,181,41],31865:[130,99,130,105],31866:[91,137,137,93],31867:[70,97,120],32033:[40,140,142,41],32034:[40,137,206,41],32035:[40,144,133,41],32036:[40,150,216,41],32037:[40,139,224,41],32038:[40,147,121,41],32039:[40,147,250,41],32040:[40,143,106,41],32041:[135,141],32042:[135,142],32043:[135,143],32044:[135,126],32045:[78,111,46],32046:[84,101,108],32047:[40,129,167,41],32048:[40,41,40,41],32049:[91,150,123,93],32050:[91,142,79,93],32051:[91,147,241,93],32052:[91,136,192,93],32053:[91,147,95,93],32054:[91,145,197,93],32055:[91,147,144,93],32056:[91,143,159,93],32057:[91,148,115,93],32058:[91,130,114,93],32059:[91,147,138,93],32060:[91,149,223,93],32061:[91,136,234,93],32062:[91,147,241,93],32063:[91,142,79,93],32064:[91,151,86,93],32065:[91,141,182,93],32066:[91,146,134,93],32067:[91,137,69,93],32068:[91,142,119,93],32069:[91,145,150,93],32070:[91,145,197,93],32071:[108],32072:[107,103],32073:[72,122],32074:[104,97],32075:[107,109],32076:[107,109,94,50],32077:[104,80,97],32078:[129,69],32079:[129,69],32080:[49,47,50],32081:[48,47,51],32082:[49,47,51],32083:[50,47,51],32084:[49,47,52],32085:[51,47,52],32086:[49,47,53],32087:[50,47,53],32088:[51,47,53],32089:[52,47,53],32090:[49,47,54],32091:[53,47,54],32092:[49,47,55],32093:[49,47,56],32094:[49,47,57],32095:[49,47,49,48],32110:[33,33],32111:[33,63],32289:[135,84],32290:[135,85],32291:[135,86],32292:[135,87],32293:[135,88],32294:[135,89],32295:[135,90],32296:[135,91],32297:[135,92],32298:[135,93],32299:[88,73],32300:[88,73,73],32301:[135,80],32302:[135,81],32303:[135,82],32304:[135,83],32305:[40,130,80,41],32306:[40,130,81,41],32307:[40,130,82,41],32308:[40,130,83,41],32309:[40,130,84,41],32310:[40,130,85,41],32311:[40,130,86,41],32312:[40,130,87,41],32313:[40,130,88,41],32314:[40,49,48,41],32315:[40,49,49,41],32316:[40,49,50,41],32317:[40,50,49,41],32318:[40,50,50,41],32319:[40,50,51,41],32320:[40,50,52,41],32321:[40,130,96,41],32322:[40,130,97,41],32323:[40,130,98,41],32324:[40,130,99,41],32325:[40,130,100,41],32326:[40,130,101,41],32327:[40,130,102,41],32328:[40,130,103,41],32329:[40,130,104,41],32330:[40,130,105,41],32331:[40,130,106,41],32332:[40,130,107,41],32333:[40,130,108,41],32334:[40,130,109,41],32335:[40,130,110,41],32336:[40,130,111,41],32337:[40,130,112,41],32338:[40,130,113,41],32339:[40,130,114,41],32340:[40,130,115,41],32341:[40,130,116,41],32342:[40,130,117,41],32343:[40,130,118,41],32344:[40,130,119,41],32345:[40,130,120,41],32346:[40,130,121,41],32347:[40,50,53,41],32348:[40,50,54,41],32349:[40,50,55,41],32350:[40,50,56,41],32351:[40,50,57,41],32352:[40,51,48,41],32353:[135,64],32354:[135,65],32355:[135,66],32356:[135,67],32357:[135,68],32358:[135,69],32359:[135,70],32360:[135,71],32361:[135,72],32362:[135,73],32363:[135,74],32364:[135,75],32365:[135,76],32366:[135,77],32367:[135,78],32368:[135,79],32369:[40,130,80,41],32370:[40,130,81,41],32371:[40,130,82,41],32372:[40,130,83,41],32373:[40,130,84,41],32374:[40,130,85,41],32375:[40,130,86,41],32376:[40,130,87,41],32377:[40,130,88,41],32378:[40,49,48,41],32379:[40,49,49,41],32380:[40,49,50,41],32381:[40,51,49,41]},gaiji_2:{29985:[129,172],29986:[129,172],29987:[129,172],29988:[129,172],29989:[250,113],29990:[250,97],29991:[129,172],29992:[129,172],29993:[129,172],29994:[129,172],29995:[250,138],29996:[129,172],29997:[129,172],29998:[251,165],29999:[129,172],3e4:[129,172],30001:[129,172],30002:[129,172],30003:[250,147],30004:[129,172],30005:[129,172],30006:[129,172],30007:[129,172],30008:[129,172],30009:[129,172],30010:[250,156],30011:[129,172],30012:[129,172],30013:[129,172],30014:[129,172],30015:[250,170],30016:[250,177],30017:[129,172],30018:[129,172],30019:[250,184],30020:[250,103],30021:[250,186],30022:[129,172],30023:[129,172],30024:[250,197],30025:[250,212],30026:[129,172],30027:[143,140],30028:[250,222],30029:[250,102],30030:[129,172],30031:[129,172],30032:[129,172],30033:[129,172],30034:[129,172],30035:[129,172],30036:[139,249],30037:[129,172],30038:[129,172],30039:[129,172],30040:[129,172],30041:[129,172],30042:[129,172],30043:[129,172],30044:[129,172],30045:[129,172],30046:[129,172],30047:[129,172],30048:[129,172],30049:[129,172],30050:[129,172],30051:[129,172],30052:[129,172],30053:[251,87],30054:[251,89],30055:[129,172],30056:[129,172],30057:[129,172],30058:[251,97],30059:[251,98],30060:[129,172],30061:[129,172],30062:[129,172],30063:[251,103],30064:[251,104],30065:[129,172],30066:[129,172],30067:[129,172],30068:[129,172],30069:[129,172],30070:[129,172],30071:[129,172],30072:[129,172],30073:[129,172],30074:[129,172],30075:[139,95],30076:[226,88],30077:[129,172],30078:[129,172],30241:[129,172],30242:[129,172],30243:[129,172],30244:[129,172],30245:[129,172],30246:[129,172],30247:[129,172],30248:[251,145],30249:[129,172],30250:[129,172],30251:[129,172],30252:[129,172],30253:[138,139],30254:[250,96],30255:[150,72],30256:[251,155],30257:[129,172],30258:[144,73],30259:[129,172],30260:[129,172],30261:[251,162],30262:[138,112],30263:[251,170],30264:[129,172],30265:[146,210],30266:[129,172],30267:[129,172],30268:[251,185],30269:[147,65],30270:[129,172],30271:[129,172],30272:[250,95],30273:[251,216],30274:[250,94],30275:[251,232],30276:[129,172],30277:[233,76],30278:[129,172],30279:[251,252],30280:[142,73],30281:[129,172],30282:[129,172],30283:[129,172]},gaiji_1_unicode:{31265:"⛌",31266:"⛍",31267:"❗",31268:"⛏",31269:"⛐",31270:"⛑",31272:"⛒",31273:"⛕",31274:"⛓",31275:"⛔",31280:"🅿",31281:"🆊",31284:"⛖",31285:"⛗",31286:"⛘",31287:"⛙",31288:"⛚",31289:"⛛",31290:"⛜",31291:"⛝",31292:"⛞",31293:"⛟",31294:"⛠",31295:"⛡",31296:"⭕",31297:"㉈",31298:"㉉",31299:"㉊",31300:"㉋",31301:"㉌",31302:"㉍",31303:"㉎",31304:"㉏",31309:"⒑",31310:"⒒",31311:"⒓",31312:"🅊",31313:"🅌",31314:"🄿",31315:"🅆",31316:"🅋",31317:"🈐",31318:"🈑",31319:"🈒",31320:"🈓",31321:"🅂",31322:"🈔",31323:"🈕",31324:"🈖",31325:"🅍",31326:"🄱",31327:"🄽",31328:"⬛",31329:"⬤",31330:"🈗",31331:"🈘",31332:"🈙",31333:"🈚",31334:"🈛",31335:"⚿",31336:"🈜",31337:"🈝",31338:"🈞",31339:"🈟",31340:"🈠",31341:"🈡",31342:"🈢",31343:"🈣",31344:"🈤",31345:"🈥",31346:"🅎",31347:"㊙",31348:"🈀",31521:"⛣",31522:"⭖",31523:"⭗",31524:"⭘",31525:"⭙",31526:"☓",31527:"㊋",31528:"〒",31529:"⛨",31530:"㉆",31531:"㉅",31532:"⛩",31533:"࿖",31534:"⛪",31535:"⛫",31536:"⛬",31537:"♨",31538:"⛭",31539:"⛮",31540:"⛯",31541:"⚓",31542:"✈",31543:"⛰",31544:"⛱",31545:"⛲",31546:"⛳",31547:"⛴",31548:"⛵",31549:"🅗",31550:"Ⓓ",31551:"Ⓢ",31552:"⛶",31553:"🅟",31554:"🆋",31555:"🆍",31556:"🆌",31557:"🅹",31558:"⛷",31559:"⛸",31560:"⛹",31561:"⛺",31562:"🅻",31563:"☎",31564:"⛻",31565:"⛼",31566:"⛽",31567:"⛾",31568:"🅼",31569:"⛿",31777:"➡",31778:"⬅",31779:"⬆",31780:"⬇",31781:"⬯",31782:"⬮",31783:"年",31784:"月",31785:"日",31786:"円",31787:"㎡",31788:"㎥",31789:"㎝",31790:"㎠",31791:"㎤",31792:"🄀",31793:"⒈",31794:"⒉",31795:"⒊",31796:"⒋",31797:"⒌",31798:"⒍",31799:"⒎",31800:"⒏",31801:"⒐",31802:"",31803:"",31804:"",31805:"",31806:"",31807:"",31808:"🄁",31809:"🄂",31810:"🄃",31811:"🄄",31812:"🄅",31813:"🄆",31814:"🄇",31815:"🄈",31816:"🄉",31817:"🄊",31818:"㈳",31819:"㈶",31820:"㈲",31821:"㈱",31822:"㈹",31823:"㉄",31824:"▶",31825:"◀",31826:"〖",31827:"〗",31828:"⟐",31829:"²",31830:"³",31831:"🄭",31832:"",31833:"",31834:"",31835:"",31836:"",31837:"",31838:"",31839:"",31840:"",31841:"",31842:"",31843:"",31844:"",31845:"",31846:"",31847:"",31848:"",31849:"",31850:"",31851:"",31852:"",31853:"",31854:"",31855:"",31856:"",31857:"",31858:"",31859:"",31860:"",31861:"",31862:"🄬",31863:"🄫",31864:"㉇",31865:"🆐",31866:"🈦",31867:"℻",32033:"㈪",32034:"㈫",32035:"㈬",32036:"㈭",32037:"㈮",32038:"㈯",32039:"㈰",32040:"㈷",32041:"㍾",32042:"㍽",32043:"㍼",32044:"㍻",32045:"№",32046:"℡",32047:"〶",32048:"⚾",32049:"🉀",32050:"🉁",32051:"🉂",32052:"🉃",32053:"🉄",32054:"🉅",32055:"🉆",32056:"🉇",32057:"🉈",32058:"🄪",32059:"🈧",32060:"🈨",32061:"🈩",32062:"🈔",32063:"🈪",32064:"🈫",32065:"🈬",32066:"🈭",32067:"🈮",32068:"🈯",32069:"🈰",32070:"🈱",32071:"ℓ",32072:"㎏",32073:"㎐",32074:"㏊",32075:"㎞",32076:"㎢",32077:"㍱",32080:"½",32081:"↉",32082:"⅓",32083:"⅔",32084:"¼",32085:"¾",32086:"⅕",32087:"⅖",32088:"⅗",32089:"⅘",32090:"⅙",32091:"⅚",32092:"⅐",32093:"⅛",32094:"⅑",32095:"⅒",32096:"☀",32097:"☁",32098:"☂",32099:"⛄",32100:"☖",32101:"☗",32102:"⛉",32103:"⛊",32104:"♦",32105:"♥",32106:"♣",32107:"♠",32108:"⛋",32109:"⨀",32110:"‼",32111:"⁉",32112:"⛅",32113:"☔",32114:"⛆",32115:"☃",32116:"⛇",32117:"⚡",32118:"⛈",32120:"⚞",32121:"⚟",32122:"♬",32123:"☎",32289:"Ⅰ",32290:"Ⅱ",32291:"Ⅲ",32292:"Ⅳ",32293:"Ⅴ",32294:"Ⅵ",32295:"Ⅶ",32296:"Ⅷ",32297:"Ⅸ",32298:"Ⅹ",32299:"Ⅺ",32300:"Ⅻ",32301:"⑰",32302:"⑱",32303:"⑲",32304:"⑳",32305:"⑴",32306:"⑵",32307:"⑶",32308:"⑷",32309:"⑸",32310:"⑹",32311:"⑺",32312:"⑻",32313:"⑼",32314:"⑽",32315:"⑾",32316:"⑿",32317:"㉑",32318:"㉒",32319:"㉓",32320:"㉔",32321:"🄐",32322:"🄑",32323:"🄒",32324:"🄓",32325:"🄔",32326:"🄕",32327:"🄖",32328:"🄗",32329:"🄘",32330:"🄙",32331:"🄚",32332:"🄛",32333:"🄜",32334:"🄝",32335:"🄞",32336:"🄟",32337:"🄠",32338:"🄡",32339:"🄢",32340:"🄣",32341:"🄤",32342:"🄥",32343:"🄦",32344:"🄧",32345:"🄨",32346:"🄩",32347:"㉕",32348:"㉖",32349:"㉗",32350:"㉘",32351:"㉙",32352:"㉚",32353:"①",32354:"②",32355:"③",32356:"④",32357:"⑤",32358:"⑥",32359:"⑦",32360:"⑧",32361:"⑨",32362:"⑩",32363:"⑪",32364:"⑫",32365:"⑬",32366:"⑭",32367:"⑮",32368:"⑯",32369:"❶",32370:"❷",32371:"❸",32372:"❹",32373:"❺",32374:"❻",32375:"❼",32376:"❽",32377:"❾",32378:"❿",32379:"⓫",32380:"⓬",32381:"㉛"},gaiji_2_unicode:{29985:"㐂",29986:"𠅘",29987:"份",29988:"仿",29989:"侚",29990:"俉",29991:"傜",29992:"儞",29993:"冼",29994:"㔟",29995:"匇",29996:"卡",29997:"卬",29998:"詹",29999:"𠮷",3e4:"呍",30001:"咖",30002:"咜",30003:"咩",30004:"唎",30005:"啊",30006:"噲",30007:"囤",30008:"圳",30009:"圴",30010:"塚",30011:"墀",30012:"姤",30013:"娣",30014:"婕",30015:"寬",30016:"﨑",30017:"㟢",30018:"庬",30019:"弴",30020:"彅",30021:"德",30022:"怗",30023:"恵",30024:"愰",30025:"昤",30026:"曈",30027:"曙",30028:"曺",30029:"曻",30030:"桒",30031:"鿄",30032:"椑",30033:"椻",30034:"橅",30035:"檑",30036:"櫛",30037:"𣏌",30038:"𣏾",30039:"𣗄",30040:"毱",30041:"泠",30042:"洮",30043:"海",30044:"涿",30045:"淊",30046:"淸",30047:"渚",30048:"潞",30049:"濹",30050:"灤",30051:"𤋮",30052:"𤋮",30053:"煇",30054:"燁",30055:"爀",30056:"玟",30057:"玨",30058:"珉",30059:"珖",30060:"琛",30061:"琡",30062:"琢",30063:"琦",30064:"琪",30065:"琬",30066:"琹",30067:"瑋",30068:"㻚",30069:"畵",30070:"疁",30071:"睲",30072:"䂓",30073:"磈",30074:"磠",30075:"祇",30076:"禮",30077:"鿆",30078:"䄃",30241:"鿅",30242:"秚",30243:"稞",30244:"筿",30245:"簱",30246:"䉤",30247:"綋",30248:"羡",30249:"脘",30250:"脺",30251:"舘",30252:"芮",30253:"葛",30254:"蓜",30255:"蓬",30256:"蕙",30257:"藎",30258:"蝕",30259:"蟬",30260:"蠋",30261:"裵",30262:"角",30263:"諶",30264:"跎",30265:"辻",30266:"迶",30267:"郝",30268:"鄧",30269:"鄭",30270:"醲",30271:"鈳",30272:"銈",30273:"錡",30274:"鍈",30275:"閒",30276:"雞",30277:"餃",30278:"饀",30279:"髙",30280:"鯖",30281:"鷗",30282:"麴",30283:"麵"}}},3170:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.calcToBuffer=l.pngCalc=l.calc=void 0;const p=c(8764),r=c(9562);l.calc=function(i){let t=-1,n=0;const a=i.length;for(;n>>24^i[n++]];return t},l.pngCalc=function(i){let t=-1,n=0;const a=i.length;for(;n>>8^r.pngCrc32Table[255&t^i[n++]];return~t},l.calcToBuffer=function(i){let t=p.Buffer.alloc(4);return t.writeInt32BE((0,l.calc)(i),0),t}},9562:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.pngCrc32Table=l.crc32Table=void 0,l.crc32Table=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188],l.pngCrc32Table=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]},9829:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i.logo_type=r.uimsbf(8),r.next(7),i.logo_id=r.uimsbf(9),r.next(4),i.logo_version=r.uimsbf(12),i.data_size=r.uimsbf(16),i.data_byte=r.readBytes(i.data_size),i}}},5074:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i.number_of_loop=r.uimsbf(8),i.common_tables=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0}),l.TsDataModuleCdtLogo=l.TsDataModuleLogo=l.TsDataModuleKeywordTable=l.TsDataModuleCommonTable=void 0;const p=c(5074);l.TsDataModuleCommonTable=p.default;const r=c(364);l.TsDataModuleKeywordTable=r.default;const i=c(7336);l.TsDataModuleLogo=i.default;const t=c(9829);l.TsDataModuleCdtLogo=t.default},364:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i.number_of_loop=r.uimsbf(8),i.keyword_tables=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i.logo_type=r.uimsbf(8),i.number_of_loop=r.uimsbf(16),i.logos=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0}),l.default=class{constructor(c){we(this,"buffer");this.buffer=c}decode(){const[c,p,r]=this.decodeDate(),[i,t,n]=this.decodeTime(),a=new Date(c,p-1,r,i,t,n),o=a.getTime(),d=60*a.getTimezoneOffset()*1e3;return new Date(o-d-324e5)}decodeDate(){const c=this.buffer.length===2?this.buffer:this.buffer.slice(0,2),p=c[0]<<8|c[1];let r=(p-15078.2)/365.25|0,i=(p-14956.1-(365.25*r|0))/30.6001|0;const t=p-14956-(365.25*r|0)-(30.6001*i|0),n=i===14||i===15?1:0;return r=r+n+1900,i=i-1-12*n,[r,i,t]}decodeTime(){const c=this.buffer.length===3?this.buffer:this.buffer.slice(2);return[10*(c[0]>>4)+(15&c[0]),10*(c[1]>>4)+(15&c[1]),10*(c[2]>>4)+(15&c[2])]}decodeOffset(){return[10*(this.buffer[0]>>4)+(15&this.buffer[0]),10*(this.buffer[1]>>4)+(15&this.buffer[1])]}}},8451:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CA_system_id=r.uimsbf(16),i.transmission_type=r.bslbf(3),i.PID=r.uimsbf(13),i.private_data_byte=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},3534:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.extention_descriptor_tag=r.uimsbf(8),i.PLP_ID=r.uimsbf(8),i.effective_symbol_length=r.uimsbf(3),i.guard_interval=r.uimsbf(3),i.bundled_channel=r.uimsbf(8),r.next(2),i.frequencies=[];r.position>>3<2+i.descriptor_length;){let t={};t.data_slice_id=r.uimsbf(8),t.tune_freq=r.uimsbf(32),t.tune_freq_type=r.uimsbf(2),t.FEC_outer=r.uimsbf(4),t.modulation=r.uimsbf(8),t.FEC_inner=r.uimsbf(4),r.next(6),i.frequencies.push(t)}return i}}},4208:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.num_of_station_point=r.uimsbf(8),i.station_points=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(4),i.stream_content=r.uimsbf(4),i.component_type=r.uimsbf(8),i.component_tag=r.uimsbf(8),i.stream_type=r.uimsbf(8),i.simulcast_group_tag=r.bslbf(8),i.ES_multi_lingual_flag=r.bslbf(1),i.main_component_flag=r.bslbf(1),i.quality_indicator=r.bslbf(2),i.sampling_rate=r.uimsbf(3),r.next(1),i.ISO_639_language_code=r.readBytes(3),i.ES_multi_lingual_flag===1&&(i.ISO_639_language_code_2=r.readBytes(3)),i.text_char=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},5141:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.free_format_flag=r.bslbf(1),i.ID=r.bslbf(1),i.layer=r.bslbf(2),i.variable_rate_audio_indicator=r.bslbf(1),r.next(3),i}}},5794:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(4),i.segmentation_mode=r.uimsbf(4),i.segmentation_info_length=r.uimsbf(8),i.segmentation_mode===0||(i.segmentation_mode===1?(r.next(7),i.start_time_NPT=r.uimsbf(33),r.next(7),i.end_time_NPT=r.uimsbf(33)):i.segmentation_mode<6?(i.start_time=r.uimsbf(24),i.duration=r.uimsbf(24),i.segmentation_info_length===10&&(i.start_time_extension=r.uimsbf(12),r.next(4),i.duration_extension=r.uimsbf(12),r.next(4))):r.next(i.segmentation_info_length<<3)),i.component_tags=[];r.position>>3<2+i.descriptor_length;){let t={};t.component_tag=r.uimsbf(8),i.component_tags.push(t)}return i}}},5066:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.title_length=r.uimsbf(8),i.title_char=r.readBytes(i.title_length),i.text_length=r.uimsbf(8),i.text_char=r.readBytes(i.text_length),i}}},7286:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.bouquet_name_char=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},2100:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.char=r.readBytes(i.descriptor_length),i}}},7841:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CA_system_id=r.uimsbf(16),i.CA_unit_id=r.uimsbf(4),i.num_of_component=r.uimsbf(4),i.components=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CA_system_id=r.uimsbf(16),i.transport_stream_id=r.uimsbf(16),i.original_network_id=r.uimsbf(16),i.power_supply_period=r.uimsbf(8),i}}},3152:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CAs=[];r.position>>3<2+i.descriptor_length;){let t={};t.CA_system_id=r.uimsbf(16),i.CAs.push(t)}return i}}},5565:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CA_system_id=r.uimsbf(16),i.ca_broadcaster_group_id=r.uimsbf(8),i.message_control=r.uimsbf(8),i.services=[];r.position>>3<2+i.descriptor_length;){let t={};t.service_id=r.uimsbf(16),i.services.push(t)}return i}}},2283:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CA_system_ID=r.uimsbf(16),r.next(3),i.CA_program_ID=r.uimsbf(13),i.second_load_flag=r.bslbf(1),i.load_indicator=r.bslbf(7),i.second_load_flag===1&&(r.next(3),i.CA_program_ID=r.uimsbf(13),r.next(1),i.load_indicator=r.bslbf(7)),i.exclusion_ID_num=r.uimsbf(8),i.exclusion_ID=[];for(let t=0;t>3)),i}}},9561:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.frequency=r.bslbf(32),r.next(8),i.frame_type=r.bslbf(4),i.FEC_outer=r.bslbf(4),i.modulation=r.bslbf(8),i.symbol_rate=r.bslbf(28),i.FEC_inner=r.bslbf(4),i}}},723:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.frequency=r.bslbf(32),r.next(8),i.frame_type=r.bslbf(4),i.FEC_outer=r.bslbf(4),i.modulation=r.bslbf(8),i.symbol_rate=r.bslbf(28),i.FEC_inner=r.bslbf(4),i.carrier_group_id=r.bslbf(8),i}}},5222:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.frequencies=[];r.position>>3<2+i.descriptor_length;){let t={};t.frequency=r.uimsbf(32),r.next(7),t.future_use_flag=r.bslbf(1),t.multiplex_frame_format_number=r.uimsbf(4),t.FEC_outer=r.uimsbf(4),t.modulation=r.uimsbf(8),t.symbol_rate=r.uimsbf(28),r.next(4),t.future_use_flag===0&&(t.future_use_data_length=r.uimsbf(8),t.future_use_data=r.readBytes(t.future_use_data_length)),t.num_of_services=r.uimsbf(28),t.services=[];for(let n=0;n{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946),r=c(9235);l.default=class{constructor(i){we(this,"buffer");this.buffer=i}decode(){let i=new p.default(this.buffer),t={};return t._raw=this.buffer,t.descriptor_tag=i.uimsbf(8),t.descriptor_length=i.uimsbf(8),t.sub_descriptors=new r.default(i.readBytesRaw(2+t.descriptor_length-(i.position>>3))).decode(),t}}},5571:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.compatibilityDescriptorLength=r.uimsbf(16),i.descriptorCount=r.uimsbf(16),i.descriptors=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(4),i.stream_content=r.uimsbf(4),i.component_type=r.uimsbf(8),i.component_tag=r.uimsbf(8),i.ISO_639_language_code=r.readBytes(3),i.text_char=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},9505:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.component_group_type=r.uimsbf(3),i.total_bit_rate_flag=r.uimsbf(1),i.num_of_group=r.uimsbf(4),i.groups=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CA_system_ID=r.uimsbf(16),r.next(3),i.CA_PID=r.uimsbf(13),i.private_data_byte=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},3336:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.conditional_playback_id=r.uimsbf(16),r.next(3),i.conditional_playback_PID=r.uimsbf(13),i}}},4117:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.connected_transmission_group_id=r.uimsbf(16),i.segment_type=r.bslbf(2),i.modulation_type_A=r.bslbf(2),i.modulation_type_B=r.bslbf(2),i.modulation_type_C=r.bslbf(2),i.additional_connected_transmission_info=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},9029:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.contents=[];r.position>>3<2+i.descriptor_length;){let t={};t.content_nibble_level_1=r.uimsbf(4),t.content_nibble_level_2=r.uimsbf(4),t.user_nibble_1=r.uimsbf(4),t.user_nibble_2=r.uimsbf(4),i.contents.push(t)}return i}}},343:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(1),i.copy_restriction_mode=r.bslbf(1),i.image_constraint_token=r.bslbf(1),i.retention_mode=r.bslbf(1),i.retention_state=r.bslbf(3),i.encryption_mode=r.bslbf(1),i}}},2399:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.copyright_identifier=r.readBytes(4),i.additional_copyright_info=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},6221:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.country_availability_flag=r.bslbf(1),r.next(7),i.country_availabilities=[];r.position>>3<2+i.descriptor_length;){let t={};t.country_code=r.readBytes(3),i.country_availabilities.push(t)}return i}}},6172:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.data_broadcast_id=r.uimsbf(16),i.id_selector_byte=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},4413:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.data_component_id=r.uimsbf(16),i.additional_data_component_info=r.readBytes(i.descriptor_length-2),i}}},971:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.data_component_id=r.uimsbf(16),i.entry_component=r.uimsbf(8),i.selector_length=r.uimsbf(8),i.selector_byte=r.readBytes(i.selector_length),i.num_of_component_ref=r.uimsbf(8),i.component_ref=r.readBytes(i.num_of_component_ref),i.ISO_639_language_code=r.readBytes(3),i.text_length=r.uimsbf(8),i.text_char=r.readBytes(i.text_length),i}}},1709:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.alignment_type=r.uimsbf(8),i}}},1018:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};if(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.digital_recording_control_data=r.bslbf(2),i.maximum_bitrate_flag=r.bslbf(1),i.component_control_flag=r.bslbf(1),i.user_defined=r.bslbf(4),i.maximum_bitrate_flag===1&&(i.maximum_bitrate=r.uimsbf(8)),i.component_control_flag===1){i.component_control_length=r.uimsbf(8),i.component_controls=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.DL_system_ID=r.uimsbf(8),r.next(3),i.PID=r.uimsbf(13),i.encrypt_protocol_number=r.uimsbf(8),i.encrypt_info=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},928:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946),r=c(5571),i=c(9235);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){let t=new p.default(this.buffer),n={};if(n._raw=this.buffer,n.descriptor_tag=t.uimsbf(8),n.descriptor_length=t.uimsbf(8),n.reboot=t.bslbf(1),n.add_on=t.bslbf(1),n.compatibility_flag=t.bslbf(1),n.module_info_flag=t.bslbf(1),n.text_info_flag=t.bslbf(1),t.next(3),n.component_size=t.uimsbf(32),n.download_id=t.uimsbf(32),n.time_out_value_DII=t.uimsbf(32),n.leak_rate=t.uimsbf(22),t.next(2),n.component_tag=t.uimsbf(8),n.compatibility_flag===1){let a=t.buffer[t.position>>3]<<8|t.buffer[1+(t.position>>3)];n.compatibilityDescriptor=new r.default(t.readBytesRaw(2+a)).decode()}if(n.module_info_flag===1){n.num_of_modules=t.uimsbf(16),n.modules=[];for(let a=0;a{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.services=[];r.position>>3<2+i.descriptor_length;){let t={};t.service_id=r.uimsbf(16),t.start_end_flag=r.bslbf(1),t.signal_level=r.bslbf(1),r.next(6),t.area_code_length=r.uimsbf(8),t.area_codes=[];for(let n=(r.position>>3)+i.area_code_length;r.position>>3{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.group_type=r.uimsbf(4),i.event_count=r.uimsbf(4),i.events=[];for(let t=0;t>3<2+i.descriptor_length;){let t={};t.original_network_id=r.uimsbf(16),t.transport_stream_id=r.uimsbf(16),t.service_id=r.uimsbf(16),t.event_id=r.uimsbf(16),i.other_network_events.push(t)}else i.private_data_byte=r.readBytes(2+i.descriptor_length-(r.position>>3));return i}}},7263:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};if(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.broadcaster_type=r.uimsbf(4),r.next(4),i.broadcaster_type===1){i.terrestrial_broadcaster_id=r.uimsbf(16),i.number_of_affiliation_id_loop=r.uimsbf(4),i.number_of_broadcaster_id_loop=r.uimsbf(4),i.affiliations=[],i.broadcasters=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.descriptor_number=r.uimsbf(4),i.last_descriptor_number=r.uimsbf(4),i.ISO_639_language_code=r.readBytes(3),i.length_of_items=r.uimsbf(8),i.items=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(7),i.quality_level=r.bslbf(1),r.next(3),i.reference_PID=r.uimsbf(13),i}}},263:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(1),i.temporal_scalability_flag=r.bslbf(1),i.spatial_scalability_flag=r.bslbf(1),i.quality_scalability_flag=r.bslbf(1),i.hierarchy_type=r.uimsbf(4),r.next(2),i.hierarchy_layer_index=r.uimsbf(6),i.tref_present_flag=r.bslbf(1),r.next(1),i.hierarchy_embedded_layer_index=r.uimsbf(6),r.next(2),i.hierarchy_channel=r.uimsbf(6),i}}},1661:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.has_location=r.bslbf(1),i.location_type=r.bslbf(1),i.format=r.uimsbf(4),r.next(2),i.has_location&&(i.location_type===0?(i.component_tag=r.uimsbf(8),i.module_id=r.uimsbf(16)):(i.URL_length=r.uimsbf(8),i.URL_byte=r.readBytes(i.URL_length))),i}}},5234:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.hyper_linkage_type=r.uimsbf(8),i.link_destination_type=r.uimsbf(8),i.selector_length=r.uimsbf(8),i.selector=r.readBytes(i.selector_length),i.private_data=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},7331:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.closed_gop_flag=r.uimsbf(1),i.identical_gop_flag=r.uimsbf(1),i.max_gop_length=r.uimsbf(14),i}}},9073:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TsDescriptorDataContent=l.TsDescriptorTargetRegion=l.TsDescriptorHyperlink=l.TsDescriptorAudioComponent=l.TsDescriptorPartialTransportStreamTime=l.TsDescriptorNetworkIdentification=l.TsDescriptorDigitalCopyControl=l.TsDescriptorHierarchicalTransmission=l.TsDescriptorHybridInformation=l.TsDescriptorMaterialInformation=l.TsDescriptorDataBroadcastId=l.TsDescriptorPartialTransportStream=l.TsDescriptorLocalTimeOffset=l.TsDescriptorParentalRating=l.TsDescriptorContent=l.TsDescriptorCaIdentifier=l.TsDescriptorStreamIdentifier=l.TsDescriptorMosaic=l.TsDescriptorComponent=l.TsDescriptorTimeShiftedEvent=l.TsDescriptorExtendedEvent=l.TsDescriptorShortEvent=l.TsDescriptorTimeShiftedService=l.TsDescriptorNearVideoOnDemandReference=l.TsDescriptorLinkage=l.TsDescriptorCountryAvailability=l.TsDescriptorService=l.TsDescriptorBouquetName=l.TsDescriptorCableDeliverySystem=l.TsDescriptorSatelliteDeliverySystem=l.TsDescriptorStuffing=l.TsDescriptorServiceList=l.TsDescriptorNetworkName=l.TsDescriptorIbp=l.TsDescriptorStd=l.TsDescriptorSmoothingBuffer=l.TsDescriptorPrivateDataIndicator=l.TsDescriptorCopyright=l.TsDescriptorMultiplexBufferUtilization=l.TsDescriptorSystemClock=l.TsDescriptorIso639Language=l.TsDescriptorConditionalAccess=l.TsDescriptorVideoWindow=l.TsDescriptorTargetBackgroundGrid=l.TsDescriptorDataStreamAlignment=l.TsDescriptorRegistration=l.TsDescriptorHierarchy=l.TsDescriptorAudioStream=l.TsDescriptorVideoStream=l.TsDescriptorUnknown=void 0,l.TsDescriptorSystemManagement=l.TsDescriptorDataComponent=l.TsDescriptorEmergencyInformation=l.TsDescriptorPartialReception=l.TsDescriptorTerrestrialDeliverySystem=l.TsDescriptorCableTsDivisionSystem=l.TsDescriptorConditionalPlayback=l.TsDescriptorCarouselCompatibleComposite=l.TsDescriptorAccessControl=l.TsDescriptorScrambleSystem=l.TsDescriptorAdvancedCableDeliverySystem=l.TsDescriptorCableMulticarrierTransmissionDeliverySystem=l.TsDescriptorCaStartup=l.TsDescriptorDlProtection=l.TsDescriptorNetworkDownloadContent=l.TsDescriptorAreaBroadcastingInformation=l.TsDescriptorServiceGroup=l.TsDescriptorContentAvailability=l.TsDescriptorConnectedTransmission=l.TsDescriptorLdtLinkage=l.TsDescriptorBoardInformation=l.TsDescriptorSiPrimeTs=l.TsDescriptorComponentGroup=l.TsDescriptorBroadcasterName=l.TsDescriptorSiParameter=l.TsDescriptorEventGroup=l.TsDescriptorSeries=l.TsDescriptorStcReference=l.TsDescriptorShortNodeInformation=l.TsDescriptorNodeRelation=l.TsDescriptorReference=l.TsDescriptorBasicLocalEvent=l.TsDescriptorLogoTransmission=l.TsDescriptorExtendedBroadcaster=l.TsDescriptorTsInformation=l.TsDescriptorCaService=l.TsDescriptorCaContractInfo=l.TsDescriptorCaEmmTs=l.TsDescriptorDownloadContent=l.TsDescriptorVideoDecodeControl=void 0;const p=c(7801);l.TsDescriptorUnknown=p.default;const r=c(56);l.TsDescriptorVideoStream=r.default;const i=c(5141);l.TsDescriptorAudioStream=i.default;const t=c(263);l.TsDescriptorHierarchy=t.default;const n=c(1115);l.TsDescriptorRegistration=n.default;const a=c(1709);l.TsDescriptorDataStreamAlignment=a.default;const o=c(355);l.TsDescriptorTargetBackgroundGrid=o.default;const d=c(1779);l.TsDescriptorVideoWindow=d.default;const g=c(4201);l.TsDescriptorConditionalAccess=g.default;const m=c(6413);l.TsDescriptorIso639Language=m.default;const v=c(6986);l.TsDescriptorSystemClock=v.default;const b=c(9190);l.TsDescriptorMultiplexBufferUtilization=b.default;const w=c(2399);l.TsDescriptorCopyright=w.default;const C=c(7251);l.TsDescriptorPrivateDataIndicator=C.default;const D=c(7600);l.TsDescriptorSmoothingBuffer=D.default;const R=c(3437);l.TsDescriptorStd=R.default;const T=c(7331);l.TsDescriptorIbp=T.default;const P=c(1885);l.TsDescriptorNetworkName=P.default;const L=c(2645);l.TsDescriptorServiceList=L.default;const I=c(5189);l.TsDescriptorStuffing=I.default;const x=c(181);l.TsDescriptorSatelliteDeliverySystem=x.default;const O=c(9561);l.TsDescriptorCableDeliverySystem=O.default;const G=c(7286);l.TsDescriptorBouquetName=G.default;const J=c(2761);l.TsDescriptorService=J.default;const te=c(6221);l.TsDescriptorCountryAvailability=te.default;const le=c(6559);l.TsDescriptorLinkage=le.default;const ne=c(923);l.TsDescriptorNearVideoOnDemandReference=ne.default;const ee=c(5636);l.TsDescriptorTimeShiftedService=ee.default;const M=c(2703);l.TsDescriptorShortEvent=M.default;const Y=c(8529);l.TsDescriptorExtendedEvent=Y.default;const j=c(1768);l.TsDescriptorTimeShiftedEvent=j.default;const z=c(3691);l.TsDescriptorComponent=z.default;const q=c(9255);l.TsDescriptorMosaic=q.default;const Z=c(6137);l.TsDescriptorStreamIdentifier=Z.default;const X=c(3152);l.TsDescriptorCaIdentifier=X.default;const oe=c(9029);l.TsDescriptorContent=oe.default;const he=c(4385);l.TsDescriptorParentalRating=he.default;const ie=c(1216);l.TsDescriptorLocalTimeOffset=ie.default;const fe=c(6546);l.TsDescriptorPartialTransportStream=fe.default;const se=c(6172);l.TsDescriptorDataBroadcastId=se.default;const Ee=c(3529);l.TsDescriptorMaterialInformation=Ee.default;const He=c(1661);l.TsDescriptorHybridInformation=He.default;const Ie=c(3494);l.TsDescriptorHierarchicalTransmission=Ie.default;const at=c(1018);l.TsDescriptorDigitalCopyControl=at.default;const je=c(8286);l.TsDescriptorNetworkIdentification=je.default;const ht=c(8857);l.TsDescriptorPartialTransportStreamTime=ht.default;const _e=c(7602);l.TsDescriptorAudioComponent=_e.default;const Oe=c(5234);l.TsDescriptorHyperlink=Oe.default;const pt=c(9937);l.TsDescriptorTargetRegion=pt.default;const vt=c(971);l.TsDescriptorDataContent=vt.default;const tt=c(6412);l.TsDescriptorVideoDecodeControl=tt.default;const pe=c(928);l.TsDescriptorDownloadContent=pe.default;const ue=c(4775);l.TsDescriptorCaEmmTs=ue.default;const W=c(7841);l.TsDescriptorCaContractInfo=W.default;const ke=c(5565);l.TsDescriptorCaService=ke.default;const Ae=c(4464);l.TsDescriptorTsInformation=Ae.default;const Ye=c(7263);l.TsDescriptorExtendedBroadcaster=Ye.default;const lt=c(4883);l.TsDescriptorLogoTransmission=lt.default;const mt=c(5794);l.TsDescriptorBasicLocalEvent=mt.default;const Ue=c(5257);l.TsDescriptorReference=Ue.default;const Ve=c(4154);l.TsDescriptorNodeRelation=Ve.default;const De=c(3835);l.TsDescriptorShortNodeInformation=De.default;const Re=c(270);l.TsDescriptorStcReference=Re.default;const ut=c(2763);l.TsDescriptorSeries=ut.default;const gt=c(7055);l.TsDescriptorEventGroup=gt.default;const Ce=c(7178);l.TsDescriptorSiParameter=Ce.default;const ze=c(2100);l.TsDescriptorBroadcasterName=ze.default;const At=c(9505);l.TsDescriptorComponentGroup=At.default;const Je=c(1514);l.TsDescriptorSiPrimeTs=Je.default;const $e=c(5066);l.TsDescriptorBoardInformation=$e.default;const Be=c(9098);l.TsDescriptorLdtLinkage=Be.default;const it=c(4117);l.TsDescriptorConnectedTransmission=it.default;const Ne=c(343);l.TsDescriptorContentAvailability=Ne.default;const Qe=c(3992);l.TsDescriptorServiceGroup=Qe.default;const Me=c(4208);l.TsDescriptorAreaBroadcastingInformation=Me.default;const Se=c(9821);l.TsDescriptorNetworkDownloadContent=Se.default;const K=c(8737);l.TsDescriptorDlProtection=K.default;const xe=c(2283);l.TsDescriptorCaStartup=xe.default;const be=c(723);l.TsDescriptorCableMulticarrierTransmissionDeliverySystem=be.default;const Te=c(3534);l.TsDescriptorAdvancedCableDeliverySystem=Te.default;const V=c(8345);l.TsDescriptorScrambleSystem=V.default;const N=c(8451);l.TsDescriptorAccessControl=N.default;const S=c(2955);l.TsDescriptorCarouselCompatibleComposite=S.default;const F=c(3336);l.TsDescriptorConditionalPlayback=F.default;const re=c(5222);l.TsDescriptorCableTsDivisionSystem=re.default;const ce=c(9219);l.TsDescriptorTerrestrialDeliverySystem=ce.default;const me=c(6566);l.TsDescriptorPartialReception=me.default;const ye=c(1602);l.TsDescriptorEmergencyInformation=ye.default;const Pe=c(4413);l.TsDescriptorDataComponent=Pe.default;const We=c(5506);l.TsDescriptorSystemManagement=We.default},6413:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.ISO_639_languages=[];r.position>>3<2+i.descriptor_length;){let t={};t.ISO_639_language_code=r.readBytes(3),t.audio_type=r.bslbf(8),i.ISO_639_languages.push(t)}return i}}},9098:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.original_service_id=r.uimsbf(16),i.transport_stream_id=r.uimsbf(16),i.original_network_id=r.uimsbf(16),i.descriptions=[];r.position>>3<2+i.descriptor_length;){let t={};t.description_id=r.uimsbf(16),r.uimsbf(4),t.description_type=r.uimsbf(4),t.user_defined=r.bslbf(8),i.descriptions.push(t)}return i}}},6559:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.transport_stream_id=r.uimsbf(16),i.original_network_id=r.uimsbf(16),i.service_id=r.bslbf(16),i.linkage_type=r.uimsbf(8),i.private_data_byte=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},1216:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.local_time_offsets=[];r.position>>3<2+i.descriptor_length;){let t={};t.country_code=r.readBytes(3),t.country_region_id=r.bslbf(6),r.next(1),t.local_time_offset_polarity=r.bslbf(1),t.local_time_offset=r.readBytes(2),t.time_of_change=r.readBytes(5),t.next_time_offset=r.readBytes(2),i.local_time_offsets.push(t)}return i}}},4883:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.logo_transmission_type=r.uimsbf(8),i.logo_transmission_type===1?(r.next(7),i.logo_id=r.uimsbf(9),r.next(4),i.logo_version=r.uimsbf(12),i.download_data_id=r.uimsbf(16)):i.logo_transmission_type===2?(r.next(7),i.logo_id=r.uimsbf(9)):i.logo_transmission_type===3&&(i.logo_char=r.readBytes(2+i.descriptor_length-(r.position>>3))),i}}},3529:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.descriptor_number=r.uimsbf(4),i.last_descriptor_number=r.uimsbf(4),i.number_of_material_set=r.uimsbf(8),i.material_sets=[];r.position>>3<2+i.descriptor_length;){let t={};t.material_type=r.uimsbf(8),t.material_name_length=r.uimsbf(8),t.material_name_char=r.readBytes(t.material_name_length),t.material_code_type=r.uimsbf(8),t.material_code_length=r.uimsbf(8),t.material_code_char=r.readBytes(t.material_code_length),t.material_period_flag=r.bslbf(1),r.next(7),t.material_period_flag===1&&(t.material_period=r.readBytes(3)),t.material_url_type=r.uimsbf(8),t.material_url_length=r.uimsbf(8),t.material_url_char=r.readBytes(t.material_url_length),t.reserved_future_use_length=r.uimsbf(8),r.next(8*t.reserved_future_use_length),i.material_sets.push(t)}return i}}},9255:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.mosaic_entry_point=r.bslbf(1),i.number_of_horizontal_elementary_cells=r.uimsbf(3),r.next(1),i.number_of_vertical_elementary_cells=r.uimsbf(3),i.logical_cells=[];r.position>>3<2+i.descriptor_length;){let t={};t.logical_cell_id=r.uimsbf(6),r.next(7),t.logical_cell_presentation_info=r.uimsbf(3),t.elementary_cell_field_length=r.uimsbf(8),t.elementary_cell_fields=[];for(let n=0;n{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.bound_valid_flag=r.bslbf(1),i.LTW_offset_lower_bound=r.uimsbf(15),r.next(1),i.LTW_offset_upper_bound=r.uimsbf(14),i}}},923:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.NVOD_references=[];r.position>>3<2+i.descriptor_length;){let t={};t.transport_stream_id=r.uimsbf(16),t.original_network_id=r.uimsbf(16),t.service_id=r.uimsbf(16),i.NVOD_references.push(t)}return i}}},9821:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946),r=c(5571);l.default=class{constructor(i){we(this,"buffer");this.buffer=i}decode(){let i=new p.default(this.buffer),t={};if(t._raw=this.buffer,t.descriptor_tag=i.uimsbf(8),t.descriptor_length=i.uimsbf(8),t.reboot=i.bslbf(1),t.add_on=i.bslbf(1),t.compatibility_flag=i.bslbf(1),t.text_info_flag=i.bslbf(1),i.next(4),t.component_size=i.uimsbf(32),t.session_protcol_number=i.uimsbf(8),t.session_id=i.uimsbf(32),t.retry=i.uimsbf(8),t.connect_timer=i.uimsbf(24),t.address_type=i.uimsbf(8),t.address_type===0&&(t.ipv4_address=i.readBytes(4),t.port_number=i.uimsbf(16)),t.address_type===1&&(t.ipv6_address=i.readBytes(16),t.port_number=i.uimsbf(16)),t.address_type===2&&(t.URL_length=i.uimsbf(8),t.URL_byte=i.readBytes(t.URL_length)),t.compatibility_flag===1){let n=i.buffer[i.position>>3]<<8|i.buffer[1+(i.position>>3)];t.compatibilityDescriptor=new r.default(i.readBytesRaw(2+n)).decode()}return t.private_data_length=i.uimsbf(8),t.private_data_byte=i.readBytes(t.private_data_length),t.text_info_flag===1&&(t.ISO_639_language_code=i.uimsbf(24),t.text_length=i.uimsbf(8),t.text_char=i.readBytes(t.text_length)),t}}},8286:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.country_code=r.readBytes(3),i.media_type=r.bslbf(16),i.network_id=r.uimsbf(16),i.private_data=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},1885:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.network_name_char=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},4154:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.reference_type=r.uimsbf(4),i.external_reference_flag=r.bslbf(1),r.next(3),i.external_reference_flag===1&&(i.information_provider_id=r.uimsbf(16),i.event_relation_id=r.uimsbf(16)),i.reference_node_id=r.uimsbf(16),i.reference_number=r.uimsbf(8),i}}},4385:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.parental_ratings=[];r.position>>3<2+i.descriptor_length;){let t={};t.country_code=r.readBytes(3),t.rating=r.uimsbf(8),i.parental_ratings.push(t)}return i}}},6566:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.services=[];r.position>>3<2+i.descriptor_length;){let t={};t.service_id=r.uimsbf(16),i.services.push(t)}return i}}},6546:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(2),i.peak_rate=r.uimsbf(22),r.next(2),i.minimum_overall_smoothing_rate=r.uimsbf(22),r.next(2),i.maximum_overall_smoothing_buffer=r.uimsbf(14),i}}},8857:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.event_version_number=r.uimsbf(8),i.event_start_time=r.readBytes(5),i.duration=r.readBytes(3),i.offset=r.readBytes(3),r.next(5),i.offset_flag=r.bslbf(1),i.other_descriptor_status=r.bslbf(1),i.jst_time_flag=r.bslbf(1),i.jst_time_flag===1&&(i.jst_time=r.readBytes(5)),i}}},7251:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.private_data_indicator=r.readBytes(4),i}}},5257:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.information_provider_id=r.uimsbf(16),i.event_relation_id=r.uimsbf(16),i.references=[];r.position>>3<2+i.descriptor_length;){let t={};t.reference_node_id=r.uimsbf(16),t.reference_number=r.uimsbf(8),t.last_reference_number=r.uimsbf(8),i.references.push(t)}return i}}},1115:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.format_identifier=r.uimsbf(32),i.additional_identification_info=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},181:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.frequency=r.bslbf(32),i.orbital_position=r.bslbf(16),i.west_east_flag=r.bslbf(1),i.polarisation=r.bslbf(2),i.modulation=r.bslbf(5),i.symbol_rate=r.bslbf(28),i.FEC_inner=r.bslbf(4),i}}},8345:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.scramble_system_id=r.uimsbf(8),i}}},2763:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.series_id=r.uimsbf(16),i.repeat_label=r.uimsbf(4),i.program_pattern=r.uimsbf(3),i.expire_date_valid_flag=r.uimsbf(1),i.expire_date=r.uimsbf(16),i.episode_number=r.uimsbf(12),i.last_episode_number=r.uimsbf(12),i.series_name_char=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},2761:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.service_type=r.uimsbf(8),i.service_provider_name_length=r.uimsbf(8),i.service_provider_name_char=r.readBytes(i.service_provider_name_length),i.service_name_length=r.uimsbf(8),i.service_name_char=r.readBytes(i.service_name_length),i}}},3992:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};if(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.service_group_type=r.uimsbf(4),r.next(4),i.service_group_type===1)for(i.service_groups=[];r.position>>3<2+i.descriptor_length;){let t={};t.primary_service_id=r.uimsbf(16),t.secondary_service_id=r.uimsbf(16),i.service_groups.push(t)}else i.private_data_byte=r.readBytes(2+i.descriptor_length-(r.position>>3));return i}}},2645:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.services=[];r.position>>3<2+i.descriptor_length;){let t={};t.service_id=r.uimsbf(16),t.service_type=r.uimsbf(8),i.services.push(t)}return i}}},2703:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.ISO_639_language_code=r.readBytes(3),i.event_name_length=r.uimsbf(8),i.event_name_char=r.readBytes(i.event_name_length),i.text_length=r.uimsbf(8),i.text_char=r.readBytes(i.text_length),i}}},3835:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.ISO_639_language_code=r.bslbf(24),i.node_name_length=r.uimsbf(8),i.node_name_char=r.readBytes(i.node_name_length),i.text_length=r.uimsbf(8),i.text_char=r.readBytes(i.text_length),i}}},7178:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);function r(a){let o=new p.default(a),d={};return d._raw=a,d.table_id=o.uimsbf(8),d.table_description_length=o.uimsbf(8),d.table_cycle=o.uimsbf(8),d}function i(a){let o=new p.default(a),d={};return d._raw=a,d.table_id=o.uimsbf(8),d.table_description_length=o.uimsbf(8),d.table_cycle=o.uimsbf(16),d}function t(a){let o=new p.default(a),d={};return d._raw=a,d.table_id=o.uimsbf(8),d.table_description_length=o.uimsbf(8),d.table_cycle_H_EIT=o.uimsbf(8),d.table_cycle_M_EIT=o.uimsbf(8),d.table_cycle_L_EIT=o.uimsbf(8),d.num_of_M_EIT_event=o.uimsbf(4),d.num_of_L_EIT_event=o.uimsbf(4),d}function n(a){let o=new p.default(a),d={};for(d._raw=a,d.table_id=o.uimsbf(8),d.table_description_length=o.uimsbf(8),d.loops=[];d.table_description_length+2>o.position>>3;){const g=o.uimsbf(2),m=o.uimsbf(2),v=o.uimsbf(1);o.next(3);const b=o.uimsbf(8),w=o.uimsbf(12);o.next(2);const C=o.uimsbf(2),D=[];for(let R=0;Ra.position>>3;){const d=a.uimsbf(8),g=a.uimsbf(8);a.previous(16);const m=a.readBytes(g+2);switch(d){case 64:case 196:case 66:case 70:o.table_descriptions.push(r(m));break;case 78:case 79:o.table_descriptions.push(t(m));break;case 80:case 96:case 88:o.table_descriptions.push(n(m));break;case 195:case 200:o.table_descriptions.push(i(m));break;default:o.table_descriptions.push({table_id:d,table_description_length:g,_raw:m})}}return o}}},1514:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.parameter_version=r.uimsbf(8),i.update_time=r.uimsbf(16),i.SI_prime_ts_network_id=r.uimsbf(16),i.SI_prime_transport_stream_id=r.uimsbf(16),i.tables=[];r.position>>3<2+i.descriptor_length;){let t={};t.table_id=r.uimsbf(8),t.table_description_length=r.uimsbf(8),t.table_description_byte=r.readBytes(t.table_description_length),i.tables.push(t)}return i}}},7600:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(2),i.sb_leak_rate=r.uimsbf(22),r.next(2),i.sb_size=r.uimsbf(22),i}}},270:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(3),i.external_event_flag=r.bslbf(1),i.STC_reference_mode=r.uimsbf(4),i.external_event_flag===1&&(i.external_event_id=r.uimsbf(16),i.external_service_id=r.uimsbf(16),i.external_network_id=r.uimsbf(16)),i.STC_reference_mode===0||(i.STC_reference_mode===1?(r.next(7),i.NPT_reference=r.uimsbf(33),r.next(7),i.STC_reference=r.uimsbf(33)):i.STC_reference_mode!==3&&i.STC_reference_mode!==5||(i.time_reference=r.uimsbf(24),i.time_reference_extention=r.uimsbf(12),r.next(11),i.STC_reference=r.uimsbf(33))),i}}},3437:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(7),i.leak_valid_flag=r.bslbf(1),i}}},6137:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.component_tag=r.uimsbf(8),i}}},5189:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.stuffing_byte=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},6986:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.external_clock_reference_indicator=r.bslbf(1),r.next(1),i.clock_accuracy_integer=r.uimsbf(6),i.clock_accuracy_exponent=r.uimsbf(3),r.next(5),i}}},5506:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.system_management_id=r.uimsbf(16),i.additional_identification_info=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},355:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.horizontal_size=r.uimsbf(14),i.vertical_size=r.uimsbf(14),i.aspect_ratio_information=r.uimsbf(4),i}}},9937:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.region_spec_type=r.uimsbf(8),i.target_region_spec={},i.region_spec_type===1&&(i.target_region_spec.prefecture_bitmap=r.readBytes(7)),i}}},9219:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.area_code=r.bslbf(12),i.guard_interval=r.bslbf(2),i.transmission_mode=r.bslbf(2),i.frequencies=[];r.position>>3<2+i.descriptor_length;){let t={};t.frequency=r.uimsbf(16),i.frequencies.push(t)}return i}}},1768:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.reference_service_id=r.uimsbf(16),i.reference_event_id=r.uimsbf(16),i}}},5636:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.reference_service_id=r.uimsbf(16),i}}},4464:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.remote_control_key_id=r.uimsbf(8),i.length_of_ts_name=r.uimsbf(6),i.transmission_type_count=r.uimsbf(2),i.ts_name_char=r.readBytes(i.length_of_ts_name),i.transmission_types=[];for(let t=0;t>3<2+i.descriptor_length;)r.next(8);return i}}},7801:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.descriptor=r.readBytes(i.descriptor_length),i}}},6412:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.still_picture_flag=r.bslbf(1),i.sequence_end_code_flag=r.bslbf(1),i.video_encode_format=r.bslbf(4),r.next(2),i}}},56:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.multiple_frame_rate_flag=r.bslbf(1),i.frame_rate_code=r.uimsbf(4),i.MPEG_1_only_flag=r.bslbf(1),i.constrained_parameter_flag=r.bslbf(1),i.still_picture_flag=r.bslbf(1),i.MPEG_1_only_flag===0&&(i.profile_and_level_indication=r.uimsbf(8),i.chroma_format=r.uimsbf(2),i.frame_rate_extension_flag=r.bslbf(1),r.next(5)),i}}},1779:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.horizontal_offset=r.uimsbf(14),i.vertical_offset=r.uimsbf(14),i.window_priority=r.uimsbf(4),i}}},1241:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(9073);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=[];for(let i=0;i{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8764),r=c(4018),i=c(2172),t=c(8090);l.default=class{constructor(){we(this,"epg");this.epg=new Map}needUpdate(n,a){return n===null||(n.table_id!==78&&n.table_id!==79||a.table_id===78||a.table_id===79)&&n.version_number!==a.version_number}addEit(n,a,o){if(n!==18||a.current_next_indicator===0)return!1;let d=a.original_network_id,g=a.transport_stream_id,m=a.service_id,v=this.epg,b=null,w=null,C=null;if(v.has(d)?b=v.get(d):(b=new Map,v.set(d,b)),b.has(g)?w=b.get(g):(w=new Map,b.set(g,w)),w.has(m))C=w.get(m);else{C={pf:{present:null,following:null},schedule:{},basic_flags:{flags:[],last_flags_id:-1},extended_flags:{flags:[],last_flags_id:-1}};for(let D of[C.basic_flags,C.extended_flags])for(let R=0;R<8;R++)D.flags.push({flag:p.Buffer.alloc(32,0),ignore:p.Buffer.alloc(32,255),version_number:-1});w.set(m,C)}for(let D of a.events){let R;if(C.schedule.hasOwnProperty(D.event_id)){if(R=C.schedule[D.event_id],this.needUpdate(R,D)){let P=new i.default(D.start_time).decode(),L=new i.default(D.duration).decodeTime();R.table_id=a.table_id,R.version_number=a.version_number,R.event_id=D.event_id,R.start_time=P,R.duration=3600*L[0]+60*L[1]+L[2],R.running_status=D.running_status,R.free_CA_mode=D.free_CA_mode}}else{R={};let P=new i.default(D.start_time).decode(),L=new i.default(D.duration).decodeTime();R.table_id=a.table_id,R.version_number=a.version_number,R.event_id=D.event_id,R.start_time=P,R.duration=3600*L[0]+60*L[1]+L[2],R.running_status=D.running_status,R.free_CA_mode=D.free_CA_mode,R.short_event=null,R.extended_event=null,R.component=null,R.content=null,R.audio_component=null,R.event_group=null,C.schedule[D.event_id]=R}a.table_id!==78&&a.table_id!==79||(a.section_number===0?C.pf.present=R:a.section_number===1&&(C.pf.following=R));let T={short_event:{descriptor:null,needUpdate:this.needUpdate(R.short_event,R),item_description:null},extended_event:{descriptor:null,needUpdate:this.needUpdate(R.extended_event,R)},component:{descriptor:null,needUpdate:this.needUpdate(R.component,R)},content:{descriptor:null,needUpdate:this.needUpdate(R.content,R)},audio_component:{descriptor:null,needUpdate:this.needUpdate(R.audio_component,R)},event_group:{descriptor:null,needUpdate:this.needUpdate(R.event_group,R)}};for(let P of D.descriptors)switch(P.descriptor_tag){case 77:let L=T.short_event;if(!L.needUpdate)break;L.descriptor===null&&(L.descriptor={}),L.descriptor.table_id=a.table_id,L.descriptor.version_number=a.version_number,L.descriptor.ISO_639_language_code=String.fromCharCode(...P.ISO_639_language_code),L.descriptor.event_name=new r.default(P.event_name_char).decode(),L.descriptor.text=new r.default(P.text_char).decode();break;case 78:let I=T.extended_event;if(!I.needUpdate)break;I.descriptor===null&&(I.descriptor={}),I.descriptor.table_id=a.table_id,I.descriptor.version_number=a.version_number,I.descriptor.ISO_639_language_code=String.fromCharCode(...P.ISO_639_language_code),I.descriptor.items=I.descriptor.items||[],I.descriptor.text=new r.default(P.text_char).decode(),P.items.forEach(te=>{te.item_description_length!==0&&(typeof I.descriptor.items=="string"&&(I.descriptor.items=[I.descriptor.items]),I.descriptor.items.length!==0&&I.descriptor.items.push(`\r +`)],{type:"application/javascript"}),this.createWorker.blob_=i),new Worker(URL.createObjectURL(i))},r.prototype.vmCall=function(i,t,n,a){var o={timeout:this.REGEXP_THREAD_TIMEOUT};try{return r.vm.runInNewContext(i,t,o)}catch{a(null),this.throwException(this.ERROR,"RegExp Timeout: "+n)}return r.REGEXP_TIMEOUT},r.prototype.maybeThrowRegExp=function(i,t){var n;if(this.REGEXP_MODE===0)n=!1;else if(this.REGEXP_MODE===1)n=!0;else if(r.vm)n=!0;else if(typeof Worker=="function"&&typeof URL=="function")n=!0;else{try{r.vm=c(1172)}catch{}n=!!r.vm}n||(t(null),this.throwException(this.ERROR,"Regular expressions not supported: "+i))},r.prototype.regExpTimeout=function(i,t,n){var a=this;return setTimeout(function(){t.terminate(),n(null);try{a.throwException(a.ERROR,"RegExp Timeout: "+i)}catch{}},this.REGEXP_THREAD_TIMEOUT)},r.prototype.createObject=function(i){return this.createObjectProto(i&&i.properties.prototype)},r.prototype.createObjectProto=function(i){if(typeof i!="object")throw Error("Non object prototype");var t=new r.Object(i);return this.isa(t,this.ERROR)&&(t.class="Error"),t},r.prototype.createArray=function(){var i=this.createObjectProto(this.ARRAY_PROTO);return this.setProperty(i,"length",0,{configurable:!1,enumerable:!1,writable:!0}),i.class="Array",i},r.prototype.createFunctionBase_=function(i,t){var n=this.createObjectProto(this.FUNCTION_PROTO);if(t){var a=this.createObjectProto(this.OBJECT_PROTO);this.setProperty(n,"prototype",a,r.NONENUMERABLE_DESCRIPTOR),this.setProperty(a,"constructor",n,r.NONENUMERABLE_DESCRIPTOR)}else n.illegalConstructor=!0;return this.setProperty(n,"length",i,r.READONLY_NONENUMERABLE_DESCRIPTOR),n.class="Function",n},r.prototype.createFunction=function(i,t,n){var a=this.createFunctionBase_(i.params.length,!0);a.parentScope=t,a.node=i;var o=i.id?String(i.id.name):n||"";return this.setProperty(a,"name",o,r.READONLY_NONENUMERABLE_DESCRIPTOR),a},r.prototype.createNativeFunction=function(i,t){var n=this.createFunctionBase_(i.length,t);return n.nativeFunc=i,i.id=this.functionCounter_++,this.setProperty(n,"name",i.name,r.READONLY_NONENUMERABLE_DESCRIPTOR),n},r.prototype.createAsyncFunction=function(i){var t=this.createFunctionBase_(i.length,!0);return t.asyncFunc=i,i.id=this.functionCounter_++,this.setProperty(t,"name",i.name,r.READONLY_NONENUMERABLE_DESCRIPTOR),t},r.prototype.nativeToPseudo=function(i){if(i instanceof r.Object)throw Error("Object is already pseudo");if(typeof i!="object"&&typeof i!="function"||i===null)return i;if(i instanceof RegExp){var t=this.createObjectProto(this.REGEXP_PROTO);return this.populateRegExp(t,i),t}if(i instanceof Date){var n=this.createObjectProto(this.DATE_PROTO);return n.data=new Date(i.valueOf()),n}if(typeof i=="function"){var a=this,o=Object.getOwnPropertyDescriptor(i,"prototype");return this.createNativeFunction(function(){var b=Array.prototype.slice.call(arguments).map(function(C){return a.pseudoToNative(C)}),w=i.apply(a,b);return a.nativeToPseudo(w)},!!o)}if(Array.isArray(i)){for(var d=this.createArray(),g=0;g0;a.pop()){var o=a[a.length-1];switch(o.node.type){case"TryStatement":return void(o.cv={type:i,value:t,label:n});case"CallExpression":case"NewExpression":if(i===r.Completion.RETURN)return void(o.value=t);if(i!==r.Completion.THROW)throw Error("Unsynatctic break/continue not rejected by Acorn");break;case"Program":o.done=!0;break e}if(i===r.Completion.BREAK){if(n?o.labels&&o.labels.indexOf(n)!==-1:o.isLoop||o.isSwitch)return void a.pop()}else if(i===r.Completion.CONTINUE&&(n?o.labels&&o.labels.indexOf(n)!==-1:o.isLoop))return}var d;if(this.isa(t,this.ERROR)){var g={EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError},m=String(this.getProperty(t,"name")),v=this.getProperty(t,"message").valueOf();(d=(g[m]||Error)(v)).stack=String(this.getProperty(t,"stack"))}else d=String(t);throw d},r.prototype.createGetter_=function(i,t){if(!this.getterStep_)throw Error("Unexpected call to createGetter");this.getterStep_=!1;var n=Array.isArray(t)?t[0]:t,a=new this.nodeConstructor({options:{}});a.type="CallExpression";var o=new r.State(a,this.stateStack[this.stateStack.length-1].scope);return o.doneCallee_=!0,o.funcThis_=n,o.func_=i,o.doneArgs_=!0,o.arguments_=[],o},r.prototype.createSetter_=function(i,t,n){if(!this.setterStep_)throw Error("Unexpected call to createSetter");this.setterStep_=!1;var a=Array.isArray(t)?t[0]:this.globalObject,o=new this.nodeConstructor({options:{}});o.type="CallExpression";var d=new r.State(o,this.stateStack[this.stateStack.length-1].scope);return d.doneCallee_=!0,d.funcThis_=a,d.func_=i,d.doneArgs_=!0,d.arguments_=[n],d},r.prototype.boxThis_=function(i){if(i==null)return this.globalObject;if(!(i instanceof r.Object)){var t=this.createObjectProto(this.getPrototype(i));return t.data=i,t}return i},r.prototype.getGlobalScope=function(){return this.globalScope},r.prototype.getStateStack=function(){return this.stateStack},r.prototype.setStateStack=function(i){this.stateStack=i},r.Value,r.State=function(i,t){this.node=i,this.scope=t},r.Scope=function(i,t,n){this.parentScope=i,this.strict=t,this.object=n},r.Object=function(i){this.getter=Object.create(null),this.setter=Object.create(null),this.properties=Object.create(null),this.proto=i},r.Object.prototype.proto=null,r.Object.prototype.class="Object",r.Object.prototype.data=null,r.Object.prototype.toString=function(){if(!(this instanceof r.Object))return String(this);if(this.class==="Array"){(d=r.toStringCycles_).push(this);try{var i=[],t=this.properties.length,n=!1;t>1024&&(t=1e3,n=!0);for(var a=0;a>=":g>>=m;break;case">>>=":g>>>=m;break;case"&=":g&=m;break;case"^=":g^=m;break;case"|=":g|=m;break;default:throw SyntaxError("Unknown assignment expression: "+n.operator)}var v=this.setValue(t.leftReference_,g);if(v)return t.doneSetter_=!0,t.setterValue_=g,this.createSetter_(v,t.leftReference_,g);i.pop(),i[i.length-1].value=g},r.prototype.stepBinaryExpression=function(i,t,n){if(!t.doneLeft_)return t.doneLeft_=!0,new r.State(n.left,t.scope);if(!t.doneRight_)return t.doneRight_=!0,t.leftValue_=t.value,new r.State(n.right,t.scope);i.pop();var a,o=t.leftValue_,d=t.value;switch(n.operator){case"==":a=o==d;break;case"!=":a=o!=d;break;case"===":a=o===d;break;case"!==":a=o!==d;break;case">":a=o>d;break;case">=":a=o>=d;break;case"<":a=o>":a=o>>d;break;case">>>":a=o>>>d;break;case"in":d instanceof r.Object||this.throwException(this.TYPE_ERROR,"'in' expects an object, not '"+d+"'"),a=this.hasProperty(d,o);break;case"instanceof":this.isa(d,this.FUNCTION)||this.throwException(this.TYPE_ERROR,"Right-hand side of instanceof is not an object"),a=o instanceof r.Object&&this.isa(o,d);break;default:throw SyntaxError("Unknown binary operator: "+n.operator)}i[i.length-1].value=a},r.prototype.stepBlockStatement=function(i,t,n){var a=t.n_||0,o=n.body[a];if(o)return t.n_=a+1,new r.State(o,t.scope);i.pop()},r.prototype.stepBreakStatement=function(i,t,n){var a=n.label&&n.label.name;this.unwind(r.Completion.BREAK,void 0,a)},r.prototype.evalCodeNumber_=0,r.prototype.stepCallExpression=function(i,t,n){if(!t.doneCallee_){t.doneCallee_=1;var a=new r.State(n.callee,t.scope);return a.components=!0,a}if(t.doneCallee_===1){t.doneCallee_=2;var o=t.value;if(Array.isArray(o)){if(t.func_=this.getValue(o),o[0]===r.SCOPE_REFERENCE?t.directEval_=o[1]==="eval":t.funcThis_=o[0],o=t.func_,this.getterStep_)return t.doneCallee_=1,this.createGetter_(o,t.value)}else t.func_=o;t.arguments_=[],t.n_=0}if(o=t.func_,!t.doneArgs_){if(t.n_!==0&&t.arguments_.push(t.value),n.arguments[t.n_])return new r.State(n.arguments[t.n_++],t.scope);if(n.type==="NewExpression"){if(o instanceof r.Object&&!o.illegalConstructor||this.throwException(this.TYPE_ERROR,o+" is not a constructor"),o===this.ARRAY)t.funcThis_=this.createArray();else{var d=o.properties.prototype;typeof d=="object"&&d!==null||(d=this.OBJECT_PROTO),t.funcThis_=this.createObjectProto(d)}t.isConstructor=!0}t.doneArgs_=!0}if(t.doneExec_)i.pop(),t.isConstructor&&typeof t.value!="object"?i[i.length-1].value=t.funcThis_:i[i.length-1].value=t.value;else{t.doneExec_=!0,o instanceof r.Object||this.throwException(this.TYPE_ERROR,o+" is not a function");var g=o.node;if(g){for(var m=this.createScope(g.body,o.parentScope),v=0;vv?t.arguments_[v]:void 0;this.setProperty(m.object,b,w)}var C=this.createArray();for(v=0;v{Object.defineProperty(l,"__esModule",{value:!0}),l.TsBuffer=void 0;const p=c(8764);l.TsBuffer=class{constructor(){we(this,"chunks",[]);we(this,"length",0);we(this,"entireLength")}add(r){this.chunks.push(r),this.length+=r.length}reset(){this.chunks.length=0,this.length=0}concat(){return p.Buffer.concat(this.chunks)}}},4018:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8764),r=c(4914),i=c(5991);l.default=class{constructor(t){we(this,"buffer");we(this,"position",0);we(this,"graphic",[66,74,48,49]);we(this,"graphicMode",[1,1,1,1]);we(this,"graphicByte",[2,1,1,1]);we(this,"graphicL",0);we(this,"graphicR",2);we(this,"graphicNormal",!0);we(this,"sjis",[]);we(this,"result","");this.buffer=t}decode(){try{for(;this.position0&&(this.result+=(0,r.decode)(p.Buffer.from(this.sjis),"shift-jis"),this.sjis=[]),this.result}readC0(){switch(this.getNext()){case 32:this.graphicNormal?this.sjis.push(129,64):this.sjis.push(32);break;case 13:this.sjis.push(13,10);break;case 14:this.graphicL=1;break;case 15:this.graphicL=0;break;case 25:this.readSS2();break;case 29:this.readSS3();break;case 27:this.readESC();break;case 22:this.position+=1;break;case 28:this.position+=2}}readC1(){switch(this.getNext()){case 137:case 136:this.graphicNormal=!1;break;case 138:this.graphicNormal=!0;break;case 139:this.graphicNormal=this.getNext()!==96;break;case 144:this.getNext()===32&&(this.position+=1);break;case 145:case 147:case 148:case 151:case 152:this.position+=1;break;case 149:for(;this.position67;)this.position++;break;case 155:this.readCSI()}}readGL(){if(this.graphicMode[this.graphicL]===1)switch(this.graphic[this.graphicL]){case 54:case 74:case 73:this.graphicNormal?this.sjis.push(...i.default.ascii[this.getNext()]):this.sjis.push(this.getNext());break;case 48:case 55:this.sjis.push(...i.default.hiragana[this.getNext()]);break;case 49:case 56:this.sjis.push(...i.default.katakana[this.getNext()]);break;case 57:case 58:case 59:case 66:const t=this.getNext(),n=this.getNext();this.useUnicode(t,n)?(this.sjis.length>0&&(this.result+=(0,r.decode)(p.Buffer.from(this.sjis),"shift-jis"),this.sjis=[]),this.result+=this.getUnicode(t,n)):this.sjis.push(...this.getSjis(t,n))}else this.position+=this.graphicByte[this.graphicL]}readGR(){if(this.graphicMode[this.graphicR]===1)switch(this.graphic[this.graphicR]){case 54:case 74:this.graphicNormal?this.sjis.push(...i.default.ascii[127&this.getNext()]):this.sjis.push(127&this.getNext());break;case 48:case 55:this.sjis.push(...i.default.hiragana[127&this.getNext()]);break;case 49:case 56:case 73:this.sjis.push(...i.default.katakana[127&this.getNext()]);break;case 57:case 58:case 59:case 66:const t=127&this.getNext(),n=127&this.getNext();this.useUnicode(t,n)?(this.sjis.length>0&&(this.result+=(0,r.decode)(p.Buffer.from(this.sjis),"shift-jis"),this.sjis=[]),this.result+=this.getUnicode(t,n)):this.sjis.push(...this.getSjis(t,n))}else this.position+=this.graphicByte[this.graphicR]}readESC(){const t=this.getNext();if(t===36){const n=this.getNext();if(n>=40&&n<=43){const a=this.getNext();if(a===32){const o=this.getNext();this.graphic[n-40]=o,this.graphicMode[n-40]=2,this.graphicByte[n-40]=2}else if(a===40){const o=this.getNext();this.graphic[n-40]=o,this.graphicMode[n-40]=3,this.graphicByte[n-40]=1}else this.graphic[n-40]=a,this.graphicMode[n-40]=1,this.graphicByte[n-40]=2}else this.graphic[0]=n,this.graphicMode[0]=1,this.graphicByte[0]=2}else if(t>=40&&t<=43){const n=this.getNext();if(n===32){const a=this.getNext();this.graphic[t-40]=a,this.graphicMode[t-40]=2,this.graphicByte[t-40]=1}else this.graphic[t-40]=n,this.graphicMode[t-40]=1,this.graphicByte[t-40]=1}else t===110?this.graphicL=2:t===111?this.graphicL=3:t===124?this.graphicR=3:t===125?this.graphicR=2:t===126&&(this.graphicR=1)}readSS2(){const t=this.graphicL;this.graphicL=2,this.readGL(),this.graphicL=t}readSS3(){const t=this.graphicL;this.graphicL=3,this.readGL(),this.graphicL=t}readCSI(){}getNext(){if(this.buffer.length===this.position)throw new Error("Buffer out of range");return this.buffer[this.position++]}useUnicode(t,n){if(t>=117&&n>=33){const a=t<<8|n;return a>=29985&&a<=30283||a>=31309&&a<=32381}return!1}getSjis(t,n){if(t>=117&&n>=33){const o=t<<8|n;return o>=29985&&o<=30283?i.default.gaiji_2[o]:o>=31309&&o<=32381?i.default.gaiji_1[o]:[]}const a=1&t?n>95?32:31:126;return[t=(t+1>>1)+(t<95?112:176)&255,n=n+a&255]}getUnicode(t,n){if(t>=117&&n>=33){const a=t<<8|n;return a>=29985&&a<=30283?i.default.gaiji_2_unicode[a]:a>=31309&&a<=32381?i.default.gaiji_1_unicode[a]:""}return""}}},5991:(y,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.default={ascii:{33:[129,73],34:[129,104],35:[129,148],36:[129,144],37:[129,147],38:[129,149],39:[129,102],40:[129,105],41:[129,106],42:[129,150],43:[129,123],44:[129,67],45:[129,124],46:[129,68],47:[129,94],48:[130,79],49:[130,80],50:[130,81],51:[130,82],52:[130,83],53:[130,84],54:[130,85],55:[130,86],56:[130,87],57:[130,88],58:[129,70],59:[129,71],60:[129,131],61:[129,129],62:[129,132],63:[129,72],64:[129,151],65:[130,96],66:[130,97],67:[130,98],68:[130,99],69:[130,100],70:[130,101],71:[130,102],72:[130,103],73:[130,104],74:[130,105],75:[130,106],76:[130,107],77:[130,108],78:[130,109],79:[130,110],80:[130,111],81:[130,112],82:[130,113],83:[130,114],84:[130,115],85:[130,116],86:[130,117],87:[130,118],88:[130,119],89:[130,120],90:[130,121],91:[129,109],92:[129,143],93:[129,110],94:[129,79],95:[129,81],96:[129,101],97:[130,129],98:[130,130],99:[130,131],100:[130,132],101:[130,133],102:[130,134],103:[130,135],104:[130,136],105:[130,137],106:[130,138],107:[130,139],108:[130,140],109:[130,141],110:[130,142],111:[130,143],112:[130,144],113:[130,145],114:[130,146],115:[130,147],116:[130,148],117:[130,149],118:[130,150],119:[130,151],120:[130,152],121:[130,153],122:[130,154],123:[129,111],124:[129,98],125:[129,112],126:[129,80]},hiragana:{33:[130,159],34:[130,160],35:[130,161],36:[130,162],37:[130,163],38:[130,164],39:[130,165],40:[130,166],41:[130,167],42:[130,168],43:[130,169],44:[130,170],45:[130,171],46:[130,172],47:[130,173],48:[130,174],49:[130,175],50:[130,176],51:[130,177],52:[130,178],53:[130,179],54:[130,180],55:[130,181],56:[130,182],57:[130,183],58:[130,184],59:[130,185],60:[130,186],61:[130,187],62:[130,188],63:[130,189],64:[130,190],65:[130,191],66:[130,192],67:[130,193],68:[130,194],69:[130,195],70:[130,196],71:[130,197],72:[130,198],73:[130,199],74:[130,200],75:[130,201],76:[130,202],77:[130,203],78:[130,204],79:[130,205],80:[130,206],81:[130,207],82:[130,208],83:[130,209],84:[130,210],85:[130,211],86:[130,212],87:[130,213],88:[130,214],89:[130,215],90:[130,216],91:[130,217],92:[130,218],93:[130,219],94:[130,220],95:[130,221],96:[130,222],97:[130,223],98:[130,224],99:[130,225],100:[130,226],101:[130,227],102:[130,228],103:[130,229],104:[130,230],105:[130,231],106:[130,232],107:[130,233],108:[130,234],109:[130,235],110:[130,236],111:[130,237],112:[130,238],113:[130,239],114:[130,240],115:[130,241],116:[129,64],117:[129,64],118:[129,64],119:[129,84],120:[129,85],121:[129,91],122:[129,66],123:[129,117],124:[129,118],125:[129,65],126:[129,69]},katakana:{33:[131,64],34:[131,65],35:[131,66],36:[131,67],37:[131,68],38:[131,69],39:[131,70],40:[131,71],41:[131,72],42:[131,73],43:[131,74],44:[131,75],45:[131,76],46:[131,77],47:[131,78],48:[131,79],49:[131,80],50:[131,81],51:[131,82],52:[131,83],53:[131,84],54:[131,85],55:[131,86],56:[131,87],57:[131,88],58:[131,89],59:[131,90],60:[131,91],61:[131,92],62:[131,93],63:[131,94],64:[131,95],65:[131,96],66:[131,97],67:[131,98],68:[131,99],69:[131,100],70:[131,101],71:[131,102],72:[131,103],73:[131,104],74:[131,105],75:[131,106],76:[131,107],77:[131,108],78:[131,109],79:[131,110],80:[131,111],81:[131,112],82:[131,113],83:[131,114],84:[131,115],85:[131,116],86:[131,117],87:[131,118],88:[131,119],89:[131,120],90:[131,121],91:[131,122],92:[131,123],93:[131,124],94:[131,125],95:[131,126],96:[131,128],97:[131,129],98:[131,130],99:[131,131],100:[131,132],101:[131,133],102:[131,134],103:[131,135],104:[131,136],105:[131,137],106:[131,138],107:[131,139],108:[131,140],109:[131,141],110:[131,142],111:[131,143],112:[131,144],113:[131,145],114:[131,146],115:[131,147],116:[131,148],117:[131,149],118:[131,150],119:[129,82],120:[129,83],121:[129,91],122:[129,66],123:[129,117],124:[129,118],125:[129,65],126:[129,69]},gaiji_1:{31309:[49,48,46],31310:[49,49,46],31311:[49,50,46],31312:[91,72,86,93],31313:[91,83,68,93],31314:[91,130,111,93],31315:[91,130,118,93],31316:[91,77,86,93],31317:[91,142,232,93],31318:[91,142,154,93],31319:[91,145,111,93],31320:[91,131,102,93],31321:[91,130,114,93],31322:[91,147,241,93],31323:[91,145,189,93],31324:[91,137,240,93],31325:[91,83,83,93],31326:[91,130,97,93],31327:[91,130,109,93],31328:[129,161],31329:[129,156],31330:[91,147,86,93],31331:[91,140,240,93],31332:[91,137,102,93],31333:[91,150,179,93],31334:[91,151,191,93],31335:[91,129,69,93],31336:[91,145,79,93],31337:[91,140,227,93],31338:[91,141,196,93],31339:[91,144,86,93],31340:[91,143,137,93],31341:[91,143,73,93],31342:[91,144,182,93],31343:[91,148,204,93],31344:[91,144,186,93],31345:[91,144,129,93],31346:[91,80,80,86,93],31347:[40,148,233,41],31348:[130,217,130,169],31777:[129,168],31778:[129,169],31779:[129,170],31780:[129,171],31781:[129,69],31782:[129,69],31783:[148,78],31784:[140,142],31785:[147,250],31786:[137,126],31787:[109,94,50],31788:[109,94,51],31789:[99,109],31790:[99,109,94,50],31791:[99,109,94,51],31792:[130,79,46],31793:[130,80,46],31794:[130,81,46],31795:[130,82,46],31796:[130,83,46],31797:[130,84,46],31798:[130,85,46],31799:[130,86,46],31800:[130,87,46],31801:[130,88,46],31802:[142,129],31803:[149,155],31804:[140,179],31805:[140,204],31806:[145,79],31807:[140,227],31808:[130,79,44],31809:[130,80,44],31810:[130,81,44],31811:[130,82,44],31812:[130,83,44],31813:[130,84,44],31814:[130,85,44],31815:[130,86,44],31816:[130,87,44],31817:[130,88,44],31818:[91,142,208,93],31819:[91,141,224,93],31820:[91,151,76,93],31821:[91,138,148,93],31822:[91,145,227,93],31823:[40,150,226,41],31824:[129,69],31825:[129,69],31826:[129,69],31827:[129,69],31828:[129,69],31829:[129,69],31830:[129,69],31831:[40,67,68,41],31832:[40,118,110,41],31833:[40,111,98,41],31834:[40,99,98,41],31835:[40,99,101],31836:[109,98,41],31837:[40,104,112,41],31838:[40,98,114,41],31839:[40,130,144,41],31840:[40,130,147,41],31841:[40,109,115,41],31842:[40,130,148,41],31843:[40,98,115,41],31844:[40,130,130,41],31845:[40,116,98,41],31846:[40,116,112,41],31847:[40,100,115,41],31848:[40,97,103,41],31849:[40,101,103,41],31850:[40,118,111,41],31851:[40,102,108,41],31852:[40,107,101],31853:[121,41],31854:[40,115,97],31855:[120,41],31856:[40,115,121],31857:[110,41],31858:[40,111,114],31859:[103,41],31860:[40,112,101],31861:[114,41],31862:[40,130,113,41],31863:[40,130,98,41],31864:[40,226,181,41],31865:[130,99,130,105],31866:[91,137,137,93],31867:[70,97,120],32033:[40,140,142,41],32034:[40,137,206,41],32035:[40,144,133,41],32036:[40,150,216,41],32037:[40,139,224,41],32038:[40,147,121,41],32039:[40,147,250,41],32040:[40,143,106,41],32041:[135,141],32042:[135,142],32043:[135,143],32044:[135,126],32045:[78,111,46],32046:[84,101,108],32047:[40,129,167,41],32048:[40,41,40,41],32049:[91,150,123,93],32050:[91,142,79,93],32051:[91,147,241,93],32052:[91,136,192,93],32053:[91,147,95,93],32054:[91,145,197,93],32055:[91,147,144,93],32056:[91,143,159,93],32057:[91,148,115,93],32058:[91,130,114,93],32059:[91,147,138,93],32060:[91,149,223,93],32061:[91,136,234,93],32062:[91,147,241,93],32063:[91,142,79,93],32064:[91,151,86,93],32065:[91,141,182,93],32066:[91,146,134,93],32067:[91,137,69,93],32068:[91,142,119,93],32069:[91,145,150,93],32070:[91,145,197,93],32071:[108],32072:[107,103],32073:[72,122],32074:[104,97],32075:[107,109],32076:[107,109,94,50],32077:[104,80,97],32078:[129,69],32079:[129,69],32080:[49,47,50],32081:[48,47,51],32082:[49,47,51],32083:[50,47,51],32084:[49,47,52],32085:[51,47,52],32086:[49,47,53],32087:[50,47,53],32088:[51,47,53],32089:[52,47,53],32090:[49,47,54],32091:[53,47,54],32092:[49,47,55],32093:[49,47,56],32094:[49,47,57],32095:[49,47,49,48],32110:[33,33],32111:[33,63],32289:[135,84],32290:[135,85],32291:[135,86],32292:[135,87],32293:[135,88],32294:[135,89],32295:[135,90],32296:[135,91],32297:[135,92],32298:[135,93],32299:[88,73],32300:[88,73,73],32301:[135,80],32302:[135,81],32303:[135,82],32304:[135,83],32305:[40,130,80,41],32306:[40,130,81,41],32307:[40,130,82,41],32308:[40,130,83,41],32309:[40,130,84,41],32310:[40,130,85,41],32311:[40,130,86,41],32312:[40,130,87,41],32313:[40,130,88,41],32314:[40,49,48,41],32315:[40,49,49,41],32316:[40,49,50,41],32317:[40,50,49,41],32318:[40,50,50,41],32319:[40,50,51,41],32320:[40,50,52,41],32321:[40,130,96,41],32322:[40,130,97,41],32323:[40,130,98,41],32324:[40,130,99,41],32325:[40,130,100,41],32326:[40,130,101,41],32327:[40,130,102,41],32328:[40,130,103,41],32329:[40,130,104,41],32330:[40,130,105,41],32331:[40,130,106,41],32332:[40,130,107,41],32333:[40,130,108,41],32334:[40,130,109,41],32335:[40,130,110,41],32336:[40,130,111,41],32337:[40,130,112,41],32338:[40,130,113,41],32339:[40,130,114,41],32340:[40,130,115,41],32341:[40,130,116,41],32342:[40,130,117,41],32343:[40,130,118,41],32344:[40,130,119,41],32345:[40,130,120,41],32346:[40,130,121,41],32347:[40,50,53,41],32348:[40,50,54,41],32349:[40,50,55,41],32350:[40,50,56,41],32351:[40,50,57,41],32352:[40,51,48,41],32353:[135,64],32354:[135,65],32355:[135,66],32356:[135,67],32357:[135,68],32358:[135,69],32359:[135,70],32360:[135,71],32361:[135,72],32362:[135,73],32363:[135,74],32364:[135,75],32365:[135,76],32366:[135,77],32367:[135,78],32368:[135,79],32369:[40,130,80,41],32370:[40,130,81,41],32371:[40,130,82,41],32372:[40,130,83,41],32373:[40,130,84,41],32374:[40,130,85,41],32375:[40,130,86,41],32376:[40,130,87,41],32377:[40,130,88,41],32378:[40,49,48,41],32379:[40,49,49,41],32380:[40,49,50,41],32381:[40,51,49,41]},gaiji_2:{29985:[129,172],29986:[129,172],29987:[129,172],29988:[129,172],29989:[250,113],29990:[250,97],29991:[129,172],29992:[129,172],29993:[129,172],29994:[129,172],29995:[250,138],29996:[129,172],29997:[129,172],29998:[251,165],29999:[129,172],3e4:[129,172],30001:[129,172],30002:[129,172],30003:[250,147],30004:[129,172],30005:[129,172],30006:[129,172],30007:[129,172],30008:[129,172],30009:[129,172],30010:[250,156],30011:[129,172],30012:[129,172],30013:[129,172],30014:[129,172],30015:[250,170],30016:[250,177],30017:[129,172],30018:[129,172],30019:[250,184],30020:[250,103],30021:[250,186],30022:[129,172],30023:[129,172],30024:[250,197],30025:[250,212],30026:[129,172],30027:[143,140],30028:[250,222],30029:[250,102],30030:[129,172],30031:[129,172],30032:[129,172],30033:[129,172],30034:[129,172],30035:[129,172],30036:[139,249],30037:[129,172],30038:[129,172],30039:[129,172],30040:[129,172],30041:[129,172],30042:[129,172],30043:[129,172],30044:[129,172],30045:[129,172],30046:[129,172],30047:[129,172],30048:[129,172],30049:[129,172],30050:[129,172],30051:[129,172],30052:[129,172],30053:[251,87],30054:[251,89],30055:[129,172],30056:[129,172],30057:[129,172],30058:[251,97],30059:[251,98],30060:[129,172],30061:[129,172],30062:[129,172],30063:[251,103],30064:[251,104],30065:[129,172],30066:[129,172],30067:[129,172],30068:[129,172],30069:[129,172],30070:[129,172],30071:[129,172],30072:[129,172],30073:[129,172],30074:[129,172],30075:[139,95],30076:[226,88],30077:[129,172],30078:[129,172],30241:[129,172],30242:[129,172],30243:[129,172],30244:[129,172],30245:[129,172],30246:[129,172],30247:[129,172],30248:[251,145],30249:[129,172],30250:[129,172],30251:[129,172],30252:[129,172],30253:[138,139],30254:[250,96],30255:[150,72],30256:[251,155],30257:[129,172],30258:[144,73],30259:[129,172],30260:[129,172],30261:[251,162],30262:[138,112],30263:[251,170],30264:[129,172],30265:[146,210],30266:[129,172],30267:[129,172],30268:[251,185],30269:[147,65],30270:[129,172],30271:[129,172],30272:[250,95],30273:[251,216],30274:[250,94],30275:[251,232],30276:[129,172],30277:[233,76],30278:[129,172],30279:[251,252],30280:[142,73],30281:[129,172],30282:[129,172],30283:[129,172]},gaiji_1_unicode:{31265:"⛌",31266:"⛍",31267:"❗",31268:"⛏",31269:"⛐",31270:"⛑",31272:"⛒",31273:"⛕",31274:"⛓",31275:"⛔",31280:"🅿",31281:"🆊",31284:"⛖",31285:"⛗",31286:"⛘",31287:"⛙",31288:"⛚",31289:"⛛",31290:"⛜",31291:"⛝",31292:"⛞",31293:"⛟",31294:"⛠",31295:"⛡",31296:"⭕",31297:"㉈",31298:"㉉",31299:"㉊",31300:"㉋",31301:"㉌",31302:"㉍",31303:"㉎",31304:"㉏",31309:"⒑",31310:"⒒",31311:"⒓",31312:"🅊",31313:"🅌",31314:"🄿",31315:"🅆",31316:"🅋",31317:"🈐",31318:"🈑",31319:"🈒",31320:"🈓",31321:"🅂",31322:"🈔",31323:"🈕",31324:"🈖",31325:"🅍",31326:"🄱",31327:"🄽",31328:"⬛",31329:"⬤",31330:"🈗",31331:"🈘",31332:"🈙",31333:"🈚",31334:"🈛",31335:"⚿",31336:"🈜",31337:"🈝",31338:"🈞",31339:"🈟",31340:"🈠",31341:"🈡",31342:"🈢",31343:"🈣",31344:"🈤",31345:"🈥",31346:"🅎",31347:"㊙",31348:"🈀",31521:"⛣",31522:"⭖",31523:"⭗",31524:"⭘",31525:"⭙",31526:"☓",31527:"㊋",31528:"〒",31529:"⛨",31530:"㉆",31531:"㉅",31532:"⛩",31533:"࿖",31534:"⛪",31535:"⛫",31536:"⛬",31537:"♨",31538:"⛭",31539:"⛮",31540:"⛯",31541:"⚓",31542:"✈",31543:"⛰",31544:"⛱",31545:"⛲",31546:"⛳",31547:"⛴",31548:"⛵",31549:"🅗",31550:"Ⓓ",31551:"Ⓢ",31552:"⛶",31553:"🅟",31554:"🆋",31555:"🆍",31556:"🆌",31557:"🅹",31558:"⛷",31559:"⛸",31560:"⛹",31561:"⛺",31562:"🅻",31563:"☎",31564:"⛻",31565:"⛼",31566:"⛽",31567:"⛾",31568:"🅼",31569:"⛿",31777:"➡",31778:"⬅",31779:"⬆",31780:"⬇",31781:"⬯",31782:"⬮",31783:"年",31784:"月",31785:"日",31786:"円",31787:"㎡",31788:"㎥",31789:"㎝",31790:"㎠",31791:"㎤",31792:"🄀",31793:"⒈",31794:"⒉",31795:"⒊",31796:"⒋",31797:"⒌",31798:"⒍",31799:"⒎",31800:"⒏",31801:"⒐",31802:"",31803:"",31804:"",31805:"",31806:"",31807:"",31808:"🄁",31809:"🄂",31810:"🄃",31811:"🄄",31812:"🄅",31813:"🄆",31814:"🄇",31815:"🄈",31816:"🄉",31817:"🄊",31818:"㈳",31819:"㈶",31820:"㈲",31821:"㈱",31822:"㈹",31823:"㉄",31824:"▶",31825:"◀",31826:"〖",31827:"〗",31828:"⟐",31829:"²",31830:"³",31831:"🄭",31832:"",31833:"",31834:"",31835:"",31836:"",31837:"",31838:"",31839:"",31840:"",31841:"",31842:"",31843:"",31844:"",31845:"",31846:"",31847:"",31848:"",31849:"",31850:"",31851:"",31852:"",31853:"",31854:"",31855:"",31856:"",31857:"",31858:"",31859:"",31860:"",31861:"",31862:"🄬",31863:"🄫",31864:"㉇",31865:"🆐",31866:"🈦",31867:"℻",32033:"㈪",32034:"㈫",32035:"㈬",32036:"㈭",32037:"㈮",32038:"㈯",32039:"㈰",32040:"㈷",32041:"㍾",32042:"㍽",32043:"㍼",32044:"㍻",32045:"№",32046:"℡",32047:"〶",32048:"⚾",32049:"🉀",32050:"🉁",32051:"🉂",32052:"🉃",32053:"🉄",32054:"🉅",32055:"🉆",32056:"🉇",32057:"🉈",32058:"🄪",32059:"🈧",32060:"🈨",32061:"🈩",32062:"🈔",32063:"🈪",32064:"🈫",32065:"🈬",32066:"🈭",32067:"🈮",32068:"🈯",32069:"🈰",32070:"🈱",32071:"ℓ",32072:"㎏",32073:"㎐",32074:"㏊",32075:"㎞",32076:"㎢",32077:"㍱",32080:"½",32081:"↉",32082:"⅓",32083:"⅔",32084:"¼",32085:"¾",32086:"⅕",32087:"⅖",32088:"⅗",32089:"⅘",32090:"⅙",32091:"⅚",32092:"⅐",32093:"⅛",32094:"⅑",32095:"⅒",32096:"☀",32097:"☁",32098:"☂",32099:"⛄",32100:"☖",32101:"☗",32102:"⛉",32103:"⛊",32104:"♦",32105:"♥",32106:"♣",32107:"♠",32108:"⛋",32109:"⨀",32110:"‼",32111:"⁉",32112:"⛅",32113:"☔",32114:"⛆",32115:"☃",32116:"⛇",32117:"⚡",32118:"⛈",32120:"⚞",32121:"⚟",32122:"♬",32123:"☎",32289:"Ⅰ",32290:"Ⅱ",32291:"Ⅲ",32292:"Ⅳ",32293:"Ⅴ",32294:"Ⅵ",32295:"Ⅶ",32296:"Ⅷ",32297:"Ⅸ",32298:"Ⅹ",32299:"Ⅺ",32300:"Ⅻ",32301:"⑰",32302:"⑱",32303:"⑲",32304:"⑳",32305:"⑴",32306:"⑵",32307:"⑶",32308:"⑷",32309:"⑸",32310:"⑹",32311:"⑺",32312:"⑻",32313:"⑼",32314:"⑽",32315:"⑾",32316:"⑿",32317:"㉑",32318:"㉒",32319:"㉓",32320:"㉔",32321:"🄐",32322:"🄑",32323:"🄒",32324:"🄓",32325:"🄔",32326:"🄕",32327:"🄖",32328:"🄗",32329:"🄘",32330:"🄙",32331:"🄚",32332:"🄛",32333:"🄜",32334:"🄝",32335:"🄞",32336:"🄟",32337:"🄠",32338:"🄡",32339:"🄢",32340:"🄣",32341:"🄤",32342:"🄥",32343:"🄦",32344:"🄧",32345:"🄨",32346:"🄩",32347:"㉕",32348:"㉖",32349:"㉗",32350:"㉘",32351:"㉙",32352:"㉚",32353:"①",32354:"②",32355:"③",32356:"④",32357:"⑤",32358:"⑥",32359:"⑦",32360:"⑧",32361:"⑨",32362:"⑩",32363:"⑪",32364:"⑫",32365:"⑬",32366:"⑭",32367:"⑮",32368:"⑯",32369:"❶",32370:"❷",32371:"❸",32372:"❹",32373:"❺",32374:"❻",32375:"❼",32376:"❽",32377:"❾",32378:"❿",32379:"⓫",32380:"⓬",32381:"㉛"},gaiji_2_unicode:{29985:"㐂",29986:"𠅘",29987:"份",29988:"仿",29989:"侚",29990:"俉",29991:"傜",29992:"儞",29993:"冼",29994:"㔟",29995:"匇",29996:"卡",29997:"卬",29998:"詹",29999:"𠮷",3e4:"呍",30001:"咖",30002:"咜",30003:"咩",30004:"唎",30005:"啊",30006:"噲",30007:"囤",30008:"圳",30009:"圴",30010:"塚",30011:"墀",30012:"姤",30013:"娣",30014:"婕",30015:"寬",30016:"﨑",30017:"㟢",30018:"庬",30019:"弴",30020:"彅",30021:"德",30022:"怗",30023:"恵",30024:"愰",30025:"昤",30026:"曈",30027:"曙",30028:"曺",30029:"曻",30030:"桒",30031:"鿄",30032:"椑",30033:"椻",30034:"橅",30035:"檑",30036:"櫛",30037:"𣏌",30038:"𣏾",30039:"𣗄",30040:"毱",30041:"泠",30042:"洮",30043:"海",30044:"涿",30045:"淊",30046:"淸",30047:"渚",30048:"潞",30049:"濹",30050:"灤",30051:"𤋮",30052:"𤋮",30053:"煇",30054:"燁",30055:"爀",30056:"玟",30057:"玨",30058:"珉",30059:"珖",30060:"琛",30061:"琡",30062:"琢",30063:"琦",30064:"琪",30065:"琬",30066:"琹",30067:"瑋",30068:"㻚",30069:"畵",30070:"疁",30071:"睲",30072:"䂓",30073:"磈",30074:"磠",30075:"祇",30076:"禮",30077:"鿆",30078:"䄃",30241:"鿅",30242:"秚",30243:"稞",30244:"筿",30245:"簱",30246:"䉤",30247:"綋",30248:"羡",30249:"脘",30250:"脺",30251:"舘",30252:"芮",30253:"葛",30254:"蓜",30255:"蓬",30256:"蕙",30257:"藎",30258:"蝕",30259:"蟬",30260:"蠋",30261:"裵",30262:"角",30263:"諶",30264:"跎",30265:"辻",30266:"迶",30267:"郝",30268:"鄧",30269:"鄭",30270:"醲",30271:"鈳",30272:"銈",30273:"錡",30274:"鍈",30275:"閒",30276:"雞",30277:"餃",30278:"饀",30279:"髙",30280:"鯖",30281:"鷗",30282:"麴",30283:"麵"}}},3170:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.calcToBuffer=l.pngCalc=l.calc=void 0;const p=c(8764),r=c(9562);l.calc=function(i){let t=-1,n=0;const a=i.length;for(;n>>24^i[n++]];return t},l.pngCalc=function(i){let t=-1,n=0;const a=i.length;for(;n>>8^r.pngCrc32Table[255&t^i[n++]];return~t},l.calcToBuffer=function(i){let t=p.Buffer.alloc(4);return t.writeInt32BE((0,l.calc)(i),0),t}},9562:(y,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.pngCrc32Table=l.crc32Table=void 0,l.crc32Table=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188],l.pngCrc32Table=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]},9829:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i.logo_type=r.uimsbf(8),r.next(7),i.logo_id=r.uimsbf(9),r.next(4),i.logo_version=r.uimsbf(12),i.data_size=r.uimsbf(16),i.data_byte=r.readBytes(i.data_size),i}}},5074:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i.number_of_loop=r.uimsbf(8),i.common_tables=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0}),l.TsDataModuleCdtLogo=l.TsDataModuleLogo=l.TsDataModuleKeywordTable=l.TsDataModuleCommonTable=void 0;const p=c(5074);l.TsDataModuleCommonTable=p.default;const r=c(364);l.TsDataModuleKeywordTable=r.default;const i=c(7336);l.TsDataModuleLogo=i.default;const t=c(9829);l.TsDataModuleCdtLogo=t.default},364:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i.number_of_loop=r.uimsbf(8),i.keyword_tables=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i.logo_type=r.uimsbf(8),i.number_of_loop=r.uimsbf(16),i.logos=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0}),l.default=class{constructor(c){we(this,"buffer");this.buffer=c}decode(){const[c,p,r]=this.decodeDate(),[i,t,n]=this.decodeTime(),a=new Date(c,p-1,r,i,t,n),o=a.getTime(),d=60*a.getTimezoneOffset()*1e3;return new Date(o-d-324e5)}decodeDate(){const c=this.buffer.length===2?this.buffer:this.buffer.slice(0,2),p=c[0]<<8|c[1];let r=(p-15078.2)/365.25|0,i=(p-14956.1-(365.25*r|0))/30.6001|0;const t=p-14956-(365.25*r|0)-(30.6001*i|0),n=i===14||i===15?1:0;return r=r+n+1900,i=i-1-12*n,[r,i,t]}decodeTime(){const c=this.buffer.length===3?this.buffer:this.buffer.slice(2);return[10*(c[0]>>4)+(15&c[0]),10*(c[1]>>4)+(15&c[1]),10*(c[2]>>4)+(15&c[2])]}decodeOffset(){return[10*(this.buffer[0]>>4)+(15&this.buffer[0]),10*(this.buffer[1]>>4)+(15&this.buffer[1])]}}},8451:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CA_system_id=r.uimsbf(16),i.transmission_type=r.bslbf(3),i.PID=r.uimsbf(13),i.private_data_byte=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},3534:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.extention_descriptor_tag=r.uimsbf(8),i.PLP_ID=r.uimsbf(8),i.effective_symbol_length=r.uimsbf(3),i.guard_interval=r.uimsbf(3),i.bundled_channel=r.uimsbf(8),r.next(2),i.frequencies=[];r.position>>3<2+i.descriptor_length;){let t={};t.data_slice_id=r.uimsbf(8),t.tune_freq=r.uimsbf(32),t.tune_freq_type=r.uimsbf(2),t.FEC_outer=r.uimsbf(4),t.modulation=r.uimsbf(8),t.FEC_inner=r.uimsbf(4),r.next(6),i.frequencies.push(t)}return i}}},4208:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.num_of_station_point=r.uimsbf(8),i.station_points=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(4),i.stream_content=r.uimsbf(4),i.component_type=r.uimsbf(8),i.component_tag=r.uimsbf(8),i.stream_type=r.uimsbf(8),i.simulcast_group_tag=r.bslbf(8),i.ES_multi_lingual_flag=r.bslbf(1),i.main_component_flag=r.bslbf(1),i.quality_indicator=r.bslbf(2),i.sampling_rate=r.uimsbf(3),r.next(1),i.ISO_639_language_code=r.readBytes(3),i.ES_multi_lingual_flag===1&&(i.ISO_639_language_code_2=r.readBytes(3)),i.text_char=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},5141:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.free_format_flag=r.bslbf(1),i.ID=r.bslbf(1),i.layer=r.bslbf(2),i.variable_rate_audio_indicator=r.bslbf(1),r.next(3),i}}},5794:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(4),i.segmentation_mode=r.uimsbf(4),i.segmentation_info_length=r.uimsbf(8),i.segmentation_mode===0||(i.segmentation_mode===1?(r.next(7),i.start_time_NPT=r.uimsbf(33),r.next(7),i.end_time_NPT=r.uimsbf(33)):i.segmentation_mode<6?(i.start_time=r.uimsbf(24),i.duration=r.uimsbf(24),i.segmentation_info_length===10&&(i.start_time_extension=r.uimsbf(12),r.next(4),i.duration_extension=r.uimsbf(12),r.next(4))):r.next(i.segmentation_info_length<<3)),i.component_tags=[];r.position>>3<2+i.descriptor_length;){let t={};t.component_tag=r.uimsbf(8),i.component_tags.push(t)}return i}}},5066:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.title_length=r.uimsbf(8),i.title_char=r.readBytes(i.title_length),i.text_length=r.uimsbf(8),i.text_char=r.readBytes(i.text_length),i}}},7286:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.bouquet_name_char=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},2100:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.char=r.readBytes(i.descriptor_length),i}}},7841:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CA_system_id=r.uimsbf(16),i.CA_unit_id=r.uimsbf(4),i.num_of_component=r.uimsbf(4),i.components=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CA_system_id=r.uimsbf(16),i.transport_stream_id=r.uimsbf(16),i.original_network_id=r.uimsbf(16),i.power_supply_period=r.uimsbf(8),i}}},3152:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CAs=[];r.position>>3<2+i.descriptor_length;){let t={};t.CA_system_id=r.uimsbf(16),i.CAs.push(t)}return i}}},5565:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CA_system_id=r.uimsbf(16),i.ca_broadcaster_group_id=r.uimsbf(8),i.message_control=r.uimsbf(8),i.services=[];r.position>>3<2+i.descriptor_length;){let t={};t.service_id=r.uimsbf(16),i.services.push(t)}return i}}},2283:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CA_system_ID=r.uimsbf(16),r.next(3),i.CA_program_ID=r.uimsbf(13),i.second_load_flag=r.bslbf(1),i.load_indicator=r.bslbf(7),i.second_load_flag===1&&(r.next(3),i.CA_program_ID=r.uimsbf(13),r.next(1),i.load_indicator=r.bslbf(7)),i.exclusion_ID_num=r.uimsbf(8),i.exclusion_ID=[];for(let t=0;t>3)),i}}},9561:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.frequency=r.bslbf(32),r.next(8),i.frame_type=r.bslbf(4),i.FEC_outer=r.bslbf(4),i.modulation=r.bslbf(8),i.symbol_rate=r.bslbf(28),i.FEC_inner=r.bslbf(4),i}}},723:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.frequency=r.bslbf(32),r.next(8),i.frame_type=r.bslbf(4),i.FEC_outer=r.bslbf(4),i.modulation=r.bslbf(8),i.symbol_rate=r.bslbf(28),i.FEC_inner=r.bslbf(4),i.carrier_group_id=r.bslbf(8),i}}},5222:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.frequencies=[];r.position>>3<2+i.descriptor_length;){let t={};t.frequency=r.uimsbf(32),r.next(7),t.future_use_flag=r.bslbf(1),t.multiplex_frame_format_number=r.uimsbf(4),t.FEC_outer=r.uimsbf(4),t.modulation=r.uimsbf(8),t.symbol_rate=r.uimsbf(28),r.next(4),t.future_use_flag===0&&(t.future_use_data_length=r.uimsbf(8),t.future_use_data=r.readBytes(t.future_use_data_length)),t.num_of_services=r.uimsbf(28),t.services=[];for(let n=0;n{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946),r=c(9235);l.default=class{constructor(i){we(this,"buffer");this.buffer=i}decode(){let i=new p.default(this.buffer),t={};return t._raw=this.buffer,t.descriptor_tag=i.uimsbf(8),t.descriptor_length=i.uimsbf(8),t.sub_descriptors=new r.default(i.readBytesRaw(2+t.descriptor_length-(i.position>>3))).decode(),t}}},5571:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.compatibilityDescriptorLength=r.uimsbf(16),i.descriptorCount=r.uimsbf(16),i.descriptors=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(4),i.stream_content=r.uimsbf(4),i.component_type=r.uimsbf(8),i.component_tag=r.uimsbf(8),i.ISO_639_language_code=r.readBytes(3),i.text_char=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},9505:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.component_group_type=r.uimsbf(3),i.total_bit_rate_flag=r.uimsbf(1),i.num_of_group=r.uimsbf(4),i.groups=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CA_system_ID=r.uimsbf(16),r.next(3),i.CA_PID=r.uimsbf(13),i.private_data_byte=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},3336:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.conditional_playback_id=r.uimsbf(16),r.next(3),i.conditional_playback_PID=r.uimsbf(13),i}}},4117:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.connected_transmission_group_id=r.uimsbf(16),i.segment_type=r.bslbf(2),i.modulation_type_A=r.bslbf(2),i.modulation_type_B=r.bslbf(2),i.modulation_type_C=r.bslbf(2),i.additional_connected_transmission_info=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},9029:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.contents=[];r.position>>3<2+i.descriptor_length;){let t={};t.content_nibble_level_1=r.uimsbf(4),t.content_nibble_level_2=r.uimsbf(4),t.user_nibble_1=r.uimsbf(4),t.user_nibble_2=r.uimsbf(4),i.contents.push(t)}return i}}},343:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(1),i.copy_restriction_mode=r.bslbf(1),i.image_constraint_token=r.bslbf(1),i.retention_mode=r.bslbf(1),i.retention_state=r.bslbf(3),i.encryption_mode=r.bslbf(1),i}}},2399:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.copyright_identifier=r.readBytes(4),i.additional_copyright_info=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},6221:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.country_availability_flag=r.bslbf(1),r.next(7),i.country_availabilities=[];r.position>>3<2+i.descriptor_length;){let t={};t.country_code=r.readBytes(3),i.country_availabilities.push(t)}return i}}},6172:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.data_broadcast_id=r.uimsbf(16),i.id_selector_byte=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},4413:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.data_component_id=r.uimsbf(16),i.additional_data_component_info=r.readBytes(i.descriptor_length-2),i}}},971:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.data_component_id=r.uimsbf(16),i.entry_component=r.uimsbf(8),i.selector_length=r.uimsbf(8),i.selector_byte=r.readBytes(i.selector_length),i.num_of_component_ref=r.uimsbf(8),i.component_ref=r.readBytes(i.num_of_component_ref),i.ISO_639_language_code=r.readBytes(3),i.text_length=r.uimsbf(8),i.text_char=r.readBytes(i.text_length),i}}},1709:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.alignment_type=r.uimsbf(8),i}}},1018:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};if(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.digital_recording_control_data=r.bslbf(2),i.maximum_bitrate_flag=r.bslbf(1),i.component_control_flag=r.bslbf(1),i.user_defined=r.bslbf(4),i.maximum_bitrate_flag===1&&(i.maximum_bitrate=r.uimsbf(8)),i.component_control_flag===1){i.component_control_length=r.uimsbf(8),i.component_controls=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.DL_system_ID=r.uimsbf(8),r.next(3),i.PID=r.uimsbf(13),i.encrypt_protocol_number=r.uimsbf(8),i.encrypt_info=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},928:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946),r=c(5571),i=c(9235);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){let t=new p.default(this.buffer),n={};if(n._raw=this.buffer,n.descriptor_tag=t.uimsbf(8),n.descriptor_length=t.uimsbf(8),n.reboot=t.bslbf(1),n.add_on=t.bslbf(1),n.compatibility_flag=t.bslbf(1),n.module_info_flag=t.bslbf(1),n.text_info_flag=t.bslbf(1),t.next(3),n.component_size=t.uimsbf(32),n.download_id=t.uimsbf(32),n.time_out_value_DII=t.uimsbf(32),n.leak_rate=t.uimsbf(22),t.next(2),n.component_tag=t.uimsbf(8),n.compatibility_flag===1){let a=t.buffer[t.position>>3]<<8|t.buffer[1+(t.position>>3)];n.compatibilityDescriptor=new r.default(t.readBytesRaw(2+a)).decode()}if(n.module_info_flag===1){n.num_of_modules=t.uimsbf(16),n.modules=[];for(let a=0;a{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.services=[];r.position>>3<2+i.descriptor_length;){let t={};t.service_id=r.uimsbf(16),t.start_end_flag=r.bslbf(1),t.signal_level=r.bslbf(1),r.next(6),t.area_code_length=r.uimsbf(8),t.area_codes=[];for(let n=(r.position>>3)+i.area_code_length;r.position>>3{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.group_type=r.uimsbf(4),i.event_count=r.uimsbf(4),i.events=[];for(let t=0;t>3<2+i.descriptor_length;){let t={};t.original_network_id=r.uimsbf(16),t.transport_stream_id=r.uimsbf(16),t.service_id=r.uimsbf(16),t.event_id=r.uimsbf(16),i.other_network_events.push(t)}else i.private_data_byte=r.readBytes(2+i.descriptor_length-(r.position>>3));return i}}},7263:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};if(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.broadcaster_type=r.uimsbf(4),r.next(4),i.broadcaster_type===1){i.terrestrial_broadcaster_id=r.uimsbf(16),i.number_of_affiliation_id_loop=r.uimsbf(4),i.number_of_broadcaster_id_loop=r.uimsbf(4),i.affiliations=[],i.broadcasters=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.descriptor_number=r.uimsbf(4),i.last_descriptor_number=r.uimsbf(4),i.ISO_639_language_code=r.readBytes(3),i.length_of_items=r.uimsbf(8),i.items=[];for(let t=0;t{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(7),i.quality_level=r.bslbf(1),r.next(3),i.reference_PID=r.uimsbf(13),i}}},263:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(1),i.temporal_scalability_flag=r.bslbf(1),i.spatial_scalability_flag=r.bslbf(1),i.quality_scalability_flag=r.bslbf(1),i.hierarchy_type=r.uimsbf(4),r.next(2),i.hierarchy_layer_index=r.uimsbf(6),i.tref_present_flag=r.bslbf(1),r.next(1),i.hierarchy_embedded_layer_index=r.uimsbf(6),r.next(2),i.hierarchy_channel=r.uimsbf(6),i}}},1661:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.has_location=r.bslbf(1),i.location_type=r.bslbf(1),i.format=r.uimsbf(4),r.next(2),i.has_location&&(i.location_type===0?(i.component_tag=r.uimsbf(8),i.module_id=r.uimsbf(16)):(i.URL_length=r.uimsbf(8),i.URL_byte=r.readBytes(i.URL_length))),i}}},5234:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.hyper_linkage_type=r.uimsbf(8),i.link_destination_type=r.uimsbf(8),i.selector_length=r.uimsbf(8),i.selector=r.readBytes(i.selector_length),i.private_data=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},7331:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.closed_gop_flag=r.uimsbf(1),i.identical_gop_flag=r.uimsbf(1),i.max_gop_length=r.uimsbf(14),i}}},9073:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TsDescriptorDataContent=l.TsDescriptorTargetRegion=l.TsDescriptorHyperlink=l.TsDescriptorAudioComponent=l.TsDescriptorPartialTransportStreamTime=l.TsDescriptorNetworkIdentification=l.TsDescriptorDigitalCopyControl=l.TsDescriptorHierarchicalTransmission=l.TsDescriptorHybridInformation=l.TsDescriptorMaterialInformation=l.TsDescriptorDataBroadcastId=l.TsDescriptorPartialTransportStream=l.TsDescriptorLocalTimeOffset=l.TsDescriptorParentalRating=l.TsDescriptorContent=l.TsDescriptorCaIdentifier=l.TsDescriptorStreamIdentifier=l.TsDescriptorMosaic=l.TsDescriptorComponent=l.TsDescriptorTimeShiftedEvent=l.TsDescriptorExtendedEvent=l.TsDescriptorShortEvent=l.TsDescriptorTimeShiftedService=l.TsDescriptorNearVideoOnDemandReference=l.TsDescriptorLinkage=l.TsDescriptorCountryAvailability=l.TsDescriptorService=l.TsDescriptorBouquetName=l.TsDescriptorCableDeliverySystem=l.TsDescriptorSatelliteDeliverySystem=l.TsDescriptorStuffing=l.TsDescriptorServiceList=l.TsDescriptorNetworkName=l.TsDescriptorIbp=l.TsDescriptorStd=l.TsDescriptorSmoothingBuffer=l.TsDescriptorPrivateDataIndicator=l.TsDescriptorCopyright=l.TsDescriptorMultiplexBufferUtilization=l.TsDescriptorSystemClock=l.TsDescriptorIso639Language=l.TsDescriptorConditionalAccess=l.TsDescriptorVideoWindow=l.TsDescriptorTargetBackgroundGrid=l.TsDescriptorDataStreamAlignment=l.TsDescriptorRegistration=l.TsDescriptorHierarchy=l.TsDescriptorAudioStream=l.TsDescriptorVideoStream=l.TsDescriptorUnknown=void 0,l.TsDescriptorSystemManagement=l.TsDescriptorDataComponent=l.TsDescriptorEmergencyInformation=l.TsDescriptorPartialReception=l.TsDescriptorTerrestrialDeliverySystem=l.TsDescriptorCableTsDivisionSystem=l.TsDescriptorConditionalPlayback=l.TsDescriptorCarouselCompatibleComposite=l.TsDescriptorAccessControl=l.TsDescriptorScrambleSystem=l.TsDescriptorAdvancedCableDeliverySystem=l.TsDescriptorCableMulticarrierTransmissionDeliverySystem=l.TsDescriptorCaStartup=l.TsDescriptorDlProtection=l.TsDescriptorNetworkDownloadContent=l.TsDescriptorAreaBroadcastingInformation=l.TsDescriptorServiceGroup=l.TsDescriptorContentAvailability=l.TsDescriptorConnectedTransmission=l.TsDescriptorLdtLinkage=l.TsDescriptorBoardInformation=l.TsDescriptorSiPrimeTs=l.TsDescriptorComponentGroup=l.TsDescriptorBroadcasterName=l.TsDescriptorSiParameter=l.TsDescriptorEventGroup=l.TsDescriptorSeries=l.TsDescriptorStcReference=l.TsDescriptorShortNodeInformation=l.TsDescriptorNodeRelation=l.TsDescriptorReference=l.TsDescriptorBasicLocalEvent=l.TsDescriptorLogoTransmission=l.TsDescriptorExtendedBroadcaster=l.TsDescriptorTsInformation=l.TsDescriptorCaService=l.TsDescriptorCaContractInfo=l.TsDescriptorCaEmmTs=l.TsDescriptorDownloadContent=l.TsDescriptorVideoDecodeControl=void 0;const p=c(7801);l.TsDescriptorUnknown=p.default;const r=c(56);l.TsDescriptorVideoStream=r.default;const i=c(5141);l.TsDescriptorAudioStream=i.default;const t=c(263);l.TsDescriptorHierarchy=t.default;const n=c(1115);l.TsDescriptorRegistration=n.default;const a=c(1709);l.TsDescriptorDataStreamAlignment=a.default;const o=c(355);l.TsDescriptorTargetBackgroundGrid=o.default;const d=c(1779);l.TsDescriptorVideoWindow=d.default;const g=c(4201);l.TsDescriptorConditionalAccess=g.default;const m=c(6413);l.TsDescriptorIso639Language=m.default;const v=c(6986);l.TsDescriptorSystemClock=v.default;const b=c(9190);l.TsDescriptorMultiplexBufferUtilization=b.default;const w=c(2399);l.TsDescriptorCopyright=w.default;const C=c(7251);l.TsDescriptorPrivateDataIndicator=C.default;const D=c(7600);l.TsDescriptorSmoothingBuffer=D.default;const R=c(3437);l.TsDescriptorStd=R.default;const T=c(7331);l.TsDescriptorIbp=T.default;const P=c(1885);l.TsDescriptorNetworkName=P.default;const L=c(2645);l.TsDescriptorServiceList=L.default;const I=c(5189);l.TsDescriptorStuffing=I.default;const x=c(181);l.TsDescriptorSatelliteDeliverySystem=x.default;const O=c(9561);l.TsDescriptorCableDeliverySystem=O.default;const G=c(7286);l.TsDescriptorBouquetName=G.default;const J=c(2761);l.TsDescriptorService=J.default;const te=c(6221);l.TsDescriptorCountryAvailability=te.default;const le=c(6559);l.TsDescriptorLinkage=le.default;const ne=c(923);l.TsDescriptorNearVideoOnDemandReference=ne.default;const ee=c(5636);l.TsDescriptorTimeShiftedService=ee.default;const M=c(2703);l.TsDescriptorShortEvent=M.default;const Y=c(8529);l.TsDescriptorExtendedEvent=Y.default;const j=c(1768);l.TsDescriptorTimeShiftedEvent=j.default;const z=c(3691);l.TsDescriptorComponent=z.default;const q=c(9255);l.TsDescriptorMosaic=q.default;const Z=c(6137);l.TsDescriptorStreamIdentifier=Z.default;const X=c(3152);l.TsDescriptorCaIdentifier=X.default;const oe=c(9029);l.TsDescriptorContent=oe.default;const he=c(4385);l.TsDescriptorParentalRating=he.default;const ie=c(1216);l.TsDescriptorLocalTimeOffset=ie.default;const fe=c(6546);l.TsDescriptorPartialTransportStream=fe.default;const se=c(6172);l.TsDescriptorDataBroadcastId=se.default;const Ee=c(3529);l.TsDescriptorMaterialInformation=Ee.default;const He=c(1661);l.TsDescriptorHybridInformation=He.default;const Ie=c(3494);l.TsDescriptorHierarchicalTransmission=Ie.default;const at=c(1018);l.TsDescriptorDigitalCopyControl=at.default;const je=c(8286);l.TsDescriptorNetworkIdentification=je.default;const ht=c(8857);l.TsDescriptorPartialTransportStreamTime=ht.default;const _e=c(7602);l.TsDescriptorAudioComponent=_e.default;const Oe=c(5234);l.TsDescriptorHyperlink=Oe.default;const pt=c(9937);l.TsDescriptorTargetRegion=pt.default;const vt=c(971);l.TsDescriptorDataContent=vt.default;const tt=c(6412);l.TsDescriptorVideoDecodeControl=tt.default;const pe=c(928);l.TsDescriptorDownloadContent=pe.default;const ue=c(4775);l.TsDescriptorCaEmmTs=ue.default;const W=c(7841);l.TsDescriptorCaContractInfo=W.default;const ke=c(5565);l.TsDescriptorCaService=ke.default;const Ae=c(4464);l.TsDescriptorTsInformation=Ae.default;const Ye=c(7263);l.TsDescriptorExtendedBroadcaster=Ye.default;const lt=c(4883);l.TsDescriptorLogoTransmission=lt.default;const mt=c(5794);l.TsDescriptorBasicLocalEvent=mt.default;const Ue=c(5257);l.TsDescriptorReference=Ue.default;const Ve=c(4154);l.TsDescriptorNodeRelation=Ve.default;const De=c(3835);l.TsDescriptorShortNodeInformation=De.default;const Re=c(270);l.TsDescriptorStcReference=Re.default;const ut=c(2763);l.TsDescriptorSeries=ut.default;const gt=c(7055);l.TsDescriptorEventGroup=gt.default;const Ce=c(7178);l.TsDescriptorSiParameter=Ce.default;const ze=c(2100);l.TsDescriptorBroadcasterName=ze.default;const At=c(9505);l.TsDescriptorComponentGroup=At.default;const Je=c(1514);l.TsDescriptorSiPrimeTs=Je.default;const $e=c(5066);l.TsDescriptorBoardInformation=$e.default;const Be=c(9098);l.TsDescriptorLdtLinkage=Be.default;const it=c(4117);l.TsDescriptorConnectedTransmission=it.default;const Ne=c(343);l.TsDescriptorContentAvailability=Ne.default;const Qe=c(3992);l.TsDescriptorServiceGroup=Qe.default;const Me=c(4208);l.TsDescriptorAreaBroadcastingInformation=Me.default;const Se=c(9821);l.TsDescriptorNetworkDownloadContent=Se.default;const K=c(8737);l.TsDescriptorDlProtection=K.default;const xe=c(2283);l.TsDescriptorCaStartup=xe.default;const be=c(723);l.TsDescriptorCableMulticarrierTransmissionDeliverySystem=be.default;const Te=c(3534);l.TsDescriptorAdvancedCableDeliverySystem=Te.default;const V=c(8345);l.TsDescriptorScrambleSystem=V.default;const N=c(8451);l.TsDescriptorAccessControl=N.default;const S=c(2955);l.TsDescriptorCarouselCompatibleComposite=S.default;const F=c(3336);l.TsDescriptorConditionalPlayback=F.default;const re=c(5222);l.TsDescriptorCableTsDivisionSystem=re.default;const ce=c(9219);l.TsDescriptorTerrestrialDeliverySystem=ce.default;const me=c(6566);l.TsDescriptorPartialReception=me.default;const ye=c(1602);l.TsDescriptorEmergencyInformation=ye.default;const Pe=c(4413);l.TsDescriptorDataComponent=Pe.default;const We=c(5506);l.TsDescriptorSystemManagement=We.default},6413:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.ISO_639_languages=[];r.position>>3<2+i.descriptor_length;){let t={};t.ISO_639_language_code=r.readBytes(3),t.audio_type=r.bslbf(8),i.ISO_639_languages.push(t)}return i}}},9098:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.original_service_id=r.uimsbf(16),i.transport_stream_id=r.uimsbf(16),i.original_network_id=r.uimsbf(16),i.descriptions=[];r.position>>3<2+i.descriptor_length;){let t={};t.description_id=r.uimsbf(16),r.uimsbf(4),t.description_type=r.uimsbf(4),t.user_defined=r.bslbf(8),i.descriptions.push(t)}return i}}},6559:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.transport_stream_id=r.uimsbf(16),i.original_network_id=r.uimsbf(16),i.service_id=r.bslbf(16),i.linkage_type=r.uimsbf(8),i.private_data_byte=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},1216:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.local_time_offsets=[];r.position>>3<2+i.descriptor_length;){let t={};t.country_code=r.readBytes(3),t.country_region_id=r.bslbf(6),r.next(1),t.local_time_offset_polarity=r.bslbf(1),t.local_time_offset=r.readBytes(2),t.time_of_change=r.readBytes(5),t.next_time_offset=r.readBytes(2),i.local_time_offsets.push(t)}return i}}},4883:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.logo_transmission_type=r.uimsbf(8),i.logo_transmission_type===1?(r.next(7),i.logo_id=r.uimsbf(9),r.next(4),i.logo_version=r.uimsbf(12),i.download_data_id=r.uimsbf(16)):i.logo_transmission_type===2?(r.next(7),i.logo_id=r.uimsbf(9)):i.logo_transmission_type===3&&(i.logo_char=r.readBytes(2+i.descriptor_length-(r.position>>3))),i}}},3529:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.descriptor_number=r.uimsbf(4),i.last_descriptor_number=r.uimsbf(4),i.number_of_material_set=r.uimsbf(8),i.material_sets=[];r.position>>3<2+i.descriptor_length;){let t={};t.material_type=r.uimsbf(8),t.material_name_length=r.uimsbf(8),t.material_name_char=r.readBytes(t.material_name_length),t.material_code_type=r.uimsbf(8),t.material_code_length=r.uimsbf(8),t.material_code_char=r.readBytes(t.material_code_length),t.material_period_flag=r.bslbf(1),r.next(7),t.material_period_flag===1&&(t.material_period=r.readBytes(3)),t.material_url_type=r.uimsbf(8),t.material_url_length=r.uimsbf(8),t.material_url_char=r.readBytes(t.material_url_length),t.reserved_future_use_length=r.uimsbf(8),r.next(8*t.reserved_future_use_length),i.material_sets.push(t)}return i}}},9255:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.mosaic_entry_point=r.bslbf(1),i.number_of_horizontal_elementary_cells=r.uimsbf(3),r.next(1),i.number_of_vertical_elementary_cells=r.uimsbf(3),i.logical_cells=[];r.position>>3<2+i.descriptor_length;){let t={};t.logical_cell_id=r.uimsbf(6),r.next(7),t.logical_cell_presentation_info=r.uimsbf(3),t.elementary_cell_field_length=r.uimsbf(8),t.elementary_cell_fields=[];for(let n=0;n{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.bound_valid_flag=r.bslbf(1),i.LTW_offset_lower_bound=r.uimsbf(15),r.next(1),i.LTW_offset_upper_bound=r.uimsbf(14),i}}},923:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.NVOD_references=[];r.position>>3<2+i.descriptor_length;){let t={};t.transport_stream_id=r.uimsbf(16),t.original_network_id=r.uimsbf(16),t.service_id=r.uimsbf(16),i.NVOD_references.push(t)}return i}}},9821:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946),r=c(5571);l.default=class{constructor(i){we(this,"buffer");this.buffer=i}decode(){let i=new p.default(this.buffer),t={};if(t._raw=this.buffer,t.descriptor_tag=i.uimsbf(8),t.descriptor_length=i.uimsbf(8),t.reboot=i.bslbf(1),t.add_on=i.bslbf(1),t.compatibility_flag=i.bslbf(1),t.text_info_flag=i.bslbf(1),i.next(4),t.component_size=i.uimsbf(32),t.session_protcol_number=i.uimsbf(8),t.session_id=i.uimsbf(32),t.retry=i.uimsbf(8),t.connect_timer=i.uimsbf(24),t.address_type=i.uimsbf(8),t.address_type===0&&(t.ipv4_address=i.readBytes(4),t.port_number=i.uimsbf(16)),t.address_type===1&&(t.ipv6_address=i.readBytes(16),t.port_number=i.uimsbf(16)),t.address_type===2&&(t.URL_length=i.uimsbf(8),t.URL_byte=i.readBytes(t.URL_length)),t.compatibility_flag===1){let n=i.buffer[i.position>>3]<<8|i.buffer[1+(i.position>>3)];t.compatibilityDescriptor=new r.default(i.readBytesRaw(2+n)).decode()}return t.private_data_length=i.uimsbf(8),t.private_data_byte=i.readBytes(t.private_data_length),t.text_info_flag===1&&(t.ISO_639_language_code=i.uimsbf(24),t.text_length=i.uimsbf(8),t.text_char=i.readBytes(t.text_length)),t}}},8286:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.country_code=r.readBytes(3),i.media_type=r.bslbf(16),i.network_id=r.uimsbf(16),i.private_data=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},1885:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.network_name_char=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},4154:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.reference_type=r.uimsbf(4),i.external_reference_flag=r.bslbf(1),r.next(3),i.external_reference_flag===1&&(i.information_provider_id=r.uimsbf(16),i.event_relation_id=r.uimsbf(16)),i.reference_node_id=r.uimsbf(16),i.reference_number=r.uimsbf(8),i}}},4385:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.parental_ratings=[];r.position>>3<2+i.descriptor_length;){let t={};t.country_code=r.readBytes(3),t.rating=r.uimsbf(8),i.parental_ratings.push(t)}return i}}},6566:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.services=[];r.position>>3<2+i.descriptor_length;){let t={};t.service_id=r.uimsbf(16),i.services.push(t)}return i}}},6546:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(2),i.peak_rate=r.uimsbf(22),r.next(2),i.minimum_overall_smoothing_rate=r.uimsbf(22),r.next(2),i.maximum_overall_smoothing_buffer=r.uimsbf(14),i}}},8857:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.event_version_number=r.uimsbf(8),i.event_start_time=r.readBytes(5),i.duration=r.readBytes(3),i.offset=r.readBytes(3),r.next(5),i.offset_flag=r.bslbf(1),i.other_descriptor_status=r.bslbf(1),i.jst_time_flag=r.bslbf(1),i.jst_time_flag===1&&(i.jst_time=r.readBytes(5)),i}}},7251:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.private_data_indicator=r.readBytes(4),i}}},5257:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.information_provider_id=r.uimsbf(16),i.event_relation_id=r.uimsbf(16),i.references=[];r.position>>3<2+i.descriptor_length;){let t={};t.reference_node_id=r.uimsbf(16),t.reference_number=r.uimsbf(8),t.last_reference_number=r.uimsbf(8),i.references.push(t)}return i}}},1115:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.format_identifier=r.uimsbf(32),i.additional_identification_info=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},181:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.frequency=r.bslbf(32),i.orbital_position=r.bslbf(16),i.west_east_flag=r.bslbf(1),i.polarisation=r.bslbf(2),i.modulation=r.bslbf(5),i.symbol_rate=r.bslbf(28),i.FEC_inner=r.bslbf(4),i}}},8345:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.scramble_system_id=r.uimsbf(8),i}}},2763:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.series_id=r.uimsbf(16),i.repeat_label=r.uimsbf(4),i.program_pattern=r.uimsbf(3),i.expire_date_valid_flag=r.uimsbf(1),i.expire_date=r.uimsbf(16),i.episode_number=r.uimsbf(12),i.last_episode_number=r.uimsbf(12),i.series_name_char=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},2761:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.service_type=r.uimsbf(8),i.service_provider_name_length=r.uimsbf(8),i.service_provider_name_char=r.readBytes(i.service_provider_name_length),i.service_name_length=r.uimsbf(8),i.service_name_char=r.readBytes(i.service_name_length),i}}},3992:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};if(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.service_group_type=r.uimsbf(4),r.next(4),i.service_group_type===1)for(i.service_groups=[];r.position>>3<2+i.descriptor_length;){let t={};t.primary_service_id=r.uimsbf(16),t.secondary_service_id=r.uimsbf(16),i.service_groups.push(t)}else i.private_data_byte=r.readBytes(2+i.descriptor_length-(r.position>>3));return i}}},2645:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.services=[];r.position>>3<2+i.descriptor_length;){let t={};t.service_id=r.uimsbf(16),t.service_type=r.uimsbf(8),i.services.push(t)}return i}}},2703:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.ISO_639_language_code=r.readBytes(3),i.event_name_length=r.uimsbf(8),i.event_name_char=r.readBytes(i.event_name_length),i.text_length=r.uimsbf(8),i.text_char=r.readBytes(i.text_length),i}}},3835:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.ISO_639_language_code=r.bslbf(24),i.node_name_length=r.uimsbf(8),i.node_name_char=r.readBytes(i.node_name_length),i.text_length=r.uimsbf(8),i.text_char=r.readBytes(i.text_length),i}}},7178:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);function r(a){let o=new p.default(a),d={};return d._raw=a,d.table_id=o.uimsbf(8),d.table_description_length=o.uimsbf(8),d.table_cycle=o.uimsbf(8),d}function i(a){let o=new p.default(a),d={};return d._raw=a,d.table_id=o.uimsbf(8),d.table_description_length=o.uimsbf(8),d.table_cycle=o.uimsbf(16),d}function t(a){let o=new p.default(a),d={};return d._raw=a,d.table_id=o.uimsbf(8),d.table_description_length=o.uimsbf(8),d.table_cycle_H_EIT=o.uimsbf(8),d.table_cycle_M_EIT=o.uimsbf(8),d.table_cycle_L_EIT=o.uimsbf(8),d.num_of_M_EIT_event=o.uimsbf(4),d.num_of_L_EIT_event=o.uimsbf(4),d}function n(a){let o=new p.default(a),d={};for(d._raw=a,d.table_id=o.uimsbf(8),d.table_description_length=o.uimsbf(8),d.loops=[];d.table_description_length+2>o.position>>3;){const g=o.uimsbf(2),m=o.uimsbf(2),v=o.uimsbf(1);o.next(3);const b=o.uimsbf(8),w=o.uimsbf(12);o.next(2);const C=o.uimsbf(2),D=[];for(let R=0;Ra.position>>3;){const d=a.uimsbf(8),g=a.uimsbf(8);a.previous(16);const m=a.readBytes(g+2);switch(d){case 64:case 196:case 66:case 70:o.table_descriptions.push(r(m));break;case 78:case 79:o.table_descriptions.push(t(m));break;case 80:case 96:case 88:o.table_descriptions.push(n(m));break;case 195:case 200:o.table_descriptions.push(i(m));break;default:o.table_descriptions.push({table_id:d,table_description_length:g,_raw:m})}}return o}}},1514:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.parameter_version=r.uimsbf(8),i.update_time=r.uimsbf(16),i.SI_prime_ts_network_id=r.uimsbf(16),i.SI_prime_transport_stream_id=r.uimsbf(16),i.tables=[];r.position>>3<2+i.descriptor_length;){let t={};t.table_id=r.uimsbf(8),t.table_description_length=r.uimsbf(8),t.table_description_byte=r.readBytes(t.table_description_length),i.tables.push(t)}return i}}},7600:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(2),i.sb_leak_rate=r.uimsbf(22),r.next(2),i.sb_size=r.uimsbf(22),i}}},270:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(3),i.external_event_flag=r.bslbf(1),i.STC_reference_mode=r.uimsbf(4),i.external_event_flag===1&&(i.external_event_id=r.uimsbf(16),i.external_service_id=r.uimsbf(16),i.external_network_id=r.uimsbf(16)),i.STC_reference_mode===0||(i.STC_reference_mode===1?(r.next(7),i.NPT_reference=r.uimsbf(33),r.next(7),i.STC_reference=r.uimsbf(33)):i.STC_reference_mode!==3&&i.STC_reference_mode!==5||(i.time_reference=r.uimsbf(24),i.time_reference_extention=r.uimsbf(12),r.next(11),i.STC_reference=r.uimsbf(33))),i}}},3437:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),r.next(7),i.leak_valid_flag=r.bslbf(1),i}}},6137:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.component_tag=r.uimsbf(8),i}}},5189:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.stuffing_byte=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},6986:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.external_clock_reference_indicator=r.bslbf(1),r.next(1),i.clock_accuracy_integer=r.uimsbf(6),i.clock_accuracy_exponent=r.uimsbf(3),r.next(5),i}}},5506:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.system_management_id=r.uimsbf(16),i.additional_identification_info=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},355:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.horizontal_size=r.uimsbf(14),i.vertical_size=r.uimsbf(14),i.aspect_ratio_information=r.uimsbf(4),i}}},9937:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.region_spec_type=r.uimsbf(8),i.target_region_spec={},i.region_spec_type===1&&(i.target_region_spec.prefecture_bitmap=r.readBytes(7)),i}}},9219:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};for(i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.area_code=r.bslbf(12),i.guard_interval=r.bslbf(2),i.transmission_mode=r.bslbf(2),i.frequencies=[];r.position>>3<2+i.descriptor_length;){let t={};t.frequency=r.uimsbf(16),i.frequencies.push(t)}return i}}},1768:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.reference_service_id=r.uimsbf(16),i.reference_event_id=r.uimsbf(16),i}}},5636:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.reference_service_id=r.uimsbf(16),i}}},4464:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.remote_control_key_id=r.uimsbf(8),i.length_of_ts_name=r.uimsbf(6),i.transmission_type_count=r.uimsbf(2),i.ts_name_char=r.readBytes(i.length_of_ts_name),i.transmission_types=[];for(let t=0;t>3<2+i.descriptor_length;)r.next(8);return i}}},7801:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.descriptor=r.readBytes(i.descriptor_length),i}}},6412:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.still_picture_flag=r.bslbf(1),i.sequence_end_code_flag=r.bslbf(1),i.video_encode_format=r.bslbf(4),r.next(2),i}}},56:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.multiple_frame_rate_flag=r.bslbf(1),i.frame_rate_code=r.uimsbf(4),i.MPEG_1_only_flag=r.bslbf(1),i.constrained_parameter_flag=r.bslbf(1),i.still_picture_flag=r.bslbf(1),i.MPEG_1_only_flag===0&&(i.profile_and_level_indication=r.uimsbf(8),i.chroma_format=r.uimsbf(2),i.frame_rate_extension_flag=r.bslbf(1),r.next(5)),i}}},1779:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.horizontal_offset=r.uimsbf(14),i.vertical_offset=r.uimsbf(14),i.window_priority=r.uimsbf(4),i}}},1241:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(9073);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=[];for(let i=0;i{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8764),r=c(4018),i=c(2172),t=c(8090);l.default=class{constructor(){we(this,"epg");this.epg=new Map}needUpdate(n,a){return n===null||(n.table_id!==78&&n.table_id!==79||a.table_id===78||a.table_id===79)&&n.version_number!==a.version_number}addEit(n,a,o){if(n!==18||a.current_next_indicator===0)return!1;let d=a.original_network_id,g=a.transport_stream_id,m=a.service_id,v=this.epg,b=null,w=null,C=null;if(v.has(d)?b=v.get(d):(b=new Map,v.set(d,b)),b.has(g)?w=b.get(g):(w=new Map,b.set(g,w)),w.has(m))C=w.get(m);else{C={pf:{present:null,following:null},schedule:{},basic_flags:{flags:[],last_flags_id:-1},extended_flags:{flags:[],last_flags_id:-1}};for(let D of[C.basic_flags,C.extended_flags])for(let R=0;R<8;R++)D.flags.push({flag:p.Buffer.alloc(32,0),ignore:p.Buffer.alloc(32,255),version_number:-1});w.set(m,C)}for(let D of a.events){let R;if(C.schedule.hasOwnProperty(D.event_id)){if(R=C.schedule[D.event_id],this.needUpdate(R,D)){let P=new i.default(D.start_time).decode(),L=new i.default(D.duration).decodeTime();R.table_id=a.table_id,R.version_number=a.version_number,R.event_id=D.event_id,R.start_time=P,R.duration=3600*L[0]+60*L[1]+L[2],R.running_status=D.running_status,R.free_CA_mode=D.free_CA_mode}}else{R={};let P=new i.default(D.start_time).decode(),L=new i.default(D.duration).decodeTime();R.table_id=a.table_id,R.version_number=a.version_number,R.event_id=D.event_id,R.start_time=P,R.duration=3600*L[0]+60*L[1]+L[2],R.running_status=D.running_status,R.free_CA_mode=D.free_CA_mode,R.short_event=null,R.extended_event=null,R.component=null,R.content=null,R.audio_component=null,R.event_group=null,C.schedule[D.event_id]=R}a.table_id!==78&&a.table_id!==79||(a.section_number===0?C.pf.present=R:a.section_number===1&&(C.pf.following=R));let T={short_event:{descriptor:null,needUpdate:this.needUpdate(R.short_event,R),item_description:null},extended_event:{descriptor:null,needUpdate:this.needUpdate(R.extended_event,R)},component:{descriptor:null,needUpdate:this.needUpdate(R.component,R)},content:{descriptor:null,needUpdate:this.needUpdate(R.content,R)},audio_component:{descriptor:null,needUpdate:this.needUpdate(R.audio_component,R)},event_group:{descriptor:null,needUpdate:this.needUpdate(R.event_group,R)}};for(let P of D.descriptors)switch(P.descriptor_tag){case 77:let L=T.short_event;if(!L.needUpdate)break;L.descriptor===null&&(L.descriptor={}),L.descriptor.table_id=a.table_id,L.descriptor.version_number=a.version_number,L.descriptor.ISO_639_language_code=String.fromCharCode(...P.ISO_639_language_code),L.descriptor.event_name=new r.default(P.event_name_char).decode(),L.descriptor.text=new r.default(P.text_char).decode();break;case 78:let I=T.extended_event;if(!I.needUpdate)break;I.descriptor===null&&(I.descriptor={}),I.descriptor.table_id=a.table_id,I.descriptor.version_number=a.version_number,I.descriptor.ISO_639_language_code=String.fromCharCode(...P.ISO_639_language_code),I.descriptor.items=I.descriptor.items||[],I.descriptor.text=new r.default(P.text_char).decode(),P.items.forEach(te=>{te.item_description_length!==0&&(typeof I.descriptor.items=="string"&&(I.descriptor.items=[I.descriptor.items]),I.descriptor.items.length!==0&&I.descriptor.items.push(`\r \r `),I.descriptor.items.push([te.item_description_char]),I.descriptor.items.push(`\r -`),I.descriptor.items.push([])),I.descriptor.items[I.descriptor.items.length-1].push(te.item_char),P.descriptor_number===P.last_descriptor_number&&(I.descriptor.items=I.descriptor.items.map(le=>Array.isArray(le)?new r.default(p.Buffer.concat(le)).decode():le).join(""))});break;case 80:let x=T.component;if(!x.needUpdate)break;x.descriptor===null&&(x.descriptor={}),x.descriptor.table_id=a.table_id,x.descriptor.version_number=a.version_number,x.descriptor.stream_content=P.stream_content,x.descriptor.component_type=P.component_type,x.descriptor.component_tag=P.component_tag,x.descriptor.ISO_639_language_code=String.fromCharCode(...P.ISO_639_language_code),x.descriptor.text=new r.default(P.text_char).decode(),x.descriptor.component_text=t.default.component.hasOwnProperty(P.stream_content)&&t.default.component[P.stream_content].hasOwnProperty(P.component_type)?t.default.component[P.stream_content][P.component_type]:"";break;case 84:let O=T.content;if(!O.needUpdate)break;O.descriptor===null&&(O.descriptor={}),O.descriptor.table_id=a.table_id,O.descriptor.version_number=a.version_number,O.descriptor.contents=P.contents.map(te=>({content_nibble_level_1:te.content_nibble_level_1,content_nibble_level_2:te.content_nibble_level_2,user_nibble_1:te.user_nibble_1,user_nibble_2:te.user_nibble_2,content_nibble_level_1_text:t.default.nibble.level_1[te.content_nibble_level_1],content_nibble_level_2_text:t.default.nibble.level_2[te.content_nibble_level_1][te.content_nibble_level_2]}));break;case 196:let G=T.audio_component;if(!G.needUpdate)break;G.descriptor===null&&(G.descriptor={}),G.descriptor.table_id=a.table_id,G.descriptor.version_number=a.version_number,G.descriptor.stream_content=P.stream_content,G.descriptor.component_type=P.component_type,G.descriptor.component_tag=P.component_tag,G.descriptor.stream_type=P.stream_type,G.descriptor.simulcast_group_tag=P.simulcast_group_tag,G.descriptor.ES_multi_lingual_flag=P.ES_multi_lingual_flag,G.descriptor.main_component_flag=P.main_component_flag,G.descriptor.quality_indicator=P.quality_indicator,G.descriptor.sampling_rate=P.sampling_rate,G.descriptor.ISO_639_language_code=String.fromCharCode(...P.ISO_639_language_code),G.descriptor.ES_multi_lingual_flag===1&&(G.descriptor.ISO_639_language_code_2=String.fromCharCode(...P.ISO_639_language_code_2)),G.descriptor.text_char=new r.default(P.text_char).decode(),G.descriptor.dialog_control_text=t.default.dialog_control[P.component_type>>7],G.descriptor.audio_for_handicapped_text=t.default.audio_for_handicapped[P.component_type>>5&3],G.descriptor.audio_mode_text=t.default.audio_mode[31&P.component_type],G.descriptor.quality_indicator_text=t.default.quality_indicator[P.quality_indicator],G.descriptor.sampling_rate_text=t.default.sampling_rate[P.sampling_rate];break;case 214:let J=T.event_group;if(!J.needUpdate)break;J.descriptor===null&&(J.descriptor={}),J.descriptor.table_id=a.table_id,J.descriptor.version_number=a.version_number,J.descriptor.group_type=P.group_type,J.descriptor.event_count=P.event_count,J.descriptor.events=P.events.map(te=>({service_id:te.service_id,event_id:te.event_id})),P.group_type!==4&&P.group_type!==5||(J.descriptor.other_network_events=P.other_network_events.map(te=>({original_network_id:te.original_network_id,transport_stream_id:te.transport_stream_id,service_id:te.service_id,event_id:te.event_id})))}for(let P of Object.keys(T)){let L=T[P];L.needUpdate!==!1&&L.descriptor!==null&&(R[P]=L.descriptor)}}if(a.table_id!==78&&a.table_id!==79){let D=7&a.table_id,R=7&a.last_table_id,T=a.section_number>>3,P=a.last_section_number>>3,L=7&a.section_number,I=7&a.segment_last_section_number,x=(15&a.table_id)<8?C.basic_flags:C.extended_flags;if(x.last_flags_id!==R||x.flags[D].version_number!==-1&&x.flags[D].version_number!==a.version_number)for(let O=0;O<8;O++)x.flags[O].flag.fill(0),x.flags[O].ignore.fill(O<=R?0:255);if(D===0&&o!==null){let O=(o.getTime()-60*o.getTimezoneOffset()*1e3)/108e5&7;for(let G=0;G>C&1,n+=(255^b.ignore[w])>>C&1;return[n,a]}}},8090:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.default={component:{1:{1:"映像480i(525i)、アスペクト比4:3",2:"映像480i(525i)、アスペクト比16:9 パンベクトルあり",3:"映像480i(525i)、アスペクト比16:9 パンベクトルなし",4:"映像480i(525i)、アスペクト比 > 16:9",131:"映像4320p、アスペクト比16:9",145:"映像2160p、アスペクト比4:3",146:"映像2160p、アスペクト比16:9 パンベクトルあり",147:"映像2160p、アスペクト比16:9 パンベクトルなし",148:"映像2160p、アスペクト比 > 16:9",161:"映像480p(525p)、アスペクト比4:3",162:"映像480p(525p)、アスペクト比16:9 パンベクトルあり",163:"映像480p(525p)、アスペクト比16:9 パンベクトルなし",164:"映像480p(525p)、アスペクト比 > 16:9",177:"映像1080i(1125i)、アスペクト比4:3",178:"映像1080i(1125i)、アスペクト比16:9 パンベクトルあり",179:"映像1080i(1125i)、アスペクト比16:9 パンベクトルなし",180:"映像1080i(1125i)、アスペクト比 > 16:9",193:"映像720p(750p)、アスペクト比4:3",194:"映像720p(750p)、アスペクト比16:9 パンベクトルあり",195:"映像720p(750p)、アスペクト比16:9 パンベクトルなし",196:"映像720p(750p)、アスペクト比 > 16:9",209:"映像240p アスペクト比4:3",210:"映像240p アスペクト比16:9 パンベクトルあり",211:"映像240p アスペクト比16:9 パンベクトルなし",212:"映像240p アスペクト比 > 16:9",225:"映像1080p(1125p)、アスペクト比4:3",226:"映像1080p(1125p)、アスペクト比16:9 パンベクトルあり",227:"映像1080p(1125p)、アスペクト比16:9 パンベクトルなし",228:"映像1080p(1125p)、アスペクト比 > 16:9",241:"映像180p アスペクト比4:3",242:"映像180p アスペクト比16:9 パンベクトルあり",243:"映像180p アスペクト比16:9 パンベクトルなし",244:"映像180p アスペクト比 > 16:9"},5:{1:"H.264|MPEG-4 AVC、映像480i(525i)、アスペクト比4:3",2:"H.264|MPEG-4 AVC、映像480i(525i)、アスペクト比16:9 パンベクトルあり",3:"H.264|MPEG-4 AVC、映像480i(525i)、アスペクト比16:9 パンベクトルなし",4:"H.264|MPEG-4 AVC、映像480i(525i)、アスペクト比 > 16:9",145:"H.264|MPEG-4 AVC、映像2160p、アスペクト比4:3",146:"H.264|MPEG-4 AVC、映像2160p、アスペクト比16:9 パンベクトルあり",147:"H.264|MPEG-4 AVC、映像2160p、アスペクト比16:9 パンベクトルなし",148:"H.264|MPEG-4 AVC、映像2160p、アスペクト比 > 16:9",161:"H.264|MPEG-4 AVC、映像480p(525p)、アスペクト比4:3",162:"H.264|MPEG-4 AVC、映像480p(525p)、アスペクト比16:9 パンベクトルあり",163:"H.264|MPEG-4 AVC、映像480p(525p)、アスペクト比16:9 パンベクトルなし",164:"H.264|MPEG-4 AVC、映像480p(525p)、アスペクト比 > 16:9",177:"H.264|MPEG-4 AVC、映像1080i(1125i)、アスペクト比4:3",178:"H.264|MPEG-4 AVC、映像1080i(1125i)、アスペクト比16:9 パンベクトルあり",179:"H.264|MPEG-4 AVC、映像1080i(1125i)、アスペクト比16:9 パンベクトルなし",180:"H.264|MPEG-4 AVC、映像1080i(1125i)、アスペクト比 > 16:9",193:"H.264|MPEG-4 AVC、映像720p(750p)、アスペクト比4:3",194:"H.264|MPEG-4 AVC、映像720p(750p)、アスペクト比16:9 パンベクトルあり",195:"H.264|MPEG-4 AVC、映像720p(750p)、アスペクト比16:9 パンベクトルなし",196:"H.264|MPEG-4 AVC、映像720p(750p)、アスペクト比 > 16:9",209:"H.264|MPEG-4 AVC、映像240p アスペクト比4:3",210:"H.264|MPEG-4 AVC、映像240p アスペクト比16:9 パンベクトルあり",211:"H.264|MPEG-4 AVC、映像240p アスペクト比16:9 パンベクトルなし",212:"H.264|MPEG-4 AVC、映像240p アスペクト比 > 16:9",225:"H.264|MPEG-4 AVC、映像1080p(1125p)、アスペクト比4:3",226:"H.264|MPEG-4 AVC、映像1080p(1125p)、アスペクト比16:9 パンベクトルあり",227:"H.264|MPEG-4 AVC、映像1080p(1125p)、アスペクト比16:9 パンベクトルなし",228:"H.264|MPEG-4 AVC、映像1080p(1125p)、アスペクト比 > 16:9",241:"H.264|MPEG-4 AVC、映像180p アスペクト比4:3",242:"H.264|MPEG-4 AVC、映像180p アスペクト比16:9 パンベクトルあり",243:"H.264|MPEG-4 AVC、映像180p アスペクト比16:9 パンベクトルなし",244:"H.264|MPEG-4 AVC、映像180p アスペクト比 > 16:9"},9:{131:"H.265|MPEG-H HEVC,映像4320p、アスペクト比16:9",147:"H.265|MPEG-H HEVC,映像2160p、アスペクト比16:9",179:"H.265|MPEG-H HEVC,映像1080i(1125i)、アスペクト比16:9",227:"H.265|MPEG-H HEVC,映像1080p(1125p)、アスペクト比16:9"}},nibble:{level_1:{0:"ニュース/報道",1:"スポーツ",2:"情報/ワイドショー",3:"ドラマ",4:"音楽",5:"バラエティ",6:"映画",7:"アニメ/特撮",8:"ドキュメンタリー/教養",9:"劇場/公演",10:"趣味/教育",11:"福祉",12:"予備",13:"予備",14:"拡張",15:"その他"},level_2:{0:{0:"定時・総合",1:"天気",2:"特集・ドキュメント",3:"政治・国会",4:"経済・市況",5:"海外・国際",6:"解説",7:"討論・会談",8:"報道特番",9:"ローカル・地域",10:"交通",11:"",12:"",13:"",14:"",15:"その他"},1:{0:"スポーツニュース",1:"野球",2:"サッカー",3:"ゴルフ",4:"その他の球技",5:"相撲・格闘技",6:"オリンピック・国際大会",7:"マラソン・陸上・水泳",8:"モータースポーツ",9:"マリン・ウィンタースポーツ",10:"競馬・公営競技",11:"",12:"",13:"",14:"",15:"その他"},2:{0:"芸能・ワイドショー",1:"ファッション",2:"暮らし・住まい",3:"健康・医療",4:"ショッピング・通販",5:"グルメ・料理",6:"イベント",7:"番組紹介・お知らせ",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},3:{0:"国内ドラマ",1:"海外ドラマ",2:"時代劇",3:"",4:"",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},4:{0:"国内ロック・ポップス",1:"海外ロック・ポップス",2:"クラシック・オペラ",3:"ジャズ・フュージョン",4:"歌謡曲・演歌",5:"ライブ・コンサート",6:"ランキング・リクエスト",7:"カラオケ・のど自慢",8:"民謡・邦楽",9:"童謡・キッズ",10:"民族音楽・ワールドミュージック",11:"",12:"",13:"",14:"",15:"その他"},5:{0:"クイズ",1:"ゲーム",2:"トークバラエティ",3:"お笑い・コメディ",4:"音楽バラエティ",5:"旅バラエティ",6:"料理バラエティ",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},6:{0:"洋画",1:"邦画",2:"アニメ",3:"",4:"",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},7:{0:"国内アニメ",1:"海外アニメ",2:"特撮",3:"",4:"",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},8:{0:"社会・時事",1:"歴史・紀行",2:"自然・動物・環境",3:"宇宙・科学・医学",4:"カルチャー・伝統文化",5:"文学・文芸",6:"スポーツ",7:"ドキュメンタリー全般",8:"インタビュー・討論",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},9:{0:"現代劇・新劇",1:"ミュージカル",2:"ダンス・バレエ",3:"落語・演芸",4:"歌舞伎・古典",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},10:{0:"旅・釣り・アウトドア",1:"園芸・ペット・手芸",2:"音楽・美術・工芸",3:"囲碁・将棋",4:"麻雀・パチンコ",5:"車・オートバイ",6:"コンピュータ・TVゲーム",7:"会話・語学",8:"幼児・小学生",9:"中学生・高校生",10:"大学生・受験",11:"生涯教育・資格",12:"教育問題",13:"",14:"",15:"その他"},11:{0:"高齢者",1:"障害者",2:"社会福祉",3:"ボランティア",4:"手話",5:"文字(字幕)",6:"音声解説",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},12:{0:"",1:"",2:"",3:"",4:"",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:""},13:{0:"",1:"",2:"",3:"",4:"",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:""},14:{0:"BS/地上デジタル放送用番組付属情報",1:"広帯域 CS デジタル放送用拡張",2:"",3:"サーバー型番組付属情報",4:"IP 放送用番組付属情報",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:""},15:{0:"",1:"",2:"",3:"",4:"",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"}}},dialog_control:{0:"音声ストリームがダイアログ制御情報を含まない",1:"音声ストリームがダイアログ制御情報を含む"},audio_for_handicapped:{0:"障がい者用音声を特定しない",1:"視覚障がい者用音声解説",2:"聴覚障がい者用音声",3:"将来使用のためリザーブ"},audio_mode:{0:"将来使用のためリザーブ",1:"1/0モード(シングルモノ)",2:"1/0+ 1/0モード(デュアルモノ)",3:"2/0モード(ステレオ)",4:"2/1モード",5:"3/0モード",6:"2/2モード",7:"3/1モード",8:"3/2モード",9:"3/2+ LFEモード(3/2.1モード)",10:"3/3.1モード",11:"2/0/0-2/0/2-0.1モード",12:"5/2.1モード",13:"3/2/2.1モード",14:"2/0/0-3/0/2-0.1モード",15:"0/2/0-3/0/2-0.1モード",16:"2/0/0-3/2/3-0.2モード",17:"3/3/3-5/2/3-3/0/0.2モード",18:"将来使用のためリザーブ",19:"将来使用のためリザーブ",20:"将来使用のためリザーブ",21:"将来使用のためリザーブ",22:"将来使用のためリザーブ",23:"将来使用のためリザーブ",24:"将来使用のためリザーブ",25:"将来使用のためリザーブ",26:"将来使用のためリザーブ",27:"将来使用のためリザーブ",28:"将来使用のためリザーブ",29:"将来使用のためリザーブ",30:"将来使用のためリザーブ",31:"将来使用のためリザーブ"},quality_indicator:{0:"将来使用のためリザーブ",1:"モード1",2:"モード2",3:"モード3"},sampling_rate:{0:"将来使用のためリザーブ",1:"16kHz",2:"22.05kHz",3:"24kHz",4:"リザーブ",5:"32kHz",6:"44.1kHz",7:"48kHz"}}},4210:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tsDataModule=l.tsTable=l.TsUtil=l.TsModuleDescriptors=l.TsDescriptors=l.TsLogo=l.TsDate=l.TsChar=l.TsCrc32=l.TsStreamLite=l.TsStream=void 0;var p=c(6777);Object.defineProperty(l,"TsStream",{enumerable:!0,get:function(){return p.default}});var r=c(5411);Object.defineProperty(l,"TsStreamLite",{enumerable:!0,get:function(){return r.default}}),l.TsCrc32=c(3170);var i=c(4018);Object.defineProperty(l,"TsChar",{enumerable:!0,get:function(){return i.default}});var t=c(2172);Object.defineProperty(l,"TsDate",{enumerable:!0,get:function(){return t.default}});var n=c(9685);Object.defineProperty(l,"TsLogo",{enumerable:!0,get:function(){return n.default}});var a=c(1241);Object.defineProperty(l,"TsDescriptors",{enumerable:!0,get:function(){return a.default}});var o=c(9235);Object.defineProperty(l,"TsModuleDescriptors",{enumerable:!0,get:function(){return o.default}});var d=c(5915);Object.defineProperty(l,"TsUtil",{enumerable:!0,get:function(){return d.default}}),l.tsTable=c(2540),l.tsDataModule=c(1481)},8822:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TsInfo=void 0;const p=c(3550);l.TsInfo=class{constructor(){we(this,"name","");we(this,"packet",0);we(this,"counter",-1);we(this,"duplication",0);we(this,"type",0);we(this,"drop",0);we(this,"scrambling",0);we(this,"buffer",new p.TsBuffer);this.buffer.entireLength=0}toObject(){return{packet:this.packet,drop:this.drop,scrambling:this.scrambling}}}},9685:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8764),r=c(3170),i=c(7755),t=p.Buffer.allocUnsafe(8+3*i.default.length+4),n=p.Buffer.allocUnsafe(8+i.default.length+4);{let o=0;t.writeUInt32BE(3*i.default.length,o),o+=4,p.Buffer.from("PLTE").copy(t,o),o+=4;for(const d of i.default)t.writeUInt8(d[0],o++),t.writeUInt8(d[1],o++),t.writeUInt8(d[2],o++);t.writeInt32BE(r.pngCalc(t.slice(4,o)),o)}{let o=0;n.writeUInt32BE(i.default.length,o),o+=4,p.Buffer.from("tRNS").copy(n,o),o+=4;for(const d of i.default)n.writeUInt8(d[3],o++);n.writeInt32BE(r.pngCalc(n.slice(4,o)),o)}class a{constructor(d){we(this,"buffer");this.buffer=d}decode(){return a.decode(this.buffer)}static decode(d){const g=[d.slice(0,33),t,n,d.slice(33)],m=d.length+t.length+n.length;return p.Buffer.concat(g,m)}}l.default=a},7755:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.default=[[0,0,0,255],[255,0,0,255],[0,255,0,255],[255,255,0,255],[0,0,255,255],[255,0,255,255],[0,255,255,255],[255,255,255,255],[0,0,0,0],[170,0,0,255],[0,170,0,255],[170,170,0,255],[0,0,170,255],[170,0,170,255],[0,170,170,255],[170,170,170,255],[0,0,85,255],[0,85,0,255],[0,85,85,255],[0,85,170,255],[0,85,255,255],[0,170,85,255],[0,170,255,255],[0,255,85,255],[0,255,170,255],[85,0,0,255],[85,0,85,255],[85,0,170,255],[85,0,255,255],[85,85,0,255],[85,85,85,255],[85,85,170,255],[85,85,255,255],[85,170,0,255],[85,170,85,255],[85,170,170,255],[85,170,255,255],[85,255,0,255],[85,255,85,255],[85,255,170,255],[85,255,255,255],[170,0,85,255],[170,0,255,255],[170,85,0,255],[170,85,85,255],[170,85,170,255],[170,85,255,255],[170,170,85,255],[170,170,255,255],[170,255,0,255],[170,255,85,255],[170,255,170,255],[170,255,255,255],[255,0,85,255],[255,0,255,255],[255,85,0,255],[255,85,85,255],[255,85,170,255],[255,85,255,255],[255,170,0,255],[255,170,85,255],[255,170,170,255],[255,170,255,255],[255,255,85,255],[255,255,255,255],[0,0,0,128],[255,0,0,128],[0,255,0,128],[255,255,0,128],[0,0,255,128],[255,0,255,128],[0,255,255,128],[255,255,255,128],[170,0,0,128],[0,170,0,128],[170,170,0,128],[0,0,170,128],[170,0,170,128],[0,170,170,128],[170,170,170,128],[0,0,85,128],[0,85,0,128],[0,85,85,128],[0,85,170,128],[0,85,255,128],[0,170,85,128],[0,170,255,128],[0,255,85,128],[0,255,170,128],[85,0,0,128],[85,0,85,128],[85,0,170,128],[85,0,255,128],[85,85,0,128],[85,85,85,128],[85,85,170,128],[85,85,255,128],[85,170,0,128],[85,170,85,128],[85,170,170,128],[85,170,255,128],[85,255,0,128],[85,255,85,128],[85,255,170,128],[85,255,255,128],[170,0,85,128],[170,0,255,128],[170,85,0,128],[170,85,85,128],[170,85,170,128],[170,85,255,128],[170,170,85,128],[170,170,255,128],[170,255,0,128],[170,255,85,128],[170,255,170,128],[170,255,255,128],[255,0,85,128],[255,0,255,128],[255,85,0,128],[255,85,85,128],[255,85,170,128],[255,85,255,128],[255,170,0,128],[255,170,85,128],[255,170,170,128],[255,170,255,128],[255,255,85,128],[255,255,255,128]]},9036:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CRC_32=r.readBytes(4),i}}},3262:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TsModuleDescriptorCrc32=l.TsModuleDescriptorModuleLink=l.TsModuleDescriptorInfo=l.TsModuleDescriptorName=l.TsModuleDescriptorType=l.TsModuleDescriptorUnknown=void 0;const p=c(312);l.TsModuleDescriptorUnknown=p.default;const r=c(8990);l.TsModuleDescriptorType=r.default;const i=c(7493);l.TsModuleDescriptorName=i.default;const t=c(3718);l.TsModuleDescriptorInfo=t.default;const n=c(9274);l.TsModuleDescriptorModuleLink=n.default;const a=c(9036);l.TsModuleDescriptorCrc32=a.default},3718:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.ISO_639_language_code=r.readBytes(3),i.text_char=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},9274:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.position=r.uimsbf(8),i.moduleId=r.uimsbf(16),i}}},7493:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.text_char=r.readBytes(i.descriptor_length),i}}},8990:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.text_char=r.readBytes(i.descriptor_length),i}}},312:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.descriptor=r.readBytes(i.descriptor_length),i}}},9235:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3262);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=[];for(let i=0;i{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946),r=c(7786);class i{constructor(n){we(this,"buffer");this.buffer=n}decode(){const n=new p.default(this.buffer),a={};return a._raw=this.buffer,a.sync_byte=n.bslbf(8),a.transport_error_indicator=n.bslbf(1),a.payload_unit_start_indicator=n.bslbf(1),a.transport_priority=n.bslbf(1),a.PID=n.uimsbf(13),a.transport_scrambling_control=n.bslbf(2),a.adaptation_field_control=n.bslbf(2),a.continuity_counter=n.uimsbf(4),a.adaptation_field_control!==2&&a.adaptation_field_control!==3||(a.adaptation_field=this.decodeAdaptationField(),n.next(n.uimsbf(8)<<3)),a.adaptation_field_control!==1&&a.adaptation_field_control!==3||(a.data_byte=this.buffer.slice(n.position>>3,188)),a}decodeAdaptationField(){const n=i.getAdaptationField(this.buffer);if(n===null)return;const a=new p.default(n),o={};return o._raw=n,o.adaptation_field_length=a.uimsbf(8),o.adaptation_field_length>0&&(o.discontinuity_indicator=a.bslbf(1),o.random_access_indicator=a.bslbf(1),o.elementary_stream_priority_indicator=a.bslbf(1),o.PCR_flag=a.bslbf(1),o.OPCR_flag=a.bslbf(1),o.splicing_point_flag=a.bslbf(1),o.transport_private_data_flag=a.bslbf(1),o.adaptation_field_extension_flag=a.bslbf(1),o.PCR_flag===1&&(o.program_clock_reference_base=a.uimsbf(33),a.next(6),o.program_clock_reference_extension=a.uimsbf(9)),o.OPCR_flag===1&&(o.original_program_clock_reference_base=a.uimsbf(33),a.next(6),o.original_program_clock_reference_extension=a.uimsbf(9)),o.splicing_point_flag===1&&(o.splice_countdown=a.tcimsbf(8)),o.transport_private_data_flag===1&&(o.transport_private_data_length=a.uimsbf(8),o.private_data_byte=a.readBytes(o.transport_private_data_length)),o.adaptation_field_extension_flag===1&&(o.adaptation_field_extension_length=a.uimsbf(8),o.ltw_flag=a.bslbf(1),o.piecewise_rate_flag=a.bslbf(1),o.seamless_splice_flag=a.bslbf(1),a.next(5),o.ltw_flag===1&&(o.ltw_valid_flag=a.bslbf(1),o.ltw_offset=a.uimsbf(15)),o.piecewise_rate_flag===1&&(a.next(2),o.piecewise_rate=a.uimsbf(22)),o.seamless_splice_flag===1&&(o.splice_type=a.bslbf(4),o.DTS_next_AU_32_30=a.bslbf(3),a.next(1),o.DTS_next_AU_29_15=a.bslbf(15),a.next(1),o.DTS_next_AU_14_0=a.bslbf(15),a.next(1)))),o}decodeBasic(){const n={};if(n._raw=this.buffer,n.sync_byte=this.buffer[0],n.transport_error_indicator=this.buffer[1]>>7,n.payload_unit_start_indicator=(64&this.buffer[1])>>6,n.transport_priority=(32&this.buffer[1])>>5,n.PID=(31&this.buffer[1])<<8|this.buffer[2],n.transport_scrambling_control=(192&this.buffer[3])>>6,n.adaptation_field_control=(48&this.buffer[3])>>4,n.continuity_counter=15&this.buffer[3],n.adaptation_field_control===2||n.adaptation_field_control===3){const a=n.adaptation_field={};a.adaptation_field_length=this.buffer[4],a.adaptation_field_length&&(a.discontinuity_indicator=(128&this.buffer[5])>>7,a.random_access_indicator=(64&this.buffer[5])>>6,a.elementary_stream_priority_indicator=(32&this.buffer[5])>>5,a.PCR_flag=(16&this.buffer[5])>>4,a.OPCR_flag=(8&this.buffer[5])>>3,a.splicing_point_flag=(4&this.buffer[5])>>2,a.transport_private_data_flag=(2&this.buffer[5])>>1,a.adaptation_field_extension_flag=1&this.buffer[5])}return n}encode(n){const a=new r.default(this.buffer);if(a.bslbf(8,71),a.bslbf(1,0),a.bslbf(1,n.payload_unit_start_indicator),a.bslbf(1,n.transport_priority),a.uimsbf(13,n.PID),a.bslbf(2,n.transport_scrambling_control),a.bslbf(2,n.adaptation_field_control),a.uimsbf(4,n.continuity_counter),n.adaptation_field_control===2||n.adaptation_field_control===3){const o=n.adaptation_field;a.uimsbf(8,o.adaptation_field_length),o.adaptation_field_length>0&&(a.bslbf(1,o.discontinuity_indicator),a.bslbf(1,o.random_access_indicator),a.bslbf(1,o.elementary_stream_priority_indicator),a.bslbf(1,o.PCR_flag),a.bslbf(1,o.OPCR_flag),a.bslbf(1,o.splicing_point_flag),a.bslbf(1,o.transport_private_data_flag),a.bslbf(1,o.adaptation_field_extension_flag),o.PCR_flag===1&&(a.uimsbf(2,o.program_clock_reference_base/2147483648|0),a.uimsbf(31,(0|o.program_clock_reference_base)>>1),a.bslbf(6,0),a.uimsbf(9,o.program_clock_reference_extension)),o.OPCR_flag===1&&(a.uimsbf(2,o.original_program_clock_reference_base/2147483648|0),a.uimsbf(31,(0|o.original_program_clock_reference_base)>>1),a.bslbf(6,0),a.uimsbf(9,o.original_program_clock_reference_extension)),o.splicing_point_flag===1&&a.tcimsbf(8,o.splice_countdown),o.transport_private_data_flag===1&&(a.uimsbf(8,o.transport_private_data_length),a.writeBytes(o.transport_private_data_length,o.private_data_byte)),o.adaptation_field_extension_flag===1&&(a.uimsbf(8,o.adaptation_field_extension_length),a.bslbf(1,o.ltw_flag),a.bslbf(1,o.piecewise_rate_flag),a.bslbf(1,o.seamless_splice_flag),a.bslbf(5,0),o.ltw_flag===1&&(a.bslbf(1,o.ltw_valid_flag),a.uimsbf(15,o.ltw_offset)),o.piecewise_rate_flag===1&&(a.bslbf(2,0),a.uimsbf(22,o.piecewise_rate)),o.seamless_splice_flag===1&&(a.bslbf(4,o.splice_type),a.bslbf(3,o.DTS_next_AU_32_30),a.bslbf(1,1),a.bslbf(15,o.DTS_next_AU_29_15),a.bslbf(1,1),a.bslbf(15,o.DTS_next_AU_14_0),a.bslbf(1,1))))}return n.adaptation_field_control!==1&&n.adaptation_field_control!==3||a.writeBytes(n.data_byte.length,n.data_byte),this.buffer.slice(0,188)}static isPes(n){if(!((16&n[3])>>4))return null;const a=(32&n[3])>>5==1?5+n[4]:4;return n[a]===0&&n[a+1]===0&&n[a+2]===1}static getAdaptationField(n){return(32&n[3])>>5?n.slice(4,5+n[4]):null}static getData(n){return(16&n[3])>>4?(32&n[3])>>5==1?n.slice(5+n[4],188):n.slice(4,188):null}}l.default=i},8946:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8764);l.default=class{constructor(r,i=0){we(this,"buffer");we(this,"position");this.buffer=r,this.position=i}readBitsRaw(r){if(this.position+r>this.buffer.length<<3)return this.position+=r,0;let i=0;for(;r>7;){const t=this.position>>3,n=7&this.position,a=Math.pow(2,8-n)-1;i<<=8,i|=(this.buffer[t]&a)<>8-n,this.position+=8,r-=8}for(;r>0;){const t=this.position>>3,n=7&this.position^7;i<<=1,i|=this.buffer[t]>>n&1,this.position++,r--}return i}readBits(r){let i=0;for(;r>31;){const t=(r-1)%31+1;i+=this.readBitsRaw(t),i*=2147483648,r-=t}return i+=this.readBitsRaw(r),i}readBytesRaw(r){if(this.position+r>this.buffer.length<<3)return this.position+=r,p.Buffer.allocUnsafe(0);const i=this.position>>3;return this.position+=r<<3,this.buffer.slice(i,i+r)}readBytes(r){return this.readBytesRaw(r)}next(r){this.position+=r}previous(r){this.position-=r}bslbf(r){return this.readBits(r)}uimsbf(r){return this.readBits(r)}tcimsbf(r){return-this.readBits(1)<{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8764),r=c(9827),i=c(8822),t=c(3550),n=c(1036),a=c(2540),o=c(6609),d=c(8803);class g extends r.Transform{constructor(b={}){super();we(this,"buffer");we(this,"info",{});we(this,"options");we(this,"trans");this.options=Object.assign({transform:!1,skipSize:0,packetSize:188,bufferSize:0,transPmtIds:[],transPmtSids:[],transPmtPids:[],transPids:[]},b),this.buffer=new t.TsBuffer,this.info={},this.trans={pat:null,cat:null,pmt:{},pmtPids:[],pids:[],rebuild:{pat:null,patCounter:0,patVersion:0}}}toPacket(b){let w=[],C=0;if(this.options.packetSize===192)for(;b.length-C>=192&&(b[4]===71||(C=b.indexOf(71,C)-4)!=-5);C+=192)w.push(b.slice(C+4,C+192));else for(;b.length-C>=188&&(b[0]===71||(C=b.indexOf(71,C))!==-1);C+=188)w.push(b.slice(C,C+188));return{packets:w,buffer:C!==-1?b.slice(C):null}}parse(b){let w=this.toPacket(b);for(let C of w.packets){if(this.options.skipSize>0&&this.options.skipSize--!=0)continue;let D=new n.default(C),R=D.decodeBasic();if(R.transport_error_indicator===1)continue;this.info.hasOwnProperty(R.PID)||(this.info[R.PID]=new i.TsInfo);let T=this.info[R.PID];if(T.packet++,this.listenerCount("packet")&&this.emit("packet",R.PID,D.decode()),(1&R.adaptation_field_control)==1){let P=[];if(R.hasOwnProperty("adaptation_field")&&R.adaptation_field.discontinuity_indicator===1&&(T.counter=-1),T.counter!==-1&&R.PID!==8191){let L=R.continuity_counter,I=T.counter,x=I+1&15,O=!0;L===I?(T.duplication++,T.duplication>1&&(O=!1)):(T.duplication=0,L!==x&&(O=!1)),O||(T.drop++,T.type=0,T.buffer.reset(),this.listenerCount("drop")&&this.emit("drop",R.PID,L,x))}if(T.counter=R.continuity_counter,R.transport_scrambling_control>>1==1)T.scrambling++,this.listenerCount("scrambling")&&this.emit("scrambling",R.PID);else{if(R.payload_unit_start_indicator===1)if(n.default.isPes(C))T.type=1;else{T.type=2;let L=n.default.getData(C),I=0,x=L[0];for(I++,x!==0&&T.buffer.length!==0&&(T.buffer.entireLength-T.buffer.length===x?(T.buffer.add(L.slice(I,I+x)),P.push(T.buffer.concat())):T.type=0),T.buffer.length!==0&&(T.buffer.reset(),T.buffer.entireLength=0),I+=x;L.length>=I+3&&L[I]!==255;){let O=3+((15&L[I+1])<<8|L[I+2]);if(L.length=58&&I<=63){if(this.listenerCount("dsmcc")){let x=new a.TsTableDsmcc(L).decode();x!==null&&this.emit("dsmcc",R.PID,x)}}else if(I===64||I===65){if(this.listenerCount("nit")){let x=new a.TsTableNit(L).decode();x!==null&&this.emit("nit",R.PID,x)}}else if(I===66||I===70){if(this.listenerCount("sdt")){let x=new a.TsTableSdt(L).decode();x!==null&&this.emit("sdt",R.PID,x)}}else if(I===74){if(this.listenerCount("bat")){let x=new a.TsTableBat(L).decode();x!==null&&this.emit("bat",R.PID,x)}}else if(I>=78&&I<=111){if(this.listenerCount("eit")){let x=(0,o.decode)(L);x!==null&&this.emit("eit",R.PID,x)}}else if(I===112){if(this.listenerCount("tdt")){let x=new a.TsTableTdt(L).decode();x!==null&&this.emit("tdt",R.PID,x)}}else if(I===115){if(this.listenerCount("tot")){let x=new a.TsTableTot(L).decode();x!==null&&this.emit("tot",R.PID,x)}}else if(I===126){if(this.listenerCount("dit")){let x=new a.TsTableDit(L).decode();x!==null&&this.emit("dit",R.PID,x)}}else if(I===127){if(this.listenerCount("sit")){let x=new a.TsTableSit(L).decode();x!==null&&this.emit("sit",R.PID,x)}}else if(I===195){if(this.listenerCount("sdtt")){let x=new a.TsTableSdtt(L).decode();x!==null&&this.emit("sdtt",R.PID,x)}}else if(I===196){if(this.listenerCount("bit")){let x=(0,d.decode)(L);x!==null&&this.emit("bit",R.PID,x)}}else if(I===200&&this.listenerCount("cdt")){let x=new a.TsTableCdt(L).decode();x!==null&&this.emit("cdt",R.PID,x)}}}}this.options.transform?R.PID!==0&&this.trans.pids.indexOf(R.PID)!==-1&&this.push(C):this.push(C)}return w.buffer}parsePat(b,w){this.trans.pat!==null&&w.version_number===this.trans.pat.version_number||(this.trans.pat=w,this.listenerCount("updatePat")&&this.emit("updatePat",b,w),this.updatePids(),this.rebuildPat())}parseCat(b,w){this.trans.cat!==null&&w.version_number===this.trans.cat.version_number||(this.trans.cat=w,this.listenerCount("updateCat")&&this.emit("updateCat",b,w),this.updatePids())}parsePmt(b,w){this.trans.pmt.hasOwnProperty(b)&&w.version_number===this.trans.pmt[b].version_number||(this.trans.pmt[b]=w,this.listenerCount("updatePmt")&&this.emit("updatePmt",b,w),this.updatePids())}updatePids(){let b=this.options.transPmtPids.slice(),w=this.options.transPids.slice();if(w.push(0),this.trans.pat!==null){let C=0;for(let D of this.trans.pat.programs)if(D.program_number===0){if(w.indexOf(D.network_PID)!==-1)continue;w.push(D.network_PID)}else b.indexOf(D.program_map_PID)===-1&&(this.options.transPmtIds.indexOf(-1)===-1&&this.options.transPmtIds.indexOf(C)===-1&&this.options.transPmtSids.indexOf(D.program_number)===-1||b.push(D.program_map_PID)),C++}if(this.trans.cat!==null)for(let C of this.trans.cat.descriptors)C.descriptor_tag===9&&w.indexOf(C.CA_PID)===-1&&w.push(C.CA_PID);for(let C of b)if(this.trans.pmt.hasOwnProperty(C)){w.indexOf(C)===-1&&w.push(C),w.indexOf(this.trans.pmt[C].PCR_PID)===-1&&w.push(this.trans.pmt[C].PCR_PID);for(let D of this.trans.pmt[C].program_info)D.descriptor_tag===9&&w.indexOf(D.CA_PID)===-1&&w.push(D.CA_PID);for(let D of this.trans.pmt[C].streams)w.indexOf(D.elementary_PID)===-1&&w.push(D.elementary_PID)}this.trans.pmtPids=b,this.trans.pids=w}rebuildPat(){let b={payload_unit_start_indicator:1,transport_priority:1,PID:0,transport_scrambling_control:0,adaptation_field_control:1,continuity_counter:0,data_byte:null},w={table_id:0,section_syntax_indicator:1,transport_stream_id:this.trans.pat.transport_stream_id,version_number:this.trans.rebuild.patVersion,current_next_indicator:1,section_number:0,last_section_number:0,programs:[]};for(let D of this.trans.pat.programs)D.program_number===0?w.programs.push({program_number:D.program_number,network_PID:D.network_PID}):this.trans.pmtPids.indexOf(D.program_map_PID)!==-1&&w.programs.push({program_number:D.program_number,program_map_PID:D.program_map_PID});let C=new a.TsTablePat(p.Buffer.alloc(1024,255)).encode(w);if(C.length>183)throw new RangeError("PAT is too long");b.data_byte=p.Buffer.concat([p.Buffer.alloc(1),C]),this.trans.rebuild.pat=new n.default(p.Buffer.alloc(188,255)).encode(b),this.trans.rebuild.patVersion=this.trans.rebuild.patVersion+1&31}createPat(){let b=p.Buffer.from(this.trans.rebuild.pat);return b[3]=240&b[3]|this.trans.rebuild.patCounter,this.trans.rebuild.patCounter=this.trans.rebuild.patCounter+1&15,b}_transform(b,w,C){if(this.buffer.add(b),this.options.bufferSize!==-1&&this.buffer.length>this.options.bufferSize){let D=this.parse(this.buffer.concat());this.buffer.reset(),D!==null&&this.buffer.add(D)}C()}_flush(b){let w=this.parse(this.buffer.concat());if(this.buffer.reset(),this.push(w),this.listenerCount("info")){let C={};for(let D of Object.keys(this.info))C[D]=this.info[D].toObject();this.emit("info",C)}b()}}l.default=g},5411:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(7187),r=c(8822),i=c(1036),t=c(2540),n=c(6609),a=c(8803);class o extends p.EventEmitter{constructor(){super();we(this,"info",{})}write(m){for(const v of m){const b=new i.default(v).decodeBasic();if(b.transport_error_indicator===1)continue;this.info[b.PID]===void 0&&(this.info[b.PID]=new r.TsInfo);const w=this.info[b.PID];if(w.packet++,(1&b.adaptation_field_control)==1){const C=[];if(b.adaptation_field&&b.adaptation_field.discontinuity_indicator===1&&(w.counter=-1),w.counter!==-1&&b.PID!==8191){const D=b.continuity_counter,R=w.counter,T=R+1&15;let P=!0;D===R?(w.duplication++,w.duplication>1&&(P=!1)):(w.duplication=0,D!==T&&(P=!1)),P||(w.drop++,w.type=0,w.buffer.reset(),this.listenerCount("drop")&&this.emit("drop",b.PID,D,T))}if(w.counter=b.continuity_counter,b.transport_scrambling_control>>1==1)w.scrambling++,this.listenerCount("scrambling")&&this.emit("scrambling",b.PID);else{if(b.payload_unit_start_indicator===1)if(i.default.isPes(v))w.type=1;else{w.type=2;const D=i.default.getData(v);let R=0;const T=D[0];for(R++,T!==0&&w.buffer.length!==0&&(w.buffer.entireLength-w.buffer.length===T?(w.buffer.add(D.slice(R,R+T)),C.push(w.buffer.concat())):w.type=0),w.buffer.length!==0&&(w.buffer.reset(),w.buffer.entireLength=0),R+=T;D.length>=R+3&&D[R]!==255;){const P=3+((15&D[R+1])<<8|D[R+2]);if(D.length=58&&R<=63){if(this.listenerCount("dsmcc")){const T=new t.TsTableDsmcc(D).decode();T!==null&&this.emit("dsmcc",b.PID,T)}}else if(R===64||R===65){if(this.listenerCount("nit")){const T=new t.TsTableNit(D).decode();T!==null&&this.emit("nit",b.PID,T)}}else if(R===66||R===70){if(this.listenerCount("sdt")){const T=new t.TsTableSdt(D).decode();T!==null&&this.emit("sdt",b.PID,T)}}else if(R===74){if(this.listenerCount("bat")){const T=new t.TsTableBat(D).decode();T!==null&&this.emit("bat",b.PID,T)}}else if(R>=78&&R<=111){if(this.listenerCount("eit")){const T=(0,n.decode)(D);T!==null&&this.emit("eit",b.PID,T)}}else if(R===112){if(this.listenerCount("tdt")){const T=new t.TsTableTdt(D).decode();T!==null&&this.emit("tdt",b.PID,T)}}else if(R===115){if(this.listenerCount("tot")){const T=new t.TsTableTot(D).decode();T!==null&&this.emit("tot",b.PID,T)}}else if(R===126){if(this.listenerCount("dit")){const T=new t.TsTableDit(D).decode();T!==null&&this.emit("dit",b.PID,T)}}else if(R===127){if(this.listenerCount("sit")){const T=new t.TsTableSit(D).decode();T!==null&&this.emit("sit",b.PID,T)}}else if(R===195){if(this.listenerCount("sdtt")){const T=new t.TsTableSdtt(D).decode();T!==null&&this.emit("sdtt",b.PID,T)}}else if(R===196){if(this.listenerCount("bit")){const T=(0,a.decode)(D);T!==null&&this.emit("bit",b.PID,T)}}else if(R===200&&this.listenerCount("cdt")){const T=new t.TsTableCdt(D).decode();T!==null&&this.emit("cdt",b.PID,T)}}}}}}end(){delete this.info}}l.default=o},644:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.bouquet_id=t.uimsbf(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),t.next(4),n.bouquet_descriptors_length=t.uimsbf(12),n.bouquet_descriptors=new i.default(t.readBytesRaw(n.bouquet_descriptors_length)).decode(),t.next(4),n.transport_stream_loop_length=t.uimsbf(12),n.transport_streams=[];for(let a=(t.position>>3)+n.transport_stream_loop_length;t.position>>3{Object.defineProperty(l,"__esModule",{value:!0}),l.decode=void 0;const p=c(3170),r=c(8946),i=c(1241);l.decode=function(t){if((0,p.calc)(t)!==0)return null;const n=new r.default(t),a={_raw:t,table_id:n.uimsbf(8),section_syntax_indicator:n.bslbf(1)};for(n.next(1),n.next(2),a.section_length=n.uimsbf(12),a.original_network_id=n.uimsbf(16),n.next(2),a.version_number=n.uimsbf(5),a.current_next_indicator=n.bslbf(1),a.section_number=n.uimsbf(8),a.last_section_number=n.uimsbf(8),n.next(3),a.broadcast_view_propriety=n.bslbf(1),a.first_descriptors_length=n.uimsbf(12),a.first_descriptors=new i.default(n.readBytesRaw(a.first_descriptors_length)).decode(),a.broadcaster_descriptors=[];(n.position>>3)-3{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};return n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),t.next(18),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),n.descriptors=new i.default(t.readBytesRaw(3+n.section_length-(t.position>>3)-4)).decode(),n.CRC_32=t.readBytes(4),n}}},7975:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};return n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.download_data_id=t.uimsbf(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),n.original_network_id=t.uimsbf(16),n.data_type=t.uimsbf(8),t.next(4),n.descriptors_loop_length=t.uimsbf(12),n.descriptors=new i.default(t.readBytesRaw(n.descriptors_loop_length)).decode(),n.data_module_byte=t.readBytes(3+n.section_length-(t.position>>3)-4),n.CRC_32=t.readBytes(4),n}}},274:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.table_id=r.uimsbf(8),i.section_syntax_indicator=r.bslbf(1),r.next(1),r.next(2),i.section_length=r.uimsbf(12),i.transition_flag=r.uimsbf(1),i}}},3900:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(5571),t=c(9235);class n{constructor(d){we(this,"buffer");this.buffer=d}decode(){let d=new r.default(this.buffer),g={};g.protocolDiscriminator=d.uimsbf(8),g.dsmccType=d.uimsbf(8),g.messageId=d.uimsbf(16),g.transaction_id=d.uimsbf(32),d.next(8),g.adaptationLength=d.uimsbf(8),g.messageLength=d.uimsbf(16),g.adaptationLength>0&&(g.adaptationType=d.uimsbf(8),g.adaptationDataByte=d.readBytes(g.adaptationLength-1)),g.downloadId=d.uimsbf(32),g.blockSize=d.uimsbf(16),g.windowSize=d.uimsbf(8),g.ackPeriod=d.uimsbf(8),g.tCDownloadWindow=d.uimsbf(32),g.tCDownloadScenario=d.uimsbf(32);let m=d.buffer[d.position>>3]<<8|d.buffer[1+(d.position>>3)];g.compatibilityDescriptor=new i.default(d.readBytesRaw(2+m)).decode(),g.numberOfModules=d.uimsbf(16),g.modules=[];for(let v=0;v0&&(g.adaptationType=d.uimsbf(8),g.adaptationDataByte=d.readBytes(g.adaptationLength-1)),g.moduleId=d.uimsbf(16),g.moduleVersion=d.uimsbf(8),d.next(8),g.blockNumber=d.uimsbf(16),g.blockDataByte=d.readBytes(g.messageLength-g.adaptationLength-6),g}}l.default=class{constructor(o){we(this,"buffer");this.buffer=o}decode(){if(this.buffer[1]>>7==1&&p.calc(this.buffer)!==0)return null;let o=new r.default(this.buffer),d={};d._raw=this.buffer,d.table_id=o.uimsbf(8),d.section_syntax_indicator=o.bslbf(1),d.private_indicator=o.bslbf(1),o.next(2),d.dsmcc_section_length=o.uimsbf(12),d.table_id_extension=o.uimsbf(16),o.next(2),d.version_number=o.uimsbf(5),d.current_next_indicator=o.bslbf(1),d.section_number=o.uimsbf(8),d.last_section_number=o.uimsbf(8);let g=o.readBytes(3+d.dsmcc_section_length-(o.position>>3)-4);return d.table_id===59?d.message=new n(g).decode():d.table_id===60?d.message=new a(g).decode():d.table_id===61?d.stream_descriptor=g:d.table_id===62&&(d.private_data_byte=g),d.section_syntax_indicator===0?d.Checksum=o.readBytes(4):d.CRC_32=o.readBytes(4),d}}},6609:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.decode=void 0;const p=c(3170),r=c(8946),i=c(1241);l.decode=function(t){if((0,p.calc)(t)!==0)return null;const n=new r.default(t),a={_raw:t,table_id:n.uimsbf(8),section_syntax_indicator:n.bslbf(1)};for(n.next(1),n.next(2),a.section_length=n.uimsbf(12),a.service_id=n.uimsbf(16),n.next(2),a.version_number=n.uimsbf(5),a.current_next_indicator=n.bslbf(1),a.section_number=n.uimsbf(8),a.last_section_number=n.uimsbf(8),a.transport_stream_id=n.uimsbf(16),a.original_network_id=n.uimsbf(16),a.segment_last_section_number=n.uimsbf(8),a.last_table_id=n.uimsbf(8),a.events=[];n.position>>3<3+a.section_length-4;){const o={event_id:n.uimsbf(16),start_time:n.readBytes(5),duration:n.readBytes(3),running_status:n.uimsbf(3),free_CA_mode:n.bslbf(1),descriptors_loop_length:n.uimsbf(12)};o.descriptors=new i.default(n.readBytesRaw(o.descriptors_loop_length)).decode(),a.events.push(o)}return a.CRC_32=n.readBytes(4),a}},2540:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TsTableBit=l.TsTableCdt=l.TsTableSdtt=l.TsTableSit=l.TsTableDit=l.TsTableTot=l.TsTableTdt=l.TsTableEit=l.TsTableBat=l.TsTableSdt=l.TsTableDsmcc=l.TsTableNit=l.TsTablePmt=l.TsTableCat=l.TsTablePat=void 0;const p=c(3419);l.TsTablePat=p.default;const r=c(9938);l.TsTableCat=r.default;const i=c(2145);l.TsTablePmt=i.default;const t=c(2374);l.TsTableNit=t.default;const n=c(3900);l.TsTableDsmcc=n.default;const a=c(4838);l.TsTableSdt=a.default;const o=c(644);l.TsTableBat=o.default;const d=c(6609);l.TsTableEit=d;const g=c(7347);l.TsTableTdt=g.default;const m=c(2392);l.TsTableTot=m.default;const v=c(274);l.TsTableDit=v.default;const b=c(4440);l.TsTableSit=b.default;const w=c(888);l.TsTableSdtt=w.default;const C=c(7975);l.TsTableCdt=C.default;const D=c(8803);l.TsTableBit=D},2374:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.network_id=t.uimsbf(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),t.next(4),n.network_descriptors_length=t.uimsbf(12),n.network_descriptors=new i.default(t.readBytesRaw(n.network_descriptors_length)).decode(),t.next(4),n.transport_stream_loop_length=t.uimsbf(12),n.transport_streams=[];for(let a=(t.position>>3)+n.transport_stream_loop_length;t.position>>3{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(7786);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};for(n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.transport_stream_id=t.uimsbf(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),n.programs=[];t.position>>3<3+n.section_length-4;){let a={};a.program_number=t.uimsbf(16),t.next(3),a.program_number===0?a.network_PID=t.uimsbf(13):a.program_map_PID=t.uimsbf(13),n.programs.push(a)}return n.CRC_32=t.readBytes(4),n}encode(t){let n,a=new i.default(this.buffer);return a.uimsbf(8,t.table_id),a.bslbf(1,t.section_syntax_indicator),a.bslbf(1,0),a.bslbf(2,3),a.next(12),a.uimsbf(16,t.transport_stream_id),a.bslbf(2,3),a.uimsbf(5,t.version_number),a.bslbf(1,t.current_next_indicator),a.uimsbf(8,t.section_number),a.uimsbf(8,t.last_section_number),t.programs.forEach(o=>{a.uimsbf(16,o.program_number),a.bslbf(3,0),o.program_number===0?a.uimsbf(13,o.network_PID):a.uimsbf(13,o.program_map_PID)}),n=a.position>>3,a.position=12,a.uimsbf(12,n-3+4),a.position=n<<3,n=a.position>>3,a.writeBytes(4,p.calcToBuffer(this.buffer.slice(0,n))),this.buffer.slice(0,n+4)}}},2145:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};for(n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.program_number=t.uimsbf(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),t.next(3),n.PCR_PID=t.uimsbf(13),t.next(4),n.program_info_length=t.uimsbf(12),n.program_info=new i.default(t.readBytesRaw(n.program_info_length)).decode(),n.streams=[];t.position>>3<3+n.section_length-4;){let a={};a.stream_type=t.uimsbf(8),t.next(3),a.elementary_PID=t.uimsbf(13),t.next(4),a.ES_info_length=t.uimsbf(12),a.ES_info=new i.default(t.readBytesRaw(a.ES_info_length)).decode(),n.streams.push(a)}return n.CRC_32=t.readBytes(4),n}}},4838:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};for(n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.transport_stream_id=t.uimsbf(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),n.original_network_id=t.uimsbf(16),t.next(8),n.services=[];t.position>>3<3+n.section_length-4;){let a={};a.service_id=t.uimsbf(16),t.next(3),a.EIT_user_defined_flags=t.bslbf(3),a.EIT_schedule_flag=t.bslbf(1),a.EIT_present_following_flag=t.bslbf(1),a.running_status=t.uimsbf(3),a.free_CA_mode=t.bslbf(1),a.descriptors_loop_length=t.uimsbf(12),a.descriptors=new i.default(t.readBytesRaw(a.descriptors_loop_length)).decode(),n.services.push(a)}return n.CRC_32=t.readBytes(4),n}}},888:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.table_id_ext=t.uimsbf(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),n.transport_stream_id=t.uimsbf(16),n.original_network_id=t.uimsbf(16),n.service_id=t.uimsbf(16),n.num_of_contents=t.uimsbf(8),n.contents=[];for(let a=0;a>3)+o.schedule_description_length;t.position>>3{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};for(n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),t.next(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),t.next(4),n.transmission_info_loop_length=t.uimsbf(12),n.transmission_info=new i.default(t.readBytesRaw(n.transmission_info_loop_length)).decode(),n.services=[];t.position>>3<3+n.section_length-4;){let a={};a.service_id=t.uimsbf(16),t.next(1),a.running_status=t.bslbf(3),a.service_loop_length=t.uimsbf(12),a.service=new i.default(t.readBytesRaw(a.service_loop_length)).decode(),n.services.push(a)}return n.CRC_32=t.readBytes(4),n}}},7347:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.table_id=r.uimsbf(8),i.section_syntax_indicator=r.bslbf(1),r.next(1),r.next(2),i.section_length=r.uimsbf(12),i.JST_time=r.readBytes(5),i}}},2392:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};return n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.JST_time=t.readBytes(5),t.next(4),n.descriptors_loop_length=t.uimsbf(12),n.descriptors=new i.default(t.readBytesRaw(n.descriptors_loop_length)).decode(),n.CRC_32=t.readBytes(4),n}}},5915:(A,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8764),r=c(4018),i=c(2172),t=c(3580),n=c(9685),a=c(1481);function o(w,C){return C.every(D=>!!w.has(D)&&(w=w.get(D),!0))}function d(w,C){return C.forEach((D,R)=>{w.has(D)||w.set(D,R===C.length-1?{}:new Map),w=w.get(D)}),w}function g(w,C){return C.every((D,R)=>!!w.has(D)&&(R===C.length-1?w.delete(D):w=w.get(D),!0))}function m(w,C){return(Object.keys(w).length===0||C.version_number!==w.version_number)&&(w.version_number=C.version_number,w.last_section_number=C.last_section_number,w.sections=new Set,!0)}function v(w,C){return!w.sections.has(C.section_number)&&(w.sections.add(C.section_number),!0)}function b(w){return w.sections.size===w.last_section_number+1}l.default=class{constructor(){we(this,"download_data_ids");we(this,"download_ids");we(this,"epg");we(this,"logo_id_refs");we(this,"logo_ids");we(this,"original_network_id");we(this,"service_ids");we(this,"services");we(this,"time");we(this,"transport_stream_id");we(this,"transport_streams");we(this,"versions");this.reset()}reset(){this.original_network_id=-1,this.transport_stream_id=-1,this.service_ids=null,this.transport_streams=new Map,this.services=new Map,this.epg=new t.default,this.time=null,this.download_data_ids=new Map,this.download_ids=new Map,this.logo_ids=new Map,this.logo_id_refs=new Map,this.versions={pat:new Map,cat:new Map,pmt:new Map,dsmcc:new Map,nit:new Map,sdt:new Map,bat:new Map,sdtt:new Map,cdt:new Map}}addPat(w,C){if(w!==0||C.table_id!==0||C.current_next_indicator===0)return!1;let D=d(this.versions.pat,[C.table_id]),R=m(D,C);if(!v(D,C))return!1;this.service_ids===null&&(this.service_ids={});let T=this.service_ids;return(Object.keys(T).length===0||R)&&(T.content=new Set,T.flag=!1),C.programs.forEach(P=>{P.program_number!==0&&T.content.add(P.program_number)}),b(D)&&(T.flag=!0),!0}addCat(w,C){return w===1&&C.table_id===1&&C.current_next_indicator!==0}addPmt(w,C){return C.table_id===2&&C.current_next_indicator!==0}addDsmcc(w,C){if(C.table_id!==59&&C.table_id!==60)return!1;if(C.current_next_indicator===0)return!0;let D=d(this.versions.dsmcc,[C.table_id,C.table_id_extension]),R=m(D,C);if(!v(D,C))return!1;switch(C.table_id){case 59:{let T=C.message;if(!o(this.download_ids,[T.downloadId]))return!1;let P=d(this.download_ids,[T.downloadId]);(Object.keys(P).length===0||R)&&(P.modules=new Map,P.numberOfModules=T.numberOfModules,P.blockSize=T.blockSize);for(let L of T.modules){let I=d(P.modules,[L.moduleId]);I.blocks=[],I.blockCount=0,I.numberOfBlocks=Math.ceil(L.moduleSize/T.blockSize),I.dataModuleByte=null,I.moduleSize=L.moduleSize,I.moduleVersion=L.moduleVersion,I.type=null,I.name=null,I.info=null,I.flag=!1;for(let x of L.moduleInfo)switch(x.descriptor_tag){case 1:I.type=new r.default(x.text_char);break;case 2:I.name=new r.default(x.text_char);break;case 3:I.info=new r.default(x.text_char)}}break}case 60:{let T=C.message;if(!o(this.download_ids,[T.downloadId]))return!1;let P=d(this.download_ids,[T.downloadId]);if(Object.keys(P).length===0||!o(P.modules,[T.moduleId]))return!1;let L=d(P.modules,[T.moduleId]);if(T.moduleVersion!==L.moduleVersion||L.blocks.hasOwnProperty(T.blockNumber))return!1;if(L.blocks[T.blockNumber]=T.blockDataByte,L.blockCount++,L.blockCount===L.numberOfBlocks){let I=p.Buffer.concat(L.blocks);I.length===L.moduleSize?(L.dataModuleByte=I,L.flag=!0):(L.blocks.length=0,L.blockCount=0)}if(P.modules.every(I=>I.flag)){for(let I of P.modules)switch(I.name){case"LOGO-00":case"LOGO-01":case"LOGO-02":case"LOGO-03":case"LOGO-04":case"LOGO-05":case"CS_LOGO-00":case"CS_LOGO-01":case"CS_LOGO-02":case"CS_LOGO-03":case"CS_LOGO-04":case"CS_LOGO-05":{let x=new a.TsDataModuleLogo(I.dataModuleByte).decode();for(let O of x.logos){let G=new Set;for(let J of O.services)G.add(J.original_network_id),d(this.logo_id_refs,[J.original_network_id,J.transport_stream_id,J.service_id]).logo_id=O.logo_id;if(G.size!==0)for(let J of G){let te=d(this.logo_ids,[J,O.logo_id]);if(Object.keys(te).length!==0&&I.moduleVersion===te.version||(te.content=new Map,te.version=I.moduleVersion,te.flag=!1),te.flag)continue;let le=new n.default(O.data_byte).decode();te.content.set(x.logo_type,le),te.content.size===6&&(te.flag=!0)}}break}}g(this.download_ids,[T.downloadId])}break}}return!0}addNit(w,C){if(w!==16||C.table_id!==64&&C.table_id!==65||C.current_next_indicator===0)return!1;let D=d(this.versions.nit,[C.table_id,C.network_id]),R=m(D,C);if(!v(D,C))return!1;C.table_id===64&&(this.original_network_id=C.network_id);let T=d(this.transport_streams,[C.network_id]);(Object.keys(T).length===0||R)&&(T.content=new Map,T.flag=!1);for(let P of C.transport_streams){let L={};L.transport_stream_id=P.transport_stream_id,L.original_network_id=P.original_network_id,L.services=null,L.satellite_delivery_system=null,L.terrestrial_delivery_system=null;for(let I of P.transport_descriptors)switch(I.descriptor_tag){case 65:L.services={},I.services.forEach(x=>{let O={};O.service_id=x.service_id,O.service_type=x.service_type,L.services[x.service_id]=O});break;case 67:L.satellite_delivery_system={},L.satellite_delivery_system.frequency=I.frequency,L.satellite_delivery_system.orbital_position=I.orbital_position,L.satellite_delivery_system.west_east_flag=I.west_east_flag,L.satellite_delivery_system.polarisation=I.polarisation,L.satellite_delivery_system.modulation=I.modulation,L.satellite_delivery_system.symbol_rate=I.symbol_rate,L.satellite_delivery_system.FEC_inner=I.FEC_inner;break;case 250:L.terrestrial_delivery_system={},L.terrestrial_delivery_system.area_code=I.area_code,L.terrestrial_delivery_system.guard_interval=I.guard_interval,L.terrestrial_delivery_system.transmission_mode=I.transmission_mode,L.terrestrial_delivery_system.frequencies=I.frequencies}T.content.set(P.transport_stream_id,L)}return b(D)&&(T.flag=!0),!0}addSdt(w,C){if(w!==17||C.table_id!==66&&C.table_id!==70||C.current_next_indicator===0)return!1;let D=d(this.versions.sdt,[C.table_id,C.original_network_id,C.transport_stream_id]),R=m(D,C);if(!v(D,C))return!1;C.table_id===66&&(this.transport_stream_id=C.transport_stream_id);let T=d(this.services,[C.original_network_id,C.transport_stream_id]);(Object.keys(T).length===0||R)&&(T.content=new Map,T.flag=!1);for(let P of C.services){let L={};L.service_id=P.service_id,L.running_status=P.running_status,L.free_CA_mode=P.free_CA_mode,L.service=null;for(let I of P.descriptors)switch(I.descriptor_tag){case 72:L.service={},L.service.service_type=I.service_type,L.service.service_provider_name=new r.default(I.service_provider_name_char).decode(),L.service.service_name=new r.default(I.service_name_char).decode();break;case 207:if(L.logo_transmission={},L.logo_transmission.logo_transmission_type=I.logo_transmission_type,I.logo_transmission_type===1?(L.logo_transmission.logo_id=I.logo_id,L.logo_transmission.logo_version=I.logo_version,L.logo_transmission.download_data_id=I.download_data_id):I.logo_transmission_type===2?L.logo_transmission.logo_id=I.logo_id:I.logo_transmission_type===3&&(L.logo_transmission.logo_char=I.logo_char),I.logo_transmission_type<3&&(d(this.logo_id_refs,[C.original_network_id,C.transport_stream_id,P.service_id]).logo_id=I.logo_id,I.logo_transmission_type===1)){let x=d(this.download_data_ids,[C.original_network_id,I.download_data_id]);Object.keys(x).length===0&&(x.flag=!1)}}T.content.set(P.service_id,L)}return b(D)&&(T.flag=!0),!0}addBat(w,C){return w===17&&C.table_id===74&&(C.current_next_indicator,!0)}addEit(w,C){return this.epg.addEit(w,C,this.time)}addTdt(w,C){return w===20&&C.table_id===112&&(this.time=new i.default(C.JST_time).decode(),!0)}addTot(w,C){return w===20&&C.table_id===115&&(this.time=new i.default(C.JST_time).decode(),!0)}addSdtt(w,C){if(w!==35&&w!==40||C.table_id!==195||C.table_id_ext>>8!=255||C.current_next_indicator===0)return!1;let D=d(this.versions.sdtt,[C.table_id,C.table_id_ext]);if(m(D,C),!v(D,C))return!1;for(let R of C.contents)for(let T of R.descriptors)T.descriptor_tag===201&&d(this.download_ids,[T.download_id]);return!0}addCdt(w,C){if(w!==41||C.table_id!==200||C.current_next_indicator===0)return!1;let D=d(this.versions.cdt,[C.table_id,C.original_network_id,C.download_data_id]);if(m(D,C),!v(D,C)||!o(this.download_data_ids,[C.original_network_id,C.download_data_id]))return!1;switch(C.data_type){case 1:{let R=new a.TsDataModuleCdtLogo(C.data_module_byte).decode(),T=d(this.logo_ids,[C.original_network_id,R.logo_id]);if(Object.keys(T).length!==0&&R.logo_version===T.version||(T.content=new Map,T.version=R.logo_version,T.flag=!1),T.flag)return!1;let P=new n.default(R.data_byte).decode();T.content.set(R.logo_type,P),T.content.size===6&&(T.flag=!0);break}}return b(D)&&g(this.download_data_ids,[C.original_network_id,C.download_data_id]),!0}hasTransportStreams(w){return w=w||this.original_network_id,!!o(this.transport_streams,[w])&&!!d(this.transport_streams,[w]).flag}hasServices(w,C){return w=w||this.original_network_id,C=C||this.transport_stream_id,!!o(this.services,[w,C])&&!!d(this.services,[w,C]).flag}hasOriginalNetworkId(){return this.original_network_id!==-1}hasTransportStreamId(){return this.transport_stream_id!==-1}hasServiceIds(){return this.service_ids!==null&&!!this.service_ids.flag}hasPresent(w,C,D){return this.epg.hasPresent(w,C,D)}hasFollowing(w,C,D){return this.epg.hasFollowing(w,C,D)}hasSchedule(){return this.epg.hasSchedule()}hasTime(){return this.time!==null}hasLogoId(w,C,D){return o(this.logo_id_refs,[w,C,D])}hasLogo(w,C){return!!o(this.logo_ids,[C,w])&&!!d(this.logo_ids,[C,w]).flag}getTransportStreams(w){if(w=w||this.original_network_id,!o(this.transport_streams,[w]))return null;let C=d(this.transport_streams,[w]),D={};for(let R of C.content)D[R[0]]=R[1];return D}getServices(w,C){if(w=w||this.original_network_id,C=C||this.transport_stream_id,!o(this.services,[w,C]))return null;let D=d(this.services,[w,C]),R={};for(let T of D.content)R[T[0]]=T[1];return R}getOriginalNetworkId(){return this.original_network_id}getTransportStreamId(){return this.transport_stream_id}getServiceIds(){return this.service_ids===null?null:Array.from(this.service_ids.content)}getPresent(w,C,D){return this.epg.getPresent(w,C,D)}getFollowing(w,C,D){return this.epg.getFollowing(w,C,D)}getSchedule(){return this.epg.getSchedule()}getScheduleAmount(){return this.epg.getScheduleAmount()}getTime(){return this.time===null?null:new Date(this.time.getTime())}getLogoId(w,C,D){return o(this.logo_id_refs,[w,C,D])?d(this.logo_id_refs,[w,C,D]).logo_id:null}getLogo(w,C){if(!o(this.logo_ids,[C,w]))return null;let D=d(this.logo_ids,[C,w]),R={};for(let T of D.content)R[T[0]]=T[1];return R}}},7786:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.default=class{constructor(c,p=0){we(this,"buffer");we(this,"position");this.buffer=c,this.position=p}writeBits(c,p){if(this.position+c>this.buffer.length<<3)this.position+=c;else for(;c>0;){let r=this.position>>3,i=7&this.position^7;this.buffer[r]=this.buffer[r]&~(1<>c-1&1)<this.buffer.length<<3)return void(this.position+=c);let r=this.position>>3;this.position+=c<<3,p.copy(this.buffer,r,0,c)}next(c){this.position+=c}previous(c){this.position-=c}bslbf(c,p){this.writeBits(c,p)}uimsbf(c,p){this.writeBits(c,p)}tcimsbf(c,p){this.writeBits(c,p>>>31<{const{AbortController:l,AbortSignal:c}=typeof self<"u"?self:typeof window<"u"?window:void 0;A.exports=l,A.exports.AbortSignal=c,A.exports.default=l},1918:function(A){A.exports=function(){var l={9798:function(r,i,t){t.r(i),t.d(i,{CanvasProvider:function(){return j},CanvasRenderer:function(){return ue},HTMLProvider:function(){return At},HTMLRenderer:function(){return it},SVGProvider:function(){return Ue},SVGRenderer:function(){return ut}}),t(2526),t(1817),t(2222),t(6992),t(7042),t(5212),t(9575),t(9653),t(5192),t(4363),t(9494),t(1539),t(9714),t(2472),t(2990),t(8927),t(3105),t(5035),t(4345),t(7174),t(2846),t(4731),t(7209),t(6319),t(8867),t(7789),t(3739),t(9368),t(4483),t(2056),t(3462),t(678),t(7462),t(3824),t(5021),t(2974),t(5016),t(3290),t(6699),t(1532),t(9720),t(4916),t(2023),t(8783),t(3112),t(5306),t(3948);var n=new Map([[0,{bytes:2,alphabet:0}],[1,{bytes:1,alphabet:1}],[2,{bytes:1,alphabet:2}],[3,{bytes:1,alphabet:3}],[4,{bytes:1,alphabet:4}],[5,{bytes:1,alphabet:5}],[6,{bytes:1,alphabet:6}],[7,{bytes:1,alphabet:7}],[8,{bytes:1,alphabet:8}],[9,{bytes:1,alphabet:9}],[10,{bytes:1,alphabet:10}],[11,{bytes:1,alphabet:11}],[12,{bytes:2,alphabet:12}],[13,{bytes:2,alphabet:13}],[14,{bytes:2,alphabet:14}]]),a=new Map([[66,{bytes:2,alphabet:0}],[74,{bytes:1,alphabet:1}],[48,{bytes:1,alphabet:2}],[49,{bytes:1,alphabet:3}],[50,{bytes:1,alphabet:4}],[51,{bytes:1,alphabet:5}],[52,{bytes:1,alphabet:6}],[53,{bytes:1,alphabet:7}],[54,{bytes:1,alphabet:8}],[55,{bytes:1,alphabet:9}],[56,{bytes:1,alphabet:10}],[73,{bytes:1,alphabet:11}],[57,{bytes:2,alphabet:12}],[58,{bytes:2,alphabet:13}],[59,{bytes:2,alphabet:14}]]),o=new Map([[15,{bytes:2,alphabet:15}],[16,{bytes:1,alphabet:16}],[17,{bytes:1,alphabet:17}],[18,{bytes:1,alphabet:18}],[19,{bytes:1,alphabet:19}],[20,{bytes:1,alphabet:20}],[21,{bytes:1,alphabet:21}],[22,{bytes:1,alphabet:22}],[23,{bytes:1,alphabet:23}],[24,{bytes:1,alphabet:24}],[25,{bytes:1,alphabet:25}],[26,{bytes:1,alphabet:26}],[27,{bytes:1,alphabet:27}],[28,{bytes:1,alphabet:28}],[29,{bytes:1,alphabet:29}],[30,{bytes:1,alphabet:30}],[31,{bytes:1,alphabet:31}]]),d=new Map([[64,{bytes:2,alphabet:15}],[65,{bytes:1,alphabet:16}],[66,{bytes:1,alphabet:17}],[67,{bytes:1,alphabet:18}],[68,{bytes:1,alphabet:19}],[69,{bytes:1,alphabet:20}],[70,{bytes:1,alphabet:21}],[71,{bytes:1,alphabet:22}],[72,{bytes:1,alphabet:23}],[73,{bytes:1,alphabet:24}],[74,{bytes:1,alphabet:25}],[75,{bytes:1,alphabet:26}],[76,{bytes:1,alphabet:27}],[77,{bytes:1,alphabet:28}],[78,{bytes:1,alphabet:29}],[79,{bytes:1,alphabet:30}],[112,{bytes:1,alphabet:31}]]),g=[["#000000FF","#FF0000FF","#00FF00FF","#FFFF00FF","#0000FFFF","#FF00FFFF","#00FFFFFF","#FFFFFFFF","#00000000","#AA0000FF","#00AA00FF","#AAAA00FF","#0000AAFF","#AA00AAFF","#00AAAAFF","#AAAAAAFF"],["#000055FF","#005500FF","#005555FF","#0055AAFF","#0055FFFF","#00AA55FF","#00AAFFFF","#00FF55FF","#00FFAAFF","#550000FF","#550055FF","#5500AAFF","#5500FFFF","#555500FF","#555555FF","#5555AAFF"],["#5555FFFF","#55AA00FF","#55AA55FF","#55AAAAFF","#55AAFFFF","#55FF00FF","#55FF55FF","#55FFAAFF","#55FFFFFF","#AA0055FF","#AA00FFFF","#AA5500FF","#AA5555FF","#AA55AAFF","#AA55FFFF","#AAAA55FF"],["#AAAAFFFF","#AAFF00FF","#AAFF55FF","#AAFFAAFF","#AAFFFFFF","#FF0055FF","#FF00AAFF","#FF5500FF","#FF5555FF","#FF55AAFF","#FF55FFFF","#FFAA00FF","#FFAA55FF","#FFAAAAFF","#FFAAFFFF","#FFFF55FF"],["#FFFFAAFF","#00000080","#FF000080","#00FF0080","#FFFF0080","#0000FF80","#FF00FF80","#00FFFF80","#FFFFFF80","#AA000080","#00AA0080","#AAAA0080","#0000AA80","#AA00AA80","#00AAAA80","#AAAAAA80"],["#00005580","#00550080","#00555580","#0055AA80","#0055FF80","#00AA5580","#00AAFF80","#00FF5580","#00FFAA80","#55000080","#55005580","#5500AA80","#5500FF80","#55550080","#55555580","#5555AA80"],["#5555FF80","#55AA0080","#55AA5580","#55AAAA80","#55AAFF80","#55FF0080","#55FF5580","#55FFAA80","#55FFFF80","#AA005580","#AA00FF80","#AA550080","#AA555580","#AA55AA80","#AA55FF80","#AAAA5580"],["#AAAAFF80","#AAFF0080","#AAFF5580","#AAFFAA80","#AAFFFF80","#FF005580","#FF00AA80","#FF550080","#FF555580","#FF55AA80","#FF55FF80","#FFAA0080","#FFAA5580","#FFAAAA80","#FFAAFF80","#FFFF5580"]],m=[" ","、","。",",",".","・",":",";","?","!","゛","゜","´","`","¨","^"," ̄","_","ヽ","ヾ","ゝ","ゞ","〃","仝","々","〆","〇","ー","―","‐","/","\","〜","‖","|","…","‥","‘","’","“","”","(",")","〔","〕","[","]","{","}","〈","〉","《","》","「","」","『","』","【","】","+","−","±","×","÷","=","≠","<",">","≦","≧","∞","∴","♂","♀","°","′","″","℃","¥","$","¢","£","%","#","&","*","@","§","☆","★","○","●","◎","◇","◆","□","■","△","▲","▽","▼","※","〒","→","←","↑","↓","〓","'",""","-","~","〳","〴","〵","〻","〼","ヿ","ゟ","∈","∋","⊆","⊇","⊂","⊃","∪","∩","⊄","⊅","⊊","⊋","∉","∅","⌅","⌆","∧","∨","¬","⇒","⇔","∀","∃","⊕","⊖","⊗","∥","∦","⦅","⦆","〘","〙","〖","〗","∠","⊥","⌒","∂","∇","≡","≒","≪","≫","√","∽","∝","∵","∫","∬","≢","≃","≅","≈","≶","≷","↔","Å","‰","♯","♭","♪","†","‡","¶","♮","♫","♬","♩","◯","▷","▶","◁","◀","↗","↘","↖","↙","⇄","⇨","⇦","⇧","⇩","⤴","⤵","0","1","2","3","4","5","6","7","8","9","⦿","◉","〽","﹆","﹅","◦","•","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","∓","ℵ","ℏ","㏋","ℓ","℧","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","゠","–","⧺","⧻","ぁ","あ","ぃ","い","ぅ","う","ぇ","え","ぉ","お","か","が","き","ぎ","く","ぐ","け","げ","こ","ご","さ","ざ","し","じ","す","ず","せ","ぜ","そ","ぞ","た","だ","ち","ぢ","っ","つ","づ","て","で","と","ど","な","に","ぬ","ね","の","は","ば","ぱ","ひ","び","ぴ","ふ","ぶ","ぷ","へ","べ","ぺ","ほ","ぼ","ぽ","ま","み","む","め","も","ゃ","や","ゅ","ゆ","ょ","よ","ら","り","る","れ","ろ","ゎ","わ","ゐ","ゑ","を","ん","ゔ","ゕ","ゖ","か゚","き゚","く゚","け゚","こ゚","","","","ァ","ア","ィ","イ","ゥ","ウ","ェ","エ","ォ","オ","カ","ガ","キ","ギ","ク","グ","ケ","ゲ","コ","ゴ","サ","ザ","シ","ジ","ス","ズ","セ","ゼ","ソ","ゾ","タ","ダ","チ","ヂ","ッ","ツ","ヅ","テ","デ","ト","ド","ナ","ニ","ヌ","ネ","ノ","ハ","バ","パ","ヒ","ビ","ピ","フ","ブ","プ","ヘ","ベ","ペ","ホ","ボ","ポ","マ","ミ","ム","メ","モ","ャ","ヤ","ュ","ユ","ョ","ヨ","ラ","リ","ル","レ","ロ","ヮ","ワ","ヰ","ヱ","ヲ","ン","ヴ","ヵ","ヶ","カ゚","キ゚","ク゚","ケ゚","コ゚","セ゚","ツ゚","ト゚","Α","Β","Γ","Δ","Ε","Ζ","Η","Θ","Ι","Κ","Λ","Μ","Ν","Ξ","Ο","Π","Ρ","Σ","Τ","Υ","Φ","Χ","Ψ","Ω","♤","♠","♢","♦","♡","♥","♧","♣","α","β","γ","δ","ε","ζ","η","θ","ι","κ","λ","μ","ν","ξ","ο","π","ρ","σ","τ","υ","φ","χ","ψ","ω","ς","⓵","⓶","⓷","⓸","⓹","⓺","⓻","⓼","⓽","⓾","☖","☗","〠","☎","☀","☁","☂","☃","♨","▱","ㇰ","ㇱ","ㇲ","ㇳ","ㇴ","ㇵ","ㇶ","ㇷ","ㇸ","ㇹ","ㇷ゚","ㇺ","ㇻ","ㇼ","ㇽ","ㇾ","ㇿ","А","Б","В","Г","Д","Е","Ё","Ж","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ч","Ш","Щ","Ъ","Ы","Ь","Э","Ю","Я","⎾","⎿","⏀","⏁","⏂","⏃","⏄","⏅","⏆","⏇","⏈","⏉","⏊","⏋","⏌","а","б","в","г","д","е","ё","ж","з","и","й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ч","ш","щ","ъ","ы","ь","э","ю","я","ヷ","ヸ","ヹ","ヺ","⋚","⋛","⅓","⅔","⅕","✓","⌘","␣","⏎","─","│","┌","┐","┘","└","├","┬","┤","┴","┼","━","┃","┏","┓","┛","┗","┣","┳","┫","┻","╋","┠","┯","┨","┷","┿","┝","┰","┥","┸","╂","㉑","㉒","㉓","㉔","㉕","㉖","㉗","㉘","㉙","㉚","㉛","㉜","㉝","㉞","㉟","㊱","㊲","㊳","㊴","㊵","㊶","㊷","㊸","㊹","㊺","㊻","㊼","㊽","㊾","㊿","","","","","","","","","◐","◑","◒","◓","‼","⁇","⁈","⁉","Ǎ","ǎ","ǐ","Ḿ","ḿ","Ǹ","ǹ","Ǒ","ǒ","ǔ","ǖ","ǘ","ǚ","ǜ","","","€"," ","¡","¤","¦","©","ª","«","­","®","¯","²","³","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","ø","ù","ú","û","ü","ý","þ","ÿ","Ā","Ī","Ū","Ē","Ō","ā","ī","ū","ē","ō","Ą","˘","Ł","Ľ","Ś","Š","Ş","Ť","Ź","Ž","Ż","ą","˛","ł","ľ","ś","ˇ","š","ş","ť","ź","˝","ž","ż","Ŕ","Ă","Ĺ","Ć","Č","Ę","Ě","Ď","Ń","Ň","Ő","Ř","Ů","Ű","Ţ","ŕ","ă","ĺ","ć","č","ę","ě","ď","đ","ń","ň","ő","ř","ů","ű","ţ","˙","Ĉ","Ĝ","Ĥ","Ĵ","Ŝ","Ŭ","ĉ","ĝ","ĥ","ĵ","ŝ","ŭ","ɱ","ʋ","ɾ","ʃ","ʒ","ɬ","ɮ","ɹ","ʈ","ɖ","ɳ","ɽ","ʂ","ʐ","ɻ","ɭ","ɟ","ɲ","ʝ","ʎ","ɡ","ŋ","ɰ","ʁ","ħ","ʕ","ʔ","ɦ","ʘ","ǂ","ɓ","ɗ","ʄ","ɠ","Ɠ","œ","Œ","ɨ","ʉ","ɘ","ɵ","ə","ɜ","ɞ","ɐ","ɯ","ʊ","ɤ","ʌ","ɔ","ɑ","ɒ","ʍ","ɥ","ʢ","ʡ","ɕ","ʑ","ɺ","ɧ","ɚ","æ̀","ǽ","ὰ","ά","ɔ̀","ɔ́","ʌ̀","ʌ́","ə̀","ə́","ɚ̀","ɚ́","ὲ","έ","͡","ˈ","ˌ","ː","ˑ","̆","‿","̋","́","̄","̀","̏","̌","̂","˥","˦","˧","˨","˩","˩˥","˥˩","̥","̬","̹","̜","̟","̠","̈","̽","̩","̯","˞","̤","̰","̼","̴","̝","̞","̘","̙","̪","̺","̻","̃","̚","❶","❷","❸","❹","❺","❻","❼","❽","❾","❿","⓫","⓬","⓭","⓮","⓯","⓰","⓱","⓲","⓳","⓴","ⅰ","ⅱ","ⅲ","ⅳ","ⅴ","ⅵ","ⅶ","ⅷ","ⅸ","ⅹ","ⅺ","ⅻ","ⓐ","ⓑ","ⓒ","ⓓ","ⓔ","ⓕ","ⓖ","ⓗ","ⓘ","ⓙ","ⓚ","ⓛ","ⓜ","ⓝ","ⓞ","ⓟ","ⓠ","ⓡ","ⓢ","ⓣ","ⓤ","ⓥ","ⓦ","ⓧ","ⓨ","ⓩ","㋐","㋑","㋒","㋓","㋔","㋕","㋖","㋗","㋘","㋙","㋚","㋛","㋜","㋝","㋞","㋟","㋠","㋡","㋢","㋣","㋺","㋩","㋥","㋭","㋬","","","","","","","","","","⁑","⁂","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","㍉","㌔","㌢","㍍","㌘","㌧","㌃","㌶","㍑","㍗","㌍","㌦","㌣","㌫","㍊","㌻","㎜","㎝","㎞","㎎","㎏","㏄","㎡","Ⅻ","","","","","","","","㍻","〝","〟","№","㏍","℡","㊤","㊥","㊦","㊧","㊨","㈱","㈲","㈹","㍾","㍽","㍼","","","","∮","","","","","∟","⊿","","","","❖","☞","俱","𠀋","㐂","丨","丯","丰","亍","仡","份","仿","伃","伋","你","佈","佉","佖","佟","佪","佬","佾","侊","侔","侗","侮","俉","俠","倁","倂","倎","倘","倧","倮","偀","倻","偁","傔","僌","僲","僐","僦","僧","儆","儃","儋","儞","儵","兊","免","兕","兗","㒵","冝","凃","凊","凞","凢","凮","刁","㓛","刓","刕","剉","剗","剡","劓","勈","勉","勌","勐","勖","勛","勤","勰","勻","匀","匇","匜","卑","卡","卣","卽","厓","厝","厲","吒","吧","呍","咜","呫","呴","呿","咈","咖","咡","咩","哆","哿","唎","唫","唵","啐","啞","喁","喆","喎","喝","喭","嗎","嘆","嘈","嘎","嘻","噉","噶","噦","器","噯","噱","噲","嚙","嚞","嚩","嚬","嚳","囉","囊","圊","𡈽","圡","圯","圳","圴","坰","坷","坼","垜","﨏","𡌛","垸","埇","埈","埏","埤","埭","埵","埶","埿","堉","塚","塡","塤","塀","塼","墉","增","墨","墩","𡑮","壒","壎","壔","壚","壠","壩","夌","虁","奝","奭","妋","妒","妤","姃","姒","姝","娓","娣","婧","婭","婷","婾","媄","媞","媧","嫄","𡢽","嬙","嬥","剝","亜","唖","娃","阿","哀","愛","挨","姶","逢","葵","茜","穐","悪","握","渥","旭","葦","芦","鯵","梓","圧","斡","扱","宛","姐","虻","飴","絢","綾","鮎","或","粟","袷","安","庵","按","暗","案","闇","鞍","杏","以","伊","位","依","偉","囲","夷","委","威","尉","惟","意","慰","易","椅","為","畏","異","移","維","緯","胃","萎","衣","謂","違","遺","医","井","亥","域","育","郁","磯","一","壱","溢","逸","稲","茨","芋","鰯","允","印","咽","員","因","姻","引","飲","淫","胤","蔭","院","陰","隠","韻","吋","右","宇","烏","羽","迂","雨","卯","鵜","窺","丑","碓","臼","渦","嘘","唄","欝","蔚","鰻","姥","厩","浦","瓜","閏","噂","云","運","雲","荏","餌","叡","営","嬰","影","映","曳","栄","永","泳","洩","瑛","盈","穎","頴","英","衛","詠","鋭","液","疫","益","駅","悦","謁","越","閲","榎","厭","円","園","堰","奄","宴","延","怨","掩","援","沿","演","炎","焔","煙","燕","猿","縁","艶","苑","薗","遠","鉛","鴛","塩","於","汚","甥","凹","央","奥","往","応","押","旺","横","欧","殴","王","翁","襖","鴬","鴎","黄","岡","沖","荻","億","屋","憶","臆","桶","牡","乙","俺","卸","恩","温","穏","音","下","化","仮","何","伽","価","佳","加","可","嘉","夏","嫁","家","寡","科","暇","果","架","歌","河","火","珂","禍","禾","稼","箇","花","苛","茄","荷","華","菓","蝦","課","嘩","貨","迦","過","霞","蚊","俄","峨","我","牙","画","臥","芽","蛾","賀","雅","餓","駕","介","会","解","回","塊","壊","廻","快","怪","悔","恢","懐","戒","拐","改","魁","晦","械","海","灰","界","皆","絵","芥","蟹","開","階","貝","凱","劾","外","咳","害","崖","慨","概","涯","碍","蓋","街","該","鎧","骸","浬","馨","蛙","垣","柿","蛎","鈎","劃","嚇","各","廓","拡","撹","格","核","殻","獲","確","穫","覚","角","赫","較","郭","閣","隔","革","学","岳","楽","額","顎","掛","笠","樫","橿","梶","鰍","潟","割","喝","恰","括","活","渇","滑","葛","褐","轄","且","鰹","叶","椛","樺","鞄","株","兜","竃","蒲","釜","鎌","噛","鴨","栢","茅","萱","粥","刈","苅","瓦","乾","侃","冠","寒","刊","勘","勧","巻","喚","堪","姦","完","官","寛","干","幹","患","感","慣","憾","換","敢","柑","桓","棺","款","歓","汗","漢","澗","潅","環","甘","監","看","竿","管","簡","緩","缶","翰","肝","艦","莞","観","諌","貫","還","鑑","間","閑","関","陥","韓","館","舘","丸","含","岸","巌","玩","癌","眼","岩","翫","贋","雁","頑","顔","願","企","伎","危","喜","器","基","奇","嬉","寄","岐","希","幾","忌","揮","机","旗","既","期","棋","棄","機","帰","毅","気","汽","畿","祈","季","稀","紀","徽","規","記","貴","起","軌","輝","飢","騎","鬼","亀","偽","儀","妓","宜","戯","技","擬","欺","犠","疑","祇","義","蟻","誼","議","掬","菊","鞠","吉","吃","喫","桔","橘","詰","砧","杵","黍","却","客","脚","虐","逆","丘","久","仇","休","及","吸","宮","弓","急","救","朽","求","汲","泣","灸","球","究","窮","笈","級","糾","給","旧","牛","去","居","巨","拒","拠","挙","渠","虚","許","距","鋸","漁","禦","魚","亨","享","京","供","侠","僑","兇","競","共","凶","協","匡","卿","叫","喬","境","峡","強","彊","怯","恐","恭","挟","教","橋","況","狂","狭","矯","胸","脅","興","蕎","郷","鏡","響","饗","驚","仰","凝","尭","暁","業","局","曲","極","玉","桐","粁","僅","勤","均","巾","錦","斤","欣","欽","琴","禁","禽","筋","緊","芹","菌","衿","襟","謹","近","金","吟","銀","九","倶","句","区","狗","玖","矩","苦","躯","駆","駈","駒","具","愚","虞","喰","空","偶","寓","遇","隅","串","櫛","釧","屑","屈","掘","窟","沓","靴","轡","窪","熊","隈","粂","栗","繰","桑","鍬","勲","君","薫","訓","群","軍","郡","卦","袈","祁","係","傾","刑","兄","啓","圭","珪","型","契","形","径","恵","慶","慧","憩","掲","携","敬","景","桂","渓","畦","稽","系","経","継","繋","罫","茎","荊","蛍","計","詣","警","軽","頚","鶏","芸","迎","鯨","劇","戟","撃","激","隙","桁","傑","欠","決","潔","穴","結","血","訣","月","件","倹","倦","健","兼","券","剣","喧","圏","堅","嫌","建","憲","懸","拳","捲","検","権","牽","犬","献","研","硯","絹","県","肩","見","謙","賢","軒","遣","鍵","険","顕","験","鹸","元","原","厳","幻","弦","減","源","玄","現","絃","舷","言","諺","限","乎","個","古","呼","固","姑","孤","己","庫","弧","戸","故","枯","湖","狐","糊","袴","股","胡","菰","虎","誇","跨","鈷","雇","顧","鼓","五","互","伍","午","呉","吾","娯","後","御","悟","梧","檎","瑚","碁","語","誤","護","醐","乞","鯉","交","佼","侯","候","倖","光","公","功","効","勾","厚","口","向","后","喉","坑","垢","好","孔","孝","宏","工","巧","巷","幸","広","庚","康","弘","恒","慌","抗","拘","控","攻","昂","晃","更","杭","校","梗","構","江","洪","浩","港","溝","甲","皇","硬","稿","糠","紅","紘","絞","綱","耕","考","肯","肱","腔","膏","航","荒","行","衡","講","貢","購","郊","酵","鉱","砿","鋼","閤","降","項","香","高","鴻","剛","劫","号","合","壕","拷","濠","豪","轟","麹","克","刻","告","国","穀","酷","鵠","黒","獄","漉","腰","甑","忽","惚","骨","狛","込","此","頃","今","困","坤","墾","婚","恨","懇","昏","昆","根","梱","混","痕","紺","艮","魂","些","佐","叉","唆","嵯","左","差","査","沙","瑳","砂","詐","鎖","裟","坐","座","挫","債","催","再","最","哉","塞","妻","宰","彩","才","採","栽","歳","済","災","采","犀","砕","砦","祭","斎","細","菜","裁","載","際","剤","在","材","罪","財","冴","坂","阪","堺","榊","肴","咲","崎","埼","碕","鷺","作","削","咋","搾","昨","朔","柵","窄","策","索","錯","桜","鮭","笹","匙","冊","刷","察","拶","撮","擦","札","殺","薩","雑","皐","鯖","捌","錆","鮫","皿","晒","三","傘","参","山","惨","撒","散","桟","燦","珊","産","算","纂","蚕","讃","賛","酸","餐","斬","暫","残","仕","仔","伺","使","刺","司","史","嗣","四","士","始","姉","姿","子","屍","市","師","志","思","指","支","孜","斯","施","旨","枝","止","死","氏","獅","祉","私","糸","紙","紫","肢","脂","至","視","詞","詩","試","誌","諮","資","賜","雌","飼","歯","事","似","侍","児","字","寺","慈","持","時","次","滋","治","爾","璽","痔","磁","示","而","耳","自","蒔","辞","汐","鹿","式","識","鴫","竺","軸","宍","雫","七","叱","執","失","嫉","室","悉","湿","漆","疾","質","実","蔀","篠","偲","柴","芝","屡","蕊","縞","舎","写","射","捨","赦","斜","煮","社","紗","者","謝","車","遮","蛇","邪","借","勺","尺","杓","灼","爵","酌","釈","錫","若","寂","弱","惹","主","取","守","手","朱","殊","狩","珠","種","腫","趣","酒","首","儒","受","呪","寿","授","樹","綬","需","囚","収","周","宗","就","州","修","愁","拾","洲","秀","秋","終","繍","習","臭","舟","蒐","衆","襲","讐","蹴","輯","週","酋","酬","集","醜","什","住","充","十","従","戎","柔","汁","渋","獣","縦","重","銃","叔","夙","宿","淑","祝","縮","粛","塾","熟","出","術","述","俊","峻","春","瞬","竣","舜","駿","准","循","旬","楯","殉","淳","準","潤","盾","純","巡","遵","醇","順","処","初","所","暑","曙","渚","庶","緒","署","書","薯","藷","諸","助","叙","女","序","徐","恕","鋤","除","傷","償","勝","匠","升","召","哨","商","唱","嘗","奨","妾","娼","宵","将","小","少","尚","庄","床","廠","彰","承","抄","招","掌","捷","昇","昌","昭","晶","松","梢","樟","樵","沼","消","渉","湘","焼","焦","照","症","省","硝","礁","祥","称","章","笑","粧","紹","肖","菖","蒋","蕉","衝","裳","訟","証","詔","詳","象","賞","醤","鉦","鍾","鐘","障","鞘","上","丈","丞","乗","冗","剰","城","場","壌","嬢","常","情","擾","条","杖","浄","状","畳","穣","蒸","譲","醸","錠","嘱","埴","飾","拭","植","殖","燭","織","職","色","触","食","蝕","辱","尻","伸","信","侵","唇","娠","寝","審","心","慎","振","新","晋","森","榛","浸","深","申","疹","真","神","秦","紳","臣","芯","薪","親","診","身","辛","進","針","震","人","仁","刃","塵","壬","尋","甚","尽","腎","訊","迅","陣","靭","笥","諏","須","酢","図","厨","逗","吹","垂","帥","推","水","炊","睡","粋","翠","衰","遂","酔","錐","錘","随","瑞","髄","崇","嵩","数","枢","趨","雛","据","杉","椙","菅","頗","雀","裾","澄","摺","寸","世","瀬","畝","是","凄","制","勢","姓","征","性","成","政","整","星","晴","棲","栖","正","清","牲","生","盛","精","聖","声","製","西","誠","誓","請","逝","醒","青","静","斉","税","脆","隻","席","惜","戚","斥","昔","析","石","積","籍","績","脊","責","赤","跡","蹟","碩","切","拙","接","摂","折","設","窃","節","説","雪","絶","舌","蝉","仙","先","千","占","宣","専","尖","川","戦","扇","撰","栓","栴","泉","浅","洗","染","潜","煎","煽","旋","穿","箭","線","繊","羨","腺","舛","船","薦","詮","賎","践","選","遷","銭","銑","閃","鮮","前","善","漸","然","全","禅","繕","膳","糎","噌","塑","岨","措","曾","曽","楚","狙","疏","疎","礎","祖","租","粗","素","組","蘇","訴","阻","遡","鼠","僧","創","双","叢","倉","喪","壮","奏","爽","宋","層","匝","惣","想","捜","掃","挿","掻","操","早","曹","巣","槍","槽","漕","燥","争","痩","相","窓","糟","総","綜","聡","草","荘","葬","蒼","藻","装","走","送","遭","鎗","霜","騒","像","増","憎","臓","蔵","贈","造","促","側","則","即","息","捉","束","測","足","速","俗","属","賊","族","続","卒","袖","其","揃","存","孫","尊","損","村","遜","他","多","太","汰","詑","唾","堕","妥","惰","打","柁","舵","楕","陀","駄","騨","体","堆","対","耐","岱","帯","待","怠","態","戴","替","泰","滞","胎","腿","苔","袋","貸","退","逮","隊","黛","鯛","代","台","大","第","醍","題","鷹","滝","瀧","卓","啄","宅","托","択","拓","沢","濯","琢","託","鐸","濁","諾","茸","凧","蛸","只","叩","但","達","辰","奪","脱","巽","竪","辿","棚","谷","狸","鱈","樽","誰","丹","単","嘆","坦","担","探","旦","歎","淡","湛","炭","短","端","箪","綻","耽","胆","蛋","誕","鍛","団","壇","弾","断","暖","檀","段","男","談","値","知","地","弛","恥","智","池","痴","稚","置","致","蜘","遅","馳","築","畜","竹","筑","蓄","逐","秩","窒","茶","嫡","着","中","仲","宙","忠","抽","昼","柱","注","虫","衷","註","酎","鋳","駐","樗","瀦","猪","苧","著","貯","丁","兆","凋","喋","寵","帖","帳","庁","弔","張","彫","徴","懲","挑","暢","朝","潮","牒","町","眺","聴","脹","腸","蝶","調","諜","超","跳","銚","長","頂","鳥","勅","捗","直","朕","沈","珍","賃","鎮","陳","津","墜","椎","槌","追","鎚","痛","通","塚","栂","掴","槻","佃","漬","柘","辻","蔦","綴","鍔","椿","潰","坪","壷","嬬","紬","爪","吊","釣","鶴","亭","低","停","偵","剃","貞","呈","堤","定","帝","底","庭","廷","弟","悌","抵","挺","提","梯","汀","碇","禎","程","締","艇","訂","諦","蹄","逓","邸","鄭","釘","鼎","泥","摘","擢","敵","滴","的","笛","適","鏑","溺","哲","徹","撤","轍","迭","鉄","典","填","天","展","店","添","纏","甜","貼","転","顛","点","伝","殿","澱","田","電","兎","吐","堵","塗","妬","屠","徒","斗","杜","渡","登","菟","賭","途","都","鍍","砥","砺","努","度","土","奴","怒","倒","党","冬","凍","刀","唐","塔","塘","套","宕","島","嶋","悼","投","搭","東","桃","梼","棟","盗","淘","湯","涛","灯","燈","当","痘","祷","等","答","筒","糖","統","到","董","蕩","藤","討","謄","豆","踏","逃","透","鐙","陶","頭","騰","闘","働","動","同","堂","導","憧","撞","洞","瞳","童","胴","萄","道","銅","峠","鴇","匿","得","徳","涜","特","督","禿","篤","毒","独","読","栃","橡","凸","突","椴","届","鳶","苫","寅","酉","瀞","噸","屯","惇","敦","沌","豚","遁","頓","呑","曇","鈍","奈","那","内","乍","凪","薙","謎","灘","捺","鍋","楢","馴","縄","畷","南","楠","軟","難","汝","二","尼","弐","迩","匂","賑","肉","虹","廿","日","乳","入","如","尿","韮","任","妊","忍","認","濡","禰","祢","寧","葱","猫","熱","年","念","捻","撚","燃","粘","乃","廼","之","埜","嚢","悩","濃","納","能","脳","膿","農","覗","蚤","巴","把","播","覇","杷","波","派","琶","破","婆","罵","芭","馬","俳","廃","拝","排","敗","杯","盃","牌","背","肺","輩","配","倍","培","媒","梅","楳","煤","狽","買","売","賠","陪","這","蝿","秤","矧","萩","伯","剥","博","拍","柏","泊","白","箔","粕","舶","薄","迫","曝","漠","爆","縛","莫","駁","麦","函","箱","硲","箸","肇","筈","櫨","幡","肌","畑","畠","八","鉢","溌","発","醗","髪","伐","罰","抜","筏","閥","鳩","噺","塙","蛤","隼","伴","判","半","反","叛","帆","搬","斑","板","氾","汎","版","犯","班","畔","繁","般","藩","販","範","釆","煩","頒","飯","挽","晩","番","盤","磐","蕃","蛮","匪","卑","否","妃","庇","彼","悲","扉","批","披","斐","比","泌","疲","皮","碑","秘","緋","罷","肥","被","誹","費","避","非","飛","樋","簸","備","尾","微","枇","毘","琵","眉","美","鼻","柊","稗","匹","疋","髭","彦","膝","菱","肘","弼","必","畢","筆","逼","桧","姫","媛","紐","百","謬","俵","彪","標","氷","漂","瓢","票","表","評","豹","廟","描","病","秒","苗","錨","鋲","蒜","蛭","鰭","品","彬","斌","浜","瀕","貧","賓","頻","敏","瓶","不","付","埠","夫","婦","富","冨","布","府","怖","扶","敷","斧","普","浮","父","符","腐","膚","芙","譜","負","賦","赴","阜","附","侮","撫","武","舞","葡","蕪","部","封","楓","風","葺","蕗","伏","副","復","幅","服","福","腹","複","覆","淵","弗","払","沸","仏","物","鮒","分","吻","噴","墳","憤","扮","焚","奮","粉","糞","紛","雰","文","聞","丙","併","兵","塀","幣","平","弊","柄","並","蔽","閉","陛","米","頁","僻","壁","癖","碧","別","瞥","蔑","箆","偏","変","片","篇","編","辺","返","遍","便","勉","娩","弁","鞭","保","舗","鋪","圃","捕","歩","甫","補","輔","穂","募","墓","慕","戊","暮","母","簿","菩","倣","俸","包","呆","報","奉","宝","峰","峯","崩","庖","抱","捧","放","方","朋","法","泡","烹","砲","縫","胞","芳","萌","蓬","蜂","褒","訪","豊","邦","鋒","飽","鳳","鵬","乏","亡","傍","剖","坊","妨","帽","忘","忙","房","暴","望","某","棒","冒","紡","肪","膨","謀","貌","貿","鉾","防","吠","頬","北","僕","卜","墨","撲","朴","牧","睦","穆","釦","勃","没","殆","堀","幌","奔","本","翻","凡","盆","摩","磨","魔","麻","埋","妹","昧","枚","毎","哩","槙","幕","膜","枕","鮪","柾","鱒","桝","亦","俣","又","抹","末","沫","迄","侭","繭","麿","万","慢","満","漫","蔓","味","未","魅","巳","箕","岬","密","蜜","湊","蓑","稔","脈","妙","粍","民","眠","務","夢","無","牟","矛","霧","鵡","椋","婿","娘","冥","名","命","明","盟","迷","銘","鳴","姪","牝","滅","免","棉","綿","緬","面","麺","摸","模","茂","妄","孟","毛","猛","盲","網","耗","蒙","儲","木","黙","目","杢","勿","餅","尤","戻","籾","貰","問","悶","紋","門","匁","也","冶","夜","爺","耶","野","弥","矢","厄","役","約","薬","訳","躍","靖","柳","薮","鑓","愉","愈","油","癒","諭","輸","唯","佑","優","勇","友","宥","幽","悠","憂","揖","有","柚","湧","涌","猶","猷","由","祐","裕","誘","遊","邑","郵","雄","融","夕","予","余","与","誉","輿","預","傭","幼","妖","容","庸","揚","揺","擁","曜","楊","様","洋","溶","熔","用","窯","羊","耀","葉","蓉","要","謡","踊","遥","陽","養","慾","抑","欲","沃","浴","翌","翼","淀","羅","螺","裸","来","莱","頼","雷","洛","絡","落","酪","乱","卵","嵐","欄","濫","藍","蘭","覧","利","吏","履","李","梨","理","璃","痢","裏","裡","里","離","陸","律","率","立","葎","掠","略","劉","流","溜","琉","留","硫","粒","隆","竜","龍","侶","慮","旅","虜","了","亮","僚","両","凌","寮","料","梁","涼","猟","療","瞭","稜","糧","良","諒","遼","量","陵","領","力","緑","倫","厘","林","淋","燐","琳","臨","輪","隣","鱗","麟","瑠","塁","涙","累","類","令","伶","例","冷","励","嶺","怜","玲","礼","苓","鈴","隷","零","霊","麗","齢","暦","歴","列","劣","烈","裂","廉","恋","憐","漣","煉","簾","練","聯","蓮","連","錬","呂","魯","櫓","炉","賂","路","露","労","婁","廊","弄","朗","楼","榔","浪","漏","牢","狼","篭","老","聾","蝋","郎","六","麓","禄","肋","録","論","倭","和","話","歪","賄","脇","惑","枠","鷲","亙","亘","鰐","詫","藁","蕨","椀","湾","碗","腕","𠮟","孁","孖","孽","宓","寘","寬","尒","尞","尣","尫","㞍","屢","層","屮","𡚴","屺","岏","岟","岣","岪","岺","峋","峐","峒","峴","𡸴","㟢","崍","崧","﨑","嵆","嵇","嵓","嵊","嵭","嶁","嶠","嶤","嶧","嶸","巋","吞","弌","丐","丕","个","丱","丶","丼","丿","乂","乖","乘","亂","亅","豫","亊","舒","弍","于","亞","亟","亠","亢","亰","亳","亶","从","仍","仄","仆","仂","仗","仞","仭","仟","价","伉","佚","估","佛","佝","佗","佇","佶","侈","侏","侘","佻","佩","佰","侑","佯","來","侖","儘","俔","俟","俎","俘","俛","俑","俚","俐","俤","俥","倚","倨","倔","倪","倥","倅","伜","俶","倡","倩","倬","俾","俯","們","倆","偃","假","會","偕","偐","偈","做","偖","偬","偸","傀","傚","傅","傴","傲","僉","僊","傳","僂","僖","僞","僥","僭","僣","僮","價","僵","儉","儁","儂","儖","儕","儔","儚","儡","儺","儷","儼","儻","儿","兀","兒","兌","兔","兢","竸","兩","兪","兮","冀","冂","囘","册","冉","冏","冑","冓","冕","冖","冤","冦","冢","冩","冪","冫","决","冱","冲","冰","况","冽","凅","凉","凛","几","處","凩","凭","凰","凵","凾","刄","刋","刔","刎","刧","刪","刮","刳","刹","剏","剄","剋","剌","剞","剔","剪","剴","剩","剳","剿","剽","劍","劔","劒","剱","劈","劑","辨","辧","劬","劭","劼","劵","勁","勍","勗","勞","勣","勦","飭","勠","勳","勵","勸","勹","匆","匈","甸","匍","匐","匏","匕","匚","匣","匯","匱","匳","匸","區","卆","卅","丗","卉","卍","凖","卞","卩","卮","夘","卻","卷","厂","厖","厠","厦","厥","厮","厰","厶","參","簒","雙","叟","曼","燮","叮","叨","叭","叺","吁","吽","呀","听","吭","吼","吮","吶","吩","吝","呎","咏","呵","咎","呟","呱","呷","呰","咒","呻","咀","呶","咄","咐","咆","哇","咢","咸","咥","咬","哄","哈","咨","咫","哂","咤","咾","咼","哘","哥","哦","唏","唔","哽","哮","哭","哺","哢","唹","啀","啣","啌","售","啜","啅","啖","啗","唸","唳","啝","喙","喀","咯","喊","喟","啻","啾","喘","喞","單","啼","喃","喩","喇","喨","嗚","嗅","嗟","嗄","嗜","嗤","嗔","嘔","嗷","嘖","嗾","嗽","嘛","嗹","噎","噐","營","嘴","嘶","嘲","嘸","噫","噤","嘯","噬","噪","嚆","嚀","嚊","嚠","嚔","嚏","嚥","嚮","嚶","嚴","囂","嚼","囁","囃","囀","囈","囎","囑","囓","囗","囮","囹","圀","囿","圄","圉","圈","國","圍","圓","團","圖","嗇","圜","圦","圷","圸","坎","圻","址","坏","坩","埀","垈","坡","坿","垉","垓","垠","垳","垤","垪","垰","埃","埆","埔","埒","埓","堊","埖","埣","堋","堙","堝","塲","堡","塢","塋","塰","毀","塒","堽","塹","墅","墹","墟","墫","墺","壞","墻","墸","墮","壅","壓","壑","壗","壙","壘","壥","壜","壤","壟","壯","壺","壹","壻","壼","壽","夂","夊","夐","夛","梦","夥","夬","夭","夲","夸","夾","竒","奕","奐","奎","奚","奘","奢","奠","奧","奬","奩","奸","妁","妝","佞","侫","妣","妲","姆","姨","姜","妍","姙","姚","娥","娟","娑","娜","娉","娚","婀","婬","婉","娵","娶","婢","婪","媚","媼","媾","嫋","嫂","媽","嫣","嫗","嫦","嫩","嫖","嫺","嫻","嬌","嬋","嬖","嬲","嫐","嬪","嬶","嬾","孃","孅","孀","孑","孕","孚","孛","孥","孩","孰","孳","孵","學","斈","孺","宀","它","宦","宸","寃","寇","寉","寔","寐","寤","實","寢","寞","寥","寫","寰","寶","寳","尅","將","專","對","尓","尠","尢","尨","尸","尹","屁","屆","屎","屓","屐","屏","孱","屬","屮","乢","屶","屹","岌","岑","岔","妛","岫","岻","岶","岼","岷","峅","岾","峇","峙","峩","峽","峺","峭","嶌","峪","崋","崕","崗","嵜","崟","崛","崑","崔","崢","崚","崙","崘","嵌","嵒","嵎","嵋","嵬","嵳","嵶","嶇","嶄","嶂","嶢","嶝","嶬","嶮","嶽","嶐","嶷","嶼","巉","巍","巓","巒","巖","巛","巫","已","巵","帋","帚","帙","帑","帛","帶","帷","幄","幃","幀","幎","幗","幔","幟","幢","幤","幇","幵","并","幺","麼","广","庠","廁","廂","廈","廐","廏","廖","廣","廝","廚","廛","廢","廡","廨","廩","廬","廱","廳","廰","廴","廸","廾","弃","弉","彝","彜","弋","弑","弖","弩","弭","弸","彁","彈","彌","彎","弯","彑","彖","彗","彙","彡","彭","彳","彷","徃","徂","彿","徊","很","徑","徇","從","徙","徘","徠","徨","徭","徼","忖","忻","忤","忸","忱","忝","悳","忿","怡","恠","怙","怐","怩","怎","怱","怛","怕","怫","怦","怏","怺","恚","恁","恪","恷","恟","恊","恆","恍","恣","恃","恤","恂","恬","恫","恙","悁","悍","惧","悃","悚","悄","悛","悖","悗","悒","悧","悋","惡","悸","惠","惓","悴","忰","悽","惆","悵","惘","慍","愕","愆","惶","惷","愀","惴","惺","愃","愡","惻","惱","愍","愎","慇","愾","愨","愧","慊","愿","愼","愬","愴","愽","慂","慄","慳","慷","慘","慙","慚","慫","慴","慯","慥","慱","慟","慝","慓","慵","憙","憖","憇","憬","憔","憚","憊","憑","憫","憮","懌","懊","應","懷","懈","懃","懆","憺","懋","罹","懍","懦","懣","懶","懺","懴","懿","懽","懼","懾","戀","戈","戉","戍","戌","戔","戛","戞","戡","截","戮","戰","戲","戳","扁","扎","扞","扣","扛","扠","扨","扼","抂","抉","找","抒","抓","抖","拔","抃","抔","拗","拑","抻","拏","拿","拆","擔","拈","拜","拌","拊","拂","拇","抛","拉","挌","拮","拱","挧","挂","挈","拯","拵","捐","挾","捍","搜","捏","掖","掎","掀","掫","捶","掣","掏","掉","掟","掵","捫","捩","掾","揩","揀","揆","揣","揉","插","揶","揄","搖","搴","搆","搓","搦","搶","攝","搗","搨","搏","摧","摯","摶","摎","攪","撕","撓","撥","撩","撈","撼","據","擒","擅","擇","撻","擘","擂","擱","擧","舉","擠","擡","抬","擣","擯","攬","擶","擴","擲","擺","攀","擽","攘","攜","攅","攤","攣","攫","攴","攵","攷","收","攸","畋","效","敖","敕","敍","敘","敞","敝","敲","數","斂","斃","變","斛","斟","斫","斷","旃","旆","旁","旄","旌","旒","旛","旙","无","旡","旱","杲","昊","昃","旻","杳","昵","昶","昴","昜","晏","晄","晉","晁","晞","晝","晤","晧","晨","晟","晢","晰","暃","暈","暎","暉","暄","暘","暝","曁","暹","曉","暾","暼","曄","暸","曖","曚","曠","昿","曦","曩","曰","曵","曷","朏","朖","朞","朦","朧","霸","朮","朿","朶","杁","朸","朷","杆","杞","杠","杙","杣","杤","枉","杰","枩","杼","杪","枌","枋","枦","枡","枅","枷","柯","枴","柬","枳","柩","枸","柤","柞","柝","柢","柮","枹","柎","柆","柧","檜","栞","框","栩","桀","桍","栲","桎","梳","栫","桙","档","桷","桿","梟","梏","梭","梔","條","梛","梃","檮","梹","桴","梵","梠","梺","椏","梍","桾","椁","棊","椈","棘","椢","椦","棡","椌","棍","棔","棧","棕","椶","椒","椄","棗","棣","椥","棹","棠","棯","椨","椪","椚","椣","椡","棆","楹","楷","楜","楸","楫","楔","楾","楮","椹","楴","椽","楙","椰","楡","楞","楝","榁","楪","榲","榮","槐","榿","槁","槓","榾","槎","寨","槊","槝","榻","槃","榧","樮","榑","榠","榜","榕","榴","槞","槨","樂","樛","槿","權","槹","槲","槧","樅","榱","樞","槭","樔","槫","樊","樒","櫁","樣","樓","橄","樌","橲","樶","橸","橇","橢","橙","橦","橈","樸","樢","檐","檍","檠","檄","檢","檣","檗","蘗","檻","櫃","櫂","檸","檳","檬","櫞","櫑","櫟","檪","櫚","櫪","櫻","欅","蘖","櫺","欒","欖","鬱","欟","欸","欷","盜","欹","飮","歇","歃","歉","歐","歙","歔","歛","歟","歡","歸","歹","歿","殀","殄","殃","殍","殘","殕","殞","殤","殪","殫","殯","殲","殱","殳","殷","殼","毆","毋","毓","毟","毬","毫","毳","毯","麾","氈","氓","气","氛","氤","氣","汞","汕","汢","汪","沂","沍","沚","沁","沛","汾","汨","汳","沒","沐","泄","泱","泓","沽","泗","泅","泝","沮","沱","沾","沺","泛","泯","泙","泪","洟","衍","洶","洫","洽","洸","洙","洵","洳","洒","洌","浣","涓","浤","浚","浹","浙","涎","涕","濤","涅","淹","渕","渊","涵","淇","淦","涸","淆","淬","淞","淌","淨","淒","淅","淺","淙","淤","淕","淪","淮","渭","湮","渮","渙","湲","湟","渾","渣","湫","渫","湶","湍","渟","湃","渺","湎","渤","滿","渝","游","溂","溪","溘","滉","溷","滓","溽","溯","滄","溲","滔","滕","溏","溥","滂","溟","潁","漑","灌","滬","滸","滾","漿","滲","漱","滯","漲","滌","漾","漓","滷","澆","潺","潸","澁","澀","潯","潛","濳","潭","澂","潼","潘","澎","澑","濂","潦","澳","澣","澡","澤","澹","濆","澪","濟","濕","濬","濔","濘","濱","濮","濛","瀉","瀋","濺","瀑","瀁","瀏","濾","瀛","瀚","潴","瀝","瀘","瀟","瀰","瀾","瀲","灑","灣","炙","炒","炯","烱","炬","炸","炳","炮","烟","烋","烝","烙","焉","烽","焜","焙","煥","煕","熈","煦","煢","煌","煖","煬","熏","燻","熄","熕","熨","熬","燗","熹","熾","燒","燉","燔","燎","燠","燬","燧","燵","燼","燹","燿","爍","爐","爛","爨","爭","爬","爰","爲","爻","爼","爿","牀","牆","牋","牘","牴","牾","犂","犁","犇","犒","犖","犢","犧","犹","犲","狃","狆","狄","狎","狒","狢","狠","狡","狹","狷","倏","猗","猊","猜","猖","猝","猴","猯","猩","猥","猾","獎","獏","默","獗","獪","獨","獰","獸","獵","獻","獺","珈","玳","珎","玻","珀","珥","珮","珞","璢","琅","瑯","琥","珸","琲","琺","瑕","琿","瑟","瑙","瑁","瑜","瑩","瑰","瑣","瑪","瑶","瑾","璋","璞","璧","瓊","瓏","瓔","珱","瓠","瓣","瓧","瓩","瓮","瓲","瓰","瓱","瓸","瓷","甄","甃","甅","甌","甎","甍","甕","甓","甞","甦","甬","甼","畄","畍","畊","畉","畛","畆","畚","畩","畤","畧","畫","畭","畸","當","疆","疇","畴","疊","疉","疂","疔","疚","疝","疥","疣","痂","疳","痃","疵","疽","疸","疼","疱","痍","痊","痒","痙","痣","痞","痾","痿","痼","瘁","痰","痺","痲","痳","瘋","瘍","瘉","瘟","瘧","瘠","瘡","瘢","瘤","瘴","瘰","瘻","癇","癈","癆","癜","癘","癡","癢","癨","癩","癪","癧","癬","癰","癲","癶","癸","發","皀","皃","皈","皋","皎","皖","皓","皙","皚","皰","皴","皸","皹","皺","盂","盍","盖","盒","盞","盡","盥","盧","盪","蘯","盻","眈","眇","眄","眩","眤","眞","眥","眦","眛","眷","眸","睇","睚","睨","睫","睛","睥","睿","睾","睹","瞎","瞋","瞑","瞠","瞞","瞰","瞶","瞹","瞿","瞼","瞽","瞻","矇","矍","矗","矚","矜","矣","矮","矼","砌","砒","礦","砠","礪","硅","碎","硴","碆","硼","碚","碌","碣","碵","碪","碯","磑","磆","磋","磔","碾","碼","磅","磊","磬","磧","磚","磽","磴","礇","礒","礑","礙","礬","礫","祀","祠","祗","祟","祚","祕","祓","祺","祿","禊","禝","禧","齋","禪","禮","禳","禹","禺","秉","秕","秧","秬","秡","秣","稈","稍","稘","稙","稠","稟","禀","稱","稻","稾","稷","穃","穗","穉","穡","穢","穩","龝","穰","穹","穽","窈","窗","窕","窘","窖","窩","竈","窰","窶","竅","竄","窿","邃","竇","竊","竍","竏","竕","竓","站","竚","竝","竡","竢","竦","竭","竰","笂","笏","笊","笆","笳","笘","笙","笞","笵","笨","笶","筐","筺","笄","筍","笋","筌","筅","筵","筥","筴","筧","筰","筱","筬","筮","箝","箘","箟","箍","箜","箚","箋","箒","箏","筝","箙","篋","篁","篌","篏","箴","篆","篝","篩","簑","簔","篦","篥","籠","簀","簇","簓","篳","篷","簗","簍","篶","簣","簧","簪","簟","簷","簫","簽","籌","籃","籔","籏","籀","籐","籘","籟","籤","籖","籥","籬","籵","粃","粐","粤","粭","粢","粫","粡","粨","粳","粲","粱","粮","粹","粽","糀","糅","糂","糘","糒","糜","糢","鬻","糯","糲","糴","糶","糺","紆","紂","紜","紕","紊","絅","絋","紮","紲","紿","紵","絆","絳","絖","絎","絲","絨","絮","絏","絣","經","綉","絛","綏","絽","綛","綺","綮","綣","綵","緇","綽","綫","總","綢","綯","緜","綸","綟","綰","緘","緝","緤","緞","緻","緲","緡","縅","縊","縣","縡","縒","縱","縟","縉","縋","縢","繆","繦","縻","縵","縹","繃","縷","縲","縺","繧","繝","繖","繞","繙","繚","繹","繪","繩","繼","繻","纃","緕","繽","辮","繿","纈","纉","續","纒","纐","纓","纔","纖","纎","纛","纜","缸","缺","罅","罌","罍","罎","罐","网","罕","罔","罘","罟","罠","罨","罩","罧","罸","羂","羆","羃","羈","羇","羌","羔","羞","羝","羚","羣","羯","羲","羹","羮","羶","羸","譱","翅","翆","翊","翕","翔","翡","翦","翩","翳","翹","飜","耆","耄","耋","耒","耘","耙","耜","耡","耨","耿","耻","聊","聆","聒","聘","聚","聟","聢","聨","聳","聲","聰","聶","聹","聽","聿","肄","肆","肅","肛","肓","肚","肭","冐","肬","胛","胥","胙","胝","胄","胚","胖","脉","胯","胱","脛","脩","脣","脯","腋","隋","腆","脾","腓","腑","胼","腱","腮","腥","腦","腴","膃","膈","膊","膀","膂","膠","膕","膤","膣","腟","膓","膩","膰","膵","膾","膸","膽","臀","臂","膺","臉","臍","臑","臙","臘","臈","臚","臟","臠","臧","臺","臻","臾","舁","舂","舅","與","舊","舍","舐","舖","舩","舫","舸","舳","艀","艙","艘","艝","艚","艟","艤","艢","艨","艪","艫","舮","艱","艷","艸","艾","芍","芒","芫","芟","芻","芬","苡","苣","苟","苒","苴","苳","苺","莓","范","苻","苹","苞","茆","苜","茉","苙","茵","茴","茖","茲","茱","荀","茹","荐","荅","茯","茫","茗","茘","莅","莚","莪","莟","莢","莖","茣","莎","莇","莊","荼","莵","荳","荵","莠","莉","莨","菴","萓","菫","菎","菽","萃","菘","萋","菁","菷","萇","菠","菲","萍","萢","萠","莽","萸","蔆","菻","葭","萪","萼","蕚","蒄","葷","葫","蒭","葮","蒂","葩","葆","萬","葯","葹","萵","蓊","葢","蒹","蒿","蒟","蓙","蓍","蒻","蓚","蓐","蓁","蓆","蓖","蒡","蔡","蓿","蓴","蔗","蔘","蔬","蔟","蔕","蔔","蓼","蕀","蕣","蕘","蕈","蕁","蘂","蕋","蕕","薀","薤","薈","薑","薊","薨","蕭","薔","薛","藪","薇","薜","蕷","蕾","薐","藉","薺","藏","薹","藐","藕","藝","藥","藜","藹","蘊","蘓","蘋","藾","藺","蘆","蘢","蘚","蘰","蘿","虍","乕","虔","號","虧","虱","蚓","蚣","蚩","蚪","蚋","蚌","蚶","蚯","蛄","蛆","蚰","蛉","蠣","蚫","蛔","蛞","蛩","蛬","蛟","蛛","蛯","蜒","蜆","蜈","蜀","蜃","蛻","蜑","蜉","蜍","蛹","蜊","蜴","蜿","蜷","蜻","蜥","蜩","蜚","蝠","蝟","蝸","蝌","蝎","蝴","蝗","蝨","蝮","蝙","蝓","蝣","蝪","蠅","螢","螟","螂","螯","蟋","螽","蟀","蟐","雖","螫","蟄","螳","蟇","蟆","螻","蟯","蟲","蟠","蠏","蠍","蟾","蟶","蟷","蠎","蟒","蠑","蠖","蠕","蠢","蠡","蠱","蠶","蠹","蠧","蠻","衄","衂","衒","衙","衞","衢","衫","袁","衾","袞","衵","衽","袵","衲","袂","袗","袒","袮","袙","袢","袍","袤","袰","袿","袱","裃","裄","裔","裘","裙","裝","裹","褂","裼","裴","裨","裲","褄","褌","褊","褓","襃","褞","褥","褪","褫","襁","襄","褻","褶","褸","襌","褝","襠","襞","襦","襤","襭","襪","襯","襴","襷","襾","覃","覈","覊","覓","覘","覡","覩","覦","覬","覯","覲","覺","覽","覿","觀","觚","觜","觝","觧","觴","觸","訃","訖","訐","訌","訛","訝","訥","訶","詁","詛","詒","詆","詈","詼","詭","詬","詢","誅","誂","誄","誨","誡","誑","誥","誦","誚","誣","諄","諍","諂","諚","諫","諳","諧","諤","諱","謔","諠","諢","諷","諞","諛","謌","謇","謚","諡","謖","謐","謗","謠","謳","鞫","謦","謫","謾","謨","譁","譌","譏","譎","證","譖","譛","譚","譫","譟","譬","譯","譴","譽","讀","讌","讎","讒","讓","讖","讙","讚","谺","豁","谿","豈","豌","豎","豐","豕","豢","豬","豸","豺","貂","貉","貅","貊","貍","貎","貔","豼","貘","戝","貭","貪","貽","貲","貳","貮","貶","賈","賁","賤","賣","賚","賽","賺","賻","贄","贅","贊","贇","贏","贍","贐","齎","贓","賍","贔","贖","赧","赭","赱","赳","趁","趙","跂","趾","趺","跏","跚","跖","跌","跛","跋","跪","跫","跟","跣","跼","踈","踉","跿","踝","踞","踐","踟","蹂","踵","踰","踴","蹊","蹇","蹉","蹌","蹐","蹈","蹙","蹤","蹠","踪","蹣","蹕","蹶","蹲","蹼","躁","躇","躅","躄","躋","躊","躓","躑","躔","躙","躪","躡","躬","躰","軆","躱","躾","軅","軈","軋","軛","軣","軼","軻","軫","軾","輊","輅","輕","輒","輙","輓","輜","輟","輛","輌","輦","輳","輻","輹","轅","轂","輾","轌","轉","轆","轎","轗","轜","轢","轣","轤","辜","辟","辣","辭","辯","辷","迚","迥","迢","迪","迯","邇","迴","逅","迹","迺","逑","逕","逡","逍","逞","逖","逋","逧","逶","逵","逹","迸","遏","遐","遑","遒","逎","遉","逾","遖","遘","遞","遨","遯","遶","隨","遲","邂","遽","邁","邀","邊","邉","邏","邨","邯","邱","邵","郢","郤","扈","郛","鄂","鄒","鄙","鄲","鄰","酊","酖","酘","酣","酥","酩","酳","酲","醋","醉","醂","醢","醫","醯","醪","醵","醴","醺","釀","釁","釉","釋","釐","釖","釟","釡","釛","釼","釵","釶","鈞","釿","鈔","鈬","鈕","鈑","鉞","鉗","鉅","鉉","鉤","鉈","銕","鈿","鉋","鉐","銜","銖","銓","銛","鉚","鋏","銹","銷","鋩","錏","鋺","鍄","錮","錙","錢","錚","錣","錺","錵","錻","鍜","鍠","鍼","鍮","鍖","鎰","鎬","鎭","鎔","鎹","鏖","鏗","鏨","鏥","鏘","鏃","鏝","鏐","鏈","鏤","鐚","鐔","鐓","鐃","鐇","鐐","鐶","鐫","鐵","鐡","鐺","鑁","鑒","鑄","鑛","鑠","鑢","鑞","鑪","鈩","鑰","鑵","鑷","鑽","鑚","鑼","鑾","钁","鑿","閂","閇","閊","閔","閖","閘","閙","閠","閨","閧","閭","閼","閻","閹","閾","闊","濶","闃","闍","闌","闕","闔","闖","關","闡","闥","闢","阡","阨","阮","阯","陂","陌","陏","陋","陷","陜","陞","陝","陟","陦","陲","陬","隍","隘","隕","隗","險","隧","隱","隲","隰","隴","隶","隸","隹","雎","雋","雉","雍","襍","雜","霍","雕","雹","霄","霆","霈","霓","霎","霑","霏","霖","霙","霤","霪","霰","霹","霽","霾","靄","靆","靈","靂","靉","靜","靠","靤","靦","靨","勒","靫","靱","靹","鞅","靼","鞁","靺","鞆","鞋","鞏","鞐","鞜","鞨","鞦","鞣","鞳","鞴","韃","韆","韈","韋","韜","韭","齏","韲","竟","韶","韵","頏","頌","頸","頤","頡","頷","頽","顆","顏","顋","顫","顯","顰","顱","顴","顳","颪","颯","颱","颶","飄","飃","飆","飩","飫","餃","餉","餒","餔","餘","餡","餝","餞","餤","餠","餬","餮","餽","餾","饂","饉","饅","饐","饋","饑","饒","饌","饕","馗","馘","馥","馭","馮","馼","駟","駛","駝","駘","駑","駭","駮","駱","駲","駻","駸","騁","騏","騅","駢","騙","騫","騷","驅","驂","驀","驃","騾","驕","驍","驛","驗","驟","驢","驥","驤","驩","驫","驪","骭","骰","骼","髀","髏","髑","髓","體","髞","髟","髢","髣","髦","髯","髫","髮","髴","髱","髷","髻","鬆","鬘","鬚","鬟","鬢","鬣","鬥","鬧","鬨","鬩","鬪","鬮","鬯","鬲","魄","魃","魏","魍","魎","魑","魘","魴","鮓","鮃","鮑","鮖","鮗","鮟","鮠","鮨","鮴","鯀","鯊","鮹","鯆","鯏","鯑","鯒","鯣","鯢","鯤","鯔","鯡","鰺","鯲","鯱","鯰","鰕","鰔","鰉","鰓","鰌","鰆","鰈","鰒","鰊","鰄","鰮","鰛","鰥","鰤","鰡","鰰","鱇","鰲","鱆","鰾","鱚","鱠","鱧","鱶","鱸","鳧","鳬","鳰","鴉","鴈","鳫","鴃","鴆","鴪","鴦","鶯","鴣","鴟","鵄","鴕","鴒","鵁","鴿","鴾","鵆","鵈","鵝","鵞","鵤","鵑","鵐","鵙","鵲","鶉","鶇","鶫","鵯","鵺","鶚","鶤","鶩","鶲","鷄","鷁","鶻","鶸","鶺","鷆","鷏","鷂","鷙","鷓","鷸","鷦","鷭","鷯","鷽","鸚","鸛","鸞","鹵","鹹","鹽","麁","麈","麋","麌","麒","麕","麑","麝","麥","麩","麸","麪","麭","靡","黌","黎","黏","黐","黔","黜","點","黝","黠","黥","黨","黯","黴","黶","黷","黹","黻","黼","黽","鼇","鼈","皷","鼕","鼡","鼬","鼾","齊","齒","齔","齣","齟","齠","齡","齦","齧","齬","齪","齷","齲","齶","龕","龜","龠","堯","槇","遙","瑤","凜","熙","噓","巢","帔","帘","幘","幞","庾","廊","廋","廹","开","异","弇","弝","弣","弴","弶","弽","彀","彅","彔","彘","彤","彧","彽","徉","徜","徧","徯","徵","德","忉","忞","忡","忩","怍","怔","怘","怳","怵","恇","悔","悝","悞","惋","惔","惕","惝","惸","愜","愫","愰","愷","慨","憍","憎","憼","憹","懲","戢","戾","扃","扖","扚","扯","抅","拄","拖","拼","挊","挘","挹","捃","捥","捼","揥","揭","揵","搐","搔","搢","摹","摑","摠","摭","擎","撾","撿","㐂","𠅘","份","仿","侚","俉","傜","儞","冼","㔟","匇","卡","卬","詹","𠮷","呍","咖","咜","咩","唎","啊","噲","囤","圳","圴","塚","墀","姤","娣","婕","寬","﨑","㟢","庬","弴","彅","德","怗","恵","愰","昤","曈","曙","曺","曻","桒","鿄","椑","椻","橅","檑","櫛","𣏌","𣏾","𣗄","毱","泠","洮","海","涿","淊","淸","渚","潞","濹","灤","𤋮","𤋮","煇","燁","爀","玟","玨","珉","珖","琛","琡","琢","琦","琪","琬","琹","瑋","㻚","畵","疁","睲","䂓","磈","磠","祇","禮","鿆","䄃","鿅","秚","稞","筿","簱","䉤","綋","羡","脘","脺","舘","芮","葛","蓜","蓬","蕙","藎","蝕","蟬","蠋","裵","角","諶","跎","辻","迶","郝","鄧","鄭","醲","鈳","銈","錡","鍈","閒","雞","餃","饀","髙","鯖","鷗","麴","麵","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","⛌","⛍","❗","⛏","⛐","⛑","","⛒","⛕","⛓","⛔","","","","","","","","","⛖","⛗","⛘","⛙","⛚","⛛","⛜","⛝","⛞","⛟","⛠","⛡","⭕","㉈","㉉","㉊","㉋","㉌","㉍","㉎","㉏","","","","","⒑","⒒","⒓","","","","","","","","","","","","","","","","","⬛","⬤","","","","","","⚿","","","","","","","","","","","","㊙","","","","","","","","","","","","⛣","⭖","⭗","⭘","⭙","☓","㊋","〒","⛨","㉆","㉅","⛩","࿖","⛪","⛫","⛬","♨","⛭","⛮","⛯","⚓","✈","⛰","⛱","⛲","⛳","⛴","⛵","","Ⓓ","Ⓢ","⛶","","","","","","⛷","⛸","⛹","⛺","","☎","⛻","⛼","⛽","⛾","","⛿","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","➡","⬅","⬆","⬇","⬯","⬮","年","月","日","円","㎡","㎥","㎝","㎠","㎤","","⒈","⒉","⒊","⒋","⒌","⒍","⒎","⒏","⒐","","","","","","","","","","","","","","","","","㈳","㈶","㈲","㈱","㈹","㉄","▶","◀","〖","〗","⟐","²","³","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","㉇","","","℻","","","","㈪","㈫","㈬","㈭","㈮","㈯","㈰","㈷","㍾","㍽","㍼","㍻","№","℡","〶","⚾","","","","","","","","","","","","","","","","","","","","","","","ℓ","㎏","㎐","㏊","㎞","㎢","㍱","","","½","↉","⅓","⅔","¼","¾","⅕","⅖","⅗","⅘","⅙","⅚","⅐","⅛","⅑","⅒","☀","☁","☂","⛄","☖","☗","⛉","⛊","♦","♥","♣","♠","⛋","⨀","‼","⁉","⛅","☔","⛆","☃","⛇","⚡","⛈","","⚞","⚟","♬","☎","","","","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ","⑰","⑱","⑲","⑳","⑴","⑵","⑶","⑷","⑸","⑹","⑺","⑻","⑼","⑽","⑾","⑿","㉑","㉒","㉓","㉔","","","","","","","","","","","","","","","","","","","","","","","","","","","㉕","㉖","㉗","㉘","㉙","㉚","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","❶","❷","❸","❹","❺","❻","❼","❽","❾","❿","⓫","⓬","㉛",""],v=["㐂","","份","仿","侚","俉","傜","儞","冼","㔟","匇","卡","卬","詹","","呍","咖","咜","咩","唎","啊","噲","囤","圳","圴","塚","墀","姤","娣","婕","寬","﨑","㟢","庬","弴","彅","德","怗","恵","愰","昤","曈","曙","曺","曻","桒","鿄","椑","椻","橅","檑","櫛","","","","毱","泠","洮","海","涿","淊","淸","渚","潞","濹","灤","𤋮","","煇","燁","爀","玟","玨","珉","珖","琛","琡","琢","琦","琪","琬","琹","瑋","㻚","畵","疁","睲","䂓","磈","磠","祇","禮","鿆","䄃","鿅","秚","稞","筿","簱","䉤","綋","羡","脘","脺","舘","芮","葛","蓜","蓬","蕙","藎","蝕","蟬","蠋","裵","角","諶","跎","辻","迶","郝","鄧","鄭","醲","鈳","銈","錡","鍈","閒","雞","餃","饀","髙","鯖","鷗","麴","麵","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","⛌","⛍","❗","⛏","⛐","⛑","","⛒","⛕","⛓","⛔","","","","","","","","","⛖","⛗","⛘","⛙","⛚","⛛","⛜","⛝","⛞","⛟","⛠","⛡","⭕","㉈","㉉","㉊","㉋","㉌","㉍","㉎","㉏","","","","","⒑","⒒","⒓","","","","","","","","","","","","","","","","","⬛","⬤","","","","","","⚿","","","","","","","","","","","","㊙","","","","","","","","","","","","⛣","⭖","⭗","⭘","⭙","☓","㊋","〒","⛨","㉆","㉅","⛩","࿖","⛪","⛫","⛬","♨","⛭","⛮","⛯","⚓","✈","⛰","⛱","⛲","⛳","⛴","⛵","","Ⓓ","Ⓢ","⛶","","","","","","⛷","⛸","⛹","⛺","","☎","⛻","⛼","⛽","⛾","","⛿","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","➡","⬅","⬆","⬇","⬯","⬮","年","月","日","円","㎡","㎥","㎝","㎠","㎤","","⒈","⒉","⒊","⒋","⒌","⒍","⒎","⒏","⒐","","","","","","","","","","","","","","","","","㈳","㈶","㈲","㈱","㈹","㉄","▶","◀","〖","〗","⟐","²","³","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","㉇","","","℻","","","","㈪","㈫","㈬","㈭","㈮","㈯","㈰","㈷","㍾","㍽","㍼","㍻","№","℡","〶","⚾","","","","","","","","","","","","","","","","","","","","","","","ℓ","㎏","㎐","㏊","㎞","㎢","㍱","","","½","↉","⅓","⅔","¼","¾","⅕","⅖","⅗","⅘","⅙","⅚","⅐","⅛","⅑","⅒","☀","☁","☂","⛄","☖","☗","⛉","⛊","♦","♥","♣","♠","⛋","⨀","‼","⁉","⛅","☔","⛆","☃","⛇","⚡","⛈","","⚞","⚟","♬","☎","","","","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ","⑰","⑱","⑲","⑳","⑴","⑵","⑶","⑷","⑸","⑹","⑺","⑻","⑼","⑽","⑾","⑿","㉑","㉒","㉓","㉔","","","","","","","","","","","","","","","","","","","","","","","","","","","㉕","㉖","㉗","㉘","㉙","㉚","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","❶","❷","❸","❹","❺","❻","❼","❽","❾","❿","⓫","⓬","㉛",""],b=["㐂","𠅘","份","仿","侚","俉","傜","儞","冼","㔟","匇","卡","卬","詹","𠮷","呍","咖","咜","咩","唎","啊","噲","囤","圳","圴","塚","墀","姤","娣","婕","寬","﨑","㟢","庬","弴","彅","德","怗","恵","愰","昤","曈","曙","曺","曻","桒","鿄","椑","椻","橅","檑","櫛","𣏌","𣏾","𣗄","毱","泠","洮","海","涿","淊","淸","渚","潞","濹","灤","𤋮","𤋮","煇","燁","爀","玟","玨","珉","珖","琛","琡","琢","琦","琪","琬","琹","瑋","㻚","畵","疁","睲","䂓","磈","磠","祇","禮","鿆","䄃","鿅","秚","稞","筿","簱","䉤","綋","羡","脘","脺","舘","芮","葛","蓜","蓬","蕙","藎","蝕","蟬","蠋","裵","角","諶","跎","辻","迶","郝","鄧","鄭","醲","鈳","銈","錡","鍈","閒","雞","餃","饀","髙","鯖","鷗","麴","麵","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","⛌","⛍","❗","⛏","⛐","⛑","","⛒","⛕","⛓","⛔","","","","","🅿","🆊","","","⛖","⛗","⛘","⛙","⛚","⛛","⛜","⛝","⛞","⛟","⛠","⛡","⭕","㉈","㉉","㉊","㉋","㉌","㉍","㉎","㉏","","","","","⒑","⒒","⒓","🅊","🅌","🄿","🅆","🅋","🈐","🈑","🈒","🈓","🅂","🈔","🈕","🈖","🅍","🄱","🄽","⬛","⬤","🈗","🈘","🈙","🈚","🈛","⚿","🈜","🈝","🈞","🈟","🈠","🈡","🈢","🈣","🈤","🈥","🅎","㊙","🈀","","","","","","","","","","","⛣","⭖","⭗","⭘","⭙","☓","㊋","〒","⛨","㉆","㉅","⛩","࿖","⛪","⛫","⛬","♨","⛭","⛮","⛯","⚓","✈","⛰","⛱","⛲","⛳","⛴","⛵","🅗","Ⓓ","Ⓢ","⛶","🅟","🆋","🆍","🆌","🅹","⛷","⛸","⛹","⛺","🅻","☎","⛻","⛼","⛽","⛾","🅼","⛿","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","➡","⬅","⬆","⬇","⬯","⬮","年","月","日","円","㎡","㎥","㎝","㎠","㎤","🄀","⒈","⒉","⒊","⒋","⒌","⒍","⒎","⒏","⒐","","","","","","","🄁","🄂","🄃","🄄","🄅","🄆","🄇","🄈","🄉","🄊","㈳","㈶","㈲","㈱","㈹","㉄","▶","◀","〖","〗","⟐","²","³","🄭","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","🄬","🄫","㉇","🆐","🈦","℻","","","","㈪","㈫","㈬","㈭","㈮","㈯","㈰","㈷","㍾","㍽","㍼","㍻","№","℡","〶","⚾","🉀","🉁","🉂","🉃","🉄","🉅","🉆","🉇","🉈","🄪","🈧","🈨","🈩","🈔","🈪","🈫","🈬","🈭","🈮","🈯","🈰","🈱","ℓ","㎏","㎐","㏊","㎞","㎢","㍱","","","½","↉","⅓","⅔","¼","¾","⅕","⅖","⅗","⅘","⅙","⅚","⅐","⅛","⅑","⅒","☀","☁","☂","⛄","☖","☗","⛉","⛊","♦","♥","♣","♠","⛋","⨀","‼","⁉","⛅","☔","⛆","☃","⛇","⚡","⛈","","⚞","⚟","♬","☎","","","","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ","⑰","⑱","⑲","⑳","⑴","⑵","⑶","⑷","⑸","⑹","⑺","⑻","⑼","⑽","⑾","⑿","㉑","㉒","㉓","㉔","🄐","🄑","🄒","🄓","🄔","🄕","🄖","🄗","🄘","🄙","🄚","🄛","🄜","🄝","🄞","🄟","🄠","🄡","🄢","🄣","🄤","🄥","🄦","🄧","🄨","🄩","㉕","㉖","㉗","㉘","㉙","㉚","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","❶","❷","❸","❹","❺","❻","❼","❽","❾","❿","⓫","⓬","㉛",""],w=["!",""","#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","¥","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"],C=["ぁ","あ","ぃ","い","ぅ","う","ぇ","え","ぉ","お","か","が","き","ぎ","く","ぐ","け","げ","こ","ご","さ","ざ","し","じ","す","ず","せ","ぜ","そ","ぞ","た","だ","ち","ぢ","っ","つ","づ","て","で","と","ど","な","に","ぬ","ね","の","は","ば","ぱ","ひ","び","ぴ","ふ","ぶ","ぷ","へ","べ","ぺ","ほ","ぼ","ぽ","ま","み","む","め","も","ゃ","や","ゅ","ゆ","ょ","よ","ら","り","る","れ","ろ","ゎ","わ","ゐ","ゑ","を","ん","","","","ゝ","ゞ","ー","。","「","」","、","・"],D=["ァ","ア","ィ","イ","ゥ","ウ","ェ","エ","ォ","オ","カ","ガ","キ","ギ","ク","グ","ケ","ゲ","コ","ゴ","サ","ザ","シ","ジ","ス","ズ","セ","ゼ","ソ","ゾ","タ","ダ","チ","ヂ","ッ","ツ","ヅ","テ","デ","ト","ド","ナ","ニ","ヌ","ネ","ノ","ハ","バ","パ","ヒ","ビ","ピ","フ","ブ","プ","ヘ","ベ","ペ","ホ","ボ","ポ","マ","ミ","ム","メ","モ","ャ","ヤ","ュ","ユ","ョ","ヨ","ラ","リ","ル","レ","ロ","ヮ","ワ","ヰ","ヱ","ヲ","ン","ヴ","ヵ","ヶ","ヽ","ヾ","ー","。","「","」","、","・"],R=new Map([["022b6f43e2a414fd68f172da202bac9a","⚞"],["94fb7be756372db6b62e3e0a119083d5","⚞"],["12aecdea283e4d07f88b9f2b740e4f86","⚟"],["1a563501affbf7f5baec350a108d5505","⚟"],["556971570f40044fa4520df3289a1cf2","⚟"],["65b042886a563a771aa389b12af7bca7","⚟"],["bbda644d17efd3c020635ee3d90968a5","⦅"],["5063561406195ca45f5992e3f7ad77d2","⦅"],["9d15c0395a4738936af34308acf2d032","⦅"],["2a063edc4770b3403f060b38166a0d4d","⦅"],["54479aa90145b4713134b78d4fb98aa5","⦅"],["12a2c7156da32fc972b5a451bb87b813","⦅"],["c8d428ead557285b0b7088388b22519c","⦅"],["7160f7419cba7acdacd23cbeb4834dbe","⦅"],["3c49616fb9bf0b9052b30e118f8857ea","⦅"],["71c94bb6d963e47443eac448a09d22ce","⦅"],["7ec2179107ba4c58abb6ef92e7781365","⦅"],["2eb49bd25d7eeada006afc0864350da4","⦅"],["a341ee7fe8a368c9737a3341f016ac70","⦅"],["f47048d669ac8d84eeb62477e8420f89","⦅"],["38566b372f4c5a1aead4efa20decd079","⦆"],["d84fc83615b75802ed422eda4ba39465","⦆"],["5bb8b7731d9473ebd7c842334dfa24f2","⦆"],["9ffa7e00cfc7e807a161ada460b8060c","⦆"],["a58dc0e1271b03a5981b57a83271afa7","⦆"],["e67210b0da0161d36b79e8c9be6a9d0c","⦆"],["08de4be9569ebd6ac01709f552ae8a65","⦆"],["e214599903c94c532684bdf54b62df61","⦆"],["2a83209f8a7489081890c277397df425","⦆"],["0294d50cea5197c8c4646d2cace3e78d","⦆"],["0b808509e4d89a2b9d02252ca85f2e34","⦆"],["2a74d4ad7292c858dc2bb559de67f2d9","⦆"],["8c810b8cbe6159e837a88575bb4e6033","⦆"],["dc66317cd6fff4f4221069a20f321fce","⦆"],["563e1633d226c10ef4ec80638997e4a9","『"],["0993d5cdf910f481eeefa19e4f09d77c","『"],["7b80a8345c16e2d4f8ff2691e245c2b1","『"],["016669fa94786f9581342d47f317c02c","『"],["01d3eb52ab29f0eecc62ff74224fffd4","『"],["089aa1d87915ef8ad3c43982ac657c8c","『"],["30e8cb69cda3ad84e87943c4351c24b7","『"],["385927959c2621acf57f8d40140924f8","『"],["2c256506f406bac4c214318f196ad5db","『"],["2d3912e10113e5c7bef33df3249af4a7","『"],["8b6444be18f269ac615643b26f9e3041","『"],["9c8c1ff659b439f73c65cf4766ab2f14","『"],["e4caa1628ad6878f14be986761e06aaa","『"],["e702912587801d73d58cdb30e48debed","』"],["d70bb2b097f44c1ddefb93bf92bbb5cd","』"],["f2b927267947a75b891403f95db72005","』"],["4ec38a1d8d22e4df6c359f00f7ad8662","』"],["55c9ea9aa8eb630e5ecb793b2f85c927","』"],["70376e1ea05a3438a19c062ad49a7960","』"],["8fe7cb78ca24d1973419eecf99252a88","』"],["9ee59c7d2c202e0214836a0138f59e24","』"],["b56aaf7fc68c5e206ccbc2ee1442b3af","』"],["ba37f6b56d8fc8980c8236de9894fa61","』"],["cc9fde9238a2bf78fd1c13f65b098e77","』"],["f02e3e84dcd71c5d3bab2b7b4b99bd7e","』"],["f686e0b742abe806fccbd4d9b3fcc4cd","』"],["37f6ecf37a0a3ef8dff083ccc8754f81","♬"],["3336f18e849144658f212bd9399bec5f","♬"],["93efdc18683d8ecacb0a920d5f2fffb3","♬"],["9b8325b71aa6a000d24f88c4d7ec730d","♬"],["ab791ef796e6b5d66f13ed9aea3e8ab2","♬"],["6eb29f1917caea1cadf94f5496a4c374","↱"],["583134b86e7d90960f64c5b863196978","➡"],["4ba716a88c003ca0a069392be3b63951","➡"],["4e0fbe47e3ba0fd5949bda53f11b16a5","➡"],["61ec226a927ee80fffa12db219a43233","➡"],["8e5b873ac8e1bf84246b281b3548c2ff","↴"],["a78d9b65f46654601ce0145622164b47","↴"],["5d01e6804b9aaec0c276f77306888c54","↴"],["6168af1e81b6497fccb6b8d3226a8016","↴"],["4360c0b7364802b680f5a65fa415bdd6","↗"],["4dab788480bb9ac50d2454b58438e407","↗"],["bfb2d58ab8c469d2b8b5c42d81e4e3b7","↗"],["4c503a0873195bfe8d71c9d55669781b","→"],["caf36eff2cf3580cd66c5cd021ee4c09","→"],["f00be20caf0aaef3a6fbec90a0e71852","Ⅰ"],["e660e1e23a6ddc9a5d2e0e1ef7ac5b86","Ⅱ"],["a62583f621fb5405add08e8f0beb6db4","Ⅱ"],["0e761ebb18b9870383725b3712f5c8d4","Ⅱ"],["1f65debfbf9df96de52c6f80922b012b","Ⅱ"],["5c13facf2da9f38922a9419061771ed0","Ⅱ"],["75a65cc3171c4c7ca0141042846ab91a","Ⅱ"],["eae94a6301787ff7bf77786ae4424601","Ⅱ"],["f1add7809e18e064e4609783211c9815","Ⅲ"],["a7ee6f7f63d348e2b8fb7ee9503f3c5c","♡"],["9c8cfb5e9349b06f0939605638896f4e","♥"],["45ce7d6d5c779136d32d3e60e13e10cd","⅕"],["51f5fe58aaf460263b766e990fdbe979","⅕"],["db40b0a65939e462396822d5ab3c6d9c","⅕"],["d9e3a48d5a7c6ba6f8db18f56cf91f92","⅛"],["86586bcdf8f14883f846849e93ca274c","⅜"],["9d81f46e134081d56bc92f69eebfabd9","⅒"],["18dddb04a4fe9b3f5c7b79e68fb8ab4b","⅒"],["eff8659a150859b7b69682a023b283c1","⅒"],["6e5ccf08b2bc815b0923df83cf9fafa1","㎠"],["8a77e56517a074d3d2ba426b84a07bf4","㎠"],["2c381a0eab014487d50f6f8bae8f0b71","㎢"],["9d1a36a1bec1cd2b0b0765f93c1e4f3c","㎢"],["e03eb00c54de790d8cc9997527fde905","㎢"],["3bce2a06a6a8557082543a6c90a42fe0","〽"],["4898c7d9fe3a8a6f9859b0e6f85a4327","〽"],["98ab18764756c8ca7608e17f562b21ce","〽"],["3037aad230d8cdae3df6e0ebedc0db79","⁉"],["66e3474e6cbd8e817ba0a1f8920bf4e7","⁉"],["4360dd96063ce1a9660cc8437e8238e3","⁈"],["6ce68b7e389c5169309ee956ed0c98a8","⁈"],["737a19289d25d963e255f3692ded6536","⁈"],["14b18199bbc3f4bf65b72e316bc41d3c","!"],["6bf58c146b692aeb403ed1f7618a060a","!"],["7f12b67caaf7c8c5075b444bb2a16c70","!"],["bfd55f4031ad80cb7401d65937b1d5d9","〜"],["4a61f6f7da9e6c8e373f4112cbd453cf","〜"],["882ded8f0bb4cdfa4ce28a0b64056d2a","〜"],["7726ffbf3a6e953affe6353c24ffb085","〜"],["0e290ec6542b5d52c972775e3d7cfeaf","-"],["420f1d27972d7cc83929307fbbb6dd50","-"],["4aa0e459273a2fe3012d7b3d2e14e07e","-"],["030b487ae68da1f4da98046f4fed390f","一"],["21699fa18fd14735a312512dfea2bff4","一"],["559fc240f4efe5a1e64714ce09217a3e","一"],["b7352c3f33a77bc9d3fbf693efbb8095","一"],["fcdb30a244fb6aad5255ee2d32fdf7fc","一"],["15a0a0fb33aacd4ce730a9503c46df5f","㊙"],["9dad4982bd65fbf21525261a7efdf669","㊙"],["c3e68e6d08d5429e28ffd6592acf4519","ゔ"],["f022cfe594d6f6930d7a5b994e1a0b71","凜"],["407057c7b7b1a91d058d572d9a9d3aa5","凜"],["fc85b0622183795f89111219dfbc6281","凜"],["9707099e5828d97eb12ff2e6ba438558","凜"],["987c829b62eb31f467165827766c410d","凜"],["58371bb195aaa7a468c5c508351ac383","凜"],["32324012ed7274a15002b66ed1e464f8","蜻"],["0ffb731db8d4a6b711f97bbb08ed8819","蜻"],["d90aae9a752e9b61662a9cafa837961f","祓"],["23d6c6f231ac5d51f4cdaaaa26701956","祓"],["81cbedabd8f88d4494255b0631820dfd","祓"],["4185f93a5571e49433ca9c13ae588f96","魎"],["9ab74d6e8bda8723614017a7fce587fe","魎"],["e96a39a050b694e5f8aadb111420b698","𠮷"],["08c5eb5fac4f1d362b946689eb2e4edf","𠮷"],["2cef7e443c22f5835658e67749ae52d1","𠮷"],["4ab0dd1578c8c5fa25f45938ff0f8575","𠮷"],["4c392bb90a1f62796f8fba2c19b4a7de","𠮷"],["43856fd7c04a779e571fe24c47f02a6c","髙"],["265efc2a174c73ea229f9ffefa703f32","髙"],["5a7af09cce6b3005355e1c6c82df8858","髙"],["808e9b858294184933f8bf45d6291572","髙"],["27f0c69a76bf571d6dc25db389d20779","髙"],["46fb250f60436fd5f33808343893ca12","髙"],["8a8c4c67a6094d4dc6039e5fe931159c","髙"],["9257f3792fcfcd21b85524d5f86f624e","髙"],["d502a276d6f311449597ee9e576d9217","髙"],["eaa49075e50fbe1fa4b7f593dfd95620","髙"],["c01d2bafce469da1abbb612fdb16c1e3","元"],["e1ce03321fdb4eaca026a49a43e521a5","元"],["0cfa6c95283a90eff3733db1ac80f58a","元"],["52c1ad5b834821dc6b85ec27bdea1f76","元"],["ad088cffd260c1fccb655cae17b14803","元"],["a9ee52eaa5b4cc32d1891d540bfe93cc","塚"],["a00182f1de36aaee28cac80a3c89d067","塚"],["b03d44ca831a0c995116056ce23f82c5","塚"],["2d6b7d3b5ca6c02d94c5b48661045b7a","﨑"],["f5c6e02e235abd23a87f48ed6a64cdcc","﨑"],["e9a3b055bda7b9ae70bde4003a4c5885","﨑"],["cb17df533b4ebd698a038defeddecf8a","﨑"],["0ea39c05c35f96d5b5a48e9815974132","﨑"],["3f642f3778827e651c8b82a4e9f06fd3","﨑"],["447d8358f482a4e1d9495902ebe269b1","﨑"],["ca59a20f1e0ee55b74db34697f961385","﨑"],["d2eae5651260b39c4239bcf00c8a76c5","﨑"],["f55eb365a9ded45d1e620f83d9f9de26","﨑"],["2b385c2642704e44347f2f4db147c8fa","葛"],["5c3a8c3a891386a771ff8f00a239b4ba","葛"],["e8caa78518e2d690af54e2206c9538f8","彅"],["2e8659ae5e220240c5f8a97147d09df6","彅"],["7592e633260537c1dfa7e5af1000752a","彅"],["a57d3f7684c28d2a901fe6020145de32","彅"],["da3ab2d5da4d69c7d312c7d819e45856","彅"],["918e84ed41c2157aa5f5bbf9aa60514c","塡"],["b1e889986beb3a6518d8c2ea53547b7c","塡"],["d449ab392afa98c27eb817c40e2eb7ce","塡"],["e7158075f2976c353e4cf9247aae3abc","遁"],["f1a6fbb17f041cc15148163da34f541f","遁"],["a1779a3aaf215916fd0d8fbbb5bf5925","蟬"],["a3c09b57be535c0f5618d72f95884c50","蟬"],["4b9401a9f9a58c7d0f9c86120aa2dd23","鏢"],["fe00b640a48dd341573cafa94afeafa2","鏢"],["f4e1d8b42e3c49ea7c896049186d74bd","蟜"],["640130a634bd2a0f4347f933a8c5d6d6","蟜"],["62985aeebaec69314f03ff9d3080ada2","鷗"],["1bd027207977c585c5889a1e24cae94e","鷗"],["5c8022286d3bc941c12e9bbc475255dd","鷗"],["e4a837fe20dfa091e03afe4857e2482e","剝"],["bf2cccb40b985fe3af04281944beac1a","剝"],["d5451a035c4e516e5ccb9372cd533d81","剝"],["e13ae32f28d840df74a88432df9b122e","剝"],["41637d181cd99088e2120a4ec6fc18aa","嬴"],["de63abb1aaa44e6ab8a11470103377d5","嬴"],["3d32b12254e01c701c195412cb8ef37c","嬴"],["f67bc6318ccf43e7902df9a6f9622932","嬴"],["d4ce6847d78fc2f8241088b5c0be795c","嬴"],["c472e6ade04610e67904aca1b1fa1468","麃"],["db3d060943fbf888eb2fa7fd87340cba","麃"],["509cff0edcba46d5db30b2f2f45c49c9","瘣"],["4862270872e35184aab420c4d38169ad","瘣"],["def4d364d00d0f78577987eaebd42aef","齕"],["3cc113a87b49ce231a7b2ffbca4c1e18","齕"],["03dddff25be65f7c284ef8addb8a0a8b","驁"],["52aa815a5a57aff03085d31acd5afbc4","驁"],["4f0431c4c63a6a362646758e62521df8","煖"],["dbf1ab17c746c48d474b3730064ba6f2","煖"],["790c6b4da6a88f7f4fdb6fdab77fe045","煖"],["4d7ae77f2bbf9c8af03d49d466f74058","煖"],["0335ba124be8a9e0c501f4051ac5fcf5","龐"],["01d7892b430fd4362c8917ad921199b2","龐"],["e866fd7e605c8b7c8bf718c45a5438cf","龐"],["5df7d88e1e15018b3bce73e765ef72d6","槌"],["48478e1f69ea50c6f7709d47f15b4007","槌"],["4d7d276f23c92f94056b292e295ebd78","神"],["87d2b97034cf680cd86bc7fe7c500d93","神"],["f6300abbfcd6bd0db3abd41041499aaa","邂"],["26c476496eb73e15285527ab7c635f0b","邂"],["be33b9008a58bab485e17de9b2ab2626","逅"],["3a9b8b576fe8efca2dedc957732afa37","逅"],["b798637262a0c1a29c8de602d4b688c6","逅"],["a3785fd94f13646623554b180d08ac77","德"],["1f81885b0996be70410e5aa3e4aab3c6","德"],["88425dfcbd96fcb6d77ebb76f834d986","德"],["9f993f913cd0614a3a965d74e0f4c8d1","德"],["a8bb5f2f83d975edfc951a1e461befdc","德"],["cd2eadbb87d0aadf1d1cd71fed0ab02f","德"],["d22feeb00ace0a632e1a780682f937e8","德"],["c9f2fda15b722253c625aebe73f4b1d9","辻"],["04556b37bff1ccc2f3b395232e104934","辻"],["117bacaeb67e3508d23a650b98f3c143","辻"],["211d70374c1787c4bc62df15794a4692","辻"],["7ba50856c59d1de19cc9c88caaced915","辻"],["0d627ebf7693b13645336a88813fb7e3","祀"],["2c3c032660b20a485575c2d8c7d47956","祀"],["1aaec04e53f2978bdf0a127c01b34e9a","遼"],["e2c3bf09b755b0d59a8a25cba6dda273","遼"],["fb13879ba2f93a8b0a28b2cd5358d1ee","遼"],["20eff1fff8d986496b949efa604ec402","誾"],["8742940fcbdbd65aeff1566c1889ece7","誾"],["23e6ef0ecc7bbe8e9465b0b40e901c0d","厓"],["5a69785acb47d746fd1ae98bd511db81","厓"],["392b8afa18046fc06398b32a42641889","你"],["7ff2c821d31ef0ca7e9c430f3e659d46","你"],["44d8b7aacbfc1fc4c32d6526ab8012ee","祠"],["c9486b883ab870fc02e7a1f189454f49","祠"],["62e7447a02f797cf287a7a758d66563b","擲"],["7d767d2518431dd61e631941dea6bb5e","擲"],["914fa35485d5016adc8b799b0cb5e978","口"],["d50802fc331261feed1a140f3b70c4b3","口"],["eeff4833bdfc34b1cbfe6a9d98f38cb5","口"],["a6d6aaeaf5505676111390a52fa6be51","暲"],["bc534a1accc68d8876e9d47ad8d4b489","暲"],["b5e8cb114ccad281bcb4d86768d509df","銈"],["d2c0ab0242ae4ad8a08bffa71613a1a7","銈"],["f09031463933b2892be7ebbc501269d0","蕙"],["f1378529fe66a7f655031d7f5b8c4eb5","蕙"],["6b696a5ae7634c454aaa7dd833fdfaf9","眷"],["5012d099f110e5e7c0df78528686ae07","榮"],["bf27e95238dd789b05e38d56dc41cbf7","嵓"],["1d2eafa6be36dc6152cb1917cd2ac486","氏"],["8b1bd5636f709dfd6a95da9f463729c3","柀"],["0b49a77f459cf3783c5bac37a80518c5","份"],["8d1ba0e24b619cb4d377ddb7adb3e6fa","喼"],["dab4c329f3c540192f758a2e0008d275","鎚"],["5b6c90ad3012bfbbc2450b5ab930484d","翟"],["7eb78d5654f8335d0b1cf4cf78872097","鄭"],["c3852ea003683f2866abd56140fb5d84","錆"],["a78b8a79d8a32c925776c82955d168cc","郭"],["b6e773b060fdd575bc965369d509f4e0","煉"],["6d981a3b846347e2b3c9ca4d13794834","桒"],["d0ed8ffbc229f84dd796cdd6de36d2e4","䃯"],["d9aff359058ab474d552ce52e5a71ec8","卿"],["5417381484172c1607d7ca60765b62d2","蝕"],["b309cd2c649ce3ef6ea0ad2f5fc655cc","這"],["2a349ac3d6b94a8a64d904083fdd5c02","辿"],["0632283bfd909ef205b1f950e2b00f16","靑"],["d91c5a40619510b21610f523f9434269","淸"],["8dc47c6e65beb788da7ed9efd59f0934","買"],["e28d4c57d97fbe4a0d67aec2cc92e7c8","捥"],["9374173a2e4b7f1dcac75eccd5ee7e7f","榊"]]),T=(t(189),new Set(["⛌","⛍","❗","⛏","⛐","⛑","⛒","⛕","⛓","⛔","","","⛖","⛗","⛘","⛙","⛚","⛛","⛜","⛝","⛞","⛟","⛠","⛡","⭕","㉈","㉉","㉊","㉋","㉌","㉍","㉎","㉏","⒑","⒒","⒓","","","","","","","","","","","","","","","","","⬛","⬤","","","","","","⚿","","","","","","","","","","","","㊙","","⛣","⭖","⭗","⭘","⭙","☓","㊋","〒","⛨","㉆","㉅","⛩","࿖","⛪","⛫","⛬","♨","⛭","⛮","⛯","⚓","✈","⛰","⛱","⛲","⛳","⛴","⛵","","Ⓓ","Ⓢ","⛶","","","","","","⛷","⛸","⛹","⛺","","☎","⛻","⛼","⛽","⛾","","⛿","➡","⬅","⬆","⬇","⬯","⬮","","","","","㎡","㎥","㎝","㎠","㎤","","⒈","⒉","⒊","⒋","⒌","⒍","⒎","⒏","⒐","","","","","","","","","","","","","","","","","㈳","㈶","㈲","㈱","㈹","㉄","▶","◀","〖","〗","⟐","²","³","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","㉇","","","℻","㈪","㈫","㈬","㈭","㈮","㈯","㈰","㈷","㍾","㍽","㍼","㍻","№","℡","〶","⚾","","","","","","","","","","","","","","","","","","","","","","","ℓ","㎏","㎐","㏊","㎞","㎢","㍱","½","↉","⅓","⅔","¼","¾","⅕","⅖","⅗","⅘","⅙","⅚","⅐","⅛","⅑","⅒","☀","☁","☂","⛄","☖","☗","⛉","⛊","♦","♥","♣","♠","⛋","⨀","‼","⁉","⛅","☔","⛆","☃","⛇","⚡","⛈","⚞","⚟","♬","","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ","⑰","⑱","⑲","⑳","⑴","⑵","⑶","⑷","⑸","⑹","⑺","⑻","⑼","⑽","⑾","⑿","㉑","㉒","㉓","㉔","","","","","","","","","","","","","","","","","","","","","","","","","","","㉕","㉖","㉗","㉘","㉙","㉚","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","❶","❷","❸","❹","❺","❻","❼","❽","❾","❿","⓫","⓬","㉛","☎","⛌","⛍","❗","⛏","⛐","⛑","⛒","⛕","⛓","⛔","🅿","🆊","⛖","⛗","⛘","⛙","⛚","⛛","⛜","⛝","⛞","⛟","⛠","⛡","⭕","㉈","㉉","㉊","㉋","㉌","㉍","㉎","㉏","⒑","⒒","⒓","🅊","🅌","🄿","🅆","🅋","🈐","🈑","🈒","🈓","🅂","🈔","🈕","🈖","🅍","🄱","🄽","⬛","⬤","🈗","🈘","🈙","🈚","🈛","⚿","🈜","🈝","🈞","🈟","🈠","🈡","🈢","🈣","🈤","🈥","🅎","㊙","🈀","⛣","⭖","⭗","⭘","⭙","☓","㊋","⛨","㉆","㉅","⛩","࿖","⛪","⛫","⛬","⛭","⛮","⛯","⚓","✈","⛰","⛱","⛲","⛳","⛴","⛵","🅗","Ⓓ","Ⓢ","⛶","🅟","🆋","🆍","🆌","🅹","⛷","⛸","⛹","⛺","🅻","⛻","⛼","⛽","⛾","🅼","⛿","➡","⬅","⬆","⬇","⬯","⬮","㎥","㎠","㎤","🄀","⒈","⒉","⒊","⒋","⒌","⒍","⒎","⒏","⒐","🄁","🄂","🄃","🄄","🄅","🄆","🄇","🄈","🄉","🄊","㈳","㈶","㉄","⟐","🄭","🄬","🄫","㉇","🆐","🈦","℻","㈪","㈫","㈬","㈭","㈮","㈯","㈰","㈷","〶","⚾","🉀","🉁","🉂","🉃","🉄","🉅","🉆","🉇","🉈","🄪","🈧","🈨","🈩","🈔","🈪","🈫","🈬","🈭","🈮","🈯","🈰","🈱","㎐","㏊","㎢","㍱","↉","⅖","⅗","⅘","⅙","⅚","⅐","⅛","⅑","⅒","⛄","⛉","⛊","⛋","⨀","⛅","☔","⛆","⛇","⚡","⛈","⚞","⚟","⑴","⑵","⑶","⑷","⑸","⑹","⑺","⑻","⑼","⑽","⑾","⑿","🄐","🄑","🄒","🄓","🄔","🄕","🄖","🄗","🄘","🄙","🄚","🄛","🄜","🄝","🄞","🄟","🄠","🄡","🄢","🄣","🄤","🄥","🄦","🄧","🄨","🄩"])),P=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],L=function(Ne){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Me=arguments.length>2?arguments[2]:void 0;Me==null&&(Me=Ne.length);for(var Se=0,K=Qe;K>8^Ne[K])]);return Se},I=function(Ne,Qe,Me,Se,K,xe,be,Te){return 0|((V=Qe+Ne(Me,Se,K)+xe+be|0)<<(N=Te)|V>>>32-N)+Me;var V,N},x=function(Ne,Qe,Me){return Ne&Qe|~Ne&Me},O=function(Ne,Qe,Me){return Ne&Me|Qe&~Me},G=function(Ne,Qe,Me){return Ne^Qe^Me},J=function(Ne,Qe,Me){return Qe^(Ne|~Me)},te=function(Ne){var Qe=(15&Ne)>>0;return"".concat(((240&Ne)>>4).toString(16)).concat(Qe.toString(16))},le=function(Ne){var Qe=64*Math.floor((Ne.byteLength+8)/64+1),Me=new Uint8Array(Qe);Me.set(new Uint8Array(Ne),0);var Se=new DataView(Me.buffer);Se.setUint8(Ne.byteLength,128),Se.setUint32(Qe-8,8*Ne.byteLength%Math.pow(2,32),!0),Se.setUint32(Qe-4,8*Ne.byteLength/Math.pow(2,32),!0);for(var K=1732584193,xe=-271733879,be=-1732584194,Te=271733878,V=0;V>>0),ce+=te((65280&K)>>>8),ce+=te((16711680&K)>>>16),ce+=te((4278190080&K)>>>24),ce+=te((255&xe)>>>0),ce+=te((65280&xe)>>>8),ce+=te((16711680&xe)>>>16),ce+=te((4278190080&xe)>>>24),ce+=te((255&be)>>>0),ce+=te((65280&be)>>>8),ce+=te((16711680&be)>>>16),ce+=te((4278190080&be)>>>24),ce+=te((255&Te)>>>0),ce+=te((65280&Te)>>>8),(ce+=te((16711680&Te)>>>16))+te((4278190080&Te)>>>24)};function ne(Ne,Qe){return function(Me){if(Array.isArray(Me))return Me}(Ne)||function(Me,Se){if(typeof Symbol<"u"&&Symbol.iterator in Object(Me)){var K=[],xe=!0,be=!1,Te=void 0;try{for(var V,N=Me[Symbol.iterator]();!(xe=(V=N.next()).done)&&(K.push(V.value),!Se||K.length!==Se);xe=!0);}catch(S){be=!0,Te=S}finally{try{xe||N.return==null||N.return()}finally{if(be)throw Te}}return K}}(Ne,Qe)||function(Me,Se){if(Me){if(typeof Me=="string")return ee(Me,Se);var K=Object.prototype.toString.call(Me).slice(8,-1);return K==="Object"&&Me.constructor&&(K=Me.constructor.name),K==="Map"||K==="Set"?Array.from(Me):K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K)?ee(Me,Se):void 0}}(Ne,Qe)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +`),I.descriptor.items.push([])),I.descriptor.items[I.descriptor.items.length-1].push(te.item_char),P.descriptor_number===P.last_descriptor_number&&(I.descriptor.items=I.descriptor.items.map(le=>Array.isArray(le)?new r.default(p.Buffer.concat(le)).decode():le).join(""))});break;case 80:let x=T.component;if(!x.needUpdate)break;x.descriptor===null&&(x.descriptor={}),x.descriptor.table_id=a.table_id,x.descriptor.version_number=a.version_number,x.descriptor.stream_content=P.stream_content,x.descriptor.component_type=P.component_type,x.descriptor.component_tag=P.component_tag,x.descriptor.ISO_639_language_code=String.fromCharCode(...P.ISO_639_language_code),x.descriptor.text=new r.default(P.text_char).decode(),x.descriptor.component_text=t.default.component.hasOwnProperty(P.stream_content)&&t.default.component[P.stream_content].hasOwnProperty(P.component_type)?t.default.component[P.stream_content][P.component_type]:"";break;case 84:let O=T.content;if(!O.needUpdate)break;O.descriptor===null&&(O.descriptor={}),O.descriptor.table_id=a.table_id,O.descriptor.version_number=a.version_number,O.descriptor.contents=P.contents.map(te=>({content_nibble_level_1:te.content_nibble_level_1,content_nibble_level_2:te.content_nibble_level_2,user_nibble_1:te.user_nibble_1,user_nibble_2:te.user_nibble_2,content_nibble_level_1_text:t.default.nibble.level_1[te.content_nibble_level_1],content_nibble_level_2_text:t.default.nibble.level_2[te.content_nibble_level_1][te.content_nibble_level_2]}));break;case 196:let G=T.audio_component;if(!G.needUpdate)break;G.descriptor===null&&(G.descriptor={}),G.descriptor.table_id=a.table_id,G.descriptor.version_number=a.version_number,G.descriptor.stream_content=P.stream_content,G.descriptor.component_type=P.component_type,G.descriptor.component_tag=P.component_tag,G.descriptor.stream_type=P.stream_type,G.descriptor.simulcast_group_tag=P.simulcast_group_tag,G.descriptor.ES_multi_lingual_flag=P.ES_multi_lingual_flag,G.descriptor.main_component_flag=P.main_component_flag,G.descriptor.quality_indicator=P.quality_indicator,G.descriptor.sampling_rate=P.sampling_rate,G.descriptor.ISO_639_language_code=String.fromCharCode(...P.ISO_639_language_code),G.descriptor.ES_multi_lingual_flag===1&&(G.descriptor.ISO_639_language_code_2=String.fromCharCode(...P.ISO_639_language_code_2)),G.descriptor.text_char=new r.default(P.text_char).decode(),G.descriptor.dialog_control_text=t.default.dialog_control[P.component_type>>7],G.descriptor.audio_for_handicapped_text=t.default.audio_for_handicapped[P.component_type>>5&3],G.descriptor.audio_mode_text=t.default.audio_mode[31&P.component_type],G.descriptor.quality_indicator_text=t.default.quality_indicator[P.quality_indicator],G.descriptor.sampling_rate_text=t.default.sampling_rate[P.sampling_rate];break;case 214:let J=T.event_group;if(!J.needUpdate)break;J.descriptor===null&&(J.descriptor={}),J.descriptor.table_id=a.table_id,J.descriptor.version_number=a.version_number,J.descriptor.group_type=P.group_type,J.descriptor.event_count=P.event_count,J.descriptor.events=P.events.map(te=>({service_id:te.service_id,event_id:te.event_id})),P.group_type!==4&&P.group_type!==5||(J.descriptor.other_network_events=P.other_network_events.map(te=>({original_network_id:te.original_network_id,transport_stream_id:te.transport_stream_id,service_id:te.service_id,event_id:te.event_id})))}for(let P of Object.keys(T)){let L=T[P];L.needUpdate!==!1&&L.descriptor!==null&&(R[P]=L.descriptor)}}if(a.table_id!==78&&a.table_id!==79){let D=7&a.table_id,R=7&a.last_table_id,T=a.section_number>>3,P=a.last_section_number>>3,L=7&a.section_number,I=7&a.segment_last_section_number,x=(15&a.table_id)<8?C.basic_flags:C.extended_flags;if(x.last_flags_id!==R||x.flags[D].version_number!==-1&&x.flags[D].version_number!==a.version_number)for(let O=0;O<8;O++)x.flags[O].flag.fill(0),x.flags[O].ignore.fill(O<=R?0:255);if(D===0&&o!==null){let O=(o.getTime()-60*o.getTimezoneOffset()*1e3)/108e5&7;for(let G=0;G>C&1,n+=(255^b.ignore[w])>>C&1;return[n,a]}}},8090:(y,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.default={component:{1:{1:"映像480i(525i)、アスペクト比4:3",2:"映像480i(525i)、アスペクト比16:9 パンベクトルあり",3:"映像480i(525i)、アスペクト比16:9 パンベクトルなし",4:"映像480i(525i)、アスペクト比 > 16:9",131:"映像4320p、アスペクト比16:9",145:"映像2160p、アスペクト比4:3",146:"映像2160p、アスペクト比16:9 パンベクトルあり",147:"映像2160p、アスペクト比16:9 パンベクトルなし",148:"映像2160p、アスペクト比 > 16:9",161:"映像480p(525p)、アスペクト比4:3",162:"映像480p(525p)、アスペクト比16:9 パンベクトルあり",163:"映像480p(525p)、アスペクト比16:9 パンベクトルなし",164:"映像480p(525p)、アスペクト比 > 16:9",177:"映像1080i(1125i)、アスペクト比4:3",178:"映像1080i(1125i)、アスペクト比16:9 パンベクトルあり",179:"映像1080i(1125i)、アスペクト比16:9 パンベクトルなし",180:"映像1080i(1125i)、アスペクト比 > 16:9",193:"映像720p(750p)、アスペクト比4:3",194:"映像720p(750p)、アスペクト比16:9 パンベクトルあり",195:"映像720p(750p)、アスペクト比16:9 パンベクトルなし",196:"映像720p(750p)、アスペクト比 > 16:9",209:"映像240p アスペクト比4:3",210:"映像240p アスペクト比16:9 パンベクトルあり",211:"映像240p アスペクト比16:9 パンベクトルなし",212:"映像240p アスペクト比 > 16:9",225:"映像1080p(1125p)、アスペクト比4:3",226:"映像1080p(1125p)、アスペクト比16:9 パンベクトルあり",227:"映像1080p(1125p)、アスペクト比16:9 パンベクトルなし",228:"映像1080p(1125p)、アスペクト比 > 16:9",241:"映像180p アスペクト比4:3",242:"映像180p アスペクト比16:9 パンベクトルあり",243:"映像180p アスペクト比16:9 パンベクトルなし",244:"映像180p アスペクト比 > 16:9"},5:{1:"H.264|MPEG-4 AVC、映像480i(525i)、アスペクト比4:3",2:"H.264|MPEG-4 AVC、映像480i(525i)、アスペクト比16:9 パンベクトルあり",3:"H.264|MPEG-4 AVC、映像480i(525i)、アスペクト比16:9 パンベクトルなし",4:"H.264|MPEG-4 AVC、映像480i(525i)、アスペクト比 > 16:9",145:"H.264|MPEG-4 AVC、映像2160p、アスペクト比4:3",146:"H.264|MPEG-4 AVC、映像2160p、アスペクト比16:9 パンベクトルあり",147:"H.264|MPEG-4 AVC、映像2160p、アスペクト比16:9 パンベクトルなし",148:"H.264|MPEG-4 AVC、映像2160p、アスペクト比 > 16:9",161:"H.264|MPEG-4 AVC、映像480p(525p)、アスペクト比4:3",162:"H.264|MPEG-4 AVC、映像480p(525p)、アスペクト比16:9 パンベクトルあり",163:"H.264|MPEG-4 AVC、映像480p(525p)、アスペクト比16:9 パンベクトルなし",164:"H.264|MPEG-4 AVC、映像480p(525p)、アスペクト比 > 16:9",177:"H.264|MPEG-4 AVC、映像1080i(1125i)、アスペクト比4:3",178:"H.264|MPEG-4 AVC、映像1080i(1125i)、アスペクト比16:9 パンベクトルあり",179:"H.264|MPEG-4 AVC、映像1080i(1125i)、アスペクト比16:9 パンベクトルなし",180:"H.264|MPEG-4 AVC、映像1080i(1125i)、アスペクト比 > 16:9",193:"H.264|MPEG-4 AVC、映像720p(750p)、アスペクト比4:3",194:"H.264|MPEG-4 AVC、映像720p(750p)、アスペクト比16:9 パンベクトルあり",195:"H.264|MPEG-4 AVC、映像720p(750p)、アスペクト比16:9 パンベクトルなし",196:"H.264|MPEG-4 AVC、映像720p(750p)、アスペクト比 > 16:9",209:"H.264|MPEG-4 AVC、映像240p アスペクト比4:3",210:"H.264|MPEG-4 AVC、映像240p アスペクト比16:9 パンベクトルあり",211:"H.264|MPEG-4 AVC、映像240p アスペクト比16:9 パンベクトルなし",212:"H.264|MPEG-4 AVC、映像240p アスペクト比 > 16:9",225:"H.264|MPEG-4 AVC、映像1080p(1125p)、アスペクト比4:3",226:"H.264|MPEG-4 AVC、映像1080p(1125p)、アスペクト比16:9 パンベクトルあり",227:"H.264|MPEG-4 AVC、映像1080p(1125p)、アスペクト比16:9 パンベクトルなし",228:"H.264|MPEG-4 AVC、映像1080p(1125p)、アスペクト比 > 16:9",241:"H.264|MPEG-4 AVC、映像180p アスペクト比4:3",242:"H.264|MPEG-4 AVC、映像180p アスペクト比16:9 パンベクトルあり",243:"H.264|MPEG-4 AVC、映像180p アスペクト比16:9 パンベクトルなし",244:"H.264|MPEG-4 AVC、映像180p アスペクト比 > 16:9"},9:{131:"H.265|MPEG-H HEVC,映像4320p、アスペクト比16:9",147:"H.265|MPEG-H HEVC,映像2160p、アスペクト比16:9",179:"H.265|MPEG-H HEVC,映像1080i(1125i)、アスペクト比16:9",227:"H.265|MPEG-H HEVC,映像1080p(1125p)、アスペクト比16:9"}},nibble:{level_1:{0:"ニュース/報道",1:"スポーツ",2:"情報/ワイドショー",3:"ドラマ",4:"音楽",5:"バラエティ",6:"映画",7:"アニメ/特撮",8:"ドキュメンタリー/教養",9:"劇場/公演",10:"趣味/教育",11:"福祉",12:"予備",13:"予備",14:"拡張",15:"その他"},level_2:{0:{0:"定時・総合",1:"天気",2:"特集・ドキュメント",3:"政治・国会",4:"経済・市況",5:"海外・国際",6:"解説",7:"討論・会談",8:"報道特番",9:"ローカル・地域",10:"交通",11:"",12:"",13:"",14:"",15:"その他"},1:{0:"スポーツニュース",1:"野球",2:"サッカー",3:"ゴルフ",4:"その他の球技",5:"相撲・格闘技",6:"オリンピック・国際大会",7:"マラソン・陸上・水泳",8:"モータースポーツ",9:"マリン・ウィンタースポーツ",10:"競馬・公営競技",11:"",12:"",13:"",14:"",15:"その他"},2:{0:"芸能・ワイドショー",1:"ファッション",2:"暮らし・住まい",3:"健康・医療",4:"ショッピング・通販",5:"グルメ・料理",6:"イベント",7:"番組紹介・お知らせ",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},3:{0:"国内ドラマ",1:"海外ドラマ",2:"時代劇",3:"",4:"",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},4:{0:"国内ロック・ポップス",1:"海外ロック・ポップス",2:"クラシック・オペラ",3:"ジャズ・フュージョン",4:"歌謡曲・演歌",5:"ライブ・コンサート",6:"ランキング・リクエスト",7:"カラオケ・のど自慢",8:"民謡・邦楽",9:"童謡・キッズ",10:"民族音楽・ワールドミュージック",11:"",12:"",13:"",14:"",15:"その他"},5:{0:"クイズ",1:"ゲーム",2:"トークバラエティ",3:"お笑い・コメディ",4:"音楽バラエティ",5:"旅バラエティ",6:"料理バラエティ",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},6:{0:"洋画",1:"邦画",2:"アニメ",3:"",4:"",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},7:{0:"国内アニメ",1:"海外アニメ",2:"特撮",3:"",4:"",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},8:{0:"社会・時事",1:"歴史・紀行",2:"自然・動物・環境",3:"宇宙・科学・医学",4:"カルチャー・伝統文化",5:"文学・文芸",6:"スポーツ",7:"ドキュメンタリー全般",8:"インタビュー・討論",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},9:{0:"現代劇・新劇",1:"ミュージカル",2:"ダンス・バレエ",3:"落語・演芸",4:"歌舞伎・古典",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},10:{0:"旅・釣り・アウトドア",1:"園芸・ペット・手芸",2:"音楽・美術・工芸",3:"囲碁・将棋",4:"麻雀・パチンコ",5:"車・オートバイ",6:"コンピュータ・TVゲーム",7:"会話・語学",8:"幼児・小学生",9:"中学生・高校生",10:"大学生・受験",11:"生涯教育・資格",12:"教育問題",13:"",14:"",15:"その他"},11:{0:"高齢者",1:"障害者",2:"社会福祉",3:"ボランティア",4:"手話",5:"文字(字幕)",6:"音声解説",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"},12:{0:"",1:"",2:"",3:"",4:"",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:""},13:{0:"",1:"",2:"",3:"",4:"",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:""},14:{0:"BS/地上デジタル放送用番組付属情報",1:"広帯域 CS デジタル放送用拡張",2:"",3:"サーバー型番組付属情報",4:"IP 放送用番組付属情報",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:""},15:{0:"",1:"",2:"",3:"",4:"",5:"",6:"",7:"",8:"",9:"",10:"",11:"",12:"",13:"",14:"",15:"その他"}}},dialog_control:{0:"音声ストリームがダイアログ制御情報を含まない",1:"音声ストリームがダイアログ制御情報を含む"},audio_for_handicapped:{0:"障がい者用音声を特定しない",1:"視覚障がい者用音声解説",2:"聴覚障がい者用音声",3:"将来使用のためリザーブ"},audio_mode:{0:"将来使用のためリザーブ",1:"1/0モード(シングルモノ)",2:"1/0+ 1/0モード(デュアルモノ)",3:"2/0モード(ステレオ)",4:"2/1モード",5:"3/0モード",6:"2/2モード",7:"3/1モード",8:"3/2モード",9:"3/2+ LFEモード(3/2.1モード)",10:"3/3.1モード",11:"2/0/0-2/0/2-0.1モード",12:"5/2.1モード",13:"3/2/2.1モード",14:"2/0/0-3/0/2-0.1モード",15:"0/2/0-3/0/2-0.1モード",16:"2/0/0-3/2/3-0.2モード",17:"3/3/3-5/2/3-3/0/0.2モード",18:"将来使用のためリザーブ",19:"将来使用のためリザーブ",20:"将来使用のためリザーブ",21:"将来使用のためリザーブ",22:"将来使用のためリザーブ",23:"将来使用のためリザーブ",24:"将来使用のためリザーブ",25:"将来使用のためリザーブ",26:"将来使用のためリザーブ",27:"将来使用のためリザーブ",28:"将来使用のためリザーブ",29:"将来使用のためリザーブ",30:"将来使用のためリザーブ",31:"将来使用のためリザーブ"},quality_indicator:{0:"将来使用のためリザーブ",1:"モード1",2:"モード2",3:"モード3"},sampling_rate:{0:"将来使用のためリザーブ",1:"16kHz",2:"22.05kHz",3:"24kHz",4:"リザーブ",5:"32kHz",6:"44.1kHz",7:"48kHz"}}},4210:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tsDataModule=l.tsTable=l.TsUtil=l.TsModuleDescriptors=l.TsDescriptors=l.TsLogo=l.TsDate=l.TsChar=l.TsCrc32=l.TsStreamLite=l.TsStream=void 0;var p=c(6777);Object.defineProperty(l,"TsStream",{enumerable:!0,get:function(){return p.default}});var r=c(5411);Object.defineProperty(l,"TsStreamLite",{enumerable:!0,get:function(){return r.default}}),l.TsCrc32=c(3170);var i=c(4018);Object.defineProperty(l,"TsChar",{enumerable:!0,get:function(){return i.default}});var t=c(2172);Object.defineProperty(l,"TsDate",{enumerable:!0,get:function(){return t.default}});var n=c(9685);Object.defineProperty(l,"TsLogo",{enumerable:!0,get:function(){return n.default}});var a=c(1241);Object.defineProperty(l,"TsDescriptors",{enumerable:!0,get:function(){return a.default}});var o=c(9235);Object.defineProperty(l,"TsModuleDescriptors",{enumerable:!0,get:function(){return o.default}});var d=c(5915);Object.defineProperty(l,"TsUtil",{enumerable:!0,get:function(){return d.default}}),l.tsTable=c(2540),l.tsDataModule=c(1481)},8822:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TsInfo=void 0;const p=c(3550);l.TsInfo=class{constructor(){we(this,"name","");we(this,"packet",0);we(this,"counter",-1);we(this,"duplication",0);we(this,"type",0);we(this,"drop",0);we(this,"scrambling",0);we(this,"buffer",new p.TsBuffer);this.buffer.entireLength=0}toObject(){return{packet:this.packet,drop:this.drop,scrambling:this.scrambling}}}},9685:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8764),r=c(3170),i=c(7755),t=p.Buffer.allocUnsafe(8+3*i.default.length+4),n=p.Buffer.allocUnsafe(8+i.default.length+4);{let o=0;t.writeUInt32BE(3*i.default.length,o),o+=4,p.Buffer.from("PLTE").copy(t,o),o+=4;for(const d of i.default)t.writeUInt8(d[0],o++),t.writeUInt8(d[1],o++),t.writeUInt8(d[2],o++);t.writeInt32BE(r.pngCalc(t.slice(4,o)),o)}{let o=0;n.writeUInt32BE(i.default.length,o),o+=4,p.Buffer.from("tRNS").copy(n,o),o+=4;for(const d of i.default)n.writeUInt8(d[3],o++);n.writeInt32BE(r.pngCalc(n.slice(4,o)),o)}class a{constructor(d){we(this,"buffer");this.buffer=d}decode(){return a.decode(this.buffer)}static decode(d){const g=[d.slice(0,33),t,n,d.slice(33)],m=d.length+t.length+n.length;return p.Buffer.concat(g,m)}}l.default=a},7755:(y,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.default=[[0,0,0,255],[255,0,0,255],[0,255,0,255],[255,255,0,255],[0,0,255,255],[255,0,255,255],[0,255,255,255],[255,255,255,255],[0,0,0,0],[170,0,0,255],[0,170,0,255],[170,170,0,255],[0,0,170,255],[170,0,170,255],[0,170,170,255],[170,170,170,255],[0,0,85,255],[0,85,0,255],[0,85,85,255],[0,85,170,255],[0,85,255,255],[0,170,85,255],[0,170,255,255],[0,255,85,255],[0,255,170,255],[85,0,0,255],[85,0,85,255],[85,0,170,255],[85,0,255,255],[85,85,0,255],[85,85,85,255],[85,85,170,255],[85,85,255,255],[85,170,0,255],[85,170,85,255],[85,170,170,255],[85,170,255,255],[85,255,0,255],[85,255,85,255],[85,255,170,255],[85,255,255,255],[170,0,85,255],[170,0,255,255],[170,85,0,255],[170,85,85,255],[170,85,170,255],[170,85,255,255],[170,170,85,255],[170,170,255,255],[170,255,0,255],[170,255,85,255],[170,255,170,255],[170,255,255,255],[255,0,85,255],[255,0,255,255],[255,85,0,255],[255,85,85,255],[255,85,170,255],[255,85,255,255],[255,170,0,255],[255,170,85,255],[255,170,170,255],[255,170,255,255],[255,255,85,255],[255,255,255,255],[0,0,0,128],[255,0,0,128],[0,255,0,128],[255,255,0,128],[0,0,255,128],[255,0,255,128],[0,255,255,128],[255,255,255,128],[170,0,0,128],[0,170,0,128],[170,170,0,128],[0,0,170,128],[170,0,170,128],[0,170,170,128],[170,170,170,128],[0,0,85,128],[0,85,0,128],[0,85,85,128],[0,85,170,128],[0,85,255,128],[0,170,85,128],[0,170,255,128],[0,255,85,128],[0,255,170,128],[85,0,0,128],[85,0,85,128],[85,0,170,128],[85,0,255,128],[85,85,0,128],[85,85,85,128],[85,85,170,128],[85,85,255,128],[85,170,0,128],[85,170,85,128],[85,170,170,128],[85,170,255,128],[85,255,0,128],[85,255,85,128],[85,255,170,128],[85,255,255,128],[170,0,85,128],[170,0,255,128],[170,85,0,128],[170,85,85,128],[170,85,170,128],[170,85,255,128],[170,170,85,128],[170,170,255,128],[170,255,0,128],[170,255,85,128],[170,255,170,128],[170,255,255,128],[255,0,85,128],[255,0,255,128],[255,85,0,128],[255,85,85,128],[255,85,170,128],[255,85,255,128],[255,170,0,128],[255,170,85,128],[255,170,170,128],[255,170,255,128],[255,255,85,128],[255,255,255,128]]},9036:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.CRC_32=r.readBytes(4),i}}},3262:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TsModuleDescriptorCrc32=l.TsModuleDescriptorModuleLink=l.TsModuleDescriptorInfo=l.TsModuleDescriptorName=l.TsModuleDescriptorType=l.TsModuleDescriptorUnknown=void 0;const p=c(312);l.TsModuleDescriptorUnknown=p.default;const r=c(8990);l.TsModuleDescriptorType=r.default;const i=c(7493);l.TsModuleDescriptorName=i.default;const t=c(3718);l.TsModuleDescriptorInfo=t.default;const n=c(9274);l.TsModuleDescriptorModuleLink=n.default;const a=c(9036);l.TsModuleDescriptorCrc32=a.default},3718:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.ISO_639_language_code=r.readBytes(3),i.text_char=r.readBytes(2+i.descriptor_length-(r.position>>3)),i}}},9274:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.position=r.uimsbf(8),i.moduleId=r.uimsbf(16),i}}},7493:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.text_char=r.readBytes(i.descriptor_length),i}}},8990:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.text_char=r.readBytes(i.descriptor_length),i}}},312:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.descriptor_tag=r.uimsbf(8),i.descriptor_length=r.uimsbf(8),i.descriptor=r.readBytes(i.descriptor_length),i}}},9235:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3262);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=[];for(let i=0;i{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946),r=c(7786);class i{constructor(n){we(this,"buffer");this.buffer=n}decode(){const n=new p.default(this.buffer),a={};return a._raw=this.buffer,a.sync_byte=n.bslbf(8),a.transport_error_indicator=n.bslbf(1),a.payload_unit_start_indicator=n.bslbf(1),a.transport_priority=n.bslbf(1),a.PID=n.uimsbf(13),a.transport_scrambling_control=n.bslbf(2),a.adaptation_field_control=n.bslbf(2),a.continuity_counter=n.uimsbf(4),a.adaptation_field_control!==2&&a.adaptation_field_control!==3||(a.adaptation_field=this.decodeAdaptationField(),n.next(n.uimsbf(8)<<3)),a.adaptation_field_control!==1&&a.adaptation_field_control!==3||(a.data_byte=this.buffer.slice(n.position>>3,188)),a}decodeAdaptationField(){const n=i.getAdaptationField(this.buffer);if(n===null)return;const a=new p.default(n),o={};return o._raw=n,o.adaptation_field_length=a.uimsbf(8),o.adaptation_field_length>0&&(o.discontinuity_indicator=a.bslbf(1),o.random_access_indicator=a.bslbf(1),o.elementary_stream_priority_indicator=a.bslbf(1),o.PCR_flag=a.bslbf(1),o.OPCR_flag=a.bslbf(1),o.splicing_point_flag=a.bslbf(1),o.transport_private_data_flag=a.bslbf(1),o.adaptation_field_extension_flag=a.bslbf(1),o.PCR_flag===1&&(o.program_clock_reference_base=a.uimsbf(33),a.next(6),o.program_clock_reference_extension=a.uimsbf(9)),o.OPCR_flag===1&&(o.original_program_clock_reference_base=a.uimsbf(33),a.next(6),o.original_program_clock_reference_extension=a.uimsbf(9)),o.splicing_point_flag===1&&(o.splice_countdown=a.tcimsbf(8)),o.transport_private_data_flag===1&&(o.transport_private_data_length=a.uimsbf(8),o.private_data_byte=a.readBytes(o.transport_private_data_length)),o.adaptation_field_extension_flag===1&&(o.adaptation_field_extension_length=a.uimsbf(8),o.ltw_flag=a.bslbf(1),o.piecewise_rate_flag=a.bslbf(1),o.seamless_splice_flag=a.bslbf(1),a.next(5),o.ltw_flag===1&&(o.ltw_valid_flag=a.bslbf(1),o.ltw_offset=a.uimsbf(15)),o.piecewise_rate_flag===1&&(a.next(2),o.piecewise_rate=a.uimsbf(22)),o.seamless_splice_flag===1&&(o.splice_type=a.bslbf(4),o.DTS_next_AU_32_30=a.bslbf(3),a.next(1),o.DTS_next_AU_29_15=a.bslbf(15),a.next(1),o.DTS_next_AU_14_0=a.bslbf(15),a.next(1)))),o}decodeBasic(){const n={};if(n._raw=this.buffer,n.sync_byte=this.buffer[0],n.transport_error_indicator=this.buffer[1]>>7,n.payload_unit_start_indicator=(64&this.buffer[1])>>6,n.transport_priority=(32&this.buffer[1])>>5,n.PID=(31&this.buffer[1])<<8|this.buffer[2],n.transport_scrambling_control=(192&this.buffer[3])>>6,n.adaptation_field_control=(48&this.buffer[3])>>4,n.continuity_counter=15&this.buffer[3],n.adaptation_field_control===2||n.adaptation_field_control===3){const a=n.adaptation_field={};a.adaptation_field_length=this.buffer[4],a.adaptation_field_length&&(a.discontinuity_indicator=(128&this.buffer[5])>>7,a.random_access_indicator=(64&this.buffer[5])>>6,a.elementary_stream_priority_indicator=(32&this.buffer[5])>>5,a.PCR_flag=(16&this.buffer[5])>>4,a.OPCR_flag=(8&this.buffer[5])>>3,a.splicing_point_flag=(4&this.buffer[5])>>2,a.transport_private_data_flag=(2&this.buffer[5])>>1,a.adaptation_field_extension_flag=1&this.buffer[5])}return n}encode(n){const a=new r.default(this.buffer);if(a.bslbf(8,71),a.bslbf(1,0),a.bslbf(1,n.payload_unit_start_indicator),a.bslbf(1,n.transport_priority),a.uimsbf(13,n.PID),a.bslbf(2,n.transport_scrambling_control),a.bslbf(2,n.adaptation_field_control),a.uimsbf(4,n.continuity_counter),n.adaptation_field_control===2||n.adaptation_field_control===3){const o=n.adaptation_field;a.uimsbf(8,o.adaptation_field_length),o.adaptation_field_length>0&&(a.bslbf(1,o.discontinuity_indicator),a.bslbf(1,o.random_access_indicator),a.bslbf(1,o.elementary_stream_priority_indicator),a.bslbf(1,o.PCR_flag),a.bslbf(1,o.OPCR_flag),a.bslbf(1,o.splicing_point_flag),a.bslbf(1,o.transport_private_data_flag),a.bslbf(1,o.adaptation_field_extension_flag),o.PCR_flag===1&&(a.uimsbf(2,o.program_clock_reference_base/2147483648|0),a.uimsbf(31,(0|o.program_clock_reference_base)>>1),a.bslbf(6,0),a.uimsbf(9,o.program_clock_reference_extension)),o.OPCR_flag===1&&(a.uimsbf(2,o.original_program_clock_reference_base/2147483648|0),a.uimsbf(31,(0|o.original_program_clock_reference_base)>>1),a.bslbf(6,0),a.uimsbf(9,o.original_program_clock_reference_extension)),o.splicing_point_flag===1&&a.tcimsbf(8,o.splice_countdown),o.transport_private_data_flag===1&&(a.uimsbf(8,o.transport_private_data_length),a.writeBytes(o.transport_private_data_length,o.private_data_byte)),o.adaptation_field_extension_flag===1&&(a.uimsbf(8,o.adaptation_field_extension_length),a.bslbf(1,o.ltw_flag),a.bslbf(1,o.piecewise_rate_flag),a.bslbf(1,o.seamless_splice_flag),a.bslbf(5,0),o.ltw_flag===1&&(a.bslbf(1,o.ltw_valid_flag),a.uimsbf(15,o.ltw_offset)),o.piecewise_rate_flag===1&&(a.bslbf(2,0),a.uimsbf(22,o.piecewise_rate)),o.seamless_splice_flag===1&&(a.bslbf(4,o.splice_type),a.bslbf(3,o.DTS_next_AU_32_30),a.bslbf(1,1),a.bslbf(15,o.DTS_next_AU_29_15),a.bslbf(1,1),a.bslbf(15,o.DTS_next_AU_14_0),a.bslbf(1,1))))}return n.adaptation_field_control!==1&&n.adaptation_field_control!==3||a.writeBytes(n.data_byte.length,n.data_byte),this.buffer.slice(0,188)}static isPes(n){if(!((16&n[3])>>4))return null;const a=(32&n[3])>>5==1?5+n[4]:4;return n[a]===0&&n[a+1]===0&&n[a+2]===1}static getAdaptationField(n){return(32&n[3])>>5?n.slice(4,5+n[4]):null}static getData(n){return(16&n[3])>>4?(32&n[3])>>5==1?n.slice(5+n[4],188):n.slice(4,188):null}}l.default=i},8946:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8764);l.default=class{constructor(r,i=0){we(this,"buffer");we(this,"position");this.buffer=r,this.position=i}readBitsRaw(r){if(this.position+r>this.buffer.length<<3)return this.position+=r,0;let i=0;for(;r>7;){const t=this.position>>3,n=7&this.position,a=Math.pow(2,8-n)-1;i<<=8,i|=(this.buffer[t]&a)<>8-n,this.position+=8,r-=8}for(;r>0;){const t=this.position>>3,n=7&this.position^7;i<<=1,i|=this.buffer[t]>>n&1,this.position++,r--}return i}readBits(r){let i=0;for(;r>31;){const t=(r-1)%31+1;i+=this.readBitsRaw(t),i*=2147483648,r-=t}return i+=this.readBitsRaw(r),i}readBytesRaw(r){if(this.position+r>this.buffer.length<<3)return this.position+=r,p.Buffer.allocUnsafe(0);const i=this.position>>3;return this.position+=r<<3,this.buffer.slice(i,i+r)}readBytes(r){return this.readBytesRaw(r)}next(r){this.position+=r}previous(r){this.position-=r}bslbf(r){return this.readBits(r)}uimsbf(r){return this.readBits(r)}tcimsbf(r){return-this.readBits(1)<{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8764),r=c(9827),i=c(8822),t=c(3550),n=c(1036),a=c(2540),o=c(6609),d=c(8803);class g extends r.Transform{constructor(b={}){super();we(this,"buffer");we(this,"info",{});we(this,"options");we(this,"trans");this.options=Object.assign({transform:!1,skipSize:0,packetSize:188,bufferSize:0,transPmtIds:[],transPmtSids:[],transPmtPids:[],transPids:[]},b),this.buffer=new t.TsBuffer,this.info={},this.trans={pat:null,cat:null,pmt:{},pmtPids:[],pids:[],rebuild:{pat:null,patCounter:0,patVersion:0}}}toPacket(b){let w=[],C=0;if(this.options.packetSize===192)for(;b.length-C>=192&&(b[4]===71||(C=b.indexOf(71,C)-4)!=-5);C+=192)w.push(b.slice(C+4,C+192));else for(;b.length-C>=188&&(b[0]===71||(C=b.indexOf(71,C))!==-1);C+=188)w.push(b.slice(C,C+188));return{packets:w,buffer:C!==-1?b.slice(C):null}}parse(b){let w=this.toPacket(b);for(let C of w.packets){if(this.options.skipSize>0&&this.options.skipSize--!=0)continue;let D=new n.default(C),R=D.decodeBasic();if(R.transport_error_indicator===1)continue;this.info.hasOwnProperty(R.PID)||(this.info[R.PID]=new i.TsInfo);let T=this.info[R.PID];if(T.packet++,this.listenerCount("packet")&&this.emit("packet",R.PID,D.decode()),(1&R.adaptation_field_control)==1){let P=[];if(R.hasOwnProperty("adaptation_field")&&R.adaptation_field.discontinuity_indicator===1&&(T.counter=-1),T.counter!==-1&&R.PID!==8191){let L=R.continuity_counter,I=T.counter,x=I+1&15,O=!0;L===I?(T.duplication++,T.duplication>1&&(O=!1)):(T.duplication=0,L!==x&&(O=!1)),O||(T.drop++,T.type=0,T.buffer.reset(),this.listenerCount("drop")&&this.emit("drop",R.PID,L,x))}if(T.counter=R.continuity_counter,R.transport_scrambling_control>>1==1)T.scrambling++,this.listenerCount("scrambling")&&this.emit("scrambling",R.PID);else{if(R.payload_unit_start_indicator===1)if(n.default.isPes(C))T.type=1;else{T.type=2;let L=n.default.getData(C),I=0,x=L[0];for(I++,x!==0&&T.buffer.length!==0&&(T.buffer.entireLength-T.buffer.length===x?(T.buffer.add(L.slice(I,I+x)),P.push(T.buffer.concat())):T.type=0),T.buffer.length!==0&&(T.buffer.reset(),T.buffer.entireLength=0),I+=x;L.length>=I+3&&L[I]!==255;){let O=3+((15&L[I+1])<<8|L[I+2]);if(L.length=58&&I<=63){if(this.listenerCount("dsmcc")){let x=new a.TsTableDsmcc(L).decode();x!==null&&this.emit("dsmcc",R.PID,x)}}else if(I===64||I===65){if(this.listenerCount("nit")){let x=new a.TsTableNit(L).decode();x!==null&&this.emit("nit",R.PID,x)}}else if(I===66||I===70){if(this.listenerCount("sdt")){let x=new a.TsTableSdt(L).decode();x!==null&&this.emit("sdt",R.PID,x)}}else if(I===74){if(this.listenerCount("bat")){let x=new a.TsTableBat(L).decode();x!==null&&this.emit("bat",R.PID,x)}}else if(I>=78&&I<=111){if(this.listenerCount("eit")){let x=(0,o.decode)(L);x!==null&&this.emit("eit",R.PID,x)}}else if(I===112){if(this.listenerCount("tdt")){let x=new a.TsTableTdt(L).decode();x!==null&&this.emit("tdt",R.PID,x)}}else if(I===115){if(this.listenerCount("tot")){let x=new a.TsTableTot(L).decode();x!==null&&this.emit("tot",R.PID,x)}}else if(I===126){if(this.listenerCount("dit")){let x=new a.TsTableDit(L).decode();x!==null&&this.emit("dit",R.PID,x)}}else if(I===127){if(this.listenerCount("sit")){let x=new a.TsTableSit(L).decode();x!==null&&this.emit("sit",R.PID,x)}}else if(I===195){if(this.listenerCount("sdtt")){let x=new a.TsTableSdtt(L).decode();x!==null&&this.emit("sdtt",R.PID,x)}}else if(I===196){if(this.listenerCount("bit")){let x=(0,d.decode)(L);x!==null&&this.emit("bit",R.PID,x)}}else if(I===200&&this.listenerCount("cdt")){let x=new a.TsTableCdt(L).decode();x!==null&&this.emit("cdt",R.PID,x)}}}}this.options.transform?R.PID!==0&&this.trans.pids.indexOf(R.PID)!==-1&&this.push(C):this.push(C)}return w.buffer}parsePat(b,w){this.trans.pat!==null&&w.version_number===this.trans.pat.version_number||(this.trans.pat=w,this.listenerCount("updatePat")&&this.emit("updatePat",b,w),this.updatePids(),this.rebuildPat())}parseCat(b,w){this.trans.cat!==null&&w.version_number===this.trans.cat.version_number||(this.trans.cat=w,this.listenerCount("updateCat")&&this.emit("updateCat",b,w),this.updatePids())}parsePmt(b,w){this.trans.pmt.hasOwnProperty(b)&&w.version_number===this.trans.pmt[b].version_number||(this.trans.pmt[b]=w,this.listenerCount("updatePmt")&&this.emit("updatePmt",b,w),this.updatePids())}updatePids(){let b=this.options.transPmtPids.slice(),w=this.options.transPids.slice();if(w.push(0),this.trans.pat!==null){let C=0;for(let D of this.trans.pat.programs)if(D.program_number===0){if(w.indexOf(D.network_PID)!==-1)continue;w.push(D.network_PID)}else b.indexOf(D.program_map_PID)===-1&&(this.options.transPmtIds.indexOf(-1)===-1&&this.options.transPmtIds.indexOf(C)===-1&&this.options.transPmtSids.indexOf(D.program_number)===-1||b.push(D.program_map_PID)),C++}if(this.trans.cat!==null)for(let C of this.trans.cat.descriptors)C.descriptor_tag===9&&w.indexOf(C.CA_PID)===-1&&w.push(C.CA_PID);for(let C of b)if(this.trans.pmt.hasOwnProperty(C)){w.indexOf(C)===-1&&w.push(C),w.indexOf(this.trans.pmt[C].PCR_PID)===-1&&w.push(this.trans.pmt[C].PCR_PID);for(let D of this.trans.pmt[C].program_info)D.descriptor_tag===9&&w.indexOf(D.CA_PID)===-1&&w.push(D.CA_PID);for(let D of this.trans.pmt[C].streams)w.indexOf(D.elementary_PID)===-1&&w.push(D.elementary_PID)}this.trans.pmtPids=b,this.trans.pids=w}rebuildPat(){let b={payload_unit_start_indicator:1,transport_priority:1,PID:0,transport_scrambling_control:0,adaptation_field_control:1,continuity_counter:0,data_byte:null},w={table_id:0,section_syntax_indicator:1,transport_stream_id:this.trans.pat.transport_stream_id,version_number:this.trans.rebuild.patVersion,current_next_indicator:1,section_number:0,last_section_number:0,programs:[]};for(let D of this.trans.pat.programs)D.program_number===0?w.programs.push({program_number:D.program_number,network_PID:D.network_PID}):this.trans.pmtPids.indexOf(D.program_map_PID)!==-1&&w.programs.push({program_number:D.program_number,program_map_PID:D.program_map_PID});let C=new a.TsTablePat(p.Buffer.alloc(1024,255)).encode(w);if(C.length>183)throw new RangeError("PAT is too long");b.data_byte=p.Buffer.concat([p.Buffer.alloc(1),C]),this.trans.rebuild.pat=new n.default(p.Buffer.alloc(188,255)).encode(b),this.trans.rebuild.patVersion=this.trans.rebuild.patVersion+1&31}createPat(){let b=p.Buffer.from(this.trans.rebuild.pat);return b[3]=240&b[3]|this.trans.rebuild.patCounter,this.trans.rebuild.patCounter=this.trans.rebuild.patCounter+1&15,b}_transform(b,w,C){if(this.buffer.add(b),this.options.bufferSize!==-1&&this.buffer.length>this.options.bufferSize){let D=this.parse(this.buffer.concat());this.buffer.reset(),D!==null&&this.buffer.add(D)}C()}_flush(b){let w=this.parse(this.buffer.concat());if(this.buffer.reset(),this.push(w),this.listenerCount("info")){let C={};for(let D of Object.keys(this.info))C[D]=this.info[D].toObject();this.emit("info",C)}b()}}l.default=g},5411:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(7187),r=c(8822),i=c(1036),t=c(2540),n=c(6609),a=c(8803);class o extends p.EventEmitter{constructor(){super();we(this,"info",{})}write(m){for(const v of m){const b=new i.default(v).decodeBasic();if(b.transport_error_indicator===1)continue;this.info[b.PID]===void 0&&(this.info[b.PID]=new r.TsInfo);const w=this.info[b.PID];if(w.packet++,(1&b.adaptation_field_control)==1){const C=[];if(b.adaptation_field&&b.adaptation_field.discontinuity_indicator===1&&(w.counter=-1),w.counter!==-1&&b.PID!==8191){const D=b.continuity_counter,R=w.counter,T=R+1&15;let P=!0;D===R?(w.duplication++,w.duplication>1&&(P=!1)):(w.duplication=0,D!==T&&(P=!1)),P||(w.drop++,w.type=0,w.buffer.reset(),this.listenerCount("drop")&&this.emit("drop",b.PID,D,T))}if(w.counter=b.continuity_counter,b.transport_scrambling_control>>1==1)w.scrambling++,this.listenerCount("scrambling")&&this.emit("scrambling",b.PID);else{if(b.payload_unit_start_indicator===1)if(i.default.isPes(v))w.type=1;else{w.type=2;const D=i.default.getData(v);let R=0;const T=D[0];for(R++,T!==0&&w.buffer.length!==0&&(w.buffer.entireLength-w.buffer.length===T?(w.buffer.add(D.slice(R,R+T)),C.push(w.buffer.concat())):w.type=0),w.buffer.length!==0&&(w.buffer.reset(),w.buffer.entireLength=0),R+=T;D.length>=R+3&&D[R]!==255;){const P=3+((15&D[R+1])<<8|D[R+2]);if(D.length=58&&R<=63){if(this.listenerCount("dsmcc")){const T=new t.TsTableDsmcc(D).decode();T!==null&&this.emit("dsmcc",b.PID,T)}}else if(R===64||R===65){if(this.listenerCount("nit")){const T=new t.TsTableNit(D).decode();T!==null&&this.emit("nit",b.PID,T)}}else if(R===66||R===70){if(this.listenerCount("sdt")){const T=new t.TsTableSdt(D).decode();T!==null&&this.emit("sdt",b.PID,T)}}else if(R===74){if(this.listenerCount("bat")){const T=new t.TsTableBat(D).decode();T!==null&&this.emit("bat",b.PID,T)}}else if(R>=78&&R<=111){if(this.listenerCount("eit")){const T=(0,n.decode)(D);T!==null&&this.emit("eit",b.PID,T)}}else if(R===112){if(this.listenerCount("tdt")){const T=new t.TsTableTdt(D).decode();T!==null&&this.emit("tdt",b.PID,T)}}else if(R===115){if(this.listenerCount("tot")){const T=new t.TsTableTot(D).decode();T!==null&&this.emit("tot",b.PID,T)}}else if(R===126){if(this.listenerCount("dit")){const T=new t.TsTableDit(D).decode();T!==null&&this.emit("dit",b.PID,T)}}else if(R===127){if(this.listenerCount("sit")){const T=new t.TsTableSit(D).decode();T!==null&&this.emit("sit",b.PID,T)}}else if(R===195){if(this.listenerCount("sdtt")){const T=new t.TsTableSdtt(D).decode();T!==null&&this.emit("sdtt",b.PID,T)}}else if(R===196){if(this.listenerCount("bit")){const T=(0,a.decode)(D);T!==null&&this.emit("bit",b.PID,T)}}else if(R===200&&this.listenerCount("cdt")){const T=new t.TsTableCdt(D).decode();T!==null&&this.emit("cdt",b.PID,T)}}}}}}end(){delete this.info}}l.default=o},644:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.bouquet_id=t.uimsbf(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),t.next(4),n.bouquet_descriptors_length=t.uimsbf(12),n.bouquet_descriptors=new i.default(t.readBytesRaw(n.bouquet_descriptors_length)).decode(),t.next(4),n.transport_stream_loop_length=t.uimsbf(12),n.transport_streams=[];for(let a=(t.position>>3)+n.transport_stream_loop_length;t.position>>3{Object.defineProperty(l,"__esModule",{value:!0}),l.decode=void 0;const p=c(3170),r=c(8946),i=c(1241);l.decode=function(t){if((0,p.calc)(t)!==0)return null;const n=new r.default(t),a={_raw:t,table_id:n.uimsbf(8),section_syntax_indicator:n.bslbf(1)};for(n.next(1),n.next(2),a.section_length=n.uimsbf(12),a.original_network_id=n.uimsbf(16),n.next(2),a.version_number=n.uimsbf(5),a.current_next_indicator=n.bslbf(1),a.section_number=n.uimsbf(8),a.last_section_number=n.uimsbf(8),n.next(3),a.broadcast_view_propriety=n.bslbf(1),a.first_descriptors_length=n.uimsbf(12),a.first_descriptors=new i.default(n.readBytesRaw(a.first_descriptors_length)).decode(),a.broadcaster_descriptors=[];(n.position>>3)-3{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};return n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),t.next(18),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),n.descriptors=new i.default(t.readBytesRaw(3+n.section_length-(t.position>>3)-4)).decode(),n.CRC_32=t.readBytes(4),n}}},7975:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};return n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.download_data_id=t.uimsbf(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),n.original_network_id=t.uimsbf(16),n.data_type=t.uimsbf(8),t.next(4),n.descriptors_loop_length=t.uimsbf(12),n.descriptors=new i.default(t.readBytesRaw(n.descriptors_loop_length)).decode(),n.data_module_byte=t.readBytes(3+n.section_length-(t.position>>3)-4),n.CRC_32=t.readBytes(4),n}}},274:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.table_id=r.uimsbf(8),i.section_syntax_indicator=r.bslbf(1),r.next(1),r.next(2),i.section_length=r.uimsbf(12),i.transition_flag=r.uimsbf(1),i}}},3900:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(5571),t=c(9235);class n{constructor(d){we(this,"buffer");this.buffer=d}decode(){let d=new r.default(this.buffer),g={};g.protocolDiscriminator=d.uimsbf(8),g.dsmccType=d.uimsbf(8),g.messageId=d.uimsbf(16),g.transaction_id=d.uimsbf(32),d.next(8),g.adaptationLength=d.uimsbf(8),g.messageLength=d.uimsbf(16),g.adaptationLength>0&&(g.adaptationType=d.uimsbf(8),g.adaptationDataByte=d.readBytes(g.adaptationLength-1)),g.downloadId=d.uimsbf(32),g.blockSize=d.uimsbf(16),g.windowSize=d.uimsbf(8),g.ackPeriod=d.uimsbf(8),g.tCDownloadWindow=d.uimsbf(32),g.tCDownloadScenario=d.uimsbf(32);let m=d.buffer[d.position>>3]<<8|d.buffer[1+(d.position>>3)];g.compatibilityDescriptor=new i.default(d.readBytesRaw(2+m)).decode(),g.numberOfModules=d.uimsbf(16),g.modules=[];for(let v=0;v0&&(g.adaptationType=d.uimsbf(8),g.adaptationDataByte=d.readBytes(g.adaptationLength-1)),g.moduleId=d.uimsbf(16),g.moduleVersion=d.uimsbf(8),d.next(8),g.blockNumber=d.uimsbf(16),g.blockDataByte=d.readBytes(g.messageLength-g.adaptationLength-6),g}}l.default=class{constructor(o){we(this,"buffer");this.buffer=o}decode(){if(this.buffer[1]>>7==1&&p.calc(this.buffer)!==0)return null;let o=new r.default(this.buffer),d={};d._raw=this.buffer,d.table_id=o.uimsbf(8),d.section_syntax_indicator=o.bslbf(1),d.private_indicator=o.bslbf(1),o.next(2),d.dsmcc_section_length=o.uimsbf(12),d.table_id_extension=o.uimsbf(16),o.next(2),d.version_number=o.uimsbf(5),d.current_next_indicator=o.bslbf(1),d.section_number=o.uimsbf(8),d.last_section_number=o.uimsbf(8);let g=o.readBytes(3+d.dsmcc_section_length-(o.position>>3)-4);return d.table_id===59?d.message=new n(g).decode():d.table_id===60?d.message=new a(g).decode():d.table_id===61?d.stream_descriptor=g:d.table_id===62&&(d.private_data_byte=g),d.section_syntax_indicator===0?d.Checksum=o.readBytes(4):d.CRC_32=o.readBytes(4),d}}},6609:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.decode=void 0;const p=c(3170),r=c(8946),i=c(1241);l.decode=function(t){if((0,p.calc)(t)!==0)return null;const n=new r.default(t),a={_raw:t,table_id:n.uimsbf(8),section_syntax_indicator:n.bslbf(1)};for(n.next(1),n.next(2),a.section_length=n.uimsbf(12),a.service_id=n.uimsbf(16),n.next(2),a.version_number=n.uimsbf(5),a.current_next_indicator=n.bslbf(1),a.section_number=n.uimsbf(8),a.last_section_number=n.uimsbf(8),a.transport_stream_id=n.uimsbf(16),a.original_network_id=n.uimsbf(16),a.segment_last_section_number=n.uimsbf(8),a.last_table_id=n.uimsbf(8),a.events=[];n.position>>3<3+a.section_length-4;){const o={event_id:n.uimsbf(16),start_time:n.readBytes(5),duration:n.readBytes(3),running_status:n.uimsbf(3),free_CA_mode:n.bslbf(1),descriptors_loop_length:n.uimsbf(12)};o.descriptors=new i.default(n.readBytesRaw(o.descriptors_loop_length)).decode(),a.events.push(o)}return a.CRC_32=n.readBytes(4),a}},2540:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TsTableBit=l.TsTableCdt=l.TsTableSdtt=l.TsTableSit=l.TsTableDit=l.TsTableTot=l.TsTableTdt=l.TsTableEit=l.TsTableBat=l.TsTableSdt=l.TsTableDsmcc=l.TsTableNit=l.TsTablePmt=l.TsTableCat=l.TsTablePat=void 0;const p=c(3419);l.TsTablePat=p.default;const r=c(9938);l.TsTableCat=r.default;const i=c(2145);l.TsTablePmt=i.default;const t=c(2374);l.TsTableNit=t.default;const n=c(3900);l.TsTableDsmcc=n.default;const a=c(4838);l.TsTableSdt=a.default;const o=c(644);l.TsTableBat=o.default;const d=c(6609);l.TsTableEit=d;const g=c(7347);l.TsTableTdt=g.default;const m=c(2392);l.TsTableTot=m.default;const v=c(274);l.TsTableDit=v.default;const b=c(4440);l.TsTableSit=b.default;const w=c(888);l.TsTableSdtt=w.default;const C=c(7975);l.TsTableCdt=C.default;const D=c(8803);l.TsTableBit=D},2374:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.network_id=t.uimsbf(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),t.next(4),n.network_descriptors_length=t.uimsbf(12),n.network_descriptors=new i.default(t.readBytesRaw(n.network_descriptors_length)).decode(),t.next(4),n.transport_stream_loop_length=t.uimsbf(12),n.transport_streams=[];for(let a=(t.position>>3)+n.transport_stream_loop_length;t.position>>3{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(7786);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};for(n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.transport_stream_id=t.uimsbf(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),n.programs=[];t.position>>3<3+n.section_length-4;){let a={};a.program_number=t.uimsbf(16),t.next(3),a.program_number===0?a.network_PID=t.uimsbf(13):a.program_map_PID=t.uimsbf(13),n.programs.push(a)}return n.CRC_32=t.readBytes(4),n}encode(t){let n,a=new i.default(this.buffer);return a.uimsbf(8,t.table_id),a.bslbf(1,t.section_syntax_indicator),a.bslbf(1,0),a.bslbf(2,3),a.next(12),a.uimsbf(16,t.transport_stream_id),a.bslbf(2,3),a.uimsbf(5,t.version_number),a.bslbf(1,t.current_next_indicator),a.uimsbf(8,t.section_number),a.uimsbf(8,t.last_section_number),t.programs.forEach(o=>{a.uimsbf(16,o.program_number),a.bslbf(3,0),o.program_number===0?a.uimsbf(13,o.network_PID):a.uimsbf(13,o.program_map_PID)}),n=a.position>>3,a.position=12,a.uimsbf(12,n-3+4),a.position=n<<3,n=a.position>>3,a.writeBytes(4,p.calcToBuffer(this.buffer.slice(0,n))),this.buffer.slice(0,n+4)}}},2145:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};for(n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.program_number=t.uimsbf(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),t.next(3),n.PCR_PID=t.uimsbf(13),t.next(4),n.program_info_length=t.uimsbf(12),n.program_info=new i.default(t.readBytesRaw(n.program_info_length)).decode(),n.streams=[];t.position>>3<3+n.section_length-4;){let a={};a.stream_type=t.uimsbf(8),t.next(3),a.elementary_PID=t.uimsbf(13),t.next(4),a.ES_info_length=t.uimsbf(12),a.ES_info=new i.default(t.readBytesRaw(a.ES_info_length)).decode(),n.streams.push(a)}return n.CRC_32=t.readBytes(4),n}}},4838:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};for(n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.transport_stream_id=t.uimsbf(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),n.original_network_id=t.uimsbf(16),t.next(8),n.services=[];t.position>>3<3+n.section_length-4;){let a={};a.service_id=t.uimsbf(16),t.next(3),a.EIT_user_defined_flags=t.bslbf(3),a.EIT_schedule_flag=t.bslbf(1),a.EIT_present_following_flag=t.bslbf(1),a.running_status=t.uimsbf(3),a.free_CA_mode=t.bslbf(1),a.descriptors_loop_length=t.uimsbf(12),a.descriptors=new i.default(t.readBytesRaw(a.descriptors_loop_length)).decode(),n.services.push(a)}return n.CRC_32=t.readBytes(4),n}}},888:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.table_id_ext=t.uimsbf(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),n.transport_stream_id=t.uimsbf(16),n.original_network_id=t.uimsbf(16),n.service_id=t.uimsbf(16),n.num_of_contents=t.uimsbf(8),n.contents=[];for(let a=0;a>3)+o.schedule_description_length;t.position>>3{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};for(n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),t.next(16),t.next(2),n.version_number=t.uimsbf(5),n.current_next_indicator=t.bslbf(1),n.section_number=t.uimsbf(8),n.last_section_number=t.uimsbf(8),t.next(4),n.transmission_info_loop_length=t.uimsbf(12),n.transmission_info=new i.default(t.readBytesRaw(n.transmission_info_loop_length)).decode(),n.services=[];t.position>>3<3+n.section_length-4;){let a={};a.service_id=t.uimsbf(16),t.next(1),a.running_status=t.bslbf(3),a.service_loop_length=t.uimsbf(12),a.service=new i.default(t.readBytesRaw(a.service_loop_length)).decode(),n.services.push(a)}return n.CRC_32=t.readBytes(4),n}}},7347:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8946);l.default=class{constructor(r){we(this,"buffer");this.buffer=r}decode(){let r=new p.default(this.buffer),i={};return i._raw=this.buffer,i.table_id=r.uimsbf(8),i.section_syntax_indicator=r.bslbf(1),r.next(1),r.next(2),i.section_length=r.uimsbf(12),i.JST_time=r.readBytes(5),i}}},2392:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(3170),r=c(8946),i=c(1241);l.default=class{constructor(t){we(this,"buffer");this.buffer=t}decode(){if(p.calc(this.buffer)!==0)return null;let t=new r.default(this.buffer),n={};return n._raw=this.buffer,n.table_id=t.uimsbf(8),n.section_syntax_indicator=t.bslbf(1),t.next(1),t.next(2),n.section_length=t.uimsbf(12),n.JST_time=t.readBytes(5),t.next(4),n.descriptors_loop_length=t.uimsbf(12),n.descriptors=new i.default(t.readBytesRaw(n.descriptors_loop_length)).decode(),n.CRC_32=t.readBytes(4),n}}},5915:(y,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0});const p=c(8764),r=c(4018),i=c(2172),t=c(3580),n=c(9685),a=c(1481);function o(w,C){return C.every(D=>!!w.has(D)&&(w=w.get(D),!0))}function d(w,C){return C.forEach((D,R)=>{w.has(D)||w.set(D,R===C.length-1?{}:new Map),w=w.get(D)}),w}function g(w,C){return C.every((D,R)=>!!w.has(D)&&(R===C.length-1?w.delete(D):w=w.get(D),!0))}function m(w,C){return(Object.keys(w).length===0||C.version_number!==w.version_number)&&(w.version_number=C.version_number,w.last_section_number=C.last_section_number,w.sections=new Set,!0)}function v(w,C){return!w.sections.has(C.section_number)&&(w.sections.add(C.section_number),!0)}function b(w){return w.sections.size===w.last_section_number+1}l.default=class{constructor(){we(this,"download_data_ids");we(this,"download_ids");we(this,"epg");we(this,"logo_id_refs");we(this,"logo_ids");we(this,"original_network_id");we(this,"service_ids");we(this,"services");we(this,"time");we(this,"transport_stream_id");we(this,"transport_streams");we(this,"versions");this.reset()}reset(){this.original_network_id=-1,this.transport_stream_id=-1,this.service_ids=null,this.transport_streams=new Map,this.services=new Map,this.epg=new t.default,this.time=null,this.download_data_ids=new Map,this.download_ids=new Map,this.logo_ids=new Map,this.logo_id_refs=new Map,this.versions={pat:new Map,cat:new Map,pmt:new Map,dsmcc:new Map,nit:new Map,sdt:new Map,bat:new Map,sdtt:new Map,cdt:new Map}}addPat(w,C){if(w!==0||C.table_id!==0||C.current_next_indicator===0)return!1;let D=d(this.versions.pat,[C.table_id]),R=m(D,C);if(!v(D,C))return!1;this.service_ids===null&&(this.service_ids={});let T=this.service_ids;return(Object.keys(T).length===0||R)&&(T.content=new Set,T.flag=!1),C.programs.forEach(P=>{P.program_number!==0&&T.content.add(P.program_number)}),b(D)&&(T.flag=!0),!0}addCat(w,C){return w===1&&C.table_id===1&&C.current_next_indicator!==0}addPmt(w,C){return C.table_id===2&&C.current_next_indicator!==0}addDsmcc(w,C){if(C.table_id!==59&&C.table_id!==60)return!1;if(C.current_next_indicator===0)return!0;let D=d(this.versions.dsmcc,[C.table_id,C.table_id_extension]),R=m(D,C);if(!v(D,C))return!1;switch(C.table_id){case 59:{let T=C.message;if(!o(this.download_ids,[T.downloadId]))return!1;let P=d(this.download_ids,[T.downloadId]);(Object.keys(P).length===0||R)&&(P.modules=new Map,P.numberOfModules=T.numberOfModules,P.blockSize=T.blockSize);for(let L of T.modules){let I=d(P.modules,[L.moduleId]);I.blocks=[],I.blockCount=0,I.numberOfBlocks=Math.ceil(L.moduleSize/T.blockSize),I.dataModuleByte=null,I.moduleSize=L.moduleSize,I.moduleVersion=L.moduleVersion,I.type=null,I.name=null,I.info=null,I.flag=!1;for(let x of L.moduleInfo)switch(x.descriptor_tag){case 1:I.type=new r.default(x.text_char);break;case 2:I.name=new r.default(x.text_char);break;case 3:I.info=new r.default(x.text_char)}}break}case 60:{let T=C.message;if(!o(this.download_ids,[T.downloadId]))return!1;let P=d(this.download_ids,[T.downloadId]);if(Object.keys(P).length===0||!o(P.modules,[T.moduleId]))return!1;let L=d(P.modules,[T.moduleId]);if(T.moduleVersion!==L.moduleVersion||L.blocks.hasOwnProperty(T.blockNumber))return!1;if(L.blocks[T.blockNumber]=T.blockDataByte,L.blockCount++,L.blockCount===L.numberOfBlocks){let I=p.Buffer.concat(L.blocks);I.length===L.moduleSize?(L.dataModuleByte=I,L.flag=!0):(L.blocks.length=0,L.blockCount=0)}if(P.modules.every(I=>I.flag)){for(let I of P.modules)switch(I.name){case"LOGO-00":case"LOGO-01":case"LOGO-02":case"LOGO-03":case"LOGO-04":case"LOGO-05":case"CS_LOGO-00":case"CS_LOGO-01":case"CS_LOGO-02":case"CS_LOGO-03":case"CS_LOGO-04":case"CS_LOGO-05":{let x=new a.TsDataModuleLogo(I.dataModuleByte).decode();for(let O of x.logos){let G=new Set;for(let J of O.services)G.add(J.original_network_id),d(this.logo_id_refs,[J.original_network_id,J.transport_stream_id,J.service_id]).logo_id=O.logo_id;if(G.size!==0)for(let J of G){let te=d(this.logo_ids,[J,O.logo_id]);if(Object.keys(te).length!==0&&I.moduleVersion===te.version||(te.content=new Map,te.version=I.moduleVersion,te.flag=!1),te.flag)continue;let le=new n.default(O.data_byte).decode();te.content.set(x.logo_type,le),te.content.size===6&&(te.flag=!0)}}break}}g(this.download_ids,[T.downloadId])}break}}return!0}addNit(w,C){if(w!==16||C.table_id!==64&&C.table_id!==65||C.current_next_indicator===0)return!1;let D=d(this.versions.nit,[C.table_id,C.network_id]),R=m(D,C);if(!v(D,C))return!1;C.table_id===64&&(this.original_network_id=C.network_id);let T=d(this.transport_streams,[C.network_id]);(Object.keys(T).length===0||R)&&(T.content=new Map,T.flag=!1);for(let P of C.transport_streams){let L={};L.transport_stream_id=P.transport_stream_id,L.original_network_id=P.original_network_id,L.services=null,L.satellite_delivery_system=null,L.terrestrial_delivery_system=null;for(let I of P.transport_descriptors)switch(I.descriptor_tag){case 65:L.services={},I.services.forEach(x=>{let O={};O.service_id=x.service_id,O.service_type=x.service_type,L.services[x.service_id]=O});break;case 67:L.satellite_delivery_system={},L.satellite_delivery_system.frequency=I.frequency,L.satellite_delivery_system.orbital_position=I.orbital_position,L.satellite_delivery_system.west_east_flag=I.west_east_flag,L.satellite_delivery_system.polarisation=I.polarisation,L.satellite_delivery_system.modulation=I.modulation,L.satellite_delivery_system.symbol_rate=I.symbol_rate,L.satellite_delivery_system.FEC_inner=I.FEC_inner;break;case 250:L.terrestrial_delivery_system={},L.terrestrial_delivery_system.area_code=I.area_code,L.terrestrial_delivery_system.guard_interval=I.guard_interval,L.terrestrial_delivery_system.transmission_mode=I.transmission_mode,L.terrestrial_delivery_system.frequencies=I.frequencies}T.content.set(P.transport_stream_id,L)}return b(D)&&(T.flag=!0),!0}addSdt(w,C){if(w!==17||C.table_id!==66&&C.table_id!==70||C.current_next_indicator===0)return!1;let D=d(this.versions.sdt,[C.table_id,C.original_network_id,C.transport_stream_id]),R=m(D,C);if(!v(D,C))return!1;C.table_id===66&&(this.transport_stream_id=C.transport_stream_id);let T=d(this.services,[C.original_network_id,C.transport_stream_id]);(Object.keys(T).length===0||R)&&(T.content=new Map,T.flag=!1);for(let P of C.services){let L={};L.service_id=P.service_id,L.running_status=P.running_status,L.free_CA_mode=P.free_CA_mode,L.service=null;for(let I of P.descriptors)switch(I.descriptor_tag){case 72:L.service={},L.service.service_type=I.service_type,L.service.service_provider_name=new r.default(I.service_provider_name_char).decode(),L.service.service_name=new r.default(I.service_name_char).decode();break;case 207:if(L.logo_transmission={},L.logo_transmission.logo_transmission_type=I.logo_transmission_type,I.logo_transmission_type===1?(L.logo_transmission.logo_id=I.logo_id,L.logo_transmission.logo_version=I.logo_version,L.logo_transmission.download_data_id=I.download_data_id):I.logo_transmission_type===2?L.logo_transmission.logo_id=I.logo_id:I.logo_transmission_type===3&&(L.logo_transmission.logo_char=I.logo_char),I.logo_transmission_type<3&&(d(this.logo_id_refs,[C.original_network_id,C.transport_stream_id,P.service_id]).logo_id=I.logo_id,I.logo_transmission_type===1)){let x=d(this.download_data_ids,[C.original_network_id,I.download_data_id]);Object.keys(x).length===0&&(x.flag=!1)}}T.content.set(P.service_id,L)}return b(D)&&(T.flag=!0),!0}addBat(w,C){return w===17&&C.table_id===74&&(C.current_next_indicator,!0)}addEit(w,C){return this.epg.addEit(w,C,this.time)}addTdt(w,C){return w===20&&C.table_id===112&&(this.time=new i.default(C.JST_time).decode(),!0)}addTot(w,C){return w===20&&C.table_id===115&&(this.time=new i.default(C.JST_time).decode(),!0)}addSdtt(w,C){if(w!==35&&w!==40||C.table_id!==195||C.table_id_ext>>8!=255||C.current_next_indicator===0)return!1;let D=d(this.versions.sdtt,[C.table_id,C.table_id_ext]);if(m(D,C),!v(D,C))return!1;for(let R of C.contents)for(let T of R.descriptors)T.descriptor_tag===201&&d(this.download_ids,[T.download_id]);return!0}addCdt(w,C){if(w!==41||C.table_id!==200||C.current_next_indicator===0)return!1;let D=d(this.versions.cdt,[C.table_id,C.original_network_id,C.download_data_id]);if(m(D,C),!v(D,C)||!o(this.download_data_ids,[C.original_network_id,C.download_data_id]))return!1;switch(C.data_type){case 1:{let R=new a.TsDataModuleCdtLogo(C.data_module_byte).decode(),T=d(this.logo_ids,[C.original_network_id,R.logo_id]);if(Object.keys(T).length!==0&&R.logo_version===T.version||(T.content=new Map,T.version=R.logo_version,T.flag=!1),T.flag)return!1;let P=new n.default(R.data_byte).decode();T.content.set(R.logo_type,P),T.content.size===6&&(T.flag=!0);break}}return b(D)&&g(this.download_data_ids,[C.original_network_id,C.download_data_id]),!0}hasTransportStreams(w){return w=w||this.original_network_id,!!o(this.transport_streams,[w])&&!!d(this.transport_streams,[w]).flag}hasServices(w,C){return w=w||this.original_network_id,C=C||this.transport_stream_id,!!o(this.services,[w,C])&&!!d(this.services,[w,C]).flag}hasOriginalNetworkId(){return this.original_network_id!==-1}hasTransportStreamId(){return this.transport_stream_id!==-1}hasServiceIds(){return this.service_ids!==null&&!!this.service_ids.flag}hasPresent(w,C,D){return this.epg.hasPresent(w,C,D)}hasFollowing(w,C,D){return this.epg.hasFollowing(w,C,D)}hasSchedule(){return this.epg.hasSchedule()}hasTime(){return this.time!==null}hasLogoId(w,C,D){return o(this.logo_id_refs,[w,C,D])}hasLogo(w,C){return!!o(this.logo_ids,[C,w])&&!!d(this.logo_ids,[C,w]).flag}getTransportStreams(w){if(w=w||this.original_network_id,!o(this.transport_streams,[w]))return null;let C=d(this.transport_streams,[w]),D={};for(let R of C.content)D[R[0]]=R[1];return D}getServices(w,C){if(w=w||this.original_network_id,C=C||this.transport_stream_id,!o(this.services,[w,C]))return null;let D=d(this.services,[w,C]),R={};for(let T of D.content)R[T[0]]=T[1];return R}getOriginalNetworkId(){return this.original_network_id}getTransportStreamId(){return this.transport_stream_id}getServiceIds(){return this.service_ids===null?null:Array.from(this.service_ids.content)}getPresent(w,C,D){return this.epg.getPresent(w,C,D)}getFollowing(w,C,D){return this.epg.getFollowing(w,C,D)}getSchedule(){return this.epg.getSchedule()}getScheduleAmount(){return this.epg.getScheduleAmount()}getTime(){return this.time===null?null:new Date(this.time.getTime())}getLogoId(w,C,D){return o(this.logo_id_refs,[w,C,D])?d(this.logo_id_refs,[w,C,D]).logo_id:null}getLogo(w,C){if(!o(this.logo_ids,[C,w]))return null;let D=d(this.logo_ids,[C,w]),R={};for(let T of D.content)R[T[0]]=T[1];return R}}},7786:(y,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.default=class{constructor(c,p=0){we(this,"buffer");we(this,"position");this.buffer=c,this.position=p}writeBits(c,p){if(this.position+c>this.buffer.length<<3)this.position+=c;else for(;c>0;){let r=this.position>>3,i=7&this.position^7;this.buffer[r]=this.buffer[r]&~(1<>c-1&1)<this.buffer.length<<3)return void(this.position+=c);let r=this.position>>3;this.position+=c<<3,p.copy(this.buffer,r,0,c)}next(c){this.position+=c}previous(c){this.position-=c}bslbf(c,p){this.writeBits(c,p)}uimsbf(c,p){this.writeBits(c,p)}tcimsbf(c,p){this.writeBits(c,p>>>31<{const{AbortController:l,AbortSignal:c}=typeof self<"u"?self:typeof window<"u"?window:void 0;y.exports=l,y.exports.AbortSignal=c,y.exports.default=l},1918:function(y){y.exports=function(){var l={9798:function(r,i,t){t.r(i),t.d(i,{CanvasProvider:function(){return j},CanvasRenderer:function(){return ue},HTMLProvider:function(){return At},HTMLRenderer:function(){return it},SVGProvider:function(){return Ue},SVGRenderer:function(){return ut}}),t(2526),t(1817),t(2222),t(6992),t(7042),t(5212),t(9575),t(9653),t(5192),t(4363),t(9494),t(1539),t(9714),t(2472),t(2990),t(8927),t(3105),t(5035),t(4345),t(7174),t(2846),t(4731),t(7209),t(6319),t(8867),t(7789),t(3739),t(9368),t(4483),t(2056),t(3462),t(678),t(7462),t(3824),t(5021),t(2974),t(5016),t(3290),t(6699),t(1532),t(9720),t(4916),t(2023),t(8783),t(3112),t(5306),t(3948);var n=new Map([[0,{bytes:2,alphabet:0}],[1,{bytes:1,alphabet:1}],[2,{bytes:1,alphabet:2}],[3,{bytes:1,alphabet:3}],[4,{bytes:1,alphabet:4}],[5,{bytes:1,alphabet:5}],[6,{bytes:1,alphabet:6}],[7,{bytes:1,alphabet:7}],[8,{bytes:1,alphabet:8}],[9,{bytes:1,alphabet:9}],[10,{bytes:1,alphabet:10}],[11,{bytes:1,alphabet:11}],[12,{bytes:2,alphabet:12}],[13,{bytes:2,alphabet:13}],[14,{bytes:2,alphabet:14}]]),a=new Map([[66,{bytes:2,alphabet:0}],[74,{bytes:1,alphabet:1}],[48,{bytes:1,alphabet:2}],[49,{bytes:1,alphabet:3}],[50,{bytes:1,alphabet:4}],[51,{bytes:1,alphabet:5}],[52,{bytes:1,alphabet:6}],[53,{bytes:1,alphabet:7}],[54,{bytes:1,alphabet:8}],[55,{bytes:1,alphabet:9}],[56,{bytes:1,alphabet:10}],[73,{bytes:1,alphabet:11}],[57,{bytes:2,alphabet:12}],[58,{bytes:2,alphabet:13}],[59,{bytes:2,alphabet:14}]]),o=new Map([[15,{bytes:2,alphabet:15}],[16,{bytes:1,alphabet:16}],[17,{bytes:1,alphabet:17}],[18,{bytes:1,alphabet:18}],[19,{bytes:1,alphabet:19}],[20,{bytes:1,alphabet:20}],[21,{bytes:1,alphabet:21}],[22,{bytes:1,alphabet:22}],[23,{bytes:1,alphabet:23}],[24,{bytes:1,alphabet:24}],[25,{bytes:1,alphabet:25}],[26,{bytes:1,alphabet:26}],[27,{bytes:1,alphabet:27}],[28,{bytes:1,alphabet:28}],[29,{bytes:1,alphabet:29}],[30,{bytes:1,alphabet:30}],[31,{bytes:1,alphabet:31}]]),d=new Map([[64,{bytes:2,alphabet:15}],[65,{bytes:1,alphabet:16}],[66,{bytes:1,alphabet:17}],[67,{bytes:1,alphabet:18}],[68,{bytes:1,alphabet:19}],[69,{bytes:1,alphabet:20}],[70,{bytes:1,alphabet:21}],[71,{bytes:1,alphabet:22}],[72,{bytes:1,alphabet:23}],[73,{bytes:1,alphabet:24}],[74,{bytes:1,alphabet:25}],[75,{bytes:1,alphabet:26}],[76,{bytes:1,alphabet:27}],[77,{bytes:1,alphabet:28}],[78,{bytes:1,alphabet:29}],[79,{bytes:1,alphabet:30}],[112,{bytes:1,alphabet:31}]]),g=[["#000000FF","#FF0000FF","#00FF00FF","#FFFF00FF","#0000FFFF","#FF00FFFF","#00FFFFFF","#FFFFFFFF","#00000000","#AA0000FF","#00AA00FF","#AAAA00FF","#0000AAFF","#AA00AAFF","#00AAAAFF","#AAAAAAFF"],["#000055FF","#005500FF","#005555FF","#0055AAFF","#0055FFFF","#00AA55FF","#00AAFFFF","#00FF55FF","#00FFAAFF","#550000FF","#550055FF","#5500AAFF","#5500FFFF","#555500FF","#555555FF","#5555AAFF"],["#5555FFFF","#55AA00FF","#55AA55FF","#55AAAAFF","#55AAFFFF","#55FF00FF","#55FF55FF","#55FFAAFF","#55FFFFFF","#AA0055FF","#AA00FFFF","#AA5500FF","#AA5555FF","#AA55AAFF","#AA55FFFF","#AAAA55FF"],["#AAAAFFFF","#AAFF00FF","#AAFF55FF","#AAFFAAFF","#AAFFFFFF","#FF0055FF","#FF00AAFF","#FF5500FF","#FF5555FF","#FF55AAFF","#FF55FFFF","#FFAA00FF","#FFAA55FF","#FFAAAAFF","#FFAAFFFF","#FFFF55FF"],["#FFFFAAFF","#00000080","#FF000080","#00FF0080","#FFFF0080","#0000FF80","#FF00FF80","#00FFFF80","#FFFFFF80","#AA000080","#00AA0080","#AAAA0080","#0000AA80","#AA00AA80","#00AAAA80","#AAAAAA80"],["#00005580","#00550080","#00555580","#0055AA80","#0055FF80","#00AA5580","#00AAFF80","#00FF5580","#00FFAA80","#55000080","#55005580","#5500AA80","#5500FF80","#55550080","#55555580","#5555AA80"],["#5555FF80","#55AA0080","#55AA5580","#55AAAA80","#55AAFF80","#55FF0080","#55FF5580","#55FFAA80","#55FFFF80","#AA005580","#AA00FF80","#AA550080","#AA555580","#AA55AA80","#AA55FF80","#AAAA5580"],["#AAAAFF80","#AAFF0080","#AAFF5580","#AAFFAA80","#AAFFFF80","#FF005580","#FF00AA80","#FF550080","#FF555580","#FF55AA80","#FF55FF80","#FFAA0080","#FFAA5580","#FFAAAA80","#FFAAFF80","#FFFF5580"]],m=[" ","、","。",",",".","・",":",";","?","!","゛","゜","´","`","¨","^"," ̄","_","ヽ","ヾ","ゝ","ゞ","〃","仝","々","〆","〇","ー","―","‐","/","\","〜","‖","|","…","‥","‘","’","“","”","(",")","〔","〕","[","]","{","}","〈","〉","《","》","「","」","『","』","【","】","+","−","±","×","÷","=","≠","<",">","≦","≧","∞","∴","♂","♀","°","′","″","℃","¥","$","¢","£","%","#","&","*","@","§","☆","★","○","●","◎","◇","◆","□","■","△","▲","▽","▼","※","〒","→","←","↑","↓","〓","'",""","-","~","〳","〴","〵","〻","〼","ヿ","ゟ","∈","∋","⊆","⊇","⊂","⊃","∪","∩","⊄","⊅","⊊","⊋","∉","∅","⌅","⌆","∧","∨","¬","⇒","⇔","∀","∃","⊕","⊖","⊗","∥","∦","⦅","⦆","〘","〙","〖","〗","∠","⊥","⌒","∂","∇","≡","≒","≪","≫","√","∽","∝","∵","∫","∬","≢","≃","≅","≈","≶","≷","↔","Å","‰","♯","♭","♪","†","‡","¶","♮","♫","♬","♩","◯","▷","▶","◁","◀","↗","↘","↖","↙","⇄","⇨","⇦","⇧","⇩","⤴","⤵","0","1","2","3","4","5","6","7","8","9","⦿","◉","〽","﹆","﹅","◦","•","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","∓","ℵ","ℏ","㏋","ℓ","℧","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","゠","–","⧺","⧻","ぁ","あ","ぃ","い","ぅ","う","ぇ","え","ぉ","お","か","が","き","ぎ","く","ぐ","け","げ","こ","ご","さ","ざ","し","じ","す","ず","せ","ぜ","そ","ぞ","た","だ","ち","ぢ","っ","つ","づ","て","で","と","ど","な","に","ぬ","ね","の","は","ば","ぱ","ひ","び","ぴ","ふ","ぶ","ぷ","へ","べ","ぺ","ほ","ぼ","ぽ","ま","み","む","め","も","ゃ","や","ゅ","ゆ","ょ","よ","ら","り","る","れ","ろ","ゎ","わ","ゐ","ゑ","を","ん","ゔ","ゕ","ゖ","か゚","き゚","く゚","け゚","こ゚","","","","ァ","ア","ィ","イ","ゥ","ウ","ェ","エ","ォ","オ","カ","ガ","キ","ギ","ク","グ","ケ","ゲ","コ","ゴ","サ","ザ","シ","ジ","ス","ズ","セ","ゼ","ソ","ゾ","タ","ダ","チ","ヂ","ッ","ツ","ヅ","テ","デ","ト","ド","ナ","ニ","ヌ","ネ","ノ","ハ","バ","パ","ヒ","ビ","ピ","フ","ブ","プ","ヘ","ベ","ペ","ホ","ボ","ポ","マ","ミ","ム","メ","モ","ャ","ヤ","ュ","ユ","ョ","ヨ","ラ","リ","ル","レ","ロ","ヮ","ワ","ヰ","ヱ","ヲ","ン","ヴ","ヵ","ヶ","カ゚","キ゚","ク゚","ケ゚","コ゚","セ゚","ツ゚","ト゚","Α","Β","Γ","Δ","Ε","Ζ","Η","Θ","Ι","Κ","Λ","Μ","Ν","Ξ","Ο","Π","Ρ","Σ","Τ","Υ","Φ","Χ","Ψ","Ω","♤","♠","♢","♦","♡","♥","♧","♣","α","β","γ","δ","ε","ζ","η","θ","ι","κ","λ","μ","ν","ξ","ο","π","ρ","σ","τ","υ","φ","χ","ψ","ω","ς","⓵","⓶","⓷","⓸","⓹","⓺","⓻","⓼","⓽","⓾","☖","☗","〠","☎","☀","☁","☂","☃","♨","▱","ㇰ","ㇱ","ㇲ","ㇳ","ㇴ","ㇵ","ㇶ","ㇷ","ㇸ","ㇹ","ㇷ゚","ㇺ","ㇻ","ㇼ","ㇽ","ㇾ","ㇿ","А","Б","В","Г","Д","Е","Ё","Ж","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ч","Ш","Щ","Ъ","Ы","Ь","Э","Ю","Я","⎾","⎿","⏀","⏁","⏂","⏃","⏄","⏅","⏆","⏇","⏈","⏉","⏊","⏋","⏌","а","б","в","г","д","е","ё","ж","з","и","й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ч","ш","щ","ъ","ы","ь","э","ю","я","ヷ","ヸ","ヹ","ヺ","⋚","⋛","⅓","⅔","⅕","✓","⌘","␣","⏎","─","│","┌","┐","┘","└","├","┬","┤","┴","┼","━","┃","┏","┓","┛","┗","┣","┳","┫","┻","╋","┠","┯","┨","┷","┿","┝","┰","┥","┸","╂","㉑","㉒","㉓","㉔","㉕","㉖","㉗","㉘","㉙","㉚","㉛","㉜","㉝","㉞","㉟","㊱","㊲","㊳","㊴","㊵","㊶","㊷","㊸","㊹","㊺","㊻","㊼","㊽","㊾","㊿","","","","","","","","","◐","◑","◒","◓","‼","⁇","⁈","⁉","Ǎ","ǎ","ǐ","Ḿ","ḿ","Ǹ","ǹ","Ǒ","ǒ","ǔ","ǖ","ǘ","ǚ","ǜ","","","€"," ","¡","¤","¦","©","ª","«","­","®","¯","²","³","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","ø","ù","ú","û","ü","ý","þ","ÿ","Ā","Ī","Ū","Ē","Ō","ā","ī","ū","ē","ō","Ą","˘","Ł","Ľ","Ś","Š","Ş","Ť","Ź","Ž","Ż","ą","˛","ł","ľ","ś","ˇ","š","ş","ť","ź","˝","ž","ż","Ŕ","Ă","Ĺ","Ć","Č","Ę","Ě","Ď","Ń","Ň","Ő","Ř","Ů","Ű","Ţ","ŕ","ă","ĺ","ć","č","ę","ě","ď","đ","ń","ň","ő","ř","ů","ű","ţ","˙","Ĉ","Ĝ","Ĥ","Ĵ","Ŝ","Ŭ","ĉ","ĝ","ĥ","ĵ","ŝ","ŭ","ɱ","ʋ","ɾ","ʃ","ʒ","ɬ","ɮ","ɹ","ʈ","ɖ","ɳ","ɽ","ʂ","ʐ","ɻ","ɭ","ɟ","ɲ","ʝ","ʎ","ɡ","ŋ","ɰ","ʁ","ħ","ʕ","ʔ","ɦ","ʘ","ǂ","ɓ","ɗ","ʄ","ɠ","Ɠ","œ","Œ","ɨ","ʉ","ɘ","ɵ","ə","ɜ","ɞ","ɐ","ɯ","ʊ","ɤ","ʌ","ɔ","ɑ","ɒ","ʍ","ɥ","ʢ","ʡ","ɕ","ʑ","ɺ","ɧ","ɚ","æ̀","ǽ","ὰ","ά","ɔ̀","ɔ́","ʌ̀","ʌ́","ə̀","ə́","ɚ̀","ɚ́","ὲ","έ","͡","ˈ","ˌ","ː","ˑ","̆","‿","̋","́","̄","̀","̏","̌","̂","˥","˦","˧","˨","˩","˩˥","˥˩","̥","̬","̹","̜","̟","̠","̈","̽","̩","̯","˞","̤","̰","̼","̴","̝","̞","̘","̙","̪","̺","̻","̃","̚","❶","❷","❸","❹","❺","❻","❼","❽","❾","❿","⓫","⓬","⓭","⓮","⓯","⓰","⓱","⓲","⓳","⓴","ⅰ","ⅱ","ⅲ","ⅳ","ⅴ","ⅵ","ⅶ","ⅷ","ⅸ","ⅹ","ⅺ","ⅻ","ⓐ","ⓑ","ⓒ","ⓓ","ⓔ","ⓕ","ⓖ","ⓗ","ⓘ","ⓙ","ⓚ","ⓛ","ⓜ","ⓝ","ⓞ","ⓟ","ⓠ","ⓡ","ⓢ","ⓣ","ⓤ","ⓥ","ⓦ","ⓧ","ⓨ","ⓩ","㋐","㋑","㋒","㋓","㋔","㋕","㋖","㋗","㋘","㋙","㋚","㋛","㋜","㋝","㋞","㋟","㋠","㋡","㋢","㋣","㋺","㋩","㋥","㋭","㋬","","","","","","","","","","⁑","⁂","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","㍉","㌔","㌢","㍍","㌘","㌧","㌃","㌶","㍑","㍗","㌍","㌦","㌣","㌫","㍊","㌻","㎜","㎝","㎞","㎎","㎏","㏄","㎡","Ⅻ","","","","","","","","㍻","〝","〟","№","㏍","℡","㊤","㊥","㊦","㊧","㊨","㈱","㈲","㈹","㍾","㍽","㍼","","","","∮","","","","","∟","⊿","","","","❖","☞","俱","𠀋","㐂","丨","丯","丰","亍","仡","份","仿","伃","伋","你","佈","佉","佖","佟","佪","佬","佾","侊","侔","侗","侮","俉","俠","倁","倂","倎","倘","倧","倮","偀","倻","偁","傔","僌","僲","僐","僦","僧","儆","儃","儋","儞","儵","兊","免","兕","兗","㒵","冝","凃","凊","凞","凢","凮","刁","㓛","刓","刕","剉","剗","剡","劓","勈","勉","勌","勐","勖","勛","勤","勰","勻","匀","匇","匜","卑","卡","卣","卽","厓","厝","厲","吒","吧","呍","咜","呫","呴","呿","咈","咖","咡","咩","哆","哿","唎","唫","唵","啐","啞","喁","喆","喎","喝","喭","嗎","嘆","嘈","嘎","嘻","噉","噶","噦","器","噯","噱","噲","嚙","嚞","嚩","嚬","嚳","囉","囊","圊","𡈽","圡","圯","圳","圴","坰","坷","坼","垜","﨏","𡌛","垸","埇","埈","埏","埤","埭","埵","埶","埿","堉","塚","塡","塤","塀","塼","墉","增","墨","墩","𡑮","壒","壎","壔","壚","壠","壩","夌","虁","奝","奭","妋","妒","妤","姃","姒","姝","娓","娣","婧","婭","婷","婾","媄","媞","媧","嫄","𡢽","嬙","嬥","剝","亜","唖","娃","阿","哀","愛","挨","姶","逢","葵","茜","穐","悪","握","渥","旭","葦","芦","鯵","梓","圧","斡","扱","宛","姐","虻","飴","絢","綾","鮎","或","粟","袷","安","庵","按","暗","案","闇","鞍","杏","以","伊","位","依","偉","囲","夷","委","威","尉","惟","意","慰","易","椅","為","畏","異","移","維","緯","胃","萎","衣","謂","違","遺","医","井","亥","域","育","郁","磯","一","壱","溢","逸","稲","茨","芋","鰯","允","印","咽","員","因","姻","引","飲","淫","胤","蔭","院","陰","隠","韻","吋","右","宇","烏","羽","迂","雨","卯","鵜","窺","丑","碓","臼","渦","嘘","唄","欝","蔚","鰻","姥","厩","浦","瓜","閏","噂","云","運","雲","荏","餌","叡","営","嬰","影","映","曳","栄","永","泳","洩","瑛","盈","穎","頴","英","衛","詠","鋭","液","疫","益","駅","悦","謁","越","閲","榎","厭","円","園","堰","奄","宴","延","怨","掩","援","沿","演","炎","焔","煙","燕","猿","縁","艶","苑","薗","遠","鉛","鴛","塩","於","汚","甥","凹","央","奥","往","応","押","旺","横","欧","殴","王","翁","襖","鴬","鴎","黄","岡","沖","荻","億","屋","憶","臆","桶","牡","乙","俺","卸","恩","温","穏","音","下","化","仮","何","伽","価","佳","加","可","嘉","夏","嫁","家","寡","科","暇","果","架","歌","河","火","珂","禍","禾","稼","箇","花","苛","茄","荷","華","菓","蝦","課","嘩","貨","迦","過","霞","蚊","俄","峨","我","牙","画","臥","芽","蛾","賀","雅","餓","駕","介","会","解","回","塊","壊","廻","快","怪","悔","恢","懐","戒","拐","改","魁","晦","械","海","灰","界","皆","絵","芥","蟹","開","階","貝","凱","劾","外","咳","害","崖","慨","概","涯","碍","蓋","街","該","鎧","骸","浬","馨","蛙","垣","柿","蛎","鈎","劃","嚇","各","廓","拡","撹","格","核","殻","獲","確","穫","覚","角","赫","較","郭","閣","隔","革","学","岳","楽","額","顎","掛","笠","樫","橿","梶","鰍","潟","割","喝","恰","括","活","渇","滑","葛","褐","轄","且","鰹","叶","椛","樺","鞄","株","兜","竃","蒲","釜","鎌","噛","鴨","栢","茅","萱","粥","刈","苅","瓦","乾","侃","冠","寒","刊","勘","勧","巻","喚","堪","姦","完","官","寛","干","幹","患","感","慣","憾","換","敢","柑","桓","棺","款","歓","汗","漢","澗","潅","環","甘","監","看","竿","管","簡","緩","缶","翰","肝","艦","莞","観","諌","貫","還","鑑","間","閑","関","陥","韓","館","舘","丸","含","岸","巌","玩","癌","眼","岩","翫","贋","雁","頑","顔","願","企","伎","危","喜","器","基","奇","嬉","寄","岐","希","幾","忌","揮","机","旗","既","期","棋","棄","機","帰","毅","気","汽","畿","祈","季","稀","紀","徽","規","記","貴","起","軌","輝","飢","騎","鬼","亀","偽","儀","妓","宜","戯","技","擬","欺","犠","疑","祇","義","蟻","誼","議","掬","菊","鞠","吉","吃","喫","桔","橘","詰","砧","杵","黍","却","客","脚","虐","逆","丘","久","仇","休","及","吸","宮","弓","急","救","朽","求","汲","泣","灸","球","究","窮","笈","級","糾","給","旧","牛","去","居","巨","拒","拠","挙","渠","虚","許","距","鋸","漁","禦","魚","亨","享","京","供","侠","僑","兇","競","共","凶","協","匡","卿","叫","喬","境","峡","強","彊","怯","恐","恭","挟","教","橋","況","狂","狭","矯","胸","脅","興","蕎","郷","鏡","響","饗","驚","仰","凝","尭","暁","業","局","曲","極","玉","桐","粁","僅","勤","均","巾","錦","斤","欣","欽","琴","禁","禽","筋","緊","芹","菌","衿","襟","謹","近","金","吟","銀","九","倶","句","区","狗","玖","矩","苦","躯","駆","駈","駒","具","愚","虞","喰","空","偶","寓","遇","隅","串","櫛","釧","屑","屈","掘","窟","沓","靴","轡","窪","熊","隈","粂","栗","繰","桑","鍬","勲","君","薫","訓","群","軍","郡","卦","袈","祁","係","傾","刑","兄","啓","圭","珪","型","契","形","径","恵","慶","慧","憩","掲","携","敬","景","桂","渓","畦","稽","系","経","継","繋","罫","茎","荊","蛍","計","詣","警","軽","頚","鶏","芸","迎","鯨","劇","戟","撃","激","隙","桁","傑","欠","決","潔","穴","結","血","訣","月","件","倹","倦","健","兼","券","剣","喧","圏","堅","嫌","建","憲","懸","拳","捲","検","権","牽","犬","献","研","硯","絹","県","肩","見","謙","賢","軒","遣","鍵","険","顕","験","鹸","元","原","厳","幻","弦","減","源","玄","現","絃","舷","言","諺","限","乎","個","古","呼","固","姑","孤","己","庫","弧","戸","故","枯","湖","狐","糊","袴","股","胡","菰","虎","誇","跨","鈷","雇","顧","鼓","五","互","伍","午","呉","吾","娯","後","御","悟","梧","檎","瑚","碁","語","誤","護","醐","乞","鯉","交","佼","侯","候","倖","光","公","功","効","勾","厚","口","向","后","喉","坑","垢","好","孔","孝","宏","工","巧","巷","幸","広","庚","康","弘","恒","慌","抗","拘","控","攻","昂","晃","更","杭","校","梗","構","江","洪","浩","港","溝","甲","皇","硬","稿","糠","紅","紘","絞","綱","耕","考","肯","肱","腔","膏","航","荒","行","衡","講","貢","購","郊","酵","鉱","砿","鋼","閤","降","項","香","高","鴻","剛","劫","号","合","壕","拷","濠","豪","轟","麹","克","刻","告","国","穀","酷","鵠","黒","獄","漉","腰","甑","忽","惚","骨","狛","込","此","頃","今","困","坤","墾","婚","恨","懇","昏","昆","根","梱","混","痕","紺","艮","魂","些","佐","叉","唆","嵯","左","差","査","沙","瑳","砂","詐","鎖","裟","坐","座","挫","債","催","再","最","哉","塞","妻","宰","彩","才","採","栽","歳","済","災","采","犀","砕","砦","祭","斎","細","菜","裁","載","際","剤","在","材","罪","財","冴","坂","阪","堺","榊","肴","咲","崎","埼","碕","鷺","作","削","咋","搾","昨","朔","柵","窄","策","索","錯","桜","鮭","笹","匙","冊","刷","察","拶","撮","擦","札","殺","薩","雑","皐","鯖","捌","錆","鮫","皿","晒","三","傘","参","山","惨","撒","散","桟","燦","珊","産","算","纂","蚕","讃","賛","酸","餐","斬","暫","残","仕","仔","伺","使","刺","司","史","嗣","四","士","始","姉","姿","子","屍","市","師","志","思","指","支","孜","斯","施","旨","枝","止","死","氏","獅","祉","私","糸","紙","紫","肢","脂","至","視","詞","詩","試","誌","諮","資","賜","雌","飼","歯","事","似","侍","児","字","寺","慈","持","時","次","滋","治","爾","璽","痔","磁","示","而","耳","自","蒔","辞","汐","鹿","式","識","鴫","竺","軸","宍","雫","七","叱","執","失","嫉","室","悉","湿","漆","疾","質","実","蔀","篠","偲","柴","芝","屡","蕊","縞","舎","写","射","捨","赦","斜","煮","社","紗","者","謝","車","遮","蛇","邪","借","勺","尺","杓","灼","爵","酌","釈","錫","若","寂","弱","惹","主","取","守","手","朱","殊","狩","珠","種","腫","趣","酒","首","儒","受","呪","寿","授","樹","綬","需","囚","収","周","宗","就","州","修","愁","拾","洲","秀","秋","終","繍","習","臭","舟","蒐","衆","襲","讐","蹴","輯","週","酋","酬","集","醜","什","住","充","十","従","戎","柔","汁","渋","獣","縦","重","銃","叔","夙","宿","淑","祝","縮","粛","塾","熟","出","術","述","俊","峻","春","瞬","竣","舜","駿","准","循","旬","楯","殉","淳","準","潤","盾","純","巡","遵","醇","順","処","初","所","暑","曙","渚","庶","緒","署","書","薯","藷","諸","助","叙","女","序","徐","恕","鋤","除","傷","償","勝","匠","升","召","哨","商","唱","嘗","奨","妾","娼","宵","将","小","少","尚","庄","床","廠","彰","承","抄","招","掌","捷","昇","昌","昭","晶","松","梢","樟","樵","沼","消","渉","湘","焼","焦","照","症","省","硝","礁","祥","称","章","笑","粧","紹","肖","菖","蒋","蕉","衝","裳","訟","証","詔","詳","象","賞","醤","鉦","鍾","鐘","障","鞘","上","丈","丞","乗","冗","剰","城","場","壌","嬢","常","情","擾","条","杖","浄","状","畳","穣","蒸","譲","醸","錠","嘱","埴","飾","拭","植","殖","燭","織","職","色","触","食","蝕","辱","尻","伸","信","侵","唇","娠","寝","審","心","慎","振","新","晋","森","榛","浸","深","申","疹","真","神","秦","紳","臣","芯","薪","親","診","身","辛","進","針","震","人","仁","刃","塵","壬","尋","甚","尽","腎","訊","迅","陣","靭","笥","諏","須","酢","図","厨","逗","吹","垂","帥","推","水","炊","睡","粋","翠","衰","遂","酔","錐","錘","随","瑞","髄","崇","嵩","数","枢","趨","雛","据","杉","椙","菅","頗","雀","裾","澄","摺","寸","世","瀬","畝","是","凄","制","勢","姓","征","性","成","政","整","星","晴","棲","栖","正","清","牲","生","盛","精","聖","声","製","西","誠","誓","請","逝","醒","青","静","斉","税","脆","隻","席","惜","戚","斥","昔","析","石","積","籍","績","脊","責","赤","跡","蹟","碩","切","拙","接","摂","折","設","窃","節","説","雪","絶","舌","蝉","仙","先","千","占","宣","専","尖","川","戦","扇","撰","栓","栴","泉","浅","洗","染","潜","煎","煽","旋","穿","箭","線","繊","羨","腺","舛","船","薦","詮","賎","践","選","遷","銭","銑","閃","鮮","前","善","漸","然","全","禅","繕","膳","糎","噌","塑","岨","措","曾","曽","楚","狙","疏","疎","礎","祖","租","粗","素","組","蘇","訴","阻","遡","鼠","僧","創","双","叢","倉","喪","壮","奏","爽","宋","層","匝","惣","想","捜","掃","挿","掻","操","早","曹","巣","槍","槽","漕","燥","争","痩","相","窓","糟","総","綜","聡","草","荘","葬","蒼","藻","装","走","送","遭","鎗","霜","騒","像","増","憎","臓","蔵","贈","造","促","側","則","即","息","捉","束","測","足","速","俗","属","賊","族","続","卒","袖","其","揃","存","孫","尊","損","村","遜","他","多","太","汰","詑","唾","堕","妥","惰","打","柁","舵","楕","陀","駄","騨","体","堆","対","耐","岱","帯","待","怠","態","戴","替","泰","滞","胎","腿","苔","袋","貸","退","逮","隊","黛","鯛","代","台","大","第","醍","題","鷹","滝","瀧","卓","啄","宅","托","択","拓","沢","濯","琢","託","鐸","濁","諾","茸","凧","蛸","只","叩","但","達","辰","奪","脱","巽","竪","辿","棚","谷","狸","鱈","樽","誰","丹","単","嘆","坦","担","探","旦","歎","淡","湛","炭","短","端","箪","綻","耽","胆","蛋","誕","鍛","団","壇","弾","断","暖","檀","段","男","談","値","知","地","弛","恥","智","池","痴","稚","置","致","蜘","遅","馳","築","畜","竹","筑","蓄","逐","秩","窒","茶","嫡","着","中","仲","宙","忠","抽","昼","柱","注","虫","衷","註","酎","鋳","駐","樗","瀦","猪","苧","著","貯","丁","兆","凋","喋","寵","帖","帳","庁","弔","張","彫","徴","懲","挑","暢","朝","潮","牒","町","眺","聴","脹","腸","蝶","調","諜","超","跳","銚","長","頂","鳥","勅","捗","直","朕","沈","珍","賃","鎮","陳","津","墜","椎","槌","追","鎚","痛","通","塚","栂","掴","槻","佃","漬","柘","辻","蔦","綴","鍔","椿","潰","坪","壷","嬬","紬","爪","吊","釣","鶴","亭","低","停","偵","剃","貞","呈","堤","定","帝","底","庭","廷","弟","悌","抵","挺","提","梯","汀","碇","禎","程","締","艇","訂","諦","蹄","逓","邸","鄭","釘","鼎","泥","摘","擢","敵","滴","的","笛","適","鏑","溺","哲","徹","撤","轍","迭","鉄","典","填","天","展","店","添","纏","甜","貼","転","顛","点","伝","殿","澱","田","電","兎","吐","堵","塗","妬","屠","徒","斗","杜","渡","登","菟","賭","途","都","鍍","砥","砺","努","度","土","奴","怒","倒","党","冬","凍","刀","唐","塔","塘","套","宕","島","嶋","悼","投","搭","東","桃","梼","棟","盗","淘","湯","涛","灯","燈","当","痘","祷","等","答","筒","糖","統","到","董","蕩","藤","討","謄","豆","踏","逃","透","鐙","陶","頭","騰","闘","働","動","同","堂","導","憧","撞","洞","瞳","童","胴","萄","道","銅","峠","鴇","匿","得","徳","涜","特","督","禿","篤","毒","独","読","栃","橡","凸","突","椴","届","鳶","苫","寅","酉","瀞","噸","屯","惇","敦","沌","豚","遁","頓","呑","曇","鈍","奈","那","内","乍","凪","薙","謎","灘","捺","鍋","楢","馴","縄","畷","南","楠","軟","難","汝","二","尼","弐","迩","匂","賑","肉","虹","廿","日","乳","入","如","尿","韮","任","妊","忍","認","濡","禰","祢","寧","葱","猫","熱","年","念","捻","撚","燃","粘","乃","廼","之","埜","嚢","悩","濃","納","能","脳","膿","農","覗","蚤","巴","把","播","覇","杷","波","派","琶","破","婆","罵","芭","馬","俳","廃","拝","排","敗","杯","盃","牌","背","肺","輩","配","倍","培","媒","梅","楳","煤","狽","買","売","賠","陪","這","蝿","秤","矧","萩","伯","剥","博","拍","柏","泊","白","箔","粕","舶","薄","迫","曝","漠","爆","縛","莫","駁","麦","函","箱","硲","箸","肇","筈","櫨","幡","肌","畑","畠","八","鉢","溌","発","醗","髪","伐","罰","抜","筏","閥","鳩","噺","塙","蛤","隼","伴","判","半","反","叛","帆","搬","斑","板","氾","汎","版","犯","班","畔","繁","般","藩","販","範","釆","煩","頒","飯","挽","晩","番","盤","磐","蕃","蛮","匪","卑","否","妃","庇","彼","悲","扉","批","披","斐","比","泌","疲","皮","碑","秘","緋","罷","肥","被","誹","費","避","非","飛","樋","簸","備","尾","微","枇","毘","琵","眉","美","鼻","柊","稗","匹","疋","髭","彦","膝","菱","肘","弼","必","畢","筆","逼","桧","姫","媛","紐","百","謬","俵","彪","標","氷","漂","瓢","票","表","評","豹","廟","描","病","秒","苗","錨","鋲","蒜","蛭","鰭","品","彬","斌","浜","瀕","貧","賓","頻","敏","瓶","不","付","埠","夫","婦","富","冨","布","府","怖","扶","敷","斧","普","浮","父","符","腐","膚","芙","譜","負","賦","赴","阜","附","侮","撫","武","舞","葡","蕪","部","封","楓","風","葺","蕗","伏","副","復","幅","服","福","腹","複","覆","淵","弗","払","沸","仏","物","鮒","分","吻","噴","墳","憤","扮","焚","奮","粉","糞","紛","雰","文","聞","丙","併","兵","塀","幣","平","弊","柄","並","蔽","閉","陛","米","頁","僻","壁","癖","碧","別","瞥","蔑","箆","偏","変","片","篇","編","辺","返","遍","便","勉","娩","弁","鞭","保","舗","鋪","圃","捕","歩","甫","補","輔","穂","募","墓","慕","戊","暮","母","簿","菩","倣","俸","包","呆","報","奉","宝","峰","峯","崩","庖","抱","捧","放","方","朋","法","泡","烹","砲","縫","胞","芳","萌","蓬","蜂","褒","訪","豊","邦","鋒","飽","鳳","鵬","乏","亡","傍","剖","坊","妨","帽","忘","忙","房","暴","望","某","棒","冒","紡","肪","膨","謀","貌","貿","鉾","防","吠","頬","北","僕","卜","墨","撲","朴","牧","睦","穆","釦","勃","没","殆","堀","幌","奔","本","翻","凡","盆","摩","磨","魔","麻","埋","妹","昧","枚","毎","哩","槙","幕","膜","枕","鮪","柾","鱒","桝","亦","俣","又","抹","末","沫","迄","侭","繭","麿","万","慢","満","漫","蔓","味","未","魅","巳","箕","岬","密","蜜","湊","蓑","稔","脈","妙","粍","民","眠","務","夢","無","牟","矛","霧","鵡","椋","婿","娘","冥","名","命","明","盟","迷","銘","鳴","姪","牝","滅","免","棉","綿","緬","面","麺","摸","模","茂","妄","孟","毛","猛","盲","網","耗","蒙","儲","木","黙","目","杢","勿","餅","尤","戻","籾","貰","問","悶","紋","門","匁","也","冶","夜","爺","耶","野","弥","矢","厄","役","約","薬","訳","躍","靖","柳","薮","鑓","愉","愈","油","癒","諭","輸","唯","佑","優","勇","友","宥","幽","悠","憂","揖","有","柚","湧","涌","猶","猷","由","祐","裕","誘","遊","邑","郵","雄","融","夕","予","余","与","誉","輿","預","傭","幼","妖","容","庸","揚","揺","擁","曜","楊","様","洋","溶","熔","用","窯","羊","耀","葉","蓉","要","謡","踊","遥","陽","養","慾","抑","欲","沃","浴","翌","翼","淀","羅","螺","裸","来","莱","頼","雷","洛","絡","落","酪","乱","卵","嵐","欄","濫","藍","蘭","覧","利","吏","履","李","梨","理","璃","痢","裏","裡","里","離","陸","律","率","立","葎","掠","略","劉","流","溜","琉","留","硫","粒","隆","竜","龍","侶","慮","旅","虜","了","亮","僚","両","凌","寮","料","梁","涼","猟","療","瞭","稜","糧","良","諒","遼","量","陵","領","力","緑","倫","厘","林","淋","燐","琳","臨","輪","隣","鱗","麟","瑠","塁","涙","累","類","令","伶","例","冷","励","嶺","怜","玲","礼","苓","鈴","隷","零","霊","麗","齢","暦","歴","列","劣","烈","裂","廉","恋","憐","漣","煉","簾","練","聯","蓮","連","錬","呂","魯","櫓","炉","賂","路","露","労","婁","廊","弄","朗","楼","榔","浪","漏","牢","狼","篭","老","聾","蝋","郎","六","麓","禄","肋","録","論","倭","和","話","歪","賄","脇","惑","枠","鷲","亙","亘","鰐","詫","藁","蕨","椀","湾","碗","腕","𠮟","孁","孖","孽","宓","寘","寬","尒","尞","尣","尫","㞍","屢","層","屮","𡚴","屺","岏","岟","岣","岪","岺","峋","峐","峒","峴","𡸴","㟢","崍","崧","﨑","嵆","嵇","嵓","嵊","嵭","嶁","嶠","嶤","嶧","嶸","巋","吞","弌","丐","丕","个","丱","丶","丼","丿","乂","乖","乘","亂","亅","豫","亊","舒","弍","于","亞","亟","亠","亢","亰","亳","亶","从","仍","仄","仆","仂","仗","仞","仭","仟","价","伉","佚","估","佛","佝","佗","佇","佶","侈","侏","侘","佻","佩","佰","侑","佯","來","侖","儘","俔","俟","俎","俘","俛","俑","俚","俐","俤","俥","倚","倨","倔","倪","倥","倅","伜","俶","倡","倩","倬","俾","俯","們","倆","偃","假","會","偕","偐","偈","做","偖","偬","偸","傀","傚","傅","傴","傲","僉","僊","傳","僂","僖","僞","僥","僭","僣","僮","價","僵","儉","儁","儂","儖","儕","儔","儚","儡","儺","儷","儼","儻","儿","兀","兒","兌","兔","兢","竸","兩","兪","兮","冀","冂","囘","册","冉","冏","冑","冓","冕","冖","冤","冦","冢","冩","冪","冫","决","冱","冲","冰","况","冽","凅","凉","凛","几","處","凩","凭","凰","凵","凾","刄","刋","刔","刎","刧","刪","刮","刳","刹","剏","剄","剋","剌","剞","剔","剪","剴","剩","剳","剿","剽","劍","劔","劒","剱","劈","劑","辨","辧","劬","劭","劼","劵","勁","勍","勗","勞","勣","勦","飭","勠","勳","勵","勸","勹","匆","匈","甸","匍","匐","匏","匕","匚","匣","匯","匱","匳","匸","區","卆","卅","丗","卉","卍","凖","卞","卩","卮","夘","卻","卷","厂","厖","厠","厦","厥","厮","厰","厶","參","簒","雙","叟","曼","燮","叮","叨","叭","叺","吁","吽","呀","听","吭","吼","吮","吶","吩","吝","呎","咏","呵","咎","呟","呱","呷","呰","咒","呻","咀","呶","咄","咐","咆","哇","咢","咸","咥","咬","哄","哈","咨","咫","哂","咤","咾","咼","哘","哥","哦","唏","唔","哽","哮","哭","哺","哢","唹","啀","啣","啌","售","啜","啅","啖","啗","唸","唳","啝","喙","喀","咯","喊","喟","啻","啾","喘","喞","單","啼","喃","喩","喇","喨","嗚","嗅","嗟","嗄","嗜","嗤","嗔","嘔","嗷","嘖","嗾","嗽","嘛","嗹","噎","噐","營","嘴","嘶","嘲","嘸","噫","噤","嘯","噬","噪","嚆","嚀","嚊","嚠","嚔","嚏","嚥","嚮","嚶","嚴","囂","嚼","囁","囃","囀","囈","囎","囑","囓","囗","囮","囹","圀","囿","圄","圉","圈","國","圍","圓","團","圖","嗇","圜","圦","圷","圸","坎","圻","址","坏","坩","埀","垈","坡","坿","垉","垓","垠","垳","垤","垪","垰","埃","埆","埔","埒","埓","堊","埖","埣","堋","堙","堝","塲","堡","塢","塋","塰","毀","塒","堽","塹","墅","墹","墟","墫","墺","壞","墻","墸","墮","壅","壓","壑","壗","壙","壘","壥","壜","壤","壟","壯","壺","壹","壻","壼","壽","夂","夊","夐","夛","梦","夥","夬","夭","夲","夸","夾","竒","奕","奐","奎","奚","奘","奢","奠","奧","奬","奩","奸","妁","妝","佞","侫","妣","妲","姆","姨","姜","妍","姙","姚","娥","娟","娑","娜","娉","娚","婀","婬","婉","娵","娶","婢","婪","媚","媼","媾","嫋","嫂","媽","嫣","嫗","嫦","嫩","嫖","嫺","嫻","嬌","嬋","嬖","嬲","嫐","嬪","嬶","嬾","孃","孅","孀","孑","孕","孚","孛","孥","孩","孰","孳","孵","學","斈","孺","宀","它","宦","宸","寃","寇","寉","寔","寐","寤","實","寢","寞","寥","寫","寰","寶","寳","尅","將","專","對","尓","尠","尢","尨","尸","尹","屁","屆","屎","屓","屐","屏","孱","屬","屮","乢","屶","屹","岌","岑","岔","妛","岫","岻","岶","岼","岷","峅","岾","峇","峙","峩","峽","峺","峭","嶌","峪","崋","崕","崗","嵜","崟","崛","崑","崔","崢","崚","崙","崘","嵌","嵒","嵎","嵋","嵬","嵳","嵶","嶇","嶄","嶂","嶢","嶝","嶬","嶮","嶽","嶐","嶷","嶼","巉","巍","巓","巒","巖","巛","巫","已","巵","帋","帚","帙","帑","帛","帶","帷","幄","幃","幀","幎","幗","幔","幟","幢","幤","幇","幵","并","幺","麼","广","庠","廁","廂","廈","廐","廏","廖","廣","廝","廚","廛","廢","廡","廨","廩","廬","廱","廳","廰","廴","廸","廾","弃","弉","彝","彜","弋","弑","弖","弩","弭","弸","彁","彈","彌","彎","弯","彑","彖","彗","彙","彡","彭","彳","彷","徃","徂","彿","徊","很","徑","徇","從","徙","徘","徠","徨","徭","徼","忖","忻","忤","忸","忱","忝","悳","忿","怡","恠","怙","怐","怩","怎","怱","怛","怕","怫","怦","怏","怺","恚","恁","恪","恷","恟","恊","恆","恍","恣","恃","恤","恂","恬","恫","恙","悁","悍","惧","悃","悚","悄","悛","悖","悗","悒","悧","悋","惡","悸","惠","惓","悴","忰","悽","惆","悵","惘","慍","愕","愆","惶","惷","愀","惴","惺","愃","愡","惻","惱","愍","愎","慇","愾","愨","愧","慊","愿","愼","愬","愴","愽","慂","慄","慳","慷","慘","慙","慚","慫","慴","慯","慥","慱","慟","慝","慓","慵","憙","憖","憇","憬","憔","憚","憊","憑","憫","憮","懌","懊","應","懷","懈","懃","懆","憺","懋","罹","懍","懦","懣","懶","懺","懴","懿","懽","懼","懾","戀","戈","戉","戍","戌","戔","戛","戞","戡","截","戮","戰","戲","戳","扁","扎","扞","扣","扛","扠","扨","扼","抂","抉","找","抒","抓","抖","拔","抃","抔","拗","拑","抻","拏","拿","拆","擔","拈","拜","拌","拊","拂","拇","抛","拉","挌","拮","拱","挧","挂","挈","拯","拵","捐","挾","捍","搜","捏","掖","掎","掀","掫","捶","掣","掏","掉","掟","掵","捫","捩","掾","揩","揀","揆","揣","揉","插","揶","揄","搖","搴","搆","搓","搦","搶","攝","搗","搨","搏","摧","摯","摶","摎","攪","撕","撓","撥","撩","撈","撼","據","擒","擅","擇","撻","擘","擂","擱","擧","舉","擠","擡","抬","擣","擯","攬","擶","擴","擲","擺","攀","擽","攘","攜","攅","攤","攣","攫","攴","攵","攷","收","攸","畋","效","敖","敕","敍","敘","敞","敝","敲","數","斂","斃","變","斛","斟","斫","斷","旃","旆","旁","旄","旌","旒","旛","旙","无","旡","旱","杲","昊","昃","旻","杳","昵","昶","昴","昜","晏","晄","晉","晁","晞","晝","晤","晧","晨","晟","晢","晰","暃","暈","暎","暉","暄","暘","暝","曁","暹","曉","暾","暼","曄","暸","曖","曚","曠","昿","曦","曩","曰","曵","曷","朏","朖","朞","朦","朧","霸","朮","朿","朶","杁","朸","朷","杆","杞","杠","杙","杣","杤","枉","杰","枩","杼","杪","枌","枋","枦","枡","枅","枷","柯","枴","柬","枳","柩","枸","柤","柞","柝","柢","柮","枹","柎","柆","柧","檜","栞","框","栩","桀","桍","栲","桎","梳","栫","桙","档","桷","桿","梟","梏","梭","梔","條","梛","梃","檮","梹","桴","梵","梠","梺","椏","梍","桾","椁","棊","椈","棘","椢","椦","棡","椌","棍","棔","棧","棕","椶","椒","椄","棗","棣","椥","棹","棠","棯","椨","椪","椚","椣","椡","棆","楹","楷","楜","楸","楫","楔","楾","楮","椹","楴","椽","楙","椰","楡","楞","楝","榁","楪","榲","榮","槐","榿","槁","槓","榾","槎","寨","槊","槝","榻","槃","榧","樮","榑","榠","榜","榕","榴","槞","槨","樂","樛","槿","權","槹","槲","槧","樅","榱","樞","槭","樔","槫","樊","樒","櫁","樣","樓","橄","樌","橲","樶","橸","橇","橢","橙","橦","橈","樸","樢","檐","檍","檠","檄","檢","檣","檗","蘗","檻","櫃","櫂","檸","檳","檬","櫞","櫑","櫟","檪","櫚","櫪","櫻","欅","蘖","櫺","欒","欖","鬱","欟","欸","欷","盜","欹","飮","歇","歃","歉","歐","歙","歔","歛","歟","歡","歸","歹","歿","殀","殄","殃","殍","殘","殕","殞","殤","殪","殫","殯","殲","殱","殳","殷","殼","毆","毋","毓","毟","毬","毫","毳","毯","麾","氈","氓","气","氛","氤","氣","汞","汕","汢","汪","沂","沍","沚","沁","沛","汾","汨","汳","沒","沐","泄","泱","泓","沽","泗","泅","泝","沮","沱","沾","沺","泛","泯","泙","泪","洟","衍","洶","洫","洽","洸","洙","洵","洳","洒","洌","浣","涓","浤","浚","浹","浙","涎","涕","濤","涅","淹","渕","渊","涵","淇","淦","涸","淆","淬","淞","淌","淨","淒","淅","淺","淙","淤","淕","淪","淮","渭","湮","渮","渙","湲","湟","渾","渣","湫","渫","湶","湍","渟","湃","渺","湎","渤","滿","渝","游","溂","溪","溘","滉","溷","滓","溽","溯","滄","溲","滔","滕","溏","溥","滂","溟","潁","漑","灌","滬","滸","滾","漿","滲","漱","滯","漲","滌","漾","漓","滷","澆","潺","潸","澁","澀","潯","潛","濳","潭","澂","潼","潘","澎","澑","濂","潦","澳","澣","澡","澤","澹","濆","澪","濟","濕","濬","濔","濘","濱","濮","濛","瀉","瀋","濺","瀑","瀁","瀏","濾","瀛","瀚","潴","瀝","瀘","瀟","瀰","瀾","瀲","灑","灣","炙","炒","炯","烱","炬","炸","炳","炮","烟","烋","烝","烙","焉","烽","焜","焙","煥","煕","熈","煦","煢","煌","煖","煬","熏","燻","熄","熕","熨","熬","燗","熹","熾","燒","燉","燔","燎","燠","燬","燧","燵","燼","燹","燿","爍","爐","爛","爨","爭","爬","爰","爲","爻","爼","爿","牀","牆","牋","牘","牴","牾","犂","犁","犇","犒","犖","犢","犧","犹","犲","狃","狆","狄","狎","狒","狢","狠","狡","狹","狷","倏","猗","猊","猜","猖","猝","猴","猯","猩","猥","猾","獎","獏","默","獗","獪","獨","獰","獸","獵","獻","獺","珈","玳","珎","玻","珀","珥","珮","珞","璢","琅","瑯","琥","珸","琲","琺","瑕","琿","瑟","瑙","瑁","瑜","瑩","瑰","瑣","瑪","瑶","瑾","璋","璞","璧","瓊","瓏","瓔","珱","瓠","瓣","瓧","瓩","瓮","瓲","瓰","瓱","瓸","瓷","甄","甃","甅","甌","甎","甍","甕","甓","甞","甦","甬","甼","畄","畍","畊","畉","畛","畆","畚","畩","畤","畧","畫","畭","畸","當","疆","疇","畴","疊","疉","疂","疔","疚","疝","疥","疣","痂","疳","痃","疵","疽","疸","疼","疱","痍","痊","痒","痙","痣","痞","痾","痿","痼","瘁","痰","痺","痲","痳","瘋","瘍","瘉","瘟","瘧","瘠","瘡","瘢","瘤","瘴","瘰","瘻","癇","癈","癆","癜","癘","癡","癢","癨","癩","癪","癧","癬","癰","癲","癶","癸","發","皀","皃","皈","皋","皎","皖","皓","皙","皚","皰","皴","皸","皹","皺","盂","盍","盖","盒","盞","盡","盥","盧","盪","蘯","盻","眈","眇","眄","眩","眤","眞","眥","眦","眛","眷","眸","睇","睚","睨","睫","睛","睥","睿","睾","睹","瞎","瞋","瞑","瞠","瞞","瞰","瞶","瞹","瞿","瞼","瞽","瞻","矇","矍","矗","矚","矜","矣","矮","矼","砌","砒","礦","砠","礪","硅","碎","硴","碆","硼","碚","碌","碣","碵","碪","碯","磑","磆","磋","磔","碾","碼","磅","磊","磬","磧","磚","磽","磴","礇","礒","礑","礙","礬","礫","祀","祠","祗","祟","祚","祕","祓","祺","祿","禊","禝","禧","齋","禪","禮","禳","禹","禺","秉","秕","秧","秬","秡","秣","稈","稍","稘","稙","稠","稟","禀","稱","稻","稾","稷","穃","穗","穉","穡","穢","穩","龝","穰","穹","穽","窈","窗","窕","窘","窖","窩","竈","窰","窶","竅","竄","窿","邃","竇","竊","竍","竏","竕","竓","站","竚","竝","竡","竢","竦","竭","竰","笂","笏","笊","笆","笳","笘","笙","笞","笵","笨","笶","筐","筺","笄","筍","笋","筌","筅","筵","筥","筴","筧","筰","筱","筬","筮","箝","箘","箟","箍","箜","箚","箋","箒","箏","筝","箙","篋","篁","篌","篏","箴","篆","篝","篩","簑","簔","篦","篥","籠","簀","簇","簓","篳","篷","簗","簍","篶","簣","簧","簪","簟","簷","簫","簽","籌","籃","籔","籏","籀","籐","籘","籟","籤","籖","籥","籬","籵","粃","粐","粤","粭","粢","粫","粡","粨","粳","粲","粱","粮","粹","粽","糀","糅","糂","糘","糒","糜","糢","鬻","糯","糲","糴","糶","糺","紆","紂","紜","紕","紊","絅","絋","紮","紲","紿","紵","絆","絳","絖","絎","絲","絨","絮","絏","絣","經","綉","絛","綏","絽","綛","綺","綮","綣","綵","緇","綽","綫","總","綢","綯","緜","綸","綟","綰","緘","緝","緤","緞","緻","緲","緡","縅","縊","縣","縡","縒","縱","縟","縉","縋","縢","繆","繦","縻","縵","縹","繃","縷","縲","縺","繧","繝","繖","繞","繙","繚","繹","繪","繩","繼","繻","纃","緕","繽","辮","繿","纈","纉","續","纒","纐","纓","纔","纖","纎","纛","纜","缸","缺","罅","罌","罍","罎","罐","网","罕","罔","罘","罟","罠","罨","罩","罧","罸","羂","羆","羃","羈","羇","羌","羔","羞","羝","羚","羣","羯","羲","羹","羮","羶","羸","譱","翅","翆","翊","翕","翔","翡","翦","翩","翳","翹","飜","耆","耄","耋","耒","耘","耙","耜","耡","耨","耿","耻","聊","聆","聒","聘","聚","聟","聢","聨","聳","聲","聰","聶","聹","聽","聿","肄","肆","肅","肛","肓","肚","肭","冐","肬","胛","胥","胙","胝","胄","胚","胖","脉","胯","胱","脛","脩","脣","脯","腋","隋","腆","脾","腓","腑","胼","腱","腮","腥","腦","腴","膃","膈","膊","膀","膂","膠","膕","膤","膣","腟","膓","膩","膰","膵","膾","膸","膽","臀","臂","膺","臉","臍","臑","臙","臘","臈","臚","臟","臠","臧","臺","臻","臾","舁","舂","舅","與","舊","舍","舐","舖","舩","舫","舸","舳","艀","艙","艘","艝","艚","艟","艤","艢","艨","艪","艫","舮","艱","艷","艸","艾","芍","芒","芫","芟","芻","芬","苡","苣","苟","苒","苴","苳","苺","莓","范","苻","苹","苞","茆","苜","茉","苙","茵","茴","茖","茲","茱","荀","茹","荐","荅","茯","茫","茗","茘","莅","莚","莪","莟","莢","莖","茣","莎","莇","莊","荼","莵","荳","荵","莠","莉","莨","菴","萓","菫","菎","菽","萃","菘","萋","菁","菷","萇","菠","菲","萍","萢","萠","莽","萸","蔆","菻","葭","萪","萼","蕚","蒄","葷","葫","蒭","葮","蒂","葩","葆","萬","葯","葹","萵","蓊","葢","蒹","蒿","蒟","蓙","蓍","蒻","蓚","蓐","蓁","蓆","蓖","蒡","蔡","蓿","蓴","蔗","蔘","蔬","蔟","蔕","蔔","蓼","蕀","蕣","蕘","蕈","蕁","蘂","蕋","蕕","薀","薤","薈","薑","薊","薨","蕭","薔","薛","藪","薇","薜","蕷","蕾","薐","藉","薺","藏","薹","藐","藕","藝","藥","藜","藹","蘊","蘓","蘋","藾","藺","蘆","蘢","蘚","蘰","蘿","虍","乕","虔","號","虧","虱","蚓","蚣","蚩","蚪","蚋","蚌","蚶","蚯","蛄","蛆","蚰","蛉","蠣","蚫","蛔","蛞","蛩","蛬","蛟","蛛","蛯","蜒","蜆","蜈","蜀","蜃","蛻","蜑","蜉","蜍","蛹","蜊","蜴","蜿","蜷","蜻","蜥","蜩","蜚","蝠","蝟","蝸","蝌","蝎","蝴","蝗","蝨","蝮","蝙","蝓","蝣","蝪","蠅","螢","螟","螂","螯","蟋","螽","蟀","蟐","雖","螫","蟄","螳","蟇","蟆","螻","蟯","蟲","蟠","蠏","蠍","蟾","蟶","蟷","蠎","蟒","蠑","蠖","蠕","蠢","蠡","蠱","蠶","蠹","蠧","蠻","衄","衂","衒","衙","衞","衢","衫","袁","衾","袞","衵","衽","袵","衲","袂","袗","袒","袮","袙","袢","袍","袤","袰","袿","袱","裃","裄","裔","裘","裙","裝","裹","褂","裼","裴","裨","裲","褄","褌","褊","褓","襃","褞","褥","褪","褫","襁","襄","褻","褶","褸","襌","褝","襠","襞","襦","襤","襭","襪","襯","襴","襷","襾","覃","覈","覊","覓","覘","覡","覩","覦","覬","覯","覲","覺","覽","覿","觀","觚","觜","觝","觧","觴","觸","訃","訖","訐","訌","訛","訝","訥","訶","詁","詛","詒","詆","詈","詼","詭","詬","詢","誅","誂","誄","誨","誡","誑","誥","誦","誚","誣","諄","諍","諂","諚","諫","諳","諧","諤","諱","謔","諠","諢","諷","諞","諛","謌","謇","謚","諡","謖","謐","謗","謠","謳","鞫","謦","謫","謾","謨","譁","譌","譏","譎","證","譖","譛","譚","譫","譟","譬","譯","譴","譽","讀","讌","讎","讒","讓","讖","讙","讚","谺","豁","谿","豈","豌","豎","豐","豕","豢","豬","豸","豺","貂","貉","貅","貊","貍","貎","貔","豼","貘","戝","貭","貪","貽","貲","貳","貮","貶","賈","賁","賤","賣","賚","賽","賺","賻","贄","贅","贊","贇","贏","贍","贐","齎","贓","賍","贔","贖","赧","赭","赱","赳","趁","趙","跂","趾","趺","跏","跚","跖","跌","跛","跋","跪","跫","跟","跣","跼","踈","踉","跿","踝","踞","踐","踟","蹂","踵","踰","踴","蹊","蹇","蹉","蹌","蹐","蹈","蹙","蹤","蹠","踪","蹣","蹕","蹶","蹲","蹼","躁","躇","躅","躄","躋","躊","躓","躑","躔","躙","躪","躡","躬","躰","軆","躱","躾","軅","軈","軋","軛","軣","軼","軻","軫","軾","輊","輅","輕","輒","輙","輓","輜","輟","輛","輌","輦","輳","輻","輹","轅","轂","輾","轌","轉","轆","轎","轗","轜","轢","轣","轤","辜","辟","辣","辭","辯","辷","迚","迥","迢","迪","迯","邇","迴","逅","迹","迺","逑","逕","逡","逍","逞","逖","逋","逧","逶","逵","逹","迸","遏","遐","遑","遒","逎","遉","逾","遖","遘","遞","遨","遯","遶","隨","遲","邂","遽","邁","邀","邊","邉","邏","邨","邯","邱","邵","郢","郤","扈","郛","鄂","鄒","鄙","鄲","鄰","酊","酖","酘","酣","酥","酩","酳","酲","醋","醉","醂","醢","醫","醯","醪","醵","醴","醺","釀","釁","釉","釋","釐","釖","釟","釡","釛","釼","釵","釶","鈞","釿","鈔","鈬","鈕","鈑","鉞","鉗","鉅","鉉","鉤","鉈","銕","鈿","鉋","鉐","銜","銖","銓","銛","鉚","鋏","銹","銷","鋩","錏","鋺","鍄","錮","錙","錢","錚","錣","錺","錵","錻","鍜","鍠","鍼","鍮","鍖","鎰","鎬","鎭","鎔","鎹","鏖","鏗","鏨","鏥","鏘","鏃","鏝","鏐","鏈","鏤","鐚","鐔","鐓","鐃","鐇","鐐","鐶","鐫","鐵","鐡","鐺","鑁","鑒","鑄","鑛","鑠","鑢","鑞","鑪","鈩","鑰","鑵","鑷","鑽","鑚","鑼","鑾","钁","鑿","閂","閇","閊","閔","閖","閘","閙","閠","閨","閧","閭","閼","閻","閹","閾","闊","濶","闃","闍","闌","闕","闔","闖","關","闡","闥","闢","阡","阨","阮","阯","陂","陌","陏","陋","陷","陜","陞","陝","陟","陦","陲","陬","隍","隘","隕","隗","險","隧","隱","隲","隰","隴","隶","隸","隹","雎","雋","雉","雍","襍","雜","霍","雕","雹","霄","霆","霈","霓","霎","霑","霏","霖","霙","霤","霪","霰","霹","霽","霾","靄","靆","靈","靂","靉","靜","靠","靤","靦","靨","勒","靫","靱","靹","鞅","靼","鞁","靺","鞆","鞋","鞏","鞐","鞜","鞨","鞦","鞣","鞳","鞴","韃","韆","韈","韋","韜","韭","齏","韲","竟","韶","韵","頏","頌","頸","頤","頡","頷","頽","顆","顏","顋","顫","顯","顰","顱","顴","顳","颪","颯","颱","颶","飄","飃","飆","飩","飫","餃","餉","餒","餔","餘","餡","餝","餞","餤","餠","餬","餮","餽","餾","饂","饉","饅","饐","饋","饑","饒","饌","饕","馗","馘","馥","馭","馮","馼","駟","駛","駝","駘","駑","駭","駮","駱","駲","駻","駸","騁","騏","騅","駢","騙","騫","騷","驅","驂","驀","驃","騾","驕","驍","驛","驗","驟","驢","驥","驤","驩","驫","驪","骭","骰","骼","髀","髏","髑","髓","體","髞","髟","髢","髣","髦","髯","髫","髮","髴","髱","髷","髻","鬆","鬘","鬚","鬟","鬢","鬣","鬥","鬧","鬨","鬩","鬪","鬮","鬯","鬲","魄","魃","魏","魍","魎","魑","魘","魴","鮓","鮃","鮑","鮖","鮗","鮟","鮠","鮨","鮴","鯀","鯊","鮹","鯆","鯏","鯑","鯒","鯣","鯢","鯤","鯔","鯡","鰺","鯲","鯱","鯰","鰕","鰔","鰉","鰓","鰌","鰆","鰈","鰒","鰊","鰄","鰮","鰛","鰥","鰤","鰡","鰰","鱇","鰲","鱆","鰾","鱚","鱠","鱧","鱶","鱸","鳧","鳬","鳰","鴉","鴈","鳫","鴃","鴆","鴪","鴦","鶯","鴣","鴟","鵄","鴕","鴒","鵁","鴿","鴾","鵆","鵈","鵝","鵞","鵤","鵑","鵐","鵙","鵲","鶉","鶇","鶫","鵯","鵺","鶚","鶤","鶩","鶲","鷄","鷁","鶻","鶸","鶺","鷆","鷏","鷂","鷙","鷓","鷸","鷦","鷭","鷯","鷽","鸚","鸛","鸞","鹵","鹹","鹽","麁","麈","麋","麌","麒","麕","麑","麝","麥","麩","麸","麪","麭","靡","黌","黎","黏","黐","黔","黜","點","黝","黠","黥","黨","黯","黴","黶","黷","黹","黻","黼","黽","鼇","鼈","皷","鼕","鼡","鼬","鼾","齊","齒","齔","齣","齟","齠","齡","齦","齧","齬","齪","齷","齲","齶","龕","龜","龠","堯","槇","遙","瑤","凜","熙","噓","巢","帔","帘","幘","幞","庾","廊","廋","廹","开","异","弇","弝","弣","弴","弶","弽","彀","彅","彔","彘","彤","彧","彽","徉","徜","徧","徯","徵","德","忉","忞","忡","忩","怍","怔","怘","怳","怵","恇","悔","悝","悞","惋","惔","惕","惝","惸","愜","愫","愰","愷","慨","憍","憎","憼","憹","懲","戢","戾","扃","扖","扚","扯","抅","拄","拖","拼","挊","挘","挹","捃","捥","捼","揥","揭","揵","搐","搔","搢","摹","摑","摠","摭","擎","撾","撿","㐂","𠅘","份","仿","侚","俉","傜","儞","冼","㔟","匇","卡","卬","詹","𠮷","呍","咖","咜","咩","唎","啊","噲","囤","圳","圴","塚","墀","姤","娣","婕","寬","﨑","㟢","庬","弴","彅","德","怗","恵","愰","昤","曈","曙","曺","曻","桒","鿄","椑","椻","橅","檑","櫛","𣏌","𣏾","𣗄","毱","泠","洮","海","涿","淊","淸","渚","潞","濹","灤","𤋮","𤋮","煇","燁","爀","玟","玨","珉","珖","琛","琡","琢","琦","琪","琬","琹","瑋","㻚","畵","疁","睲","䂓","磈","磠","祇","禮","鿆","䄃","鿅","秚","稞","筿","簱","䉤","綋","羡","脘","脺","舘","芮","葛","蓜","蓬","蕙","藎","蝕","蟬","蠋","裵","角","諶","跎","辻","迶","郝","鄧","鄭","醲","鈳","銈","錡","鍈","閒","雞","餃","饀","髙","鯖","鷗","麴","麵","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","⛌","⛍","❗","⛏","⛐","⛑","","⛒","⛕","⛓","⛔","","","","","","","","","⛖","⛗","⛘","⛙","⛚","⛛","⛜","⛝","⛞","⛟","⛠","⛡","⭕","㉈","㉉","㉊","㉋","㉌","㉍","㉎","㉏","","","","","⒑","⒒","⒓","","","","","","","","","","","","","","","","","⬛","⬤","","","","","","⚿","","","","","","","","","","","","㊙","","","","","","","","","","","","⛣","⭖","⭗","⭘","⭙","☓","㊋","〒","⛨","㉆","㉅","⛩","࿖","⛪","⛫","⛬","♨","⛭","⛮","⛯","⚓","✈","⛰","⛱","⛲","⛳","⛴","⛵","","Ⓓ","Ⓢ","⛶","","","","","","⛷","⛸","⛹","⛺","","☎","⛻","⛼","⛽","⛾","","⛿","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","➡","⬅","⬆","⬇","⬯","⬮","年","月","日","円","㎡","㎥","㎝","㎠","㎤","","⒈","⒉","⒊","⒋","⒌","⒍","⒎","⒏","⒐","","","","","","","","","","","","","","","","","㈳","㈶","㈲","㈱","㈹","㉄","▶","◀","〖","〗","⟐","²","³","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","㉇","","","℻","","","","㈪","㈫","㈬","㈭","㈮","㈯","㈰","㈷","㍾","㍽","㍼","㍻","№","℡","〶","⚾","","","","","","","","","","","","","","","","","","","","","","","ℓ","㎏","㎐","㏊","㎞","㎢","㍱","","","½","↉","⅓","⅔","¼","¾","⅕","⅖","⅗","⅘","⅙","⅚","⅐","⅛","⅑","⅒","☀","☁","☂","⛄","☖","☗","⛉","⛊","♦","♥","♣","♠","⛋","⨀","‼","⁉","⛅","☔","⛆","☃","⛇","⚡","⛈","","⚞","⚟","♬","☎","","","","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ","⑰","⑱","⑲","⑳","⑴","⑵","⑶","⑷","⑸","⑹","⑺","⑻","⑼","⑽","⑾","⑿","㉑","㉒","㉓","㉔","","","","","","","","","","","","","","","","","","","","","","","","","","","㉕","㉖","㉗","㉘","㉙","㉚","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","❶","❷","❸","❹","❺","❻","❼","❽","❾","❿","⓫","⓬","㉛",""],v=["㐂","","份","仿","侚","俉","傜","儞","冼","㔟","匇","卡","卬","詹","","呍","咖","咜","咩","唎","啊","噲","囤","圳","圴","塚","墀","姤","娣","婕","寬","﨑","㟢","庬","弴","彅","德","怗","恵","愰","昤","曈","曙","曺","曻","桒","鿄","椑","椻","橅","檑","櫛","","","","毱","泠","洮","海","涿","淊","淸","渚","潞","濹","灤","𤋮","","煇","燁","爀","玟","玨","珉","珖","琛","琡","琢","琦","琪","琬","琹","瑋","㻚","畵","疁","睲","䂓","磈","磠","祇","禮","鿆","䄃","鿅","秚","稞","筿","簱","䉤","綋","羡","脘","脺","舘","芮","葛","蓜","蓬","蕙","藎","蝕","蟬","蠋","裵","角","諶","跎","辻","迶","郝","鄧","鄭","醲","鈳","銈","錡","鍈","閒","雞","餃","饀","髙","鯖","鷗","麴","麵","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","⛌","⛍","❗","⛏","⛐","⛑","","⛒","⛕","⛓","⛔","","","","","","","","","⛖","⛗","⛘","⛙","⛚","⛛","⛜","⛝","⛞","⛟","⛠","⛡","⭕","㉈","㉉","㉊","㉋","㉌","㉍","㉎","㉏","","","","","⒑","⒒","⒓","","","","","","","","","","","","","","","","","⬛","⬤","","","","","","⚿","","","","","","","","","","","","㊙","","","","","","","","","","","","⛣","⭖","⭗","⭘","⭙","☓","㊋","〒","⛨","㉆","㉅","⛩","࿖","⛪","⛫","⛬","♨","⛭","⛮","⛯","⚓","✈","⛰","⛱","⛲","⛳","⛴","⛵","","Ⓓ","Ⓢ","⛶","","","","","","⛷","⛸","⛹","⛺","","☎","⛻","⛼","⛽","⛾","","⛿","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","➡","⬅","⬆","⬇","⬯","⬮","年","月","日","円","㎡","㎥","㎝","㎠","㎤","","⒈","⒉","⒊","⒋","⒌","⒍","⒎","⒏","⒐","","","","","","","","","","","","","","","","","㈳","㈶","㈲","㈱","㈹","㉄","▶","◀","〖","〗","⟐","²","³","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","㉇","","","℻","","","","㈪","㈫","㈬","㈭","㈮","㈯","㈰","㈷","㍾","㍽","㍼","㍻","№","℡","〶","⚾","","","","","","","","","","","","","","","","","","","","","","","ℓ","㎏","㎐","㏊","㎞","㎢","㍱","","","½","↉","⅓","⅔","¼","¾","⅕","⅖","⅗","⅘","⅙","⅚","⅐","⅛","⅑","⅒","☀","☁","☂","⛄","☖","☗","⛉","⛊","♦","♥","♣","♠","⛋","⨀","‼","⁉","⛅","☔","⛆","☃","⛇","⚡","⛈","","⚞","⚟","♬","☎","","","","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ","⑰","⑱","⑲","⑳","⑴","⑵","⑶","⑷","⑸","⑹","⑺","⑻","⑼","⑽","⑾","⑿","㉑","㉒","㉓","㉔","","","","","","","","","","","","","","","","","","","","","","","","","","","㉕","㉖","㉗","㉘","㉙","㉚","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","❶","❷","❸","❹","❺","❻","❼","❽","❾","❿","⓫","⓬","㉛",""],b=["㐂","𠅘","份","仿","侚","俉","傜","儞","冼","㔟","匇","卡","卬","詹","𠮷","呍","咖","咜","咩","唎","啊","噲","囤","圳","圴","塚","墀","姤","娣","婕","寬","﨑","㟢","庬","弴","彅","德","怗","恵","愰","昤","曈","曙","曺","曻","桒","鿄","椑","椻","橅","檑","櫛","𣏌","𣏾","𣗄","毱","泠","洮","海","涿","淊","淸","渚","潞","濹","灤","𤋮","𤋮","煇","燁","爀","玟","玨","珉","珖","琛","琡","琢","琦","琪","琬","琹","瑋","㻚","畵","疁","睲","䂓","磈","磠","祇","禮","鿆","䄃","鿅","秚","稞","筿","簱","䉤","綋","羡","脘","脺","舘","芮","葛","蓜","蓬","蕙","藎","蝕","蟬","蠋","裵","角","諶","跎","辻","迶","郝","鄧","鄭","醲","鈳","銈","錡","鍈","閒","雞","餃","饀","髙","鯖","鷗","麴","麵","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","⛌","⛍","❗","⛏","⛐","⛑","","⛒","⛕","⛓","⛔","","","","","🅿","🆊","","","⛖","⛗","⛘","⛙","⛚","⛛","⛜","⛝","⛞","⛟","⛠","⛡","⭕","㉈","㉉","㉊","㉋","㉌","㉍","㉎","㉏","","","","","⒑","⒒","⒓","🅊","🅌","🄿","🅆","🅋","🈐","🈑","🈒","🈓","🅂","🈔","🈕","🈖","🅍","🄱","🄽","⬛","⬤","🈗","🈘","🈙","🈚","🈛","⚿","🈜","🈝","🈞","🈟","🈠","🈡","🈢","🈣","🈤","🈥","🅎","㊙","🈀","","","","","","","","","","","⛣","⭖","⭗","⭘","⭙","☓","㊋","〒","⛨","㉆","㉅","⛩","࿖","⛪","⛫","⛬","♨","⛭","⛮","⛯","⚓","✈","⛰","⛱","⛲","⛳","⛴","⛵","🅗","Ⓓ","Ⓢ","⛶","🅟","🆋","🆍","🆌","🅹","⛷","⛸","⛹","⛺","🅻","☎","⛻","⛼","⛽","⛾","🅼","⛿","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","➡","⬅","⬆","⬇","⬯","⬮","年","月","日","円","㎡","㎥","㎝","㎠","㎤","🄀","⒈","⒉","⒊","⒋","⒌","⒍","⒎","⒏","⒐","","","","","","","🄁","🄂","🄃","🄄","🄅","🄆","🄇","🄈","🄉","🄊","㈳","㈶","㈲","㈱","㈹","㉄","▶","◀","〖","〗","⟐","²","³","🄭","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","🄬","🄫","㉇","🆐","🈦","℻","","","","㈪","㈫","㈬","㈭","㈮","㈯","㈰","㈷","㍾","㍽","㍼","㍻","№","℡","〶","⚾","🉀","🉁","🉂","🉃","🉄","🉅","🉆","🉇","🉈","🄪","🈧","🈨","🈩","🈔","🈪","🈫","🈬","🈭","🈮","🈯","🈰","🈱","ℓ","㎏","㎐","㏊","㎞","㎢","㍱","","","½","↉","⅓","⅔","¼","¾","⅕","⅖","⅗","⅘","⅙","⅚","⅐","⅛","⅑","⅒","☀","☁","☂","⛄","☖","☗","⛉","⛊","♦","♥","♣","♠","⛋","⨀","‼","⁉","⛅","☔","⛆","☃","⛇","⚡","⛈","","⚞","⚟","♬","☎","","","","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ","⑰","⑱","⑲","⑳","⑴","⑵","⑶","⑷","⑸","⑹","⑺","⑻","⑼","⑽","⑾","⑿","㉑","㉒","㉓","㉔","🄐","🄑","🄒","🄓","🄔","🄕","🄖","🄗","🄘","🄙","🄚","🄛","🄜","🄝","🄞","🄟","🄠","🄡","🄢","🄣","🄤","🄥","🄦","🄧","🄨","🄩","㉕","㉖","㉗","㉘","㉙","㉚","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","❶","❷","❸","❹","❺","❻","❼","❽","❾","❿","⓫","⓬","㉛",""],w=["!",""","#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","¥","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"],C=["ぁ","あ","ぃ","い","ぅ","う","ぇ","え","ぉ","お","か","が","き","ぎ","く","ぐ","け","げ","こ","ご","さ","ざ","し","じ","す","ず","せ","ぜ","そ","ぞ","た","だ","ち","ぢ","っ","つ","づ","て","で","と","ど","な","に","ぬ","ね","の","は","ば","ぱ","ひ","び","ぴ","ふ","ぶ","ぷ","へ","べ","ぺ","ほ","ぼ","ぽ","ま","み","む","め","も","ゃ","や","ゅ","ゆ","ょ","よ","ら","り","る","れ","ろ","ゎ","わ","ゐ","ゑ","を","ん","","","","ゝ","ゞ","ー","。","「","」","、","・"],D=["ァ","ア","ィ","イ","ゥ","ウ","ェ","エ","ォ","オ","カ","ガ","キ","ギ","ク","グ","ケ","ゲ","コ","ゴ","サ","ザ","シ","ジ","ス","ズ","セ","ゼ","ソ","ゾ","タ","ダ","チ","ヂ","ッ","ツ","ヅ","テ","デ","ト","ド","ナ","ニ","ヌ","ネ","ノ","ハ","バ","パ","ヒ","ビ","ピ","フ","ブ","プ","ヘ","ベ","ペ","ホ","ボ","ポ","マ","ミ","ム","メ","モ","ャ","ヤ","ュ","ユ","ョ","ヨ","ラ","リ","ル","レ","ロ","ヮ","ワ","ヰ","ヱ","ヲ","ン","ヴ","ヵ","ヶ","ヽ","ヾ","ー","。","「","」","、","・"],R=new Map([["022b6f43e2a414fd68f172da202bac9a","⚞"],["94fb7be756372db6b62e3e0a119083d5","⚞"],["12aecdea283e4d07f88b9f2b740e4f86","⚟"],["1a563501affbf7f5baec350a108d5505","⚟"],["556971570f40044fa4520df3289a1cf2","⚟"],["65b042886a563a771aa389b12af7bca7","⚟"],["bbda644d17efd3c020635ee3d90968a5","⦅"],["5063561406195ca45f5992e3f7ad77d2","⦅"],["9d15c0395a4738936af34308acf2d032","⦅"],["2a063edc4770b3403f060b38166a0d4d","⦅"],["54479aa90145b4713134b78d4fb98aa5","⦅"],["12a2c7156da32fc972b5a451bb87b813","⦅"],["c8d428ead557285b0b7088388b22519c","⦅"],["7160f7419cba7acdacd23cbeb4834dbe","⦅"],["3c49616fb9bf0b9052b30e118f8857ea","⦅"],["71c94bb6d963e47443eac448a09d22ce","⦅"],["7ec2179107ba4c58abb6ef92e7781365","⦅"],["2eb49bd25d7eeada006afc0864350da4","⦅"],["a341ee7fe8a368c9737a3341f016ac70","⦅"],["f47048d669ac8d84eeb62477e8420f89","⦅"],["38566b372f4c5a1aead4efa20decd079","⦆"],["d84fc83615b75802ed422eda4ba39465","⦆"],["5bb8b7731d9473ebd7c842334dfa24f2","⦆"],["9ffa7e00cfc7e807a161ada460b8060c","⦆"],["a58dc0e1271b03a5981b57a83271afa7","⦆"],["e67210b0da0161d36b79e8c9be6a9d0c","⦆"],["08de4be9569ebd6ac01709f552ae8a65","⦆"],["e214599903c94c532684bdf54b62df61","⦆"],["2a83209f8a7489081890c277397df425","⦆"],["0294d50cea5197c8c4646d2cace3e78d","⦆"],["0b808509e4d89a2b9d02252ca85f2e34","⦆"],["2a74d4ad7292c858dc2bb559de67f2d9","⦆"],["8c810b8cbe6159e837a88575bb4e6033","⦆"],["dc66317cd6fff4f4221069a20f321fce","⦆"],["563e1633d226c10ef4ec80638997e4a9","『"],["0993d5cdf910f481eeefa19e4f09d77c","『"],["7b80a8345c16e2d4f8ff2691e245c2b1","『"],["016669fa94786f9581342d47f317c02c","『"],["01d3eb52ab29f0eecc62ff74224fffd4","『"],["089aa1d87915ef8ad3c43982ac657c8c","『"],["30e8cb69cda3ad84e87943c4351c24b7","『"],["385927959c2621acf57f8d40140924f8","『"],["2c256506f406bac4c214318f196ad5db","『"],["2d3912e10113e5c7bef33df3249af4a7","『"],["8b6444be18f269ac615643b26f9e3041","『"],["9c8c1ff659b439f73c65cf4766ab2f14","『"],["e4caa1628ad6878f14be986761e06aaa","『"],["e702912587801d73d58cdb30e48debed","』"],["d70bb2b097f44c1ddefb93bf92bbb5cd","』"],["f2b927267947a75b891403f95db72005","』"],["4ec38a1d8d22e4df6c359f00f7ad8662","』"],["55c9ea9aa8eb630e5ecb793b2f85c927","』"],["70376e1ea05a3438a19c062ad49a7960","』"],["8fe7cb78ca24d1973419eecf99252a88","』"],["9ee59c7d2c202e0214836a0138f59e24","』"],["b56aaf7fc68c5e206ccbc2ee1442b3af","』"],["ba37f6b56d8fc8980c8236de9894fa61","』"],["cc9fde9238a2bf78fd1c13f65b098e77","』"],["f02e3e84dcd71c5d3bab2b7b4b99bd7e","』"],["f686e0b742abe806fccbd4d9b3fcc4cd","』"],["37f6ecf37a0a3ef8dff083ccc8754f81","♬"],["3336f18e849144658f212bd9399bec5f","♬"],["93efdc18683d8ecacb0a920d5f2fffb3","♬"],["9b8325b71aa6a000d24f88c4d7ec730d","♬"],["ab791ef796e6b5d66f13ed9aea3e8ab2","♬"],["6eb29f1917caea1cadf94f5496a4c374","↱"],["583134b86e7d90960f64c5b863196978","➡"],["4ba716a88c003ca0a069392be3b63951","➡"],["4e0fbe47e3ba0fd5949bda53f11b16a5","➡"],["61ec226a927ee80fffa12db219a43233","➡"],["8e5b873ac8e1bf84246b281b3548c2ff","↴"],["a78d9b65f46654601ce0145622164b47","↴"],["5d01e6804b9aaec0c276f77306888c54","↴"],["6168af1e81b6497fccb6b8d3226a8016","↴"],["4360c0b7364802b680f5a65fa415bdd6","↗"],["4dab788480bb9ac50d2454b58438e407","↗"],["bfb2d58ab8c469d2b8b5c42d81e4e3b7","↗"],["4c503a0873195bfe8d71c9d55669781b","→"],["caf36eff2cf3580cd66c5cd021ee4c09","→"],["f00be20caf0aaef3a6fbec90a0e71852","Ⅰ"],["e660e1e23a6ddc9a5d2e0e1ef7ac5b86","Ⅱ"],["a62583f621fb5405add08e8f0beb6db4","Ⅱ"],["0e761ebb18b9870383725b3712f5c8d4","Ⅱ"],["1f65debfbf9df96de52c6f80922b012b","Ⅱ"],["5c13facf2da9f38922a9419061771ed0","Ⅱ"],["75a65cc3171c4c7ca0141042846ab91a","Ⅱ"],["eae94a6301787ff7bf77786ae4424601","Ⅱ"],["f1add7809e18e064e4609783211c9815","Ⅲ"],["a7ee6f7f63d348e2b8fb7ee9503f3c5c","♡"],["9c8cfb5e9349b06f0939605638896f4e","♥"],["45ce7d6d5c779136d32d3e60e13e10cd","⅕"],["51f5fe58aaf460263b766e990fdbe979","⅕"],["db40b0a65939e462396822d5ab3c6d9c","⅕"],["d9e3a48d5a7c6ba6f8db18f56cf91f92","⅛"],["86586bcdf8f14883f846849e93ca274c","⅜"],["9d81f46e134081d56bc92f69eebfabd9","⅒"],["18dddb04a4fe9b3f5c7b79e68fb8ab4b","⅒"],["eff8659a150859b7b69682a023b283c1","⅒"],["6e5ccf08b2bc815b0923df83cf9fafa1","㎠"],["8a77e56517a074d3d2ba426b84a07bf4","㎠"],["2c381a0eab014487d50f6f8bae8f0b71","㎢"],["9d1a36a1bec1cd2b0b0765f93c1e4f3c","㎢"],["e03eb00c54de790d8cc9997527fde905","㎢"],["3bce2a06a6a8557082543a6c90a42fe0","〽"],["4898c7d9fe3a8a6f9859b0e6f85a4327","〽"],["98ab18764756c8ca7608e17f562b21ce","〽"],["3037aad230d8cdae3df6e0ebedc0db79","⁉"],["66e3474e6cbd8e817ba0a1f8920bf4e7","⁉"],["4360dd96063ce1a9660cc8437e8238e3","⁈"],["6ce68b7e389c5169309ee956ed0c98a8","⁈"],["737a19289d25d963e255f3692ded6536","⁈"],["14b18199bbc3f4bf65b72e316bc41d3c","!"],["6bf58c146b692aeb403ed1f7618a060a","!"],["7f12b67caaf7c8c5075b444bb2a16c70","!"],["bfd55f4031ad80cb7401d65937b1d5d9","〜"],["4a61f6f7da9e6c8e373f4112cbd453cf","〜"],["882ded8f0bb4cdfa4ce28a0b64056d2a","〜"],["7726ffbf3a6e953affe6353c24ffb085","〜"],["0e290ec6542b5d52c972775e3d7cfeaf","-"],["420f1d27972d7cc83929307fbbb6dd50","-"],["4aa0e459273a2fe3012d7b3d2e14e07e","-"],["030b487ae68da1f4da98046f4fed390f","一"],["21699fa18fd14735a312512dfea2bff4","一"],["559fc240f4efe5a1e64714ce09217a3e","一"],["b7352c3f33a77bc9d3fbf693efbb8095","一"],["fcdb30a244fb6aad5255ee2d32fdf7fc","一"],["15a0a0fb33aacd4ce730a9503c46df5f","㊙"],["9dad4982bd65fbf21525261a7efdf669","㊙"],["c3e68e6d08d5429e28ffd6592acf4519","ゔ"],["f022cfe594d6f6930d7a5b994e1a0b71","凜"],["407057c7b7b1a91d058d572d9a9d3aa5","凜"],["fc85b0622183795f89111219dfbc6281","凜"],["9707099e5828d97eb12ff2e6ba438558","凜"],["987c829b62eb31f467165827766c410d","凜"],["58371bb195aaa7a468c5c508351ac383","凜"],["32324012ed7274a15002b66ed1e464f8","蜻"],["0ffb731db8d4a6b711f97bbb08ed8819","蜻"],["d90aae9a752e9b61662a9cafa837961f","祓"],["23d6c6f231ac5d51f4cdaaaa26701956","祓"],["81cbedabd8f88d4494255b0631820dfd","祓"],["4185f93a5571e49433ca9c13ae588f96","魎"],["9ab74d6e8bda8723614017a7fce587fe","魎"],["e96a39a050b694e5f8aadb111420b698","𠮷"],["08c5eb5fac4f1d362b946689eb2e4edf","𠮷"],["2cef7e443c22f5835658e67749ae52d1","𠮷"],["4ab0dd1578c8c5fa25f45938ff0f8575","𠮷"],["4c392bb90a1f62796f8fba2c19b4a7de","𠮷"],["43856fd7c04a779e571fe24c47f02a6c","髙"],["265efc2a174c73ea229f9ffefa703f32","髙"],["5a7af09cce6b3005355e1c6c82df8858","髙"],["808e9b858294184933f8bf45d6291572","髙"],["27f0c69a76bf571d6dc25db389d20779","髙"],["46fb250f60436fd5f33808343893ca12","髙"],["8a8c4c67a6094d4dc6039e5fe931159c","髙"],["9257f3792fcfcd21b85524d5f86f624e","髙"],["d502a276d6f311449597ee9e576d9217","髙"],["eaa49075e50fbe1fa4b7f593dfd95620","髙"],["c01d2bafce469da1abbb612fdb16c1e3","元"],["e1ce03321fdb4eaca026a49a43e521a5","元"],["0cfa6c95283a90eff3733db1ac80f58a","元"],["52c1ad5b834821dc6b85ec27bdea1f76","元"],["ad088cffd260c1fccb655cae17b14803","元"],["a9ee52eaa5b4cc32d1891d540bfe93cc","塚"],["a00182f1de36aaee28cac80a3c89d067","塚"],["b03d44ca831a0c995116056ce23f82c5","塚"],["2d6b7d3b5ca6c02d94c5b48661045b7a","﨑"],["f5c6e02e235abd23a87f48ed6a64cdcc","﨑"],["e9a3b055bda7b9ae70bde4003a4c5885","﨑"],["cb17df533b4ebd698a038defeddecf8a","﨑"],["0ea39c05c35f96d5b5a48e9815974132","﨑"],["3f642f3778827e651c8b82a4e9f06fd3","﨑"],["447d8358f482a4e1d9495902ebe269b1","﨑"],["ca59a20f1e0ee55b74db34697f961385","﨑"],["d2eae5651260b39c4239bcf00c8a76c5","﨑"],["f55eb365a9ded45d1e620f83d9f9de26","﨑"],["2b385c2642704e44347f2f4db147c8fa","葛"],["5c3a8c3a891386a771ff8f00a239b4ba","葛"],["e8caa78518e2d690af54e2206c9538f8","彅"],["2e8659ae5e220240c5f8a97147d09df6","彅"],["7592e633260537c1dfa7e5af1000752a","彅"],["a57d3f7684c28d2a901fe6020145de32","彅"],["da3ab2d5da4d69c7d312c7d819e45856","彅"],["918e84ed41c2157aa5f5bbf9aa60514c","塡"],["b1e889986beb3a6518d8c2ea53547b7c","塡"],["d449ab392afa98c27eb817c40e2eb7ce","塡"],["e7158075f2976c353e4cf9247aae3abc","遁"],["f1a6fbb17f041cc15148163da34f541f","遁"],["a1779a3aaf215916fd0d8fbbb5bf5925","蟬"],["a3c09b57be535c0f5618d72f95884c50","蟬"],["4b9401a9f9a58c7d0f9c86120aa2dd23","鏢"],["fe00b640a48dd341573cafa94afeafa2","鏢"],["f4e1d8b42e3c49ea7c896049186d74bd","蟜"],["640130a634bd2a0f4347f933a8c5d6d6","蟜"],["62985aeebaec69314f03ff9d3080ada2","鷗"],["1bd027207977c585c5889a1e24cae94e","鷗"],["5c8022286d3bc941c12e9bbc475255dd","鷗"],["e4a837fe20dfa091e03afe4857e2482e","剝"],["bf2cccb40b985fe3af04281944beac1a","剝"],["d5451a035c4e516e5ccb9372cd533d81","剝"],["e13ae32f28d840df74a88432df9b122e","剝"],["41637d181cd99088e2120a4ec6fc18aa","嬴"],["de63abb1aaa44e6ab8a11470103377d5","嬴"],["3d32b12254e01c701c195412cb8ef37c","嬴"],["f67bc6318ccf43e7902df9a6f9622932","嬴"],["d4ce6847d78fc2f8241088b5c0be795c","嬴"],["c472e6ade04610e67904aca1b1fa1468","麃"],["db3d060943fbf888eb2fa7fd87340cba","麃"],["509cff0edcba46d5db30b2f2f45c49c9","瘣"],["4862270872e35184aab420c4d38169ad","瘣"],["def4d364d00d0f78577987eaebd42aef","齕"],["3cc113a87b49ce231a7b2ffbca4c1e18","齕"],["03dddff25be65f7c284ef8addb8a0a8b","驁"],["52aa815a5a57aff03085d31acd5afbc4","驁"],["4f0431c4c63a6a362646758e62521df8","煖"],["dbf1ab17c746c48d474b3730064ba6f2","煖"],["790c6b4da6a88f7f4fdb6fdab77fe045","煖"],["4d7ae77f2bbf9c8af03d49d466f74058","煖"],["0335ba124be8a9e0c501f4051ac5fcf5","龐"],["01d7892b430fd4362c8917ad921199b2","龐"],["e866fd7e605c8b7c8bf718c45a5438cf","龐"],["5df7d88e1e15018b3bce73e765ef72d6","槌"],["48478e1f69ea50c6f7709d47f15b4007","槌"],["4d7d276f23c92f94056b292e295ebd78","神"],["87d2b97034cf680cd86bc7fe7c500d93","神"],["f6300abbfcd6bd0db3abd41041499aaa","邂"],["26c476496eb73e15285527ab7c635f0b","邂"],["be33b9008a58bab485e17de9b2ab2626","逅"],["3a9b8b576fe8efca2dedc957732afa37","逅"],["b798637262a0c1a29c8de602d4b688c6","逅"],["a3785fd94f13646623554b180d08ac77","德"],["1f81885b0996be70410e5aa3e4aab3c6","德"],["88425dfcbd96fcb6d77ebb76f834d986","德"],["9f993f913cd0614a3a965d74e0f4c8d1","德"],["a8bb5f2f83d975edfc951a1e461befdc","德"],["cd2eadbb87d0aadf1d1cd71fed0ab02f","德"],["d22feeb00ace0a632e1a780682f937e8","德"],["c9f2fda15b722253c625aebe73f4b1d9","辻"],["04556b37bff1ccc2f3b395232e104934","辻"],["117bacaeb67e3508d23a650b98f3c143","辻"],["211d70374c1787c4bc62df15794a4692","辻"],["7ba50856c59d1de19cc9c88caaced915","辻"],["0d627ebf7693b13645336a88813fb7e3","祀"],["2c3c032660b20a485575c2d8c7d47956","祀"],["1aaec04e53f2978bdf0a127c01b34e9a","遼"],["e2c3bf09b755b0d59a8a25cba6dda273","遼"],["fb13879ba2f93a8b0a28b2cd5358d1ee","遼"],["20eff1fff8d986496b949efa604ec402","誾"],["8742940fcbdbd65aeff1566c1889ece7","誾"],["23e6ef0ecc7bbe8e9465b0b40e901c0d","厓"],["5a69785acb47d746fd1ae98bd511db81","厓"],["392b8afa18046fc06398b32a42641889","你"],["7ff2c821d31ef0ca7e9c430f3e659d46","你"],["44d8b7aacbfc1fc4c32d6526ab8012ee","祠"],["c9486b883ab870fc02e7a1f189454f49","祠"],["62e7447a02f797cf287a7a758d66563b","擲"],["7d767d2518431dd61e631941dea6bb5e","擲"],["914fa35485d5016adc8b799b0cb5e978","口"],["d50802fc331261feed1a140f3b70c4b3","口"],["eeff4833bdfc34b1cbfe6a9d98f38cb5","口"],["a6d6aaeaf5505676111390a52fa6be51","暲"],["bc534a1accc68d8876e9d47ad8d4b489","暲"],["b5e8cb114ccad281bcb4d86768d509df","銈"],["d2c0ab0242ae4ad8a08bffa71613a1a7","銈"],["f09031463933b2892be7ebbc501269d0","蕙"],["f1378529fe66a7f655031d7f5b8c4eb5","蕙"],["6b696a5ae7634c454aaa7dd833fdfaf9","眷"],["5012d099f110e5e7c0df78528686ae07","榮"],["bf27e95238dd789b05e38d56dc41cbf7","嵓"],["1d2eafa6be36dc6152cb1917cd2ac486","氏"],["8b1bd5636f709dfd6a95da9f463729c3","柀"],["0b49a77f459cf3783c5bac37a80518c5","份"],["8d1ba0e24b619cb4d377ddb7adb3e6fa","喼"],["dab4c329f3c540192f758a2e0008d275","鎚"],["5b6c90ad3012bfbbc2450b5ab930484d","翟"],["7eb78d5654f8335d0b1cf4cf78872097","鄭"],["c3852ea003683f2866abd56140fb5d84","錆"],["a78b8a79d8a32c925776c82955d168cc","郭"],["b6e773b060fdd575bc965369d509f4e0","煉"],["6d981a3b846347e2b3c9ca4d13794834","桒"],["d0ed8ffbc229f84dd796cdd6de36d2e4","䃯"],["d9aff359058ab474d552ce52e5a71ec8","卿"],["5417381484172c1607d7ca60765b62d2","蝕"],["b309cd2c649ce3ef6ea0ad2f5fc655cc","這"],["2a349ac3d6b94a8a64d904083fdd5c02","辿"],["0632283bfd909ef205b1f950e2b00f16","靑"],["d91c5a40619510b21610f523f9434269","淸"],["8dc47c6e65beb788da7ed9efd59f0934","買"],["e28d4c57d97fbe4a0d67aec2cc92e7c8","捥"],["9374173a2e4b7f1dcac75eccd5ee7e7f","榊"]]),T=(t(189),new Set(["⛌","⛍","❗","⛏","⛐","⛑","⛒","⛕","⛓","⛔","","","⛖","⛗","⛘","⛙","⛚","⛛","⛜","⛝","⛞","⛟","⛠","⛡","⭕","㉈","㉉","㉊","㉋","㉌","㉍","㉎","㉏","⒑","⒒","⒓","","","","","","","","","","","","","","","","","⬛","⬤","","","","","","⚿","","","","","","","","","","","","㊙","","⛣","⭖","⭗","⭘","⭙","☓","㊋","〒","⛨","㉆","㉅","⛩","࿖","⛪","⛫","⛬","♨","⛭","⛮","⛯","⚓","✈","⛰","⛱","⛲","⛳","⛴","⛵","","Ⓓ","Ⓢ","⛶","","","","","","⛷","⛸","⛹","⛺","","☎","⛻","⛼","⛽","⛾","","⛿","➡","⬅","⬆","⬇","⬯","⬮","","","","","㎡","㎥","㎝","㎠","㎤","","⒈","⒉","⒊","⒋","⒌","⒍","⒎","⒏","⒐","","","","","","","","","","","","","","","","","㈳","㈶","㈲","㈱","㈹","㉄","▶","◀","〖","〗","⟐","²","³","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","㉇","","","℻","㈪","㈫","㈬","㈭","㈮","㈯","㈰","㈷","㍾","㍽","㍼","㍻","№","℡","〶","⚾","","","","","","","","","","","","","","","","","","","","","","","ℓ","㎏","㎐","㏊","㎞","㎢","㍱","½","↉","⅓","⅔","¼","¾","⅕","⅖","⅗","⅘","⅙","⅚","⅐","⅛","⅑","⅒","☀","☁","☂","⛄","☖","☗","⛉","⛊","♦","♥","♣","♠","⛋","⨀","‼","⁉","⛅","☔","⛆","☃","⛇","⚡","⛈","⚞","⚟","♬","","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ","⑰","⑱","⑲","⑳","⑴","⑵","⑶","⑷","⑸","⑹","⑺","⑻","⑼","⑽","⑾","⑿","㉑","㉒","㉓","㉔","","","","","","","","","","","","","","","","","","","","","","","","","","","㉕","㉖","㉗","㉘","㉙","㉚","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","❶","❷","❸","❹","❺","❻","❼","❽","❾","❿","⓫","⓬","㉛","☎","⛌","⛍","❗","⛏","⛐","⛑","⛒","⛕","⛓","⛔","🅿","🆊","⛖","⛗","⛘","⛙","⛚","⛛","⛜","⛝","⛞","⛟","⛠","⛡","⭕","㉈","㉉","㉊","㉋","㉌","㉍","㉎","㉏","⒑","⒒","⒓","🅊","🅌","🄿","🅆","🅋","🈐","🈑","🈒","🈓","🅂","🈔","🈕","🈖","🅍","🄱","🄽","⬛","⬤","🈗","🈘","🈙","🈚","🈛","⚿","🈜","🈝","🈞","🈟","🈠","🈡","🈢","🈣","🈤","🈥","🅎","㊙","🈀","⛣","⭖","⭗","⭘","⭙","☓","㊋","⛨","㉆","㉅","⛩","࿖","⛪","⛫","⛬","⛭","⛮","⛯","⚓","✈","⛰","⛱","⛲","⛳","⛴","⛵","🅗","Ⓓ","Ⓢ","⛶","🅟","🆋","🆍","🆌","🅹","⛷","⛸","⛹","⛺","🅻","⛻","⛼","⛽","⛾","🅼","⛿","➡","⬅","⬆","⬇","⬯","⬮","㎥","㎠","㎤","🄀","⒈","⒉","⒊","⒋","⒌","⒍","⒎","⒏","⒐","🄁","🄂","🄃","🄄","🄅","🄆","🄇","🄈","🄉","🄊","㈳","㈶","㉄","⟐","🄭","🄬","🄫","㉇","🆐","🈦","℻","㈪","㈫","㈬","㈭","㈮","㈯","㈰","㈷","〶","⚾","🉀","🉁","🉂","🉃","🉄","🉅","🉆","🉇","🉈","🄪","🈧","🈨","🈩","🈔","🈪","🈫","🈬","🈭","🈮","🈯","🈰","🈱","㎐","㏊","㎢","㍱","↉","⅖","⅗","⅘","⅙","⅚","⅐","⅛","⅑","⅒","⛄","⛉","⛊","⛋","⨀","⛅","☔","⛆","⛇","⚡","⛈","⚞","⚟","⑴","⑵","⑶","⑷","⑸","⑹","⑺","⑻","⑼","⑽","⑾","⑿","🄐","🄑","🄒","🄓","🄔","🄕","🄖","🄗","🄘","🄙","🄚","🄛","🄜","🄝","🄞","🄟","🄠","🄡","🄢","🄣","🄤","🄥","🄦","🄧","🄨","🄩"])),P=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],L=function(Ne){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Me=arguments.length>2?arguments[2]:void 0;Me==null&&(Me=Ne.length);for(var Se=0,K=Qe;K>8^Ne[K])]);return Se},I=function(Ne,Qe,Me,Se,K,xe,be,Te){return 0|((V=Qe+Ne(Me,Se,K)+xe+be|0)<<(N=Te)|V>>>32-N)+Me;var V,N},x=function(Ne,Qe,Me){return Ne&Qe|~Ne&Me},O=function(Ne,Qe,Me){return Ne&Me|Qe&~Me},G=function(Ne,Qe,Me){return Ne^Qe^Me},J=function(Ne,Qe,Me){return Qe^(Ne|~Me)},te=function(Ne){var Qe=(15&Ne)>>0;return"".concat(((240&Ne)>>4).toString(16)).concat(Qe.toString(16))},le=function(Ne){var Qe=64*Math.floor((Ne.byteLength+8)/64+1),Me=new Uint8Array(Qe);Me.set(new Uint8Array(Ne),0);var Se=new DataView(Me.buffer);Se.setUint8(Ne.byteLength,128),Se.setUint32(Qe-8,8*Ne.byteLength%Math.pow(2,32),!0),Se.setUint32(Qe-4,8*Ne.byteLength/Math.pow(2,32),!0);for(var K=1732584193,xe=-271733879,be=-1732584194,Te=271733878,V=0;V>>0),ce+=te((65280&K)>>>8),ce+=te((16711680&K)>>>16),ce+=te((4278190080&K)>>>24),ce+=te((255&xe)>>>0),ce+=te((65280&xe)>>>8),ce+=te((16711680&xe)>>>16),ce+=te((4278190080&xe)>>>24),ce+=te((255&be)>>>0),ce+=te((65280&be)>>>8),ce+=te((16711680&be)>>>16),ce+=te((4278190080&be)>>>24),ce+=te((255&Te)>>>0),ce+=te((65280&Te)>>>8),(ce+=te((16711680&Te)>>>16))+te((4278190080&Te)>>>24)};function ne(Ne,Qe){return function(Me){if(Array.isArray(Me))return Me}(Ne)||function(Me,Se){if(typeof Symbol<"u"&&Symbol.iterator in Object(Me)){var K=[],xe=!0,be=!1,Te=void 0;try{for(var V,N=Me[Symbol.iterator]();!(xe=(V=N.next()).done)&&(K.push(V.value),!Se||K.length!==Se);xe=!0);}catch(S){be=!0,Te=S}finally{try{xe||N.return==null||N.return()}finally{if(be)throw Te}}return K}}(Ne,Qe)||function(Me,Se){if(Me){if(typeof Me=="string")return ee(Me,Se);var K=Object.prototype.toString.call(Me).slice(8,-1);return K==="Object"&&Me.constructor&&(K=Me.constructor.name),K==="Map"||K==="Set"?Array.from(Me):K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K)?ee(Me,Se):void 0}}(Ne,Qe)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ee(Ne,Qe){(Qe==null||Qe>Ne.length)&&(Qe=Ne.length);for(var Me=0,Se=new Array(Qe);Me>2)!==N||(L(K,S),0))}},{key:"getRGBAColorCode",value:function(K){if(K==null)return null;var xe=document.createElement("canvas");xe.width=xe.height=1;var be=xe.getContext("2d");if(!be)return null;be.fillStyle=K,be.fillRect(0,0,xe.width,xe.height);var Te=ne(be.getImageData(0,0,1,1).data,4),V=Te[0],N=Te[1],S=Te[2],F=Te[3],re="#".concat(V.toString(16).toUpperCase().padStart(2,"0")).concat(N.toString(16).toUpperCase().padStart(2,"0")).concat(S.toString(16).toUpperCase().padStart(2,"0")).concat(F.toString(16).toUpperCase().padStart(2,"0"));return xe.width=xe.height=0,re}},{key:"fillAlphaColorCode",value:function(K){if(K==null)return"";var xe=Number.parseInt(K.substring(1,3),16),be=Number.parseInt(K.substring(3,5),16),Te=Number.parseInt(K.substring(5,7),16);return"#".concat(xe.toString(16).toUpperCase().padStart(2,"0")).concat(be.toString(16).toUpperCase().padStart(2,"0")).concat(Te.toString(16).toUpperCase().padStart(2,"0"),"FF")}},{key:"getRGBAfromColorCode",value:function(K){if(K==null)return"";var xe=Number.parseInt(K.substring(1,3),16),be=Number.parseInt(K.substring(3,5),16),Te=Number.parseInt(K.substring(5,7),16),V=Number.parseInt(K.substring(7,9),16);return"rgba(".concat(xe,", ").concat(be,", ").concat(Te,", ").concat(V/255,")")}}],(Me=[{key:"initialize",value:function(){this.render_canvas=null,this.option_canvas=null,this.render_text="",this.GL=0,this.GR=2,this.G_BACK=[n.get(0),n.get(1),n.get(2),o.get(31)],this.DRCS_mapping=new Map([[15,new Map],[16,new Map],[17,new Map],[18,new Map],[19,new Map],[20,new Map],[21,new Map],[22,new Map],[23,new Map],[24,new Map],[25,new Map],[26,new Map],[27,new Map],[28,new Map],[29,new Map],[30,new Map]]),this.purpose_width=1920,this.purpose_height=1080,this.swf_x=1920,this.swf_y=1080,this.sdf_x=1920,this.sdf_y=1080,this.sdp_x=0,this.sdp_y=0,this.ssm_x=72,this.ssm_y=72,this.shs=8,this.svs=48,this.text_size_x=1,this.text_size_y=1,this.position_x=-1,this.position_y=-1,this.pallet=0,this.fg_color=g[this.pallet][7],this.bg_color=g[this.pallet][8],this.force_bg_color=null,this.hlc=0,this.stl=!1,this.orn=null,this.force_orn=null,this.timeElapsed=0,this.endTime=null,this.rendered=!1,this.PRA=null,this.normalFont="sans-serif",this.gaijiFont=this.normalFont,this.drcsReplacement=!1,this.drcsReplaceMapping=new Map,this.useStroke=!1,this.usePUA=!1}},{key:"width",value:function(){return Math.floor((this.shs+this.ssm_x)*this.text_size_x)}},{key:"height",value:function(){return Math.floor((this.svs+this.ssm_y)*this.text_size_y)}},{key:"width_magnification",value:function(){return Math.ceil(this.purpose_width/this.swf_x)}},{key:"height_magnification",value:function(){return Math.ceil(this.purpose_height/this.swf_y)}},{key:"canvas_width",value:function(){return this.swf_x*this.width_magnification()}},{key:"canvas_height",value:function(){return this.swf_y*this.height_magnification()}},{key:"move_absolute_dot",value:function(K,xe){this.position_x=K,this.position_y=xe}},{key:"move_absolute_pos",value:function(K,xe){this.position_x=this.sdp_x+K*this.width(),this.position_y=this.sdp_y+(xe+1)*this.height()}},{key:"move_relative_pos",value:function(K,xe){for((this.position_x<0||this.position_y<0)&&this.move_absolute_dot(this.sdp_x,this.sdp_y+(this.ssm_y+this.svs));K<0;)this.position_x-=this.width(),K++,this.position_x0;)this.position_x+=this.width(),K--,this.position_x>=this.sdp_x+this.sdf_x&&(this.position_x=this.sdp_x,xe++);for(;xe<0;)this.position_y-=this.height(),xe++;for(;xe>0;)this.position_y+=this.height(),xe--}},{key:"move_newline",value:function(){(this.position_x<0||this.position_y<0)&&this.move_absolute_dot(this.sdp_x,this.sdp_y+(this.ssm_y+this.svs)),this.position_x=this.sdp_x,this.position_y=this.position_y+this.height()}},{key:"render",value:function(K){var xe,be,Te,V,N,S,F,re,ce,me,ye,Pe,We,nt,et;this.initialize(),this.option_canvas=(xe=K==null?void 0:K.canvas)!==null&&xe!==void 0?xe:null,this.force_orn=(be=typeof(K==null?void 0:K.forceStrokeColor)=="boolean"?K==null?void 0:K.forceStrokeColor:Ne.getRGBAColorCode(K==null?void 0:K.forceStrokeColor))!==null&&be!==void 0?be:null,this.force_bg_color=(Te=Ne.getRGBAColorCode(K==null?void 0:K.forceBackgroundColor))!==null&&Te!==void 0?Te:null,this.purpose_width=(V=(N=K==null?void 0:K.width)!==null&&N!==void 0?N:K==null||(S=K.canvas)===null||S===void 0?void 0:S.width)!==null&&V!==void 0?V:this.purpose_width,this.purpose_height=(F=(re=K==null?void 0:K.height)!==null&&re!==void 0?re:K==null||(ce=K.canvas)===null||ce===void 0?void 0:ce.height)!==null&&F!==void 0?F:this.purpose_height,this.normalFont=(me=K==null?void 0:K.normalFont)!==null&&me!==void 0?me:"sans-serif",this.gaijiFont=(ye=K==null?void 0:K.gaijiFont)!==null&&ye!==void 0?ye:this.normalFont,this.drcsReplacement=(Pe=K==null?void 0:K.drcsReplacement)!==null&&Pe!==void 0&&Pe,this.drcsReplaceMapping=new Map(R);for(var ot,dt=Object.entries((ot=K==null?void 0:K.drcsReplaceMapping)!==null&&ot!==void 0?ot:{}),yt=0;yt0&&(this.endTime=this.startTime+this.timeElapsed),K+=1;else if(this.pes[K]===13)this.move_newline(),K+=1;else if(this.pes[K]===14)this.GL=1,K+=1;else if(this.pes[K]===15)this.GL=0,K+=1;else if(this.pes[K]===22){var re=63&this.pes[K+1];this.move_relative_pos(re,0),K+=2}else if(this.pes[K]===24)K+=1;else if(this.pes[K]===25){var ce=0,me=this.G_BACK[2];if(!me)return;for(var ye=0;ye=0||xt<0)return;for(;Vt>8),ot=127&Te,dt=(We=d.get(et))===null||We===void 0?void 0:We.alphabet;dt&&((nt=this.DRCS_mapping.get(dt))===null||nt===void 0||nt.set(ot,Pe))}else{var yt,wt=32639&Te;(yt=this.DRCS_mapping.get(15))===null||yt===void 0||yt.set(wt,Pe)}xe+=4+ye}}}}},{key:"renderCharacter",value:function(K,xe){var be;if((this.position_x<0||this.position_y<0)&&this.move_absolute_dot(this.sdp_x,this.sdp_y+(this.ssm_y+this.svs)),this.option_canvas){this.option_canvas&&!this.render_canvas&&(this.render_canvas=document.createElement("canvas"),this.render_canvas.width=this.canvas_width(),this.render_canvas.height=this.canvas_height());var Te,V=(be=this.render_canvas)===null||be===void 0?void 0:be.getContext("2d");if(V)if(xe.alphabet!==31&&(this.rendered=!0,V.fillStyle=Ne.getRGBAfromColorCode((Te=this.force_bg_color)!==null&&Te!==void 0?Te:this.bg_color),V.fillRect(this.position_x*this.width_magnification(),(this.position_y-this.height())*this.height_magnification(),this.width()*this.width_magnification(),this.height()*this.height_magnification()),1&this.hlc&&(V.fillStyle=Ne.getRGBAfromColorCode(this.fg_color),V.fillRect(this.position_x*this.width_magnification(),(this.position_y-1)*this.height_magnification(),this.width()*this.width_magnification(),1*this.height_magnification())),2&this.hlc&&(V.fillStyle=Ne.getRGBAfromColorCode(this.fg_color),V.fillRect((this.position_x+this.width()-1)*this.width_magnification(),(this.position_y-this.height())*this.height_magnification(),1*this.width_magnification(),this.height()*this.height_magnification())),4&this.hlc&&(V.fillStyle=Ne.getRGBAfromColorCode(this.fg_color),V.fillRect(this.position_x*this.width_magnification(),(this.position_y-this.height())*this.height_magnification(),this.width()*this.width_magnification(),1*this.height_magnification())),8&this.hlc&&(V.fillStyle=Ne.getRGBAfromColorCode(this.fg_color),V.fillRect(this.position_x*this.width_magnification(),(this.position_y-this.height())*this.height_magnification(),1*this.width_magnification(),this.height()*this.height_magnification())),this.stl&&(V.fillStyle=Ne.getRGBAfromColorCode(this.fg_color),V.fillRect(this.position_x*this.width_magnification(),(this.position_y-1)*this.height_magnification(),this.width()*this.width_magnification(),1*this.height_magnification()))),xe.alphabet===0){var N=94*(((65280&K)>>8)-33)+(((255&K)>>0)-33),S=7896;if(N>Vt}xt>0&&V.fillRect((this.position_x-0+Math.floor(this.shs*this.text_size_x/2)+2*Tt)*this.width_magnification()+2*Rt,(this.position_y-this.height()+Math.floor(this.svs*this.text_size_y/2)+2*Lt)*this.height_magnification()+2*bt,2*this.width_magnification(),2*this.height_magnification())}}V.fillStyle=Ne.getRGBAfromColorCode(this.fg_color);for(var Bt=0;Bt>Jt}Mt>0&&V.fillRect((this.position_x-0+Math.floor(this.shs*this.text_size_x/2)+2*jt)*this.width_magnification(),(this.position_y-this.height()+Math.floor(this.svs*this.text_size_y/2)+2*Bt)*this.height_magnification(),2*this.width_magnification(),2*this.height_magnification())}}this.move_relative_pos(1,0)}}}},{key:"renderFont",value:function(K){var xe;if(this.text_size_x===.5&&this.text_size_y===.5&&(C.includes(K)||D.includes(K))||(this.render_text+=K),this.render_canvas)if(Y!=null&&Y.has(K)){var be=Y.get(K),Te=be.viewBox,V=be.path;this.renderPath(Te,V)}else{var N=T.has(K);N&&(K+="︎");var S=(xe=this.render_canvas)===null||xe===void 0?void 0:xe.getContext("2d");if(S){var F=(this.position_x+this.width()/2)*this.width_magnification(),re=(this.position_y-this.height()/2)*this.height_magnification();S.translate(F,re),S.scale(this.text_size_x*this.width_magnification(),this.text_size_y*this.height_magnification());var ce=this.getOrnColorCode();if(ce&&(!this.force_orn||this.force_orn===!0||this.force_orn!==this.fg_color))if(this.useStroke)S.font="".concat(this.ssm_x,"px ").concat(N?this.gaijiFont:this.normalFont),S.strokeStyle=Ne.getRGBAfromColorCode(ce),S.lineJoin="round",S.textBaseline="middle",S.textAlign="center",S.lineWidth=8,S.strokeText(K,0,0);else{S.setTransform(1,0,0,1,0,0),S.translate(F,re),S.scale(this.text_size_x,this.text_size_y*this.height_magnification()/this.width_magnification());for(var me=-4*this.width_magnification();me<=4*this.width_magnification();me++)for(var ye=-4*this.width_magnification();ye<=4*this.width_magnification();ye++)S.font="".concat(this.ssm_x*this.width_magnification(),"px ").concat(N?this.gaijiFont:this.normalFont),S.fillStyle=Ne.getRGBAfromColorCode(ce),S.textBaseline="middle",S.textAlign="center",S.fillText(K,0+ye,0+me);S.setTransform(1,0,0,1,0,0),S.translate(F,re),S.scale(this.text_size_x*this.width_magnification(),this.text_size_y*this.height_magnification())}S.font="".concat(this.ssm_x,"px ").concat(N?this.gaijiFont:this.normalFont),S.fillStyle=Ne.getRGBAfromColorCode(this.fg_color),S.textBaseline="middle",S.textAlign="center",S.fillText(K,0,0),S.setTransform(1,0,0,1,0,0)}}}},{key:"renderPath",value:function(K,xe){var be;if(this.render_canvas){var Te=(be=this.render_canvas)===null||be===void 0?void 0:be.getContext("2d");if(Te){var V=(this.position_x+this.shs/2)*this.width_magnification(),N=(this.position_y-this.height()+this.svs/2)*this.height_magnification();Te.translate(V,N);var S=ne(K,4),F=S[0],re=S[1],ce=S[2]-F,me=S[3]-re;Te.scale(this.ssm_y/ce,this.ssm_y/me),Te.translate(F,re);var ye=this.getOrnColorCode();if(ye&&(!this.force_orn||this.force_orn===!0||this.force_orn!==this.fg_color))if(this.useStroke)Te.strokeStyle=Ne.getRGBAfromColorCode(ye),Te.lineJoin="round",Te.lineWidth=4*Math.max(ce/this.ssm_y,me/this.ssm_y)*2,Te.stroke(new Path2D(xe));else for(var Pe=-4*this.width_magnification();Pe<=4*this.width_magnification();Pe++)for(var We=-4*this.width_magnification();We<=4*this.width_magnification();We++)Te.translate(We,Pe),Te.fillStyle=Ne.getRGBAfromColorCode(ye),Te.fill(new Path2D(xe)),Te.translate(-We,-Pe);Te.fillStyle=Ne.getRGBAfromColorCode(this.fg_color),Te.fill(new Path2D(xe)),Te.setTransform(1,0,0,1,0,0)}}}},{key:"getOrnColorCode",value:function(){return this.force_orn===!0?Ne.fillAlphaColorCode(this.bg_color):this.force_orn===!1?this.orn:(K=this.force_orn)!==null&&K!==void 0?K:this.orn;var K}}])&&M(Qe.prototype,Me),Se&&M(Qe,Se),Ne}();function z(Ne){return(z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Qe){return typeof Qe}:function(Qe){return Qe&&typeof Symbol=="function"&&Qe.constructor===Symbol&&Qe!==Symbol.prototype?"symbol":typeof Qe})(Ne)}function q(Ne,Qe){(Qe==null||Qe>Ne.length)&&(Qe=Ne.length);for(var Me=0,Se=new Array(Qe);Me"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function se(Ne,Qe){return(se=Object.setPrototypeOf||function(Me,Se){return Me.__proto__=Se,Me})(Ne,Qe)}function Ee(Ne){return(Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(Qe){return Qe.__proto__||Object.getPrototypeOf(Qe)})(Ne)}t(7327),t(9826),t(4553),t(9554),t(2707),t(561),t(489),t(8304),t(4747);var He=function(Ne){(function(xe,be){if(typeof be!="function"&&be!==null)throw new TypeError("Super expression must either be null or a function");xe.prototype=Object.create(be&&be.prototype,{constructor:{value:xe,writable:!0,configurable:!0}}),be&&se(xe,be)})(K,Ne);var Qe,Me,Se=(Qe=K,Me=fe(),function(){var xe,be=Ee(Qe);if(Me){var Te=Ee(this).constructor;xe=Reflect.construct(be,arguments,Te)}else xe=be.apply(this,arguments);return function(V,N){return!N||z(N)!=="object"&&typeof N!="function"?function(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}(V):N}(this,xe)});function K(){return Z(this,K),Se.apply(this,arguments)}return oe(K,[{key:"addCue",value:function(xe){this.push(xe)}},{key:"removeCue",value:function(xe){var be=this.findIndex(function(Te){return Te===xe});be<0||this.splice(be,1)}},{key:"getCueById",value:function(xe){var be;return(be=this.find(function(Te){return Te.id===xe}))!==null&&be!==void 0?be:null}}]),K}(he(Array)),Ie=function(){function Ne(Qe){Z(this,Ne),this.all=new He,this.active=new He,this.polling_handler=this.polling.bind(this),this.polling_id=null,this.cues=this.all,this.oncuechange=null,this.id="",this.kind="metadata",this.label="",this.language="ja-JP",this.mode="hidden",this.inBandMetadataTrackDispatchType="",this.sourceBuffer=null,this.listeners=[],this.media=Qe}return oe(Ne,[{key:"startPolling",value:function(){this.polling_id=window.requestAnimationFrame(this.polling_handler)}},{key:"stopPolling",value:function(){this.polling_id!=null&&(window.cancelAnimationFrame(this.polling_id),this.polling_id=null)}},{key:"polling",value:function(){var Qe=this.active,Me=this.activeCues;if(Qe.length!==Me.length){var Se=null;try{Se=new CustomEvent("cuechange")}catch{(Se=document.createEvent("CustomEvent")).initCustomEvent("cuechange",!1,!1,{})}Se!=null&&(this.dispatchEvent(Se),this.oncuechange&&this.oncuechange.call(this,Se))}else for(var K=0;KSe.length||Se[xe+0]!==73||Se[xe+1]!==68||Se[xe+2]!==51||(xe+=6)+4>Se.length)break;var Te=je(Se,xe+0,xe+4);xe+=4;var V=be+3+2+1+4+Te;if(V>Se.length)break;for(var N=xe;NSe.length)break;var F=Oe(Se,N+0,N+4);if((N+=4)+4>Se.length)break;var re=je(Se,N+0,N+4);N+=6;var ce=S+4+4+2+re;if(ce>Se.length)break;if(F==="PRIV"){for(var me=N,ye=ce;Se[N]!==0&&NSe.length||Se[xe+0]===51&&Se[xe+1]===68&&Se[xe+2]===73&&(xe+=10)}return K}},{key:"setInBandMetadataTextTrack",value:function(Me){var Se;(Se=this.id3Track)===null||Se===void 0||Se.removeEventListener("cuechange",this.onID3CueChangeHandler),this.id3Track=Me,this.id3Track.mode="hidden",this.id3Track.addEventListener("cuechange",this.onID3CueChangeHandler)}},{key:"pushID3v2Cue",value:function(Me){if(!this.id3Track)return!1;var Se=Me.startTime,K=Me;if(this.id3Track.inBandMetadataTrackDispatchType==="15260DFFFF49443320FF49443320000F")return this.pushID3v2Data(Se,new Uint8Array(K.data));if(this.id3Track.inBandMetadataTrackDispatchType==="com.apple.streaming"){if(K.value.key==="PRIV")return this.pushID3v2PRIVData(Se,K.value.info,new Uint8Array(K.value.data));if(K.value.key==="TXXX")return this.pushID3v2TXXXData(Se,K.value.info,K.value.data)}else if(this.id3Track.label==="id3"){if(K.value.key==="PRIV")return this.pushID3v2PRIVData(Se,K.value.info,new Uint8Array(K.value.data));if(K.value.key==="TXXX")return this.pushID3v2TXXXData(Se,K.value.info,K.value.data)}else if(this.id3Track.label==="Timed Metadata"){if(K.frame.key==="PRIV")return this.pushID3v2PRIVData(Se,K.frame.owner,new Uint8Array(K.frame.data));if(K.frame.key==="TXXX")return this.pushID3v2TXXXData(Se,K.frame.description,K.frame.data)}return!1}},{key:"onID3CueChange",value:function(){this.id3Track&&(this.isOnSeeking||this.onTimeupdate())}},{key:"addB24Cue",value:function(Me,Se,K){var xe;if(!this.b24Track||!j.detect(K,this.rendererOption))return!1;var be=new((xe=window.VTTCue)!==null&&xe!==void 0?xe:window.TextTrackCue)(Me,Se,"");if(be.data=K,window.VTTCue)this.b24Track.addCue(be);else if(window.TextTrackCue){var Te;if(Array.prototype.some.call((Te=this.b24Track.cues)!==null&&Te!==void 0?Te:[],function(F){return F.startTime===Me}))return!1;if(this.b24Track.cues){for(var V=[],N=this.b24Track.cues.length-1;N>=0;N--)this.b24Track.cues[N].startTime>=Me&&(V.push(this.b24Track.cues[N]),this.b24Track.removeCue(this.b24Track.cues[N]));this.b24Track.addCue(be);for(var S=V.length-1;S>=0;S--)this.b24Track.addCue(V[S])}}return!0}},{key:"onB24CueChange",value:function(){if(this.media&&this.b24Track){if(this.viewCanvas){var Me=this.viewCanvas.getContext("2d");Me&&Me.clearRect(0,0,this.viewCanvas.width,this.viewCanvas.height)}if(this.rawCanvas){var Se=this.rawCanvas.getContext("2d");Se&&Se.clearRect(0,0,this.rawCanvas.width,this.rawCanvas.height)}if(this.b24Track.activeCues&&this.b24Track.activeCues.length>0){var K=this.b24Track.activeCues[this.b24Track.activeCues.length-1];if(K.startTime<=this.media.currentTime&&this.media.currentTime<=K.endTime&&!this.isOnSeeking){var xe=new j(K.data,K.startTime),be=!1;if(this.isShowing&&this.viewCanvas){var Te,V,N,S,F,re,ce,me,ye=xe.render(tt(tt({},this.rendererOption),{},{canvas:this.viewCanvas,width:(Te=(V=this.rendererOption)===null||V===void 0?void 0:V.width)!==null&&Te!==void 0?Te:this.viewCanvas.width,height:(N=(S=this.rendererOption)===null||S===void 0?void 0:S.height)!==null&&N!==void 0?N:this.viewCanvas.height}));(ye==null?void 0:ye.PRA)!=null&&((ce=this.rendererOption)===null||ce===void 0||(me=ce.PRACallback)===null||me===void 0||me.call(ce,ye.PRA)),be=(F=ye==null?void 0:ye.rendered)!==null&&F!==void 0&&F,this.textContent=(re=ye==null?void 0:ye.textContent)!==null&&re!==void 0?re:null}this.isShowing&&this.rawCanvas&&xe.render(tt(tt({},this.rendererOption),{},{canvas:this.rawCanvas,width:this.rawCanvas.width,height:this.rawCanvas.height,keepAspectRatio:!0})),this.onB24CueChangeDrawed=be}else this.onB24CueChangeDrawed=!1,this.textContent=null;for(var Pe=this.b24Track.activeCues.length-2;Pe>=0;Pe--){var We=this.b24Track.activeCues[Pe];We.endTime=Math.min(We.endTime,K.startTime),We.startTime===We.endTime&&this.b24Track.removeCue(We)}}else this.onB24CueChangeDrawed=!1,this.textContent=null}else this.onB24CueChangeDrawed=!1}},{key:"onHighResTimeupdate",value:function(){this.onTimeupdate(),this.highResTimeupdatePollingId=window.requestAnimationFrame(this.onHighResTimeupdateHandler)}},{key:"onTimeupdate",value:function(){if(this.media)if(this.prevCurrentTime!=null)if(this.id3Track&&this.id3Track.cues&&this.id3Track.cues.length!==0)if(this.isOnSeeking)this.prevCurrentTime=this.media.currentTime;else if(Math.abs(this.media.currentTime-this.prevCurrentTime)>1)this.prevCurrentTime=this.media.currentTime;else{for(var Me,Se,K=new at(Number.NEGATIVE_INFINITY,this.id3Track.cues[0].startTime),xe=[K],be=0;beMe;ye--){var Pe=xe[ye];if(Pe!==K&&this.pushID3v2Cue(Pe))break}else for(var We=Me;We0){var N=this.b24Track.activeCues[this.b24Track.activeCues.length-1];if(N.startTime<=this.media.currentTime&&this.media.currentTime<=N.endTime&&!this.isOnSeeking){var S,F,re,ce,me=new j(N.data,N.startTime);this.isShowing&&this.viewCanvas&&me.render(tt(tt({},this.rendererOption),{},{canvas:this.viewCanvas,width:(S=(F=this.rendererOption)===null||F===void 0?void 0:F.width)!==null&&S!==void 0?S:this.viewCanvas.width,height:(re=(ce=this.rendererOption)===null||ce===void 0?void 0:ce.height)!==null&&re!==void 0?re:this.viewCanvas.height})),this.isShowing&&this.rawCanvas&&me.render(tt(tt({},this.rendererOption),{},{canvas:this.rawCanvas,width:this.rawCanvas.width,height:this.rawCanvas.height,keepAspectRatio:!0}))}}}}}},{key:"onID3Addtrack",value:function(Me){if(this.media){var Se=Me.track;Se.kind==="metadata"&&(Se.inBandMetadataTrackDispatchType!=="15260DFFFF49443320FF49443320000F"&&Se.inBandMetadataTrackDispatchType!=="com.apple.streaming"&&Se.label!=="id3"||this.setInBandMetadataTextTrack(Se))}}},{key:"setupTrack",value:function(){var Me,Se;if(this.media){if((Me=this.rendererOption)!==null&&Me!==void 0&&Me.useHighResTextTrack)this.b24Track=new Ie(this.media),this.b24Track.startPolling();else{for(var K="ARIB B24 Japanese (data_identifier=0x".concat(this.data_identifier.toString(16),", data_group_id=").concat(this.data_group_id,")"),xe=0;xe=0;V--)this.b24Track.removeCue(this.b24Track.cues[V])}(Me=this.b24Track)===null||Me===void 0||Me.removeEventListener("cuechange",this.onB24CueChangeHandler),(Se=this.id3Track)===null||Se===void 0||Se.removeEventListener("cuechange",this.onID3CueChangeHandler),(K=this.media)===null||K===void 0||K.removeEventListener("seeking",this.onSeekingHandler),(xe=this.media)===null||xe===void 0||xe.removeEventListener("seeked",this.onSeekedHandler),(be=this.media)===null||be===void 0||be.textTracks.removeEventListener("addtrack",this.onID3AddtrackHandler),this.b24Track=this.id3Track=null}},{key:"cleanupCanvas",value:function(){var Me;window.removeEventListener("resize",this.onResizeHandler),(Me=this.media)===null||Me===void 0||Me.removeEventListener("resize",this.onResizeHandler),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.viewCanvas&&this.subtitleElement&&this.subtitleElement.removeChild(this.viewCanvas),this.viewCanvas&&(this.viewCanvas.width=this.viewCanvas.height=0),this.rawCanvas&&(this.rawCanvas.width=this.rawCanvas.height=0),this.viewCanvas=this.rawCanvas=null}}])&&function(Me,Se){for(var K=0;K>>1^3988292384:Se>>>=1}return~Se}function ke(Ne){return function(Qe){if(Array.isArray(Qe))return Ye(Qe)}(Ne)||function(Qe){if(typeof Symbol<"u"&&Symbol.iterator in Object(Qe))return Array.from(Qe)}(Ne)||Ae(Ne)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ae(Ne,Qe){if(Ne){if(typeof Ne=="string")return Ye(Ne,Qe);var Me=Object.prototype.toString.call(Ne).slice(8,-1);return Me==="Object"&&Ne.constructor&&(Me=Ne.constructor.name),Me==="Map"||Me==="Set"?Array.from(Ne):Me==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Me)?Ye(Ne,Qe):void 0}}function Ye(Ne,Qe){(Qe==null||Qe>Ne.length)&&(Qe=Ne.length);for(var Me=0,Se=new Array(Qe);Me>2)!==N||(L(K,S),0))}},{key:"getRGBAColorCode",value:function(K){if(K==null)return null;var xe=document.createElement("canvas");xe.width=xe.height=1;var be=xe.getContext("2d");if(!be)return null;be.fillStyle=K,be.fillRect(0,0,xe.width,xe.height);var Te,V=function(me){if(Array.isArray(me))return me}(Te=be.getImageData(0,0,1,1).data)||function(me,ye){if(typeof Symbol<"u"&&Symbol.iterator in Object(me)){var Pe=[],We=!0,nt=!1,et=void 0;try{for(var ot,dt=me[Symbol.iterator]();!(We=(ot=dt.next()).done)&&(Pe.push(ot.value),Pe.length!==4);We=!0);}catch(yt){nt=!0,et=yt}finally{try{We||dt.return==null||dt.return()}finally{if(nt)throw et}}return Pe}}(Te)||Ae(Te,4)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}(),N=V[0],S=V[1],F=V[2],re=V[3],ce="#".concat(N.toString(16).toUpperCase().padStart(2,"0")).concat(S.toString(16).toUpperCase().padStart(2,"0")).concat(F.toString(16).toUpperCase().padStart(2,"0")).concat(re.toString(16).toUpperCase().padStart(2,"0"));return xe.width=xe.height=0,ce}},{key:"fillAlphaColorCode",value:function(K){if(K==null)return"";var xe=Number.parseInt(K.substring(1,3),16),be=Number.parseInt(K.substring(3,5),16),Te=Number.parseInt(K.substring(5,7),16);return"#".concat(xe.toString(16).toUpperCase().padStart(2,"0")).concat(be.toString(16).toUpperCase().padStart(2,"0")).concat(Te.toString(16).toUpperCase().padStart(2,"0"),"FF")}},{key:"getRGBAfromColorCode",value:function(K){if(K==null)return"";var xe=Number.parseInt(K.substring(1,3),16),be=Number.parseInt(K.substring(3,5),16),Te=Number.parseInt(K.substring(5,7),16),V=Number.parseInt(K.substring(7,9),16);return"rgba(".concat(xe,", ").concat(be,", ").concat(Te,", ").concat(V/255,")")}},{key:"getRGBfromColorCode",value:function(K){if(K==null)return"";var xe=Number.parseInt(K.substring(1,3),16),be=Number.parseInt(K.substring(3,5),16),Te=Number.parseInt(K.substring(5,7),16);return"rgb(".concat(xe,", ").concat(be,", ").concat(Te,")")}},{key:"getAlphaFromColorCode",value:function(K){return K==null?Number.NaN:Number.parseInt(K.substring(7,9),16)}}],(Me=[{key:"width",value:function(){return Math.floor((this.shs+this.ssm_x)*this.text_size_x)}},{key:"height",value:function(){return Math.floor((this.svs+this.ssm_y)*this.text_size_y)}},{key:"move_absolute_dot",value:function(K,xe){this.position_x=K,this.position_y=xe}},{key:"move_absolute_pos",value:function(K,xe){this.position_x=this.sdp_x+K*this.width(),this.position_y=this.sdp_y+(xe+1)*this.height()}},{key:"move_relative_pos",value:function(K,xe){for((this.position_x<0||this.position_y<0)&&this.move_absolute_dot(this.sdp_x,this.sdp_y+(this.ssm_y+this.svs));K<0;)this.position_x-=this.width(),K++,this.position_x0;)this.position_x+=this.width(),K--,this.position_x>=this.sdp_x+this.sdf_x&&(this.position_x=this.sdp_x,xe++);for(;xe<0;)this.position_y-=this.height(),xe++;for(;xe>0;)this.position_y+=this.height(),xe--}},{key:"move_newline",value:function(){(this.position_x<0||this.position_y<0)&&this.move_absolute_dot(this.sdp_x,this.sdp_y+(this.ssm_y+this.svs)),this.position_x=this.sdp_x,this.position_y=this.position_y+this.height()}},{key:"render",value:function(K){var xe,be,Te,V,N,S,F,re;this.svg=(xe=K==null?void 0:K.svg)!==null&&xe!==void 0?xe:null,this.force_orn=(be=typeof(K==null?void 0:K.forceStrokeColor)=="boolean"?K==null?void 0:K.forceStrokeColor:Ne.getRGBAColorCode(K==null?void 0:K.forceStrokeColor))!==null&&be!==void 0?be:null,this.force_bg_color=(Te=Ne.getRGBAColorCode(K==null?void 0:K.forceBackgroundColor))!==null&&Te!==void 0?Te:null,this.normalFont=(V=K==null?void 0:K.normalFont)!==null&&V!==void 0?V:this.normalFont,this.gaijiFont=(N=K==null?void 0:K.gaijiFont)!==null&&N!==void 0?N:this.normalFont,this.drcsReplacement=(S=K==null?void 0:K.drcsReplacement)!==null&&S!==void 0&&S,this.drcsReplaceMapping=new Map(R);for(var ce,me=Object.entries((ce=K==null?void 0:K.drcsReplaceMapping)!==null&&ce!==void 0?ce:{}),ye=0;ye0&&(this.endTime=this.startTime+this.timeElapsed),K+=1;else if(this.pes[K]===13)this.move_newline(),K+=1;else if(this.pes[K]===14)this.GL=1,K+=1;else if(this.pes[K]===15)this.GL=0,K+=1;else if(this.pes[K]===22){var re=63&this.pes[K+1];this.move_relative_pos(re,0),K+=2}else if(this.pes[K]===24)K+=1;else if(this.pes[K]===25){var ce=0,me=this.G_BACK[2];if(!me)return;for(var ye=0;ye=0||Ut<0)return;for(;Bt>8),ot=127&Te,dt=(We=d.get(et))===null||We===void 0?void 0:We.alphabet;dt&&((nt=this.DRCS_mapping.get(dt))===null||nt===void 0||nt.set(ot,Pe))}else{var yt,wt=32639&Te;(yt=this.DRCS_mapping.get(15))===null||yt===void 0||yt.set(wt,Pe)}xe+=4+ye}}}}},{key:"renderCharacter",value:function(K,xe){if((this.position_x<0||this.position_y<0)&&this.move_absolute_dot(this.sdp_x,this.sdp_y+(this.ssm_y+this.svs)),this.svg!==null){if(xe.alphabet!==31){this.rendered||this.svg.setAttribute("viewBox","0 0 ".concat(this.swf_x," ").concat(this.swf_y)),this.rendered=!0;var be=this.force_bg_color||this.bg_color,Te=Ne.getAlphaFromColorCode(be);if(!this.groups.has(Te)){var V=document.createElementNS("http://www.w3.org/2000/svg","g");V.setAttribute("opacity","".concat(Te/255)),this.groups.set(Te,V),this.svg.appendChild(V)}var N=this.groups.get(Te),S=document.createElementNS("http://www.w3.org/2000/svg","rect");if(S.setAttribute("shape-rendering","crispEdges"),S.setAttribute("x","".concat(this.position_x)),S.setAttribute("y","".concat(this.position_y-this.height())),S.setAttribute("width","".concat(this.width()+1)),S.setAttribute("height","".concat(this.height()+1)),S.setAttribute("fill","".concat(Ne.getRGBfromColorCode(be))),N.appendChild(S),1&this.hlc){var F=document.createElementNS("http://www.w3.org/2000/svg","line");F.setAttribute("shape-rendering","crispEdges"),F.setAttribute("x1","".concat(this.position_x)),F.setAttribute("y1","".concat(this.position_y-1)),F.setAttribute("x2","".concat(this.position_x+this.width())),F.setAttribute("y2","".concat(this.position_y-1)),F.setAttribute("stroke","".concat(Ne.getRGBAfromColorCode(this.fg_color))),F.setAttribute("stroke-width","".concat(2)),this.svg.appendChild(F)}if(2&this.hlc){var re=document.createElementNS("http://www.w3.org/2000/svg","line");re.setAttribute("shape-rendering","crispEdges"),re.setAttribute("x1","".concat(this.position_x+this.width()-1)),re.setAttribute("y1","".concat(this.position_y-this.height())),re.setAttribute("x2","".concat(this.position_x+this.width()-1)),re.setAttribute("y2","".concat(this.position_y)),re.setAttribute("stroke","".concat(Ne.getRGBAfromColorCode(this.fg_color))),re.setAttribute("stroke-width","".concat(2)),this.svg.appendChild(re)}if(4&this.hlc){var ce=document.createElementNS("http://www.w3.org/2000/svg","line");ce.setAttribute("shape-rendering","crispEdges"),ce.setAttribute("x1","".concat(this.position_x)),ce.setAttribute("y1","".concat(this.position_y-this.height()+1)),ce.setAttribute("x2","".concat(this.position_x+this.width())),ce.setAttribute("y2","".concat(this.position_y-this.height()+1)),ce.setAttribute("stroke","".concat(Ne.getRGBAfromColorCode(this.fg_color))),ce.setAttribute("stroke-width","".concat(2)),this.svg.appendChild(ce)}if(8&this.hlc){var me=document.createElementNS("http://www.w3.org/2000/svg","line");me.setAttribute("shape-rendering","crispEdges"),me.setAttribute("x1","".concat(this.position_x+1)),me.setAttribute("y1","".concat(this.position_y-this.height())),me.setAttribute("x2","".concat(this.position_x+1)),me.setAttribute("y2","".concat(this.position_y)),me.setAttribute("stroke","".concat(Ne.getRGBAfromColorCode(this.fg_color))),me.setAttribute("stroke-width","".concat(2)),this.svg.appendChild(me)}if(this.stl){var ye=document.createElementNS("http://www.w3.org/2000/svg","line");ye.setAttribute("shape-rendering","crispEdges"),ye.setAttribute("x1","".concat(this.position_x)),ye.setAttribute("y1","".concat(this.position_y-1)),ye.setAttribute("x2","".concat(this.position_x+this.width())),ye.setAttribute("y2","".concat(this.position_y-1)),ye.setAttribute("stroke","".concat(Ne.getRGBAfromColorCode(this.fg_color))),ye.setAttribute("stroke-width","".concat(2)),this.svg.appendChild(ye)}}if(xe.alphabet===0){var Pe=94*(((65280&K)>>8)-33)+(((255&K)>>0)-33),We=7896;if(Pe>$t}di>0&&Bt.fillRect(2*(2+Wt+Ot),2*(2+Jt+Mt),2,2)}}Bt.fillStyle=Ne.getRGBAfromColorCode(this.fg_color);for(var ui=0;ui>Pi}li>0&&Bt.fillRect(2*(2+ti),2*(2+ui),2,2)}var mi=document.createElementNS("http://www.w3.org/2000/svg","image");if(mi.setAttribute("href",Tt.toDataURL()),mi.setAttribute("x","".concat(this.position_x+Math.floor(this.shs*this.text_size_x/2)-4)),mi.setAttribute("y","".concat(this.position_y+Math.floor(this.svs*this.text_size_y/2)-this.height()-4)),mi.setAttribute("width","".concat(Tt.width/2*2)),mi.setAttribute("height","".concat(Tt.height/2*2)),this.flc===0){var gi=document.createElementNS("http://www.w3.org/2000/svg","animate");gi.setAttribute("attributeName","opacity"),gi.setAttribute("values","1;0"),gi.setAttribute("dur","1s"),gi.setAttribute("calcMode","discrete"),gi.setAttribute("repeatCount","indefinite"),mi.appendChild(gi)}else if(this.flc===7){var Kt=document.createElementNS("http://www.w3.org/2000/svg","animate");Kt.setAttribute("attributeName","opacity"),Kt.setAttribute("values","0;1"),Kt.setAttribute("dur","1s"),Kt.setAttribute("calcMode","discrete"),Kt.setAttribute("repeatCount","indefinite"),mi.appendChild(Kt)}this.svg.appendChild(mi)}this.move_relative_pos(1,0)}}}},{key:"renderFont",value:function(K){var xe,be;this.text_size_x===.5&&this.text_size_y===.5&&(C.includes(K)||D.includes(K))||(this.text+=K);var Te=T.has(K),V=Te?this.gaijiFont:this.normalFont;if(mt!=null&&(xe=mt)!==null&&xe!==void 0&&xe.has(K)){var N=mt.get(K),S=N.viewBox,F=N.path;this.renderPath(S,F)}else{Te&&(K+="︎");var re=document.createElementNS("http://www.w3.org/2000/svg","text");if(re.setAttribute("x","0"),re.setAttribute("y","0"),re.setAttribute("transform","scale(".concat(this.text_size_x," ").concat(this.text_size_y,") translate(").concat((this.position_x+this.width()/2)/this.text_size_x," ").concat((this.position_y-this.height()/2)/this.text_size_y,")")),re.setAttribute("transform-origin","0 0"),re.setAttribute("font-size","".concat(this.ssm_x)),re.setAttribute("font-family",V),re.setAttribute("dominant-baseline","central"),re.setAttribute("text-anchor","middle"),re.setAttribute("fill",Ne.getRGBAfromColorCode(this.fg_color)),re.setAttribute("paint-order","stroke"),re.setAttribute("stroke-linejoin","round"),re.setAttribute("stroke-width",this.getOrnColorCode()?"".concat(8):"0"),re.setAttribute("stroke",this.getOrnColorCode()?Ne.getRGBAfromColorCode(this.getOrnColorCode()):"transparent"),re.appendChild(document.createTextNode(K)),this.flc===0){var ce=document.createElementNS("http://www.w3.org/2000/svg","animate");ce.setAttribute("attributeName","opacity"),ce.setAttribute("values","1;0"),ce.setAttribute("dur","1s"),ce.setAttribute("calcMode","discrete"),ce.setAttribute("repeatCount","indefinite"),re.appendChild(ce)}else if(this.flc===7){var me=document.createElementNS("http://www.w3.org/2000/svg","animate");me.setAttribute("attributeName","opacity"),me.setAttribute("values","0;1"),me.setAttribute("dur","1s"),me.setAttribute("calcMode","discrete"),me.setAttribute("repeatCount","indefinite"),re.appendChild(me)}(be=this.svg)===null||be===void 0||be.appendChild(re)}}},{key:"renderPath",value:function(K,xe){var be;document.createElementNS("http://www.w3.org/2000/svg","svg").setAttribute("viewBox","".concat(K[0]," ").concat(K[1]," ").concat(K[2]," ").concat(K[3]));var Te=this.ssm_x*this.text_size_x/(K[2]-K[0]),V=this.ssm_y*this.text_size_y/(K[3]-K[1]),N=this.shs*this.text_size_x/2,S=this.svs*this.text_size_y/2,F=document.createElementNS("http://www.w3.org/2000/svg","path");if(F.setAttribute("d",xe),F.setAttribute("x","0"),F.setAttribute("y","0"),F.setAttribute("transform","scale(".concat(Te," ").concat(V,") translate(").concat((this.position_x+N)/Te," ").concat((this.position_y+S-this.height())/V,")")),F.setAttribute("transform-origin","0 0"),F.setAttribute("fill",Ne.getRGBAfromColorCode(this.fg_color)),F.setAttribute("paint-order","stroke"),F.setAttribute("stroke-linejoin","round"),F.setAttribute("stroke-width",this.getOrnColorCode()?"".concat(4/Math.min(Te,V)):"0"),F.setAttribute("stroke",this.getOrnColorCode()?Ne.getRGBAfromColorCode(this.getOrnColorCode()):"transparent"),this.flc===0){var re=document.createElementNS("http://www.w3.org/2000/svg","animate");re.setAttribute("attributeName","opacity"),re.setAttribute("values","1;0"),re.setAttribute("dur","1s"),re.setAttribute("calcMode","discrete"),re.setAttribute("repeatCount","indefinite"),F.appendChild(re)}else if(this.flc===7){var ce=document.createElementNS("http://www.w3.org/2000/svg","animate");ce.setAttribute("attributeName","opacity"),ce.setAttribute("values","0;1"),ce.setAttribute("dur","1s"),ce.setAttribute("calcMode","discrete"),ce.setAttribute("repeatCount","indefinite"),F.appendChild(ce)}(be=this.svg)===null||be===void 0||be.appendChild(F)}},{key:"parseBitmap",value:function(K,xe){if(this.svg!==null){this.rendered||this.svg.setAttribute("viewBox","0 0 ".concat(this.swf_x," ").concat(this.swf_y)),this.rendered=!0;var be=this.pes[K]<<8|this.pes[K+1];K+=2;var Te=this.pes[K]<<8|this.pes[K+1];K+=2;var V=this.pes[K];K+=1;var N=new Set(this.pes.subarray(K,K+V));if(!((K+=V)+33>xe)){var S=this.pes.subarray(K,K+33),F=this.pes.subarray(K+33,xe),re=new Uint8Array(S.byteLength+F.byteLength+396+140),ce=new DataView(re.buffer);re.set(S,0),re.set(F,569);for(var me=0;me<8;me++)for(var ye=0;ye<16;ye++)if(!N.has(16*me+ye)){var Pe=g[me][ye],We=Number.parseInt(Pe.substring(1,3),16),nt=Number.parseInt(Pe.substring(3,5),16),et=Number.parseInt(Pe.substring(5,7),16),ot=Number.parseInt(Pe.substring(7,9),16);re[41+3*(16*me+ye)]=We,re[41+3*(16*me+ye)+1]=nt,re[41+3*(16*me+ye)+2]=et,re[437+(16*me+ye)]=ot}ce.setInt32(33,384,!1),re[37]=80,re[38]=76,re[39]=84,re[40]=69,ce.setInt32(429,128,!1),re[433]=116,re[434]=82,re[435]=78,re[436]=83,ce.setInt32(425,W(re,37,425),!1),ce.setInt32(565,W(re,433,565),!1);var dt=ce.getInt32(16,!1),yt=ce.getInt32(20,!1),wt=document.createElementNS("http://www.w3.org/2000/svg","svg");wt.setAttribute("x","".concat(this.sdp_x)),wt.setAttribute("y","".concat(this.sdp_y)),wt.setAttribute("width","".concat(this.sdf_x)),wt.setAttribute("height","".concat(this.sdf_y)),wt.setAttribute("viewBox","0 0 ".concat(this.sdf_x," ").concat(this.sdf_y));var bt=document.createElementNS("http://www.w3.org/2000/svg","image");if(bt.setAttribute("href","data:image/png;base64,"+window.btoa(String.fromCharCode.apply(String,ke(re)))),bt.setAttribute("x","".concat(2*be)),bt.setAttribute("y","".concat(2*Te)),bt.setAttribute("width","".concat(2*dt)),bt.setAttribute("height","".concat(2*yt)),wt.appendChild(bt),N.size>0){for(var Rt=0;Rt<8;Rt++)for(var Lt=0;Lt<16;Lt++)if(N.has(16*Rt+Lt)){var Tt=g[Rt][Lt],xt=Number.parseInt(Tt.substring(1,3),16),Ut=Number.parseInt(Tt.substring(3,5),16),Vt=Number.parseInt(Tt.substring(5,7),16),Bt=Number.parseInt(Tt.substring(7,9),16);re[41+3*(16*Rt+Lt)]=xt,re[41+3*(16*Rt+Lt)+1]=Ut,re[41+3*(16*Rt+Lt)+2]=Vt,re[437+(16*Rt+Lt)]=Bt}else re[437+(16*Rt+Lt)]=0;ce.setInt32(425,W(re,37,425),!1),ce.setInt32(565,W(re,433,565),!1);var jt=document.createElementNS("http://www.w3.org/2000/svg","image");jt.setAttribute("href","data:image/png;base64,"+window.btoa(String.fromCharCode.apply(String,ke(re)))),jt.setAttribute("x","".concat(2*be)),jt.setAttribute("y","".concat(2*Te)),jt.setAttribute("width","".concat(2*dt)),jt.setAttribute("height","".concat(2*yt));var Mt=document.createElementNS("http://www.w3.org/2000/svg","animate");Mt.setAttribute("attributeName","opacity"),Mt.setAttribute("values","1;0"),Mt.setAttribute("dur","1s"),Mt.setAttribute("calcMode","discrete"),Mt.setAttribute("repeatCount","indefinite"),jt.appendChild(Mt),wt.appendChild(jt)}this.svg.appendChild(wt)}}}},{key:"getOrnColorCode",value:function(){return this.force_orn===!0?Ne.fillAlphaColorCode(this.bg_color):this.force_orn===!1?this.orn:(K=this.force_orn)!==null&&K!==void 0?K:this.orn;var K}}])&<(Qe.prototype,Me),Se&<(Qe,Se),Ne}();function Ve(Ne,Qe){var Me=Object.keys(Ne);if(Object.getOwnPropertySymbols){var Se=Object.getOwnPropertySymbols(Ne);Qe&&(Se=Se.filter(function(K){return Object.getOwnPropertyDescriptor(Ne,K).enumerable})),Me.push.apply(Me,Se)}return Me}function De(Ne){for(var Qe=1;QeSe.length||Se[xe+0]!==73||Se[xe+1]!==68||Se[xe+2]!==51||(xe+=6)+4>Se.length)break;var Te=je(Se,xe+0,xe+4);xe+=4;var V=be+3+2+1+4+Te;if(V>Se.length)break;for(var N=xe;NSe.length)break;var F=Oe(Se,N+0,N+4);if((N+=4)+4>Se.length)break;var re=je(Se,N+0,N+4);N+=6;var ce=S+4+4+2+re;if(ce>Se.length)break;if(F==="PRIV"){for(var me=N,ye=ce;Se[N]!==0&&NSe.length||Se[xe+0]===51&&Se[xe+1]===68&&Se[xe+2]===73&&(xe+=10)}return K}},{key:"setInBandMetadataTextTrack",value:function(Me){var Se;(Se=this.id3Track)===null||Se===void 0||Se.removeEventListener("cuechange",this.onID3CueChangeHandler),this.id3Track=Me,this.id3Track.mode="hidden",this.id3Track.addEventListener("cuechange",this.onID3CueChangeHandler)}},{key:"pushID3v2Cue",value:function(Me){if(!this.id3Track)return!1;var Se=Me.startTime,K=Me;if(this.id3Track.inBandMetadataTrackDispatchType==="15260DFFFF49443320FF49443320000F")return this.pushID3v2Data(Se,new Uint8Array(K.data));if(this.id3Track.inBandMetadataTrackDispatchType==="com.apple.streaming"){if(K.value.key==="PRIV")return this.pushID3v2PRIVData(Se,K.value.info,new Uint8Array(K.value.data));if(K.value.key==="TXXX")return this.pushID3v2TXXXData(Se,K.value.info,K.value.data)}else if(this.id3Track.label==="id3"){if(K.value.key==="PRIV")return this.pushID3v2PRIVData(Se,K.value.info,new Uint8Array(K.value.data));if(K.value.key==="TXXX")return this.pushID3v2TXXXData(Se,K.value.info,K.value.data)}else if(this.id3Track.label==="Timed Metadata"){if(K.frame.key==="PRIV")return this.pushID3v2PRIVData(Se,K.frame.owner,new Uint8Array(K.frame.data));if(K.frame.key==="TXXX")return this.pushID3v2TXXXData(Se,K.frame.description,K.frame.data)}return!1}},{key:"onID3CueChange",value:function(){this.id3Track&&(this.isOnSeeking||this.onTimeupdate())}},{key:"addB24Cue",value:function(Me,Se,K){var xe;if(!this.b24Track||!Ue.detect(K,this.rendererOption))return!1;var be=new((xe=window.VTTCue)!==null&&xe!==void 0?xe:window.TextTrackCue)(Me,Se,"");if(be.data=K,window.VTTCue)this.b24Track.addCue(be);else if(window.TextTrackCue){var Te;if(Array.prototype.some.call((Te=this.b24Track.cues)!==null&&Te!==void 0?Te:[],function(F){return F.startTime===Me}))return!1;if(this.b24Track.cues){for(var V=[],N=this.b24Track.cues.length-1;N>=0;N--)this.b24Track.cues[N].startTime>=Me&&(V.push(this.b24Track.cues[N]),this.b24Track.removeCue(this.b24Track.cues[N]));this.b24Track.addCue(be);for(var S=V.length-1;S>=0;S--)this.b24Track.addCue(V[S])}}return!0}},{key:"onB24CueChange",value:function(){if(this.media&&this.b24Track){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);if(this.b24Track.activeCues&&this.b24Track.activeCues.length>0){var Me=this.b24Track.activeCues[this.b24Track.activeCues.length-1];if(Me.startTime<=this.media.currentTime&&this.media.currentTime<=Me.endTime&&!this.isOnSeeking){var Se=new Ue(Me.data,Me.startTime);if(this.isShowing){var K,xe,be,Te=Se.render(De(De({},this.rendererOption),{},{svg:this.svg}));(Te==null?void 0:Te.PRA)!=null&&((xe=this.rendererOption)===null||xe===void 0||(be=xe.PRACallback)===null||be===void 0||be.call(xe,Te.PRA)),Te==null||Te.rendered,this.textContent=(K=Te==null?void 0:Te.textContent)!==null&&K!==void 0?K:null}this.onB24CueChangeDrawed=!0}else this.onB24CueChangeDrawed=!1,this.textContent=null;for(var V=this.b24Track.activeCues.length-2;V>=0;V--){var N=this.b24Track.activeCues[V];N.endTime=Math.min(N.endTime,Me.startTime),N.startTime===N.endTime&&this.b24Track.removeCue(N)}}else this.onB24CueChangeDrawed=!1,this.textContent=null}else this.onB24CueChangeDrawed=!1}},{key:"onHighResTimeupdate",value:function(){this.onTimeupdate(),this.highResTimeupdatePollingId=window.requestAnimationFrame(this.onHighResTimeupdateHandler)}},{key:"onTimeupdate",value:function(){if(this.media)if(this.prevCurrentTime!=null)if(this.id3Track&&this.id3Track.cues&&this.id3Track.cues.length!==0)if(this.isOnSeeking)this.prevCurrentTime=this.media.currentTime;else if(Math.abs(this.media.currentTime-this.prevCurrentTime)>1)this.prevCurrentTime=this.media.currentTime;else{for(var Me,Se,K=new at(Number.NEGATIVE_INFINITY,this.id3Track.cues[0].startTime),xe=[K],be=0;beMe;ye--){var Pe=xe[ye];if(Pe!==K&&this.pushID3v2Cue(Pe))break}else for(var We=Me;We=0;V--)this.b24Track.removeCue(this.b24Track.cues[V])}(Me=this.b24Track)===null||Me===void 0||Me.removeEventListener("cuechange",this.onB24CueChangeHandler),(Se=this.id3Track)===null||Se===void 0||Se.removeEventListener("cuechange",this.onID3CueChangeHandler),(K=this.media)===null||K===void 0||K.removeEventListener("seeking",this.onSeekingHandler),(xe=this.media)===null||xe===void 0||xe.removeEventListener("seeked",this.onSeekedHandler),(be=this.media)===null||be===void 0||be.textTracks.removeEventListener("addtrack",this.onID3AddtrackHandler),this.b24Track=this.id3Track=null}},{key:"cleanupSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild)}}])&&function(Me,Se){for(var K=0;KNe.length)&&(Qe=Ne.length);for(var Me=0,Se=new Array(Qe);Me>2)!==N||(L(K,S),0))}},{key:"getRGBAColorCode",value:function(K){if(K==null)return null;var xe=document.createElement("canvas");xe.width=xe.height=1;var be=xe.getContext("2d");if(!be)return null;be.fillStyle=K,be.fillRect(0,0,xe.width,xe.height);var Te,V=function(me){if(Array.isArray(me))return me}(Te=be.getImageData(0,0,1,1).data)||function(me,ye){if(typeof Symbol<"u"&&Symbol.iterator in Object(me)){var Pe=[],We=!0,nt=!1,et=void 0;try{for(var ot,dt=me[Symbol.iterator]();!(We=(ot=dt.next()).done)&&(Pe.push(ot.value),Pe.length!==4);We=!0);}catch(yt){nt=!0,et=yt}finally{try{We||dt.return==null||dt.return()}finally{if(nt)throw et}}return Pe}}(Te)||function(me,ye){if(me){if(typeof me=="string")return gt(me,4);var Pe=Object.prototype.toString.call(me).slice(8,-1);return Pe==="Object"&&me.constructor&&(Pe=me.constructor.name),Pe==="Map"||Pe==="Set"?Array.from(me):Pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Pe)?gt(me,4):void 0}}(Te)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}(),N=V[0],S=V[1],F=V[2],re=V[3],ce="#".concat(N.toString(16).toUpperCase().padStart(2,"0")).concat(S.toString(16).toUpperCase().padStart(2,"0")).concat(F.toString(16).toUpperCase().padStart(2,"0")).concat(re.toString(16).toUpperCase().padStart(2,"0"));return xe.width=xe.height=0,ce}},{key:"fillAlphaColorCode",value:function(K){if(K==null)return"";var xe=Number.parseInt(K.substring(1,3),16),be=Number.parseInt(K.substring(3,5),16),Te=Number.parseInt(K.substring(5,7),16);return"#".concat(xe.toString(16).toUpperCase().padStart(2,"0")).concat(be.toString(16).toUpperCase().padStart(2,"0")).concat(Te.toString(16).toUpperCase().padStart(2,"0"),"FF")}},{key:"getRGBAfromColorCode",value:function(K){if(K==null)return"";var xe=Number.parseInt(K.substring(1,3),16),be=Number.parseInt(K.substring(3,5),16),Te=Number.parseInt(K.substring(5,7),16),V=Number.parseInt(K.substring(7,9),16);return"rgba(".concat(xe,", ").concat(be,", ").concat(Te,", ").concat(V/255,")")}}],(Me=[{key:"width",value:function(){return Math.floor((this.shs+this.ssm_x)*this.text_size_x)}},{key:"height",value:function(){return Math.floor((this.svs+this.ssm_y)*this.text_size_y)}},{key:"move_absolute_dot",value:function(K,xe){this.position_x=K,this.position_y=xe}},{key:"move_absolute_pos",value:function(K,xe){this.position_x=this.sdp_x+K*this.width(),this.position_y=this.sdp_y+(xe+1)*this.height()}},{key:"move_relative_pos",value:function(K,xe){for((this.position_x<0||this.position_y<0)&&this.move_absolute_dot(this.sdp_x,this.sdp_y+(this.ssm_y+this.svs));K<0;)this.position_x-=this.width(),K++,this.position_x0;)this.position_x+=this.width(),K--,this.position_x>=this.sdp_x+this.sdf_x&&(this.position_x=this.sdp_x,xe++);for(;xe<0;)this.position_y-=this.height(),xe++;for(;xe>0;)this.position_y+=this.height(),xe--}},{key:"move_newline",value:function(){(this.position_x<0||this.position_y<0)&&this.move_absolute_dot(this.sdp_x,this.sdp_y+(this.ssm_y+this.svs)),this.position_x=this.sdp_x,this.position_y=this.position_y+this.height()}},{key:"render",value:function(K){var xe,be,Te,V,N,S,F,re;this.table=(xe=K==null?void 0:K.table)!==null&&xe!==void 0?xe:null,this.force_orn=(be=typeof(K==null?void 0:K.forceStrokeColor)=="boolean"?K==null?void 0:K.forceStrokeColor:Ne.getRGBAColorCode(K==null?void 0:K.forceStrokeColor))!==null&&be!==void 0?be:null,this.force_bg_color=(Te=Ne.getRGBAColorCode(K==null?void 0:K.forceBackgroundColor))!==null&&Te!==void 0?Te:null,this.normalFont=(V=K==null?void 0:K.normalFont)!==null&&V!==void 0?V:this.normalFont,this.gaijiFont=(N=K==null?void 0:K.gaijiFont)!==null&&N!==void 0?N:this.normalFont,this.drcsReplacement=(S=K==null?void 0:K.drcsReplacement)!==null&&S!==void 0&&S,this.drcsReplaceMapping=new Map(R);for(var ce,me=Object.entries((ce=K==null?void 0:K.drcsReplaceMapping)!==null&&ce!==void 0?ce:{}),ye=0;ye0&&(this.endTime=this.startTime+this.timeElapsed),K+=1;else if(this.pes[K]===13)this.move_newline(),K+=1;else if(this.pes[K]===14)this.GL=1,K+=1;else if(this.pes[K]===15)this.GL=0,K+=1;else if(this.pes[K]===22){var re=63&this.pes[K+1];this.move_relative_pos(re,0),K+=2}else if(this.pes[K]===24)K+=1;else if(this.pes[K]===25){var ce=0,me=this.G_BACK[2];if(!me)return;for(var ye=0;ye>8),ot=127&Te,dt=(We=d.get(et))===null||We===void 0?void 0:We.alphabet;dt&&((nt=this.DRCS_mapping.get(dt))===null||nt===void 0||nt.set(ot,Pe))}else{var yt,wt=32639&Te;(yt=this.DRCS_mapping.get(15))===null||yt===void 0||yt.set(wt,Pe)}xe+=4+ye}}}}},{key:"renderCharacter",value:function(K,xe){if((this.position_x<0||this.position_y<0)&&this.move_absolute_dot(this.sdp_x,this.sdp_y+(this.ssm_y+this.svs)),this.table!==null){if(this.cells===null){this.table.parentElement&&(this.table.parentElement.style.position="absolute",this.table.parentElement.style.width="".concat(this.swf_x,"px"),this.table.parentElement.style.height="".concat(this.swf_y,"px")),this.table.style.willChange="transform",this.table.style.position="absolute",this.table.style.left="".concat(this.sdp_x,"px"),this.table.style.top="".concat(this.sdp_y,"px"),this.table.style.width="".concat(this.sdf_x,"px"),this.table.style.height="".concat(this.sdf_y,"px"),this.table.style.boxSizing="border-box",this.table.style.border="none",this.table.style.borderCollapse="collapse";for(var be=[],Te=0,V=0;Te>8)-33)+(((255&K)>>0)-33),ce=7896;if(re>Jt}Mt>0&&Tt.fillRect(2/this.text_size_x+jt+Vt,2/this.text_size_y+Bt+Ut,1,1)}}Tt.fillStyle=Ne.getRGBAfromColorCode(this.fg_color);for(var Wt=0;Wt>ui}oi>0&&Tt.fillRect(2/this.text_size_x+di,2/this.text_size_y+Wt,1,1)}for(var ti=Math.floor(2*this.text_size_x),li=Math.floor(2*this.text_size_y),wi=Math.round((this.position_x-this.sdp_x)/(this.ssm_x+this.shs)*2),Pi=Math.round((this.position_y-this.height()-this.sdp_y)/(this.ssm_y+this.svs)*2),mi=0;miSe.length||Se[xe+0]!==73||Se[xe+1]!==68||Se[xe+2]!==51||(xe+=6)+4>Se.length)break;var Te=je(Se,xe+0,xe+4);xe+=4;var V=be+3+2+1+4+Te;if(V>Se.length)break;for(var N=xe;NSe.length)break;var F=Oe(Se,N+0,N+4);if((N+=4)+4>Se.length)break;var re=je(Se,N+0,N+4);N+=6;var ce=S+4+4+2+re;if(ce>Se.length)break;if(F==="PRIV"){for(var me=N,ye=ce;Se[N]!==0&&NSe.length||Se[xe+0]===51&&Se[xe+1]===68&&Se[xe+2]===73&&(xe+=10)}return K}},{key:"setInBandMetadataTextTrack",value:function(Me){var Se;(Se=this.id3Track)===null||Se===void 0||Se.removeEventListener("cuechange",this.onID3CueChangeHandler),this.id3Track=Me,this.id3Track.mode="hidden",this.id3Track.addEventListener("cuechange",this.onID3CueChangeHandler)}},{key:"pushID3v2Cue",value:function(Me){if(!this.id3Track)return!1;var Se=Me.startTime,K=Me;if(this.id3Track.inBandMetadataTrackDispatchType==="15260DFFFF49443320FF49443320000F")return this.pushID3v2Data(Se,new Uint8Array(K.data));if(this.id3Track.inBandMetadataTrackDispatchType==="com.apple.streaming"){if(K.value.key==="PRIV")return this.pushID3v2PRIVData(Se,K.value.info,new Uint8Array(K.value.data));if(K.value.key==="TXXX")return this.pushID3v2TXXXData(Se,K.value.info,K.value.data)}else if(this.id3Track.label==="id3"){if(K.value.key==="PRIV")return this.pushID3v2PRIVData(Se,K.value.info,new Uint8Array(K.value.data));if(K.value.key==="TXXX")return this.pushID3v2TXXXData(Se,K.value.info,K.value.data)}else if(this.id3Track.label==="Timed Metadata"){if(K.frame.key==="PRIV")return this.pushID3v2PRIVData(Se,K.frame.owner,new Uint8Array(K.frame.data));if(K.frame.key==="TXXX")return this.pushID3v2TXXXData(Se,K.frame.description,K.frame.data)}return!1}},{key:"onID3CueChange",value:function(){this.id3Track&&(this.isOnSeeking||this.onTimeupdate())}},{key:"addB24Cue",value:function(Me,Se,K){var xe;if(!this.b24Track||!At.detect(K,this.rendererOption))return!1;var be=new((xe=window.VTTCue)!==null&&xe!==void 0?xe:window.TextTrackCue)(Me,Se,"");if(be.data=K,window.VTTCue)this.b24Track.addCue(be);else if(window.TextTrackCue){var Te;if(Array.prototype.some.call((Te=this.b24Track.cues)!==null&&Te!==void 0?Te:[],function(F){return F.startTime===Me}))return!1;if(this.b24Track.cues){for(var V=[],N=this.b24Track.cues.length-1;N>=0;N--)this.b24Track.cues[N].startTime>=Me&&(V.push(this.b24Track.cues[N]),this.b24Track.removeCue(this.b24Track.cues[N]));this.b24Track.addCue(be);for(var S=V.length-1;S>=0;S--)this.b24Track.addCue(V[S])}}return!0}},{key:"onB24CueChange",value:function(){if(this.media&&this.b24Track){if(this.table)for(;this.table.firstChild;)this.table.removeChild(this.table.firstChild);if(this.b24Track.activeCues&&this.b24Track.activeCues.length>0){var Me=this.b24Track.activeCues[this.b24Track.activeCues.length-1];if(Me.startTime<=this.media.currentTime&&this.media.currentTime<=Me.endTime&&!this.isOnSeeking){var Se,K,xe,be,Te,V=new At(Me.data,Me.startTime).render($e($e({},this.rendererOption),{},{table:(Se=this.table)!==null&&Se!==void 0?Se:void 0}));(V==null?void 0:V.PRA)!=null&&((be=this.rendererOption)===null||be===void 0||(Te=be.PRACallback)===null||Te===void 0||Te.call(be,V.PRA)),V!=null&&V.rendered&&this.onResize(),this.onB24CueChangeDrawed=(K=V==null?void 0:V.rendered)!==null&&K!==void 0&&K,this.textContent=(xe=V==null?void 0:V.textContent)!==null&&xe!==void 0?xe:null}else this.onB24CueChangeDrawed=!1,this.textContent=null;for(var N=this.b24Track.activeCues.length-2;N>=0;N--){var S=this.b24Track.activeCues[N];S.endTime=Math.min(S.endTime,Me.startTime),S.startTime===S.endTime&&this.b24Track.removeCue(S)}}else this.onB24CueChangeDrawed=!1,this.textContent=null}else this.onB24CueChangeDrawed=!1}},{key:"onHighResTimeupdate",value:function(){this.onTimeupdate(),this.highResTimeupdatePollingId=window.requestAnimationFrame(this.onHighResTimeupdateHandler)}},{key:"onTimeupdate",value:function(){if(this.media)if(this.prevCurrentTime!=null)if(this.id3Track&&this.id3Track.cues&&this.id3Track.cues.length!==0)if(this.isOnSeeking)this.prevCurrentTime=this.media.currentTime;else if(Math.abs(this.media.currentTime-this.prevCurrentTime)>1)this.prevCurrentTime=this.media.currentTime;else{for(var Me,Se,K=new at(Number.NEGATIVE_INFINITY,this.id3Track.cues[0].startTime),xe=[K],be=0;beMe;ye--){var Pe=xe[ye];if(Pe!==K&&this.pushID3v2Cue(Pe))break}else for(var We=Me;We=0;V--)this.b24Track.removeCue(this.b24Track.cues[V])}(Me=this.b24Track)===null||Me===void 0||Me.removeEventListener("cuechange",this.onB24CueChangeHandler),(Se=this.id3Track)===null||Se===void 0||Se.removeEventListener("cuechange",this.onID3CueChangeHandler),(K=this.media)===null||K===void 0||K.removeEventListener("seeking",this.onSeekingHandler),(xe=this.media)===null||xe===void 0||xe.removeEventListener("seeked",this.onSeekedHandler),(be=this.media)===null||be===void 0||be.textTracks.removeEventListener("addtrack",this.onID3AddtrackHandler),this.b24Track=this.id3Track=null}},{key:"cleanupTable",value:function(){var Me;window.removeEventListener("resize",this.onResizeHandler),(Me=this.media)===null||Me===void 0||Me.removeEventListener("resize",this.onResizeHandler),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.table&&this.wrapper&&this.wrapper.removeChild(this.table),this.wrapper&&this.subtitleElement&&this.subtitleElement.removeChild(this.wrapper),this.wrapper=this.table=null}}])&&function(Me,Se){for(var K=0;K>8&255]},ie=function(tt){return[255&tt,tt>>8&255,tt>>16&255,tt>>24&255]},fe=function(tt){return tt[3]<<24|tt[2]<<16|tt[1]<<8|tt[0]},se=function(tt){return Z(tt,23,4)},Ee=function(tt){return Z(tt,52,8)},He=function(tt,pe){L(tt.prototype,pe,{get:function(){return G(this)[pe]}})},Ie=function(tt,pe,ue,W){var ke=C(ue),Ae=G(tt);if(ke+pe>Ae.byteLength)throw q(ne);var Ye=G(Ae.buffer).bytes,lt=ke+Ae.byteOffset,mt=Ye.slice(lt,lt+pe);return W?mt:mt.reverse()},at=function(tt,pe,ue,W,ke,Ae){var Ye=C(ue),lt=G(tt);if(Ye+pe>lt.byteLength)throw q(ne);for(var mt=G(lt.buffer).bytes,Ue=Ye+lt.byteOffset,Ve=W(+ke),De=0;DeOe;)(je=_e[Oe++])in M||d(M,je,ee[je]);ht.constructor=M}T&&R(j)!==z&&T(j,z);var pt=new Y(new M(2)),vt=j.setInt8;pt.setInt8(0,2147483648),pt.setInt8(1,2147483649),!pt.getInt8(0)&&pt.getInt8(1)||g(j,{setInt8:function(tt,pe){vt.call(this,tt,pe<<24>>24)},setUint8:function(tt,pe){vt.call(this,tt,pe<<24>>24)}},{unsafe:!0})}else M=function(tt){v(this,M,te);var pe=C(tt);J(this,{bytes:I.call(new Array(pe),0),byteLength:pe}),a||(this.byteLength=pe)},Y=function(tt,pe,ue){v(this,Y,le),v(tt,M,le);var W=G(tt).byteLength,ke=b(pe);if(ke<0||ke>W)throw q("Wrong offset");if(ke+(ue=ue===void 0?W-ke:w(ue))>W)throw q("Wrong length");J(this,{buffer:tt,byteLength:ue,byteOffset:ke}),a||(this.buffer=tt,this.byteLength=ue,this.byteOffset=ke)},a&&(He(M,"byteLength"),He(Y,"buffer"),He(Y,"byteLength"),He(Y,"byteOffset")),g(Y.prototype,{getInt8:function(tt){return Ie(this,1,tt)[0]<<24>>24},getUint8:function(tt){return Ie(this,1,tt)[0]},getInt16:function(tt){var pe=Ie(this,2,tt,arguments.length>1?arguments[1]:void 0);return(pe[1]<<8|pe[0])<<16>>16},getUint16:function(tt){var pe=Ie(this,2,tt,arguments.length>1?arguments[1]:void 0);return pe[1]<<8|pe[0]},getInt32:function(tt){return fe(Ie(this,4,tt,arguments.length>1?arguments[1]:void 0))},getUint32:function(tt){return fe(Ie(this,4,tt,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(tt){return X(Ie(this,4,tt,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(tt){return X(Ie(this,8,tt,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(tt,pe){at(this,1,tt,oe,pe)},setUint8:function(tt,pe){at(this,1,tt,oe,pe)},setInt16:function(tt,pe){at(this,2,tt,he,pe,arguments.length>2?arguments[2]:void 0)},setUint16:function(tt,pe){at(this,2,tt,he,pe,arguments.length>2?arguments[2]:void 0)},setInt32:function(tt,pe){at(this,4,tt,ie,pe,arguments.length>2?arguments[2]:void 0)},setUint32:function(tt,pe){at(this,4,tt,ie,pe,arguments.length>2?arguments[2]:void 0)},setFloat32:function(tt,pe){at(this,4,tt,se,pe,arguments.length>2?arguments[2]:void 0)},setFloat64:function(tt,pe){at(this,8,tt,Ee,pe,arguments.length>2?arguments[2]:void 0)}});x(M,te),x(Y,le),r.exports={ArrayBuffer:M,DataView:Y}},1048:function(r,i,t){var n=t(7908),a=t(1400),o=t(7466),d=Math.min;r.exports=[].copyWithin||function(g,m){var v=n(this),b=o(v.length),w=a(g,b),C=a(m,b),D=arguments.length>2?arguments[2]:void 0,R=d((D===void 0?b:a(D,b))-C,b-w),T=1;for(C0;)C in v?v[w]=v[C]:delete v[w],w+=T,C+=T;return v}},1285:function(r,i,t){var n=t(7908),a=t(1400),o=t(7466);r.exports=function(d){for(var g=n(this),m=o(g.length),v=arguments.length,b=a(v>1?arguments[1]:void 0,m),w=v>2?arguments[2]:void 0,C=w===void 0?m:a(w,m);C>b;)g[b++]=d;return g}},8533:function(r,i,t){var n=t(2092).forEach,a=t(9341),o=t(9207),d=a("forEach"),g=o("forEach");r.exports=d&&g?[].forEach:function(m){return n(this,m,arguments.length>1?arguments[1]:void 0)}},1318:function(r,i,t){var n=t(5656),a=t(7466),o=t(1400),d=function(g){return function(m,v,b){var w,C=n(m),D=a(C.length),R=o(b,D);if(g&&v!=v){for(;D>R;)if((w=C[R++])!=w)return!0}else for(;D>R;R++)if((g||R in C)&&C[R]===v)return g||R||0;return!g&&-1}};r.exports={includes:d(!0),indexOf:d(!1)}},2092:function(r,i,t){var n=t(9974),a=t(8361),o=t(7908),d=t(7466),g=t(5417),m=[].push,v=function(b){var w=b==1,C=b==2,D=b==3,R=b==4,T=b==6,P=b==7,L=b==5||T;return function(I,x,O,G){for(var J,te,le=o(I),ne=a(le),ee=n(x,O,3),M=d(ne.length),Y=0,j=G||g,z=w?j(I,M):C||P?j(I,0):void 0;M>Y;Y++)if((L||Y in ne)&&(te=ee(J=ne[Y],Y,le),b))if(w)z[Y]=te;else if(te)switch(b){case 3:return!0;case 5:return J;case 6:return Y;case 2:m.call(z,J)}else switch(b){case 4:return!1;case 7:m.call(z,J)}return T?-1:D||R?R:z}};r.exports={forEach:v(0),map:v(1),filter:v(2),some:v(3),every:v(4),find:v(5),findIndex:v(6),filterOut:v(7)}},6583:function(r,i,t){var n=t(5656),a=t(9958),o=t(7466),d=t(9341),g=t(9207),m=Math.min,v=[].lastIndexOf,b=!!v&&1/[1].lastIndexOf(1,-0)<0,w=d("lastIndexOf"),C=g("indexOf",{ACCESSORS:!0,1:0}),D=b||!w||!C;r.exports=D?function(R){if(b)return v.apply(this,arguments)||0;var T=n(this),P=o(T.length),L=P-1;for(arguments.length>1&&(L=m(L,a(arguments[1]))),L<0&&(L=P+L);L>=0;L--)if(L in T&&T[L]===R)return L||0;return-1}:v},1194:function(r,i,t){var n=t(7293),a=t(5112),o=t(7392),d=a("species");r.exports=function(g){return o>=51||!n(function(){var m=[];return(m.constructor={})[d]=function(){return{foo:1}},m[g](Boolean).foo!==1})}},9341:function(r,i,t){var n=t(7293);r.exports=function(a,o){var d=[][a];return!!d&&n(function(){d.call(null,o||function(){throw 1},1)})}},9207:function(r,i,t){var n=t(9781),a=t(7293),o=t(6656),d=Object.defineProperty,g={},m=function(v){throw v};r.exports=function(v,b){if(o(g,v))return g[v];b||(b={});var w=[][v],C=!!o(b,"ACCESSORS")&&b.ACCESSORS,D=o(b,0)?b[0]:m,R=o(b,1)?b[1]:void 0;return g[v]=!!w&&!a(function(){if(C&&!n)return!0;var T={length:-1};C?d(T,1,{enumerable:!0,get:m}):T[1]=1,w.call(T,D,R)})}},3671:function(r,i,t){var n=t(3099),a=t(7908),o=t(8361),d=t(7466),g=function(m){return function(v,b,w,C){n(b);var D=a(v),R=o(D),T=d(D.length),P=m?T-1:0,L=m?-1:1;if(w<2)for(;;){if(P in R){C=R[P],P+=L;break}if(P+=L,m?P<0:T<=P)throw TypeError("Reduce of empty array with no initial value")}for(;m?P>=0:T>P;P+=L)P in R&&(C=b(C,R[P],P,D));return C}};r.exports={left:g(!1),right:g(!0)}},5417:function(r,i,t){var n=t(111),a=t(3157),o=t(5112)("species");r.exports=function(d,g){var m;return a(d)&&(typeof(m=d.constructor)!="function"||m!==Array&&!a(m.prototype)?n(m)&&(m=m[o])===null&&(m=void 0):m=void 0),new(m===void 0?Array:m)(g===0?0:g)}},7072:function(r,i,t){var n=t(5112)("iterator"),a=!1;try{var o=0,d={next:function(){return{done:!!o++}},return:function(){a=!0}};d[n]=function(){return this},Array.from(d,function(){throw 2})}catch{}r.exports=function(g,m){if(!m&&!a)return!1;var v=!1;try{var b={};b[n]=function(){return{next:function(){return{done:v=!0}}}},g(b)}catch{}return v}},4326:function(r){var i={}.toString;r.exports=function(t){return i.call(t).slice(8,-1)}},648:function(r,i,t){var n=t(1694),a=t(4326),o=t(5112)("toStringTag"),d=a(function(){return arguments}())=="Arguments";r.exports=n?a:function(g){var m,v,b;return g===void 0?"Undefined":g===null?"Null":typeof(v=function(w,C){try{return w[C]}catch{}}(m=Object(g),o))=="string"?v:d?a(m):(b=a(m))=="Object"&&typeof m.callee=="function"?"Arguments":b}},5631:function(r,i,t){var n=t(3070).f,a=t(30),o=t(2248),d=t(9974),g=t(5787),m=t(408),v=t(654),b=t(6340),w=t(9781),C=t(2423).fastKey,D=t(9909),R=D.set,T=D.getterFor;r.exports={getConstructor:function(P,L,I,x){var O=P(function(le,ne){g(le,O,L),R(le,{type:L,index:a(null),first:void 0,last:void 0,size:0}),w||(le.size=0),ne!=null&&m(ne,le[x],{that:le,AS_ENTRIES:I})}),G=T(L),J=function(le,ne,ee){var M,Y,j=G(le),z=te(le,ne);return z?z.value=ee:(j.last=z={index:Y=C(ne,!0),key:ne,value:ee,previous:M=j.last,next:void 0,removed:!1},j.first||(j.first=z),M&&(M.next=z),w?j.size++:le.size++,Y!=="F"&&(j.index[Y]=z)),le},te=function(le,ne){var ee,M=G(le),Y=C(ne);if(Y!=="F")return M.index[Y];for(ee=M.first;ee;ee=ee.next)if(ee.key==ne)return ee};return o(O.prototype,{clear:function(){for(var le=G(this),ne=le.index,ee=le.first;ee;)ee.removed=!0,ee.previous&&(ee.previous=ee.previous.next=void 0),delete ne[ee.index],ee=ee.next;le.first=le.last=void 0,w?le.size=0:this.size=0},delete:function(le){var ne=this,ee=G(ne),M=te(ne,le);if(M){var Y=M.next,j=M.previous;delete ee.index[M.index],M.removed=!0,j&&(j.next=Y),Y&&(Y.previous=j),ee.first==M&&(ee.first=Y),ee.last==M&&(ee.last=j),w?ee.size--:ne.size--}return!!M},forEach:function(le){for(var ne,ee=G(this),M=d(le,arguments.length>1?arguments[1]:void 0,3);ne=ne?ne.next:ee.first;)for(M(ne.value,ne.key,this);ne&&ne.removed;)ne=ne.previous},has:function(le){return!!te(this,le)}}),o(O.prototype,I?{get:function(le){var ne=te(this,le);return ne&&ne.value},set:function(le,ne){return J(this,le===0?0:le,ne)}}:{add:function(le){return J(this,le=le===0?0:le,le)}}),w&&n(O.prototype,"size",{get:function(){return G(this).size}}),O},setStrong:function(P,L,I){var x=L+" Iterator",O=T(L),G=T(x);v(P,L,function(J,te){R(this,{type:x,target:J,state:O(J),kind:te,last:void 0})},function(){for(var J=G(this),te=J.kind,le=J.last;le&&le.removed;)le=le.previous;return J.target&&(J.last=le=le?le.next:J.state.first)?te=="keys"?{value:le.key,done:!1}:te=="values"?{value:le.value,done:!1}:{value:[le.key,le.value],done:!1}:(J.target=void 0,{value:void 0,done:!0})},I?"entries":"values",!I,!0),b(L)}}},7710:function(r,i,t){var n=t(2109),a=t(7854),o=t(4705),d=t(1320),g=t(2423),m=t(408),v=t(5787),b=t(111),w=t(7293),C=t(7072),D=t(8003),R=t(9587);r.exports=function(T,P,L){var I=T.indexOf("Map")!==-1,x=T.indexOf("Weak")!==-1,O=I?"set":"add",G=a[T],J=G&&G.prototype,te=G,le={},ne=function(q){var Z=J[q];d(J,q,q=="add"?function(X){return Z.call(this,X===0?0:X),this}:q=="delete"?function(X){return!(x&&!b(X))&&Z.call(this,X===0?0:X)}:q=="get"?function(X){return x&&!b(X)?void 0:Z.call(this,X===0?0:X)}:q=="has"?function(X){return!(x&&!b(X))&&Z.call(this,X===0?0:X)}:function(X,oe){return Z.call(this,X===0?0:X,oe),this})};if(o(T,typeof G!="function"||!(x||J.forEach&&!w(function(){new G().entries().next()}))))te=L.getConstructor(P,T,I,O),g.REQUIRED=!0;else if(o(T,!0)){var ee=new te,M=ee[O](x?{}:-0,1)!=ee,Y=w(function(){ee.has(1)}),j=C(function(q){new G(q)}),z=!x&&w(function(){for(var q=new G,Z=5;Z--;)q[O](Z,Z);return!q.has(-0)});j||((te=P(function(q,Z){v(q,te,T);var X=R(new G,q,te);return Z!=null&&m(Z,X[O],{that:X,AS_ENTRIES:I}),X})).prototype=J,J.constructor=te),(Y||z)&&(ne("delete"),ne("has"),I&&ne("get")),(z||M)&&ne(O),x&&J.clear&&delete J.clear}return le[T]=te,n({global:!0,forced:te!=G},le),D(te,T),x||L.setStrong(te,T,I),te}},9920:function(r,i,t){var n=t(6656),a=t(3887),o=t(1236),d=t(3070);r.exports=function(g,m){for(var v=a(m),b=d.f,w=o.f,C=0;C=74)&&(n=d.match(/Chrome\/(\d+)/))&&(a=n[1]),r.exports=a&&+a},748:function(r){r.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(r,i,t){var n=t(7854),a=t(1236).f,o=t(8880),d=t(1320),g=t(3505),m=t(9920),v=t(4705);r.exports=function(b,w){var C,D,R,T,P,L=b.target,I=b.global,x=b.stat;if(C=I?n:x?n[L]||g(L,{}):(n[L]||{}).prototype)for(D in w){if(T=w[D],R=b.noTargetGet?(P=a(C,D))&&P.value:C[D],!v(I?D:L+(x?".":"#")+D,b.forced)&&R!==void 0){if(typeof T==typeof R)continue;m(T,R)}(b.sham||R&&R.sham)&&o(T,"sham",!0),d(C,D,T,b)}}},7293:function(r){r.exports=function(i){try{return!!i()}catch{return!0}}},7007:function(r,i,t){t(4916);var n=t(1320),a=t(7293),o=t(5112),d=t(2261),g=t(8880),m=o("species"),v=!a(function(){var R=/./;return R.exec=function(){var T=[];return T.groups={a:"7"},T},"".replace(R,"$")!=="7"}),b="a".replace(/./,"$0")==="$0",w=o("replace"),C=!!/./[w]&&/./[w]("a","$0")==="",D=!a(function(){var R=/(?:)/,T=R.exec;R.exec=function(){return T.apply(this,arguments)};var P="ab".split(R);return P.length!==2||P[0]!=="a"||P[1]!=="b"});r.exports=function(R,T,P,L){var I=o(R),x=!a(function(){var ne={};return ne[I]=function(){return 7},""[R](ne)!=7}),O=x&&!a(function(){var ne=!1,ee=/a/;return R==="split"&&((ee={}).constructor={},ee.constructor[m]=function(){return ee},ee.flags="",ee[I]=/./[I]),ee.exec=function(){return ne=!0,null},ee[I](""),!ne});if(!x||!O||R==="replace"&&(!v||!b||C)||R==="split"&&!D){var G=/./[I],J=P(I,""[R],function(ne,ee,M,Y,j){return ee.exec===d?x&&!j?{done:!0,value:G.call(ee,M,Y)}:{done:!0,value:ne.call(M,ee,Y)}:{done:!1}},{REPLACE_KEEPS_$0:b,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:C}),te=J[0],le=J[1];n(String.prototype,R,te),n(RegExp.prototype,I,T==2?function(ne,ee){return le.call(ne,this,ee)}:function(ne){return le.call(ne,this)})}L&&g(RegExp.prototype[I],"sham",!0)}},6677:function(r,i,t){var n=t(7293);r.exports=!n(function(){return Object.isExtensible(Object.preventExtensions({}))})},9974:function(r,i,t){var n=t(3099);r.exports=function(a,o,d){if(n(a),o===void 0)return a;switch(d){case 0:return function(){return a.call(o)};case 1:return function(g){return a.call(o,g)};case 2:return function(g,m){return a.call(o,g,m)};case 3:return function(g,m,v){return a.call(o,g,m,v)}}return function(){return a.apply(o,arguments)}}},5005:function(r,i,t){var n=t(857),a=t(7854),o=function(d){return typeof d=="function"?d:void 0};r.exports=function(d,g){return arguments.length<2?o(n[d])||o(a[d]):n[d]&&n[d][g]||a[d]&&a[d][g]}},1246:function(r,i,t){var n=t(648),a=t(7497),o=t(5112)("iterator");r.exports=function(d){if(d!=null)return d[o]||d["@@iterator"]||a[n(d)]}},647:function(r,i,t){var n=t(7908),a=Math.floor,o="".replace,d=/\$([$&'`]|\d\d?|<[^>]*>)/g,g=/\$([$&'`]|\d\d?)/g;r.exports=function(m,v,b,w,C,D){var R=b+m.length,T=w.length,P=g;return C!==void 0&&(C=n(C),P=d),o.call(D,P,function(L,I){var x;switch(I.charAt(0)){case"$":return"$";case"&":return m;case"`":return v.slice(0,b);case"'":return v.slice(R);case"<":x=C[I.slice(1,-1)];break;default:var O=+I;if(O===0)return L;if(O>T){var G=a(O/10);return G===0?L:G<=T?w[G-1]===void 0?I.charAt(1):w[G-1]+I.charAt(1):L}x=w[O-1]}return x===void 0?"":x})}},7854:function(r,i,t){var n=function(a){return a&&a.Math==Math&&a};r.exports=n(typeof globalThis=="object"&&globalThis)||n(typeof window=="object"&&window)||n(typeof self=="object"&&self)||n(typeof t.g=="object"&&t.g)||function(){return this}()||Function("return this")()},6656:function(r){var i={}.hasOwnProperty;r.exports=function(t,n){return i.call(t,n)}},3501:function(r){r.exports={}},490:function(r,i,t){var n=t(5005);r.exports=n("document","documentElement")},4664:function(r,i,t){var n=t(9781),a=t(7293),o=t(317);r.exports=!n&&!a(function(){return Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a!=7})},1179:function(r){var i=1/0,t=Math.abs,n=Math.pow,a=Math.floor,o=Math.log,d=Math.LN2;r.exports={pack:function(g,m,v){var b,w,C,D=new Array(v),R=8*v-m-1,T=(1<>1,L=m===23?n(2,-24)-n(2,-77):0,I=g<0||g===0&&1/g<0?1:0,x=0;for((g=t(g))!=g||g===i?(w=g!=g?1:0,b=T):(b=a(o(g)/d),g*(C=n(2,-b))<1&&(b--,C*=2),(g+=b+P>=1?L/C:L*n(2,1-P))*C>=2&&(b++,C/=2),b+P>=T?(w=0,b=T):b+P>=1?(w=(g*C-1)*n(2,m),b+=P):(w=g*n(2,P-1)*n(2,m),b=0));m>=8;D[x++]=255&w,w/=256,m-=8);for(b=b<0;D[x++]=255&b,b/=256,R-=8);return D[--x]|=128*I,D},unpack:function(g,m){var v,b=g.length,w=8*b-m-1,C=(1<>1,R=w-7,T=b-1,P=g[T--],L=127&P;for(P>>=7;R>0;L=256*L+g[T],T--,R-=8);for(v=L&(1<<-R)-1,L>>=-R,R+=m;R>0;v=256*v+g[T],T--,R-=8);if(L===0)L=1-D;else{if(L===C)return v?NaN:P?-1/0:i;v+=n(2,m),L-=D}return(P?-1:1)*v*n(2,L-m)}}},8361:function(r,i,t){var n=t(7293),a=t(4326),o="".split;r.exports=n(function(){return!Object("z").propertyIsEnumerable(0)})?function(d){return a(d)=="String"?o.call(d,""):Object(d)}:Object},9587:function(r,i,t){var n=t(111),a=t(7674);r.exports=function(o,d,g){var m,v;return a&&typeof(m=d.constructor)=="function"&&m!==g&&n(v=m.prototype)&&v!==g.prototype&&a(o,v),o}},2788:function(r,i,t){var n=t(5465),a=Function.toString;typeof n.inspectSource!="function"&&(n.inspectSource=function(o){return a.call(o)}),r.exports=n.inspectSource},2423:function(r,i,t){var n=t(3501),a=t(111),o=t(6656),d=t(3070).f,g=t(9711),m=t(6677),v=g("meta"),b=0,w=Object.isExtensible||function(){return!0},C=function(R){d(R,v,{value:{objectID:"O"+ ++b,weakData:{}}})},D=r.exports={REQUIRED:!1,fastKey:function(R,T){if(!a(R))return typeof R=="symbol"?R:(typeof R=="string"?"S":"P")+R;if(!o(R,v)){if(!w(R))return"F";if(!T)return"E";C(R)}return R[v].objectID},getWeakData:function(R,T){if(!o(R,v)){if(!w(R))return!0;if(!T)return!1;C(R)}return R[v].weakData},onFreeze:function(R){return m&&D.REQUIRED&&w(R)&&!o(R,v)&&C(R),R}};n[v]=!0},9909:function(r,i,t){var n,a,o,d=t(8536),g=t(7854),m=t(111),v=t(8880),b=t(6656),w=t(5465),C=t(6200),D=t(3501),R=g.WeakMap;if(d){var T=w.state||(w.state=new R),P=T.get,L=T.has,I=T.set;n=function(O,G){return G.facade=O,I.call(T,O,G),G},a=function(O){return P.call(T,O)||{}},o=function(O){return L.call(T,O)}}else{var x=C("state");D[x]=!0,n=function(O,G){return G.facade=O,v(O,x,G),G},a=function(O){return b(O,x)?O[x]:{}},o=function(O){return b(O,x)}}r.exports={set:n,get:a,has:o,enforce:function(O){return o(O)?a(O):n(O,{})},getterFor:function(O){return function(G){var J;if(!m(G)||(J=a(G)).type!==O)throw TypeError("Incompatible receiver, "+O+" required");return J}}}},7659:function(r,i,t){var n=t(5112),a=t(7497),o=n("iterator"),d=Array.prototype;r.exports=function(g){return g!==void 0&&(a.Array===g||d[o]===g)}},3157:function(r,i,t){var n=t(4326);r.exports=Array.isArray||function(a){return n(a)=="Array"}},4705:function(r,i,t){var n=t(7293),a=/#|\.prototype\./,o=function(b,w){var C=g[d(b)];return C==v||C!=m&&(typeof w=="function"?n(w):!!w)},d=o.normalize=function(b){return String(b).replace(a,".").toLowerCase()},g=o.data={},m=o.NATIVE="N",v=o.POLYFILL="P";r.exports=o},111:function(r){r.exports=function(i){return typeof i=="object"?i!==null:typeof i=="function"}},1913:function(r){r.exports=!1},7850:function(r,i,t){var n=t(111),a=t(4326),o=t(5112)("match");r.exports=function(d){var g;return n(d)&&((g=d[o])!==void 0?!!g:a(d)=="RegExp")}},408:function(r,i,t){var n=t(9670),a=t(7659),o=t(7466),d=t(9974),g=t(1246),m=t(9212),v=function(b,w){this.stopped=b,this.result=w};r.exports=function(b,w,C){var D,R,T,P,L,I,x,O=C&&C.that,G=!(!C||!C.AS_ENTRIES),J=!(!C||!C.IS_ITERATOR),te=!(!C||!C.INTERRUPTED),le=d(w,O,1+G+te),ne=function(M){return D&&m(D),new v(!0,M)},ee=function(M){return G?(n(M),te?le(M[0],M[1],ne):le(M[0],M[1])):te?le(M,ne):le(M)};if(J)D=b;else{if(typeof(R=g(b))!="function")throw TypeError("Target is not iterable");if(a(R)){for(T=0,P=o(b.length);P>T;T++)if((L=ee(b[T]))&&L instanceof v)return L;return new v(!1)}D=R.call(b)}for(I=D.next;!(x=I.call(D)).done;){try{L=ee(x.value)}catch(M){throw m(D),M}if(typeof L=="object"&&L&&L instanceof v)return L}return new v(!1)}},9212:function(r,i,t){var n=t(9670);r.exports=function(a){var o=a.return;if(o!==void 0)return n(o.call(a)).value}},3383:function(r,i,t){var n,a,o,d=t(7293),g=t(9518),m=t(8880),v=t(6656),b=t(5112),w=t(1913),C=b("iterator"),D=!1;[].keys&&("next"in(o=[].keys())?(a=g(g(o)))!==Object.prototype&&(n=a):D=!0);var R=n==null||d(function(){var T={};return n[C].call(T)!==T});R&&(n={}),w&&!R||v(n,C)||m(n,C,function(){return this}),r.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:D}},7497:function(r){r.exports={}},133:function(r,i,t){var n=t(7293);r.exports=!!Object.getOwnPropertySymbols&&!n(function(){return!String(Symbol())})},8536:function(r,i,t){var n=t(7854),a=t(2788),o=n.WeakMap;r.exports=typeof o=="function"&&/native code/.test(a(o))},3929:function(r,i,t){var n=t(7850);r.exports=function(a){if(n(a))throw TypeError("The method doesn't accept regular expressions");return a}},7023:function(r,i,t){var n=t(7854).isFinite;r.exports=Number.isFinite||function(a){return typeof a=="number"&&n(a)}},3009:function(r,i,t){var n=t(7854),a=t(3111).trim,o=t(1361),d=n.parseInt,g=/^[+-]?0[Xx]/,m=d(o+"08")!==8||d(o+"0x16")!==22;r.exports=m?function(v,b){var w=a(String(v));return d(w,b>>>0||(g.test(w)?16:10))}:d},30:function(r,i,t){var n,a=t(9670),o=t(6048),d=t(748),g=t(3501),m=t(490),v=t(317),b=t(6200)("IE_PROTO"),w=function(){},C=function(R){return" + diff --git a/client/dist/sw.js b/client/dist/sw.js index 0a198696..87d35143 100644 --- a/client/dist/sw.js +++ b/client/dist/sw.js @@ -1 +1 @@ -if(!self.define){let s,e={};const a=(a,r)=>(a=new URL(a+".js",r).href,e[a]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=a,s.onload=e,document.head.appendChild(s)}else s=a,importScripts(a),e()})).then((()=>{let s=e[a];if(!s)throw new Error(`Module ${a} didn’t register its module`);return s})));self.define=(r,i)=>{const l=s||("document"in self?document.currentScript.src:"")||location.href;if(e[l])return;let n={};const o=s=>a(s,l),u={module:{uri:l},exports:n,require:o};e[l]=Promise.all(r.map((s=>u[s]||o(s)))).then((s=>(i(...s),n)))}}define(["./workbox-7cfec069"],(function(s){"use strict";self.addEventListener("message",(s=>{s.data&&"SKIP_WAITING"===s.data.type&&self.skipWaiting()})),s.precacheAndRoute([{url:"assets/Account-BdTOSg7M.js",revision:null},{url:"assets/Account.ZM28_5D2.css",revision:null},{url:"assets/Base-DG5Aczxr.js",revision:null},{url:"assets/Base.Cp6CgsIm.css",revision:null},{url:"assets/Caption-DTN65rsJ.js",revision:null},{url:"assets/Capture-DXmMH4Q0.js",revision:null},{url:"assets/CaptureCompositor-CiYI9DNZ.js",revision:null},{url:"assets/ChannelsStore-eNnhxLya.js",revision:null},{url:"assets/CommentMuteSettings-aK-5x8By.js",revision:null},{url:"assets/CommentMuteSettings.CJLa_EoH.css",revision:null},{url:"assets/DataBroadcasting-2V44xfhw.js",revision:null},{url:"assets/General-BDH0Q5Sc.js",revision:null},{url:"assets/General.BBuuwIky.css",revision:null},{url:"assets/Home-X3_NWbJ7.js",revision:null},{url:"assets/Home.DimxINvZ.css",revision:null},{url:"assets/index-D2zR81a8.js",revision:null},{url:"assets/Index-URzyaqeB.js",revision:null},{url:"assets/Index.BFGA0HKk.css",revision:null},{url:"assets/index.D5eprzLz.css",revision:null},{url:"assets/Jikkyo-B_6kQb1w.js",revision:null},{url:"assets/Jikkyo.tkdegJaQ.css",revision:null},{url:"assets/LivePSIArchivedDataDecoder-BHXU14x5.js",revision:null},{url:"assets/Login-BYLQtBry.js",revision:null},{url:"assets/Login.Dwwpbfhv.css",revision:null},{url:"assets/Navigation-CsJWaG4R.js",revision:null},{url:"assets/Navigation.XXHY4CL6.css",revision:null},{url:"assets/NotFound-DmKC9dt8.js",revision:null},{url:"assets/NotFound.CtTq_cgx.css",revision:null},{url:"assets/PlayerController-BUt1PTIZ.js",revision:null},{url:"assets/PlayerController.DG7mw1wc.css",revision:null},{url:"assets/PlayerUtils-BMfVEgCY.js",revision:null},{url:"assets/Quality-DK_FYgCl.js",revision:null},{url:"assets/Quality.CGrJ9DyQ.css",revision:null},{url:"assets/Register-DlYiOkKw.js",revision:null},{url:"assets/Register.uYK-W3Zn.css",revision:null},{url:"assets/Server-DBO70_b0.js",revision:null},{url:"assets/Server.BxdGitx4.css",revision:null},{url:"assets/ssrBoot-BvljY2yG.js",revision:null},{url:"assets/ssrBoot.D4XLN205.css",revision:null},{url:"assets/swiper-cQLwFU5D.js",revision:null},{url:"assets/swiper.Be9b3THL.css",revision:null},{url:"assets/Twitter-Bph-nOIj.js",revision:null},{url:"assets/Twitter-Q1WO_0TU.js",revision:null},{url:"assets/Twitter.DS1ieZ3J.css",revision:null},{url:"assets/VAvatar-CTvU0rd-.js",revision:null},{url:"assets/VAvatar.BPRvkK24.css",revision:null},{url:"assets/VCard-C5ODUzfZ.js",revision:null},{url:"assets/VCard.IL2cTJ3-.css",revision:null},{url:"assets/VDialog-BE2JXbX2.js",revision:null},{url:"assets/VDialog.BTaKRSA5.css",revision:null},{url:"assets/VFileInput-CPtGNAvQ.js",revision:null},{url:"assets/VFileInput.CPnScYjA.css",revision:null},{url:"assets/VForm-la6x9pr-.js",revision:null},{url:"assets/VSelect-BuCCGZYb.js",revision:null},{url:"assets/VSelect.BV6TXo8f.css",revision:null},{url:"assets/VSlider-S8IhLMNG.js",revision:null},{url:"assets/VSlider.DYiZbM5l.css",revision:null},{url:"assets/VSwitch-BiucEdzW.js",revision:null},{url:"assets/VSwitch.DKnmDl2-.css",revision:null},{url:"assets/VTextField-DymZQzkG.js",revision:null},{url:"assets/VTextField.DaFHH20j.css",revision:null},{url:"assets/vuedraggable.umd-X59vE-3L.js",revision:null},{url:"assets/Watch-D4hYYE_4.js",revision:null},{url:"assets/Watch-Dgkro2UJ.js",revision:null},{url:"assets/workbox-window.prod.es5-D5gOYdM7.js",revision:null},{url:"index.html",revision:"f09c101569142dd5ed9cbd7dbdbb35cd"},{url:"assets/images/icons/icon-192px.png",revision:"cc3f0142a77651214f66f0a725253521"},{url:"assets/images/icons/icon-512px.png",revision:"37175521e6de680e90740ead2506f9fd"},{url:"assets/images/icons/icon-maskable-192px.png",revision:"291866775902df321181d8dbc66c0d22"},{url:"assets/fonts/Kosugi-Regular.woff2",revision:"c11d0f4e766049ad73b069d2bfd35a74"},{url:"assets/fonts/KosugiMaru-Regular.woff2",revision:"62b5c6457c2bc2bfda594fce863db134"},{url:"assets/fonts/MaterialDesignIcons.woff2",revision:"1d7bcee1b302339c3b8db10214dc9ec6"},{url:"assets/fonts/NotoSansJP-Bold.woff2",revision:"8ae2b8c883b00e678cf347f4089e54b5"},{url:"assets/fonts/NotoSansJP-Medium.woff2",revision:"e8e02898cd984df0386a7feb0881d73c"},{url:"assets/fonts/OpenSans-Bold.woff2",revision:"c0b9bbd547c51eb4bf70adfe2c6751a4"},{url:"assets/fonts/OpenSans-Medium.woff2",revision:"291650388e03dfa88fed8fe2ec138f43"},{url:"assets/fonts/Twemoji.woff2",revision:"def76ca590bbc2ab6c79bfbb22ddd882"},{url:"assets/fonts/YakuHanJPs-Bold.woff2",revision:"33e20e22177396ce5c9e402bdeaf9fbd"},{url:"assets/fonts/YakuHanJPs-Medium.woff2",revision:"56621201e09808a0a36a251226584e25"},{url:"assets/images/account-icon-default.png",revision:"3840f879e0ddf77549f4035ae72e8f6b"},{url:"assets/images/icon.svg",revision:"63abc49a99bd463af26e73cec607771d"},{url:"assets/images/logo.svg",revision:"83079d38a7a118e1c80fe28d139991d8"},{url:"assets/romsounds/01.wav",revision:"4187b218123ba4ff5de4e48ad3ee7778"},{url:"assets/romsounds/02.wav",revision:"a6e40866a7da83a5a6a77c62686b2fa6"},{url:"assets/romsounds/03.wav",revision:"30f5d254ec6c10bc37f0584e6cb2d0ed"},{url:"assets/romsounds/04.wav",revision:"626bbd8f569576f18fba702740d731c5"},{url:"assets/romsounds/05.wav",revision:"dbfbd7f4e2e7670f47dac6f52de3fd98"},{url:"assets/romsounds/06.wav",revision:"5e68fa08d3621ab451a6daf1d52803b9"},{url:"assets/romsounds/07.wav",revision:"b17f57be56bb2141660d2a18a497cf69"},{url:"assets/romsounds/08.wav",revision:"88b1bed69315e657ecaa6e7cdaa032c5"},{url:"assets/romsounds/09.wav",revision:"39dd16fc0f20240d5347448f9703e42a"},{url:"assets/romsounds/10.wav",revision:"e0a34f995f013843fb5e552c2dc78a03"},{url:"assets/romsounds/11.wav",revision:"4b6fd4f4bddcee2ad1987e4c82da9476"},{url:"assets/romsounds/12.wav",revision:"e0e67a86607a7ad8457c4adefbac50e9"},{url:"assets/romsounds/13.wav",revision:"d6c8ef577228462c7b90e677396ca652"},{url:"assets/romsounds/14.wav",revision:"d72e6dd844260adc6db71a04d3763d07"},{url:"assets/images/icons/apple-touch-icon.png",revision:"a1ff224fdbecfd10c117cd6172799b94"},{url:"assets/images/icons/favicon-16px.png",revision:"66d1179e73198777a49235a76619a093"},{url:"assets/images/icons/favicon-32px.png",revision:"85e6e77bb3362197cf564bf9b21ebe12"},{url:"assets/images/icons/favicon.svg",revision:"1bf40917c217fd567119c219ebabe4b9"},{url:"assets/images/icons/icon-maskable-512px.png",revision:"d105aac16603bc9e5349fba31bf71cfd"},{url:"assets/images/player-backgrounds/01.jpg",revision:"14d74db9eb062b39dc128daeba77cb63"},{url:"assets/images/player-backgrounds/02.jpg",revision:"98e077363a5eec17da30acef5038f924"},{url:"assets/images/player-backgrounds/03.jpg",revision:"e75e4fc34090286e347cebf12c74b1b8"},{url:"assets/images/player-backgrounds/04.jpg",revision:"714dd3c050c09a16236f2424c548c83f"},{url:"assets/images/player-backgrounds/05.jpg",revision:"717125c34121b326e8f90773565f59ca"},{url:"assets/images/player-backgrounds/06.jpg",revision:"aa3b22785383baf67ad6d53fee94ed1c"},{url:"assets/images/player-backgrounds/07.jpg",revision:"dc9937f7a374b99981cb0d6c9a642e56"},{url:"assets/images/player-backgrounds/08.jpg",revision:"b6cedbf1da35814fbf784591380fde62"},{url:"assets/images/player-backgrounds/09.jpg",revision:"e989450375d6954b37b066a1cec3ad35"},{url:"assets/images/player-backgrounds/10.jpg",revision:"417128b6120078997139b44ee2c73dbd"},{url:"assets/images/player-backgrounds/11.jpg",revision:"8c173e2d5980e09dc7b0e36e97b8f189"},{url:"assets/images/player-backgrounds/12.jpg",revision:"97231a4813562229cc55d4516cb85350"},{url:"assets/images/player-backgrounds/13.jpg",revision:"6efbebd72cadf7bdd59a0ad5325662d7"},{url:"assets/images/player-backgrounds/14.jpg",revision:"54d47c83175ed7f11697a2cb3e54e3b1"},{url:"assets/images/player-backgrounds/15.jpg",revision:"e9cb581540c06a770d299dede678ff0c"},{url:"assets/images/player-backgrounds/16.jpg",revision:"b7e7ddc4ae9ba3811f3d5c0ae39a073f"},{url:"assets/images/player-backgrounds/17.jpg",revision:"d363a4b8256115c7505a420ca6a55aae"},{url:"assets/images/player-backgrounds/18.jpg",revision:"6c4e11b735bf6c95dfa5d47c3ae8e2e2"},{url:"assets/images/player-backgrounds/19.jpg",revision:"7fdf1e54a13c7e9d34ceb170fb47c26a"},{url:"assets/images/player-backgrounds/20.jpg",revision:"119ef99d06f809582244c2014ba005aa"},{url:"assets/images/player-backgrounds/21.jpg",revision:"b83a101c3a856de1728790666e4c0040"},{url:"assets/images/player-backgrounds/22.jpg",revision:"e6575b88d5aa774dc9b3c53e334c7c04"},{url:"assets/images/player-backgrounds/23.jpg",revision:"c78d6d5548d8e2ed7b6681a6a29f75bb"},{url:"assets/images/player-backgrounds/24.jpg",revision:"1da1420c684e6e51a0301b83544cf08c"},{url:"assets/images/player-backgrounds/25.jpg",revision:"aa51d71045e5f5cc9d3b89daa344b917"},{url:"assets/images/player-backgrounds/26.jpg",revision:"a8deb2d94eb69f1ccaaede00ba5bb6b7"},{url:"assets/images/player-backgrounds/27.jpg",revision:"5dde7e046f56139835c5db0c397ea0bd"},{url:"assets/images/player-backgrounds/28.jpg",revision:"a8027e60652ba8b43f436aba7895a82c"},{url:"assets/images/player-backgrounds/29.jpg",revision:"e0b12e01312c0e627fb133726e44da8e"},{url:"assets/images/player-backgrounds/30.jpg",revision:"b1841274afaa34e3f2c73a0bf6546c83"},{url:"assets/images/player-backgrounds/31.jpg",revision:"89a95df22ca39eb75cf5be6ba869223e"},{url:"assets/images/player-backgrounds/32.jpg",revision:"04aae5ba779d6f5637e40c9da4952e57"},{url:"assets/images/player-backgrounds/33.jpg",revision:"cb273547824cbd6adbd3dc4a19e3741c"},{url:"assets/images/player-backgrounds/34.jpg",revision:"772bdfc97346e0f4466db4f23aaa986f"},{url:"assets/images/player-backgrounds/35.jpg",revision:"08635247d80c6eada10efd122a0233ae"},{url:"assets/images/player-backgrounds/36.jpg",revision:"d941cbfec1db86258d3131c664c6c606"},{url:"assets/images/player-backgrounds/37.jpg",revision:"4f79166b5886629699c8914996dae8ec"},{url:"assets/images/player-backgrounds/38.jpg",revision:"428d6030a438a79fda9c3b891c49ab7e"},{url:"assets/images/player-backgrounds/39.jpg",revision:"81a7227fee4c963573dbd748066e79e4"},{url:"assets/images/player-backgrounds/40.jpg",revision:"e59c8f21613f90767eacfcf35a1827d2"},{url:"assets/images/player-backgrounds/41.jpg",revision:"63aeaea733070316bff748bc113a4a46"},{url:"assets/images/player-backgrounds/42.jpg",revision:"d1875f1d0349c573d3e8cb91f2aadc33"},{url:"assets/images/player-backgrounds/43.jpg",revision:"e64ed14afdc88195682716c677108b80"},{url:"assets/images/player-backgrounds/44.jpg",revision:"0c29f86f731632a6ac52703b68ffa274"},{url:"assets/images/player-backgrounds/45.jpg",revision:"6b061167c6e71f473ee9adc45a7dbf7c"},{url:"assets/images/player-backgrounds/46.jpg",revision:"d24c8fbd847cba6e0e99c85218daa430"},{url:"assets/images/player-backgrounds/47.jpg",revision:"9a907a8ecadc4889f604b0a00564d1f9"},{url:"assets/images/player-backgrounds/48.jpg",revision:"aaf24d179484067bf4bab284c52456dd"},{url:"assets/images/player-backgrounds/49.jpg",revision:"0d6cffc1fe9c516400a904f8cea606b3"},{url:"assets/images/player-backgrounds/50.jpg",revision:"dde138765e318791b3e236ab985f9e98"},{url:"manifest.webmanifest",revision:"39625e3a59c49821bc944888ed3172ca"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"),{denylist:[/^\/api/]}))})); +if(!self.define){let s,e={};const a=(a,r)=>(a=new URL(a+".js",r).href,e[a]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=a,s.onload=e,document.head.appendChild(s)}else s=a,importScripts(a),e()})).then((()=>{let s=e[a];if(!s)throw new Error(`Module ${a} didn’t register its module`);return s})));self.define=(r,i)=>{const l=s||("document"in self?document.currentScript.src:"")||location.href;if(e[l])return;let n={};const o=s=>a(s,l),u={module:{uri:l},exports:n,require:o};e[l]=Promise.all(r.map((s=>u[s]||o(s)))).then((s=>(i(...s),n)))}}define(["./workbox-7cfec069"],(function(s){"use strict";self.addEventListener("message",(s=>{s.data&&"SKIP_WAITING"===s.data.type&&self.skipWaiting()})),s.precacheAndRoute([{url:"assets/Account-ccYjkIrH.js",revision:null},{url:"assets/Account.ZM28_5D2.css",revision:null},{url:"assets/Base-D8WlXaKF.js",revision:null},{url:"assets/Base.Cp6CgsIm.css",revision:null},{url:"assets/Caption-iQ0Q9kku.js",revision:null},{url:"assets/Capture-CXo2T7QZ.js",revision:null},{url:"assets/CaptureCompositor-IHku5OQc.js",revision:null},{url:"assets/ChannelsStore-DchOc5Uo.js",revision:null},{url:"assets/CommentMuteSettings-B8qrNY4M.js",revision:null},{url:"assets/CommentMuteSettings.CJLa_EoH.css",revision:null},{url:"assets/DataBroadcasting-jA1j5Sob.js",revision:null},{url:"assets/General-C-9qy5lQ.js",revision:null},{url:"assets/General.BBuuwIky.css",revision:null},{url:"assets/Home-QNi6QgIc.js",revision:null},{url:"assets/Home.DimxINvZ.css",revision:null},{url:"assets/Index-Cgb5zSyW.js",revision:null},{url:"assets/index-Dbi6R656.js",revision:null},{url:"assets/Index.BFGA0HKk.css",revision:null},{url:"assets/index.D5eprzLz.css",revision:null},{url:"assets/Jikkyo-Dl7DpmHu.js",revision:null},{url:"assets/Jikkyo.BXj39bNx.css",revision:null},{url:"assets/LivePSIArchivedDataDecoder-UNf1hsdD.js",revision:null},{url:"assets/Login-RVjujZFe.js",revision:null},{url:"assets/Login.Dwwpbfhv.css",revision:null},{url:"assets/Navigation-DZesdvbM.js",revision:null},{url:"assets/Navigation.XXHY4CL6.css",revision:null},{url:"assets/NotFound-DQeyXnhV.js",revision:null},{url:"assets/NotFound.CtTq_cgx.css",revision:null},{url:"assets/PlayerController-CPRxjWAH.js",revision:null},{url:"assets/PlayerController.DYQ78zJV.css",revision:null},{url:"assets/PlayerUtils-BMfVEgCY.js",revision:null},{url:"assets/Quality-gVW3mlCw.js",revision:null},{url:"assets/Quality.CGrJ9DyQ.css",revision:null},{url:"assets/Register-DasYxOlR.js",revision:null},{url:"assets/Register.uYK-W3Zn.css",revision:null},{url:"assets/Server-DT8h7w7n.js",revision:null},{url:"assets/Server.BxdGitx4.css",revision:null},{url:"assets/ssrBoot-sWDXISB3.js",revision:null},{url:"assets/ssrBoot.D4XLN205.css",revision:null},{url:"assets/swiper-BjXfmU5J.js",revision:null},{url:"assets/swiper.Be9b3THL.css",revision:null},{url:"assets/Twitter-C35t607p.js",revision:null},{url:"assets/Twitter-DX_Loh3n.js",revision:null},{url:"assets/Twitter.DS1ieZ3J.css",revision:null},{url:"assets/VAvatar-BrXxzhAv.js",revision:null},{url:"assets/VAvatar.BPRvkK24.css",revision:null},{url:"assets/VCard-BBvTbBT9.js",revision:null},{url:"assets/VCard.IL2cTJ3-.css",revision:null},{url:"assets/VDialog-B1HdJyP2.js",revision:null},{url:"assets/VDialog.BTaKRSA5.css",revision:null},{url:"assets/VFileInput-dOsuHg_x.js",revision:null},{url:"assets/VFileInput.CPnScYjA.css",revision:null},{url:"assets/VForm-B829AxXJ.js",revision:null},{url:"assets/VSelect-dbg9h4rI.js",revision:null},{url:"assets/VSelect.BV6TXo8f.css",revision:null},{url:"assets/VSlider-CBNN6xX6.js",revision:null},{url:"assets/VSlider.DYiZbM5l.css",revision:null},{url:"assets/VSwitch-Cf-jClsc.js",revision:null},{url:"assets/VSwitch.DKnmDl2-.css",revision:null},{url:"assets/VTextField-DTBkpwFs.js",revision:null},{url:"assets/VTextField.DaFHH20j.css",revision:null},{url:"assets/vuedraggable.umd-Dq96441i.js",revision:null},{url:"assets/Watch-_oOaHvAT.js",revision:null},{url:"assets/Watch-By8d0RQ2.js",revision:null},{url:"assets/workbox-window.prod.es5-D5gOYdM7.js",revision:null},{url:"index.html",revision:"ce1aba0ead0dab623e062ffa897706af"},{url:"assets/images/icons/icon-192px.png",revision:"cc3f0142a77651214f66f0a725253521"},{url:"assets/images/icons/icon-512px.png",revision:"37175521e6de680e90740ead2506f9fd"},{url:"assets/images/icons/icon-maskable-192px.png",revision:"291866775902df321181d8dbc66c0d22"},{url:"assets/fonts/Kosugi-Regular.woff2",revision:"c11d0f4e766049ad73b069d2bfd35a74"},{url:"assets/fonts/KosugiMaru-Regular.woff2",revision:"62b5c6457c2bc2bfda594fce863db134"},{url:"assets/fonts/MaterialDesignIcons.woff2",revision:"1d7bcee1b302339c3b8db10214dc9ec6"},{url:"assets/fonts/NotoSansJP-Bold.woff2",revision:"8ae2b8c883b00e678cf347f4089e54b5"},{url:"assets/fonts/NotoSansJP-Medium.woff2",revision:"e8e02898cd984df0386a7feb0881d73c"},{url:"assets/fonts/OpenSans-Bold.woff2",revision:"c0b9bbd547c51eb4bf70adfe2c6751a4"},{url:"assets/fonts/OpenSans-Medium.woff2",revision:"291650388e03dfa88fed8fe2ec138f43"},{url:"assets/fonts/Twemoji.woff2",revision:"def76ca590bbc2ab6c79bfbb22ddd882"},{url:"assets/fonts/YakuHanJPs-Bold.woff2",revision:"33e20e22177396ce5c9e402bdeaf9fbd"},{url:"assets/fonts/YakuHanJPs-Medium.woff2",revision:"56621201e09808a0a36a251226584e25"},{url:"assets/images/account-icon-default.png",revision:"3840f879e0ddf77549f4035ae72e8f6b"},{url:"assets/images/icon.svg",revision:"63abc49a99bd463af26e73cec607771d"},{url:"assets/images/logo.svg",revision:"83079d38a7a118e1c80fe28d139991d8"},{url:"assets/romsounds/01.wav",revision:"4187b218123ba4ff5de4e48ad3ee7778"},{url:"assets/romsounds/02.wav",revision:"a6e40866a7da83a5a6a77c62686b2fa6"},{url:"assets/romsounds/03.wav",revision:"30f5d254ec6c10bc37f0584e6cb2d0ed"},{url:"assets/romsounds/04.wav",revision:"626bbd8f569576f18fba702740d731c5"},{url:"assets/romsounds/05.wav",revision:"dbfbd7f4e2e7670f47dac6f52de3fd98"},{url:"assets/romsounds/06.wav",revision:"5e68fa08d3621ab451a6daf1d52803b9"},{url:"assets/romsounds/07.wav",revision:"b17f57be56bb2141660d2a18a497cf69"},{url:"assets/romsounds/08.wav",revision:"88b1bed69315e657ecaa6e7cdaa032c5"},{url:"assets/romsounds/09.wav",revision:"39dd16fc0f20240d5347448f9703e42a"},{url:"assets/romsounds/10.wav",revision:"e0a34f995f013843fb5e552c2dc78a03"},{url:"assets/romsounds/11.wav",revision:"4b6fd4f4bddcee2ad1987e4c82da9476"},{url:"assets/romsounds/12.wav",revision:"e0e67a86607a7ad8457c4adefbac50e9"},{url:"assets/romsounds/13.wav",revision:"d6c8ef577228462c7b90e677396ca652"},{url:"assets/romsounds/14.wav",revision:"d72e6dd844260adc6db71a04d3763d07"},{url:"assets/images/icons/apple-touch-icon.png",revision:"a1ff224fdbecfd10c117cd6172799b94"},{url:"assets/images/icons/favicon-16px.png",revision:"66d1179e73198777a49235a76619a093"},{url:"assets/images/icons/favicon-32px.png",revision:"85e6e77bb3362197cf564bf9b21ebe12"},{url:"assets/images/icons/favicon.svg",revision:"1bf40917c217fd567119c219ebabe4b9"},{url:"assets/images/icons/icon-maskable-512px.png",revision:"d105aac16603bc9e5349fba31bf71cfd"},{url:"assets/images/player-backgrounds/01.jpg",revision:"14d74db9eb062b39dc128daeba77cb63"},{url:"assets/images/player-backgrounds/02.jpg",revision:"98e077363a5eec17da30acef5038f924"},{url:"assets/images/player-backgrounds/03.jpg",revision:"e75e4fc34090286e347cebf12c74b1b8"},{url:"assets/images/player-backgrounds/04.jpg",revision:"714dd3c050c09a16236f2424c548c83f"},{url:"assets/images/player-backgrounds/05.jpg",revision:"717125c34121b326e8f90773565f59ca"},{url:"assets/images/player-backgrounds/06.jpg",revision:"aa3b22785383baf67ad6d53fee94ed1c"},{url:"assets/images/player-backgrounds/07.jpg",revision:"dc9937f7a374b99981cb0d6c9a642e56"},{url:"assets/images/player-backgrounds/08.jpg",revision:"b6cedbf1da35814fbf784591380fde62"},{url:"assets/images/player-backgrounds/09.jpg",revision:"e989450375d6954b37b066a1cec3ad35"},{url:"assets/images/player-backgrounds/10.jpg",revision:"417128b6120078997139b44ee2c73dbd"},{url:"assets/images/player-backgrounds/11.jpg",revision:"8c173e2d5980e09dc7b0e36e97b8f189"},{url:"assets/images/player-backgrounds/12.jpg",revision:"97231a4813562229cc55d4516cb85350"},{url:"assets/images/player-backgrounds/13.jpg",revision:"6efbebd72cadf7bdd59a0ad5325662d7"},{url:"assets/images/player-backgrounds/14.jpg",revision:"54d47c83175ed7f11697a2cb3e54e3b1"},{url:"assets/images/player-backgrounds/15.jpg",revision:"e9cb581540c06a770d299dede678ff0c"},{url:"assets/images/player-backgrounds/16.jpg",revision:"b7e7ddc4ae9ba3811f3d5c0ae39a073f"},{url:"assets/images/player-backgrounds/17.jpg",revision:"d363a4b8256115c7505a420ca6a55aae"},{url:"assets/images/player-backgrounds/18.jpg",revision:"6c4e11b735bf6c95dfa5d47c3ae8e2e2"},{url:"assets/images/player-backgrounds/19.jpg",revision:"7fdf1e54a13c7e9d34ceb170fb47c26a"},{url:"assets/images/player-backgrounds/20.jpg",revision:"119ef99d06f809582244c2014ba005aa"},{url:"assets/images/player-backgrounds/21.jpg",revision:"b83a101c3a856de1728790666e4c0040"},{url:"assets/images/player-backgrounds/22.jpg",revision:"e6575b88d5aa774dc9b3c53e334c7c04"},{url:"assets/images/player-backgrounds/23.jpg",revision:"c78d6d5548d8e2ed7b6681a6a29f75bb"},{url:"assets/images/player-backgrounds/24.jpg",revision:"1da1420c684e6e51a0301b83544cf08c"},{url:"assets/images/player-backgrounds/25.jpg",revision:"aa51d71045e5f5cc9d3b89daa344b917"},{url:"assets/images/player-backgrounds/26.jpg",revision:"a8deb2d94eb69f1ccaaede00ba5bb6b7"},{url:"assets/images/player-backgrounds/27.jpg",revision:"5dde7e046f56139835c5db0c397ea0bd"},{url:"assets/images/player-backgrounds/28.jpg",revision:"a8027e60652ba8b43f436aba7895a82c"},{url:"assets/images/player-backgrounds/29.jpg",revision:"e0b12e01312c0e627fb133726e44da8e"},{url:"assets/images/player-backgrounds/30.jpg",revision:"b1841274afaa34e3f2c73a0bf6546c83"},{url:"assets/images/player-backgrounds/31.jpg",revision:"89a95df22ca39eb75cf5be6ba869223e"},{url:"assets/images/player-backgrounds/32.jpg",revision:"04aae5ba779d6f5637e40c9da4952e57"},{url:"assets/images/player-backgrounds/33.jpg",revision:"cb273547824cbd6adbd3dc4a19e3741c"},{url:"assets/images/player-backgrounds/34.jpg",revision:"772bdfc97346e0f4466db4f23aaa986f"},{url:"assets/images/player-backgrounds/35.jpg",revision:"08635247d80c6eada10efd122a0233ae"},{url:"assets/images/player-backgrounds/36.jpg",revision:"d941cbfec1db86258d3131c664c6c606"},{url:"assets/images/player-backgrounds/37.jpg",revision:"4f79166b5886629699c8914996dae8ec"},{url:"assets/images/player-backgrounds/38.jpg",revision:"428d6030a438a79fda9c3b891c49ab7e"},{url:"assets/images/player-backgrounds/39.jpg",revision:"81a7227fee4c963573dbd748066e79e4"},{url:"assets/images/player-backgrounds/40.jpg",revision:"e59c8f21613f90767eacfcf35a1827d2"},{url:"assets/images/player-backgrounds/41.jpg",revision:"63aeaea733070316bff748bc113a4a46"},{url:"assets/images/player-backgrounds/42.jpg",revision:"d1875f1d0349c573d3e8cb91f2aadc33"},{url:"assets/images/player-backgrounds/43.jpg",revision:"e64ed14afdc88195682716c677108b80"},{url:"assets/images/player-backgrounds/44.jpg",revision:"0c29f86f731632a6ac52703b68ffa274"},{url:"assets/images/player-backgrounds/45.jpg",revision:"6b061167c6e71f473ee9adc45a7dbf7c"},{url:"assets/images/player-backgrounds/46.jpg",revision:"d24c8fbd847cba6e0e99c85218daa430"},{url:"assets/images/player-backgrounds/47.jpg",revision:"9a907a8ecadc4889f604b0a00564d1f9"},{url:"assets/images/player-backgrounds/48.jpg",revision:"aaf24d179484067bf4bab284c52456dd"},{url:"assets/images/player-backgrounds/49.jpg",revision:"0d6cffc1fe9c516400a904f8cea606b3"},{url:"assets/images/player-backgrounds/50.jpg",revision:"dde138765e318791b3e236ab985f9e98"},{url:"manifest.webmanifest",revision:"39625e3a59c49821bc944888ed3172ca"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"),{denylist:[/^\/api/]}))})); diff --git a/client/package.json b/client/package.json index cce3c4d6..0cbb1288 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "KonomiTV", - "version": "0.10.0", + "version": "0.10.1", "private": true, "scripts": { "akebi": "run-script-os", diff --git a/installer/KonomiTV-Installer.py b/installer/KonomiTV-Installer.py index 995c38ba..86ee6147 100644 --- a/installer/KonomiTV-Installer.py +++ b/installer/KonomiTV-Installer.py @@ -25,7 +25,7 @@ # インストール or アップデート対象の KonomiTV バージョン -TARGET_VERSION = '0.10.0' +TARGET_VERSION = '0.10.1' def ShowHeader(): print(Padding(Rule( diff --git a/installer/pyproject.toml b/installer/pyproject.toml index 3b8e4a6a..b7ec4c6e 100644 --- a/installer/pyproject.toml +++ b/installer/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "KonomiTV-Installer" -version = "0.10.0" +version = "0.10.1" description = "KonomiTV Installer" package-mode = false diff --git a/server/app/constants.py b/server/app/constants.py index 70ee5734..01d4a91b 100644 --- a/server/app/constants.py +++ b/server/app/constants.py @@ -10,7 +10,7 @@ # バージョン -VERSION = '0.10.0' +VERSION = '0.10.1' # ベースディレクトリ BASE_DIR = Path(__file__).resolve().parent.parent diff --git a/server/pyproject.toml b/server/pyproject.toml index 1be126cf..c5be4d3d 100644 --- a/server/pyproject.toml +++ b/server/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "KonomiTV" -version = "0.10.0" +version = "0.10.1" description = "KonomiTV: Kept Organized, Notably Optimized, Modern Interface TV media server" package-mode = false